@kindgi/client 0.1.4-rc.0 → 0.1.4-rc.2
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 +458 -256
- package/dist/index.d.cts +2430 -238
- package/dist/index.d.ts +2430 -238
- package/dist/index.js +458 -257
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -14,7 +14,13 @@ function notYetWired(method, reason) {
|
|
|
14
14
|
reason
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function fromWire(body) {
|
|
17
|
+
function fromWire(body, status) {
|
|
18
|
+
const error = classify(body, status);
|
|
19
|
+
if (error.code === "server") return error;
|
|
20
|
+
const code = body !== null && typeof body === "object" && typeof body.code === "string" ? body.code : void 0;
|
|
21
|
+
return code === void 0 ? error : { ...error, serverCode: code };
|
|
22
|
+
}
|
|
23
|
+
function classify(body, status) {
|
|
18
24
|
if (!body || typeof body !== "object") {
|
|
19
25
|
return {
|
|
20
26
|
code: "server",
|
|
@@ -44,11 +50,7 @@ function fromWire(body) {
|
|
|
44
50
|
return { code: "auth", message, reason: "forbidden" };
|
|
45
51
|
case "rate-limited":
|
|
46
52
|
case "rate-limit-exceeded":
|
|
47
|
-
return
|
|
48
|
-
code: "rate-limited",
|
|
49
|
-
message,
|
|
50
|
-
...typeof obj.retryAfterSeconds === "number" ? { retryAfterSeconds: obj.retryAfterSeconds } : {}
|
|
51
|
-
};
|
|
53
|
+
return rateLimited(message, obj);
|
|
52
54
|
case "not-found":
|
|
53
55
|
case "run-not-found":
|
|
54
56
|
case "agent-not-found":
|
|
@@ -71,27 +73,9 @@ function fromWire(body) {
|
|
|
71
73
|
case "provider-not-found":
|
|
72
74
|
case "capability-not-found":
|
|
73
75
|
case "token-not-found":
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
resource: {
|
|
78
|
-
kind: code.replace(/-not-found$/u, "") || "unknown",
|
|
79
|
-
id: readStringField(
|
|
80
|
-
details,
|
|
81
|
-
"agentId",
|
|
82
|
-
"toolId",
|
|
83
|
-
"runId",
|
|
84
|
-
"adapterId",
|
|
85
|
-
"userId",
|
|
86
|
-
"providerId",
|
|
87
|
-
"capabilityId",
|
|
88
|
-
"tokenId",
|
|
89
|
-
"factId",
|
|
90
|
-
"guardrailId",
|
|
91
|
-
"id"
|
|
92
|
-
) ?? "unknown"
|
|
93
|
-
}
|
|
94
|
-
};
|
|
76
|
+
case "agent-version-not-found":
|
|
77
|
+
case "promotion-not-found":
|
|
78
|
+
return notFound(code, message, details);
|
|
95
79
|
case "conflict":
|
|
96
80
|
case "already-terminal":
|
|
97
81
|
case "run-already-terminal":
|
|
@@ -107,6 +91,26 @@ function fromWire(body) {
|
|
|
107
91
|
case "approval-not-decided":
|
|
108
92
|
case "slug-conflict":
|
|
109
93
|
case "project-default-already-exists":
|
|
94
|
+
case "registry-read-only":
|
|
95
|
+
case "policy-scope-taken":
|
|
96
|
+
case "policy-scope-changed":
|
|
97
|
+
case "nothing-to-roll-back":
|
|
98
|
+
case "not-pinned":
|
|
99
|
+
case "agent-version-live":
|
|
100
|
+
case "eval-suite-already-registered":
|
|
101
|
+
case "policy-already-registered":
|
|
102
|
+
case "mcp-endpoint-already-registered":
|
|
103
|
+
case "identity-provider-already-registered":
|
|
104
|
+
case "version-already-exists":
|
|
105
|
+
case "eval-run-already-terminal":
|
|
106
|
+
case "approval-already-decided":
|
|
107
|
+
case "judge-class-name-taken":
|
|
108
|
+
case "promotion-superseded":
|
|
109
|
+
case "gate-policy-already-registered":
|
|
110
|
+
case "gate-policy-scope-taken":
|
|
111
|
+
case "gate-policy-scope-changed":
|
|
112
|
+
case "gate-policy-scope-unpinned":
|
|
113
|
+
case "gate-policy-needs-pin":
|
|
110
114
|
return { code: "conflict", message, reason: code };
|
|
111
115
|
case "invalid-request":
|
|
112
116
|
case "validation-failed":
|
|
@@ -122,11 +126,8 @@ function fromWire(body) {
|
|
|
122
126
|
case "invalid-guardrail":
|
|
123
127
|
case "invalid-provider":
|
|
124
128
|
case "supervisor-header-missing":
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
message,
|
|
128
|
-
issues: obj.issues ?? details?.issues ?? []
|
|
129
|
-
};
|
|
129
|
+
case "scope-invalid":
|
|
130
|
+
return invalidRequest(message, obj, details);
|
|
130
131
|
case "guardrail-violation":
|
|
131
132
|
return {
|
|
132
133
|
code: "guardrail-violation",
|
|
@@ -134,6 +135,23 @@ function fromWire(body) {
|
|
|
134
135
|
violations: readGuardrailViolations(details?.violations),
|
|
135
136
|
evaluationErrors: readEvaluationErrors(details?.evaluationErrors)
|
|
136
137
|
};
|
|
138
|
+
default:
|
|
139
|
+
return byStatus(status, code, message, obj, details);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function byStatus(status, code, message, obj, details) {
|
|
143
|
+
switch (status) {
|
|
144
|
+
case 404:
|
|
145
|
+
case 410:
|
|
146
|
+
return notFound(code, message, details);
|
|
147
|
+
case 400:
|
|
148
|
+
return invalidRequest(message, obj, details);
|
|
149
|
+
case 401:
|
|
150
|
+
return { code: "auth", message, reason: "unauthenticated" };
|
|
151
|
+
case 403:
|
|
152
|
+
return { code: "auth", message, reason: "forbidden" };
|
|
153
|
+
case 429:
|
|
154
|
+
return rateLimited(message, obj);
|
|
137
155
|
default:
|
|
138
156
|
return {
|
|
139
157
|
code: "server",
|
|
@@ -143,6 +161,43 @@ function fromWire(body) {
|
|
|
143
161
|
};
|
|
144
162
|
}
|
|
145
163
|
}
|
|
164
|
+
function notFound(code, message, details) {
|
|
165
|
+
return {
|
|
166
|
+
code: "not-found",
|
|
167
|
+
message,
|
|
168
|
+
resource: {
|
|
169
|
+
kind: code.replace(/-not-found$/u, "") || "unknown",
|
|
170
|
+
id: readStringField(
|
|
171
|
+
details,
|
|
172
|
+
"agentId",
|
|
173
|
+
"toolId",
|
|
174
|
+
"runId",
|
|
175
|
+
"adapterId",
|
|
176
|
+
"userId",
|
|
177
|
+
"providerId",
|
|
178
|
+
"capabilityId",
|
|
179
|
+
"tokenId",
|
|
180
|
+
"factId",
|
|
181
|
+
"guardrailId",
|
|
182
|
+
"id"
|
|
183
|
+
) ?? "unknown"
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function invalidRequest(message, obj, details) {
|
|
188
|
+
return {
|
|
189
|
+
code: "invalid-request",
|
|
190
|
+
message,
|
|
191
|
+
issues: obj.issues ?? details?.issues ?? []
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function rateLimited(message, obj) {
|
|
195
|
+
return {
|
|
196
|
+
code: "rate-limited",
|
|
197
|
+
message,
|
|
198
|
+
...typeof obj.retryAfterSeconds === "number" ? { retryAfterSeconds: obj.retryAfterSeconds } : {}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
146
201
|
function readStringField(obj, ...keys) {
|
|
147
202
|
if (obj === void 0) return void 0;
|
|
148
203
|
for (const key of keys) {
|
|
@@ -192,6 +247,17 @@ var KindgiApiError = class extends Error {
|
|
|
192
247
|
}
|
|
193
248
|
};
|
|
194
249
|
|
|
250
|
+
// src/list-page.ts
|
|
251
|
+
function listPage(page) {
|
|
252
|
+
const result = {
|
|
253
|
+
data: page.data,
|
|
254
|
+
hasMore: page.hasMore,
|
|
255
|
+
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
256
|
+
};
|
|
257
|
+
Object.defineProperty(result, "items", { get: () => result.data, enumerable: false });
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
260
|
+
|
|
195
261
|
// src/streaming.ts
|
|
196
262
|
async function* readSse(options) {
|
|
197
263
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
@@ -347,10 +413,7 @@ function makeAdaptersClient(transport) {
|
|
|
347
413
|
...filter?.status !== void 0 && { status: filter.status }
|
|
348
414
|
}
|
|
349
415
|
});
|
|
350
|
-
return
|
|
351
|
-
items: page.data,
|
|
352
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
353
|
-
};
|
|
416
|
+
return listPage(page);
|
|
354
417
|
},
|
|
355
418
|
async get(adapterId) {
|
|
356
419
|
return transport.request({
|
|
@@ -407,6 +470,57 @@ function makeAdaptersClient(transport) {
|
|
|
407
470
|
// src/resources/agents.ts
|
|
408
471
|
function makeAgentsClient(transport) {
|
|
409
472
|
const seg = (s) => encodeURIComponent(s);
|
|
473
|
+
const versions = {
|
|
474
|
+
async list(agentId, filter) {
|
|
475
|
+
return transport.request({
|
|
476
|
+
method: "GET",
|
|
477
|
+
path: `/v1/agents/${seg(agentId)}/versions`,
|
|
478
|
+
query: {
|
|
479
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
480
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
},
|
|
484
|
+
async get(agentId, version) {
|
|
485
|
+
return transport.request({
|
|
486
|
+
method: "GET",
|
|
487
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}`
|
|
488
|
+
});
|
|
489
|
+
},
|
|
490
|
+
async unregister(agentId, version, options) {
|
|
491
|
+
return transport.request({
|
|
492
|
+
method: "POST",
|
|
493
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/unregister`,
|
|
494
|
+
...options?.idempotencyKey !== void 0 && {
|
|
495
|
+
idempotencyKey: options.idempotencyKey
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
},
|
|
499
|
+
async derive(agentId, input, options) {
|
|
500
|
+
return transport.request({
|
|
501
|
+
method: "POST",
|
|
502
|
+
path: `/v1/agents/${seg(agentId)}/versions`,
|
|
503
|
+
body: input,
|
|
504
|
+
...options?.idempotencyKey !== void 0 && {
|
|
505
|
+
idempotencyKey: options.idempotencyKey
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
},
|
|
509
|
+
async reinstate(agentId, version, options) {
|
|
510
|
+
const wire = await transport.request({
|
|
511
|
+
method: "POST",
|
|
512
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/reinstate`,
|
|
513
|
+
...options?.idempotencyKey !== void 0 && {
|
|
514
|
+
idempotencyKey: options.idempotencyKey
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
return {
|
|
518
|
+
agentId: wire.agentId,
|
|
519
|
+
version: wire.version,
|
|
520
|
+
wasTombstoned: wire.wasTombstoned
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
};
|
|
410
524
|
return {
|
|
411
525
|
async define(spec, options) {
|
|
412
526
|
const result = await transport.request({
|
|
@@ -436,59 +550,106 @@ function makeAgentsClient(transport) {
|
|
|
436
550
|
path: `/v1/agents/${seg(agentId)}`
|
|
437
551
|
});
|
|
438
552
|
},
|
|
439
|
-
versions
|
|
440
|
-
|
|
553
|
+
versions,
|
|
554
|
+
reinstateVersion: (agentId, version, options) => versions.reinstate(agentId, version, options),
|
|
555
|
+
live: {
|
|
556
|
+
async resolve(agentId, where) {
|
|
441
557
|
return transport.request({
|
|
442
558
|
method: "GET",
|
|
443
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
559
|
+
path: `/v1/agents/${seg(agentId)}/live`,
|
|
444
560
|
query: {
|
|
445
|
-
...
|
|
446
|
-
...
|
|
561
|
+
...where?.projectId !== void 0 && { projectId: where.projectId },
|
|
562
|
+
...where?.segments !== void 0 && { segment: where.segments.map(segmentParam) }
|
|
447
563
|
}
|
|
448
564
|
});
|
|
449
565
|
},
|
|
450
|
-
async
|
|
566
|
+
async list(agentId) {
|
|
451
567
|
return transport.request({
|
|
452
568
|
method: "GET",
|
|
453
|
-
path: `/v1/agents/${seg(agentId)}/versions
|
|
569
|
+
path: `/v1/agents/${seg(agentId)}/live-versions`
|
|
454
570
|
});
|
|
455
571
|
},
|
|
456
|
-
async
|
|
572
|
+
async rollback(agentId, input, options) {
|
|
457
573
|
return transport.request({
|
|
458
574
|
method: "POST",
|
|
459
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
575
|
+
path: `/v1/agents/${seg(agentId)}/live/rollback`,
|
|
576
|
+
body: input,
|
|
577
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
463
578
|
});
|
|
464
579
|
},
|
|
465
|
-
async
|
|
580
|
+
async unpin(agentId, input, options) {
|
|
466
581
|
return transport.request({
|
|
467
582
|
method: "POST",
|
|
468
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
583
|
+
path: `/v1/agents/${seg(agentId)}/live/unpin`,
|
|
469
584
|
body: input,
|
|
470
|
-
...options?.idempotencyKey !== void 0 && {
|
|
471
|
-
|
|
585
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
promotions: {
|
|
590
|
+
async create(agentId, input, options) {
|
|
591
|
+
return transport.request({
|
|
592
|
+
method: "POST",
|
|
593
|
+
path: `/v1/agents/${seg(agentId)}/promotions`,
|
|
594
|
+
body: input,
|
|
595
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
596
|
+
});
|
|
597
|
+
},
|
|
598
|
+
async check(agentId, input) {
|
|
599
|
+
return transport.request({
|
|
600
|
+
method: "POST",
|
|
601
|
+
path: `/v1/agents/${seg(agentId)}/promotions/check`,
|
|
602
|
+
body: input
|
|
603
|
+
});
|
|
604
|
+
},
|
|
605
|
+
async list(agentId, filter) {
|
|
606
|
+
return transport.request({
|
|
607
|
+
method: "GET",
|
|
608
|
+
path: `/v1/agents/${seg(agentId)}/promotions`,
|
|
609
|
+
query: {
|
|
610
|
+
...filter?.scope !== void 0 && scopeQuery(filter.scope),
|
|
611
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
612
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
472
613
|
}
|
|
473
614
|
});
|
|
615
|
+
},
|
|
616
|
+
async get(agentId, promotionId) {
|
|
617
|
+
return transport.request({
|
|
618
|
+
method: "GET",
|
|
619
|
+
path: `/v1/agents/${seg(agentId)}/promotions/${seg(promotionId)}`
|
|
620
|
+
});
|
|
474
621
|
}
|
|
475
622
|
},
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
return {
|
|
485
|
-
agentId: wire.agentId,
|
|
486
|
-
version: wire.version,
|
|
487
|
-
wasTombstoned: wire.wasTombstoned
|
|
488
|
-
};
|
|
623
|
+
gatePolicy: {
|
|
624
|
+
async resolve(agentId, scope) {
|
|
625
|
+
return transport.request({
|
|
626
|
+
method: "GET",
|
|
627
|
+
path: `/v1/agents/${seg(agentId)}/gate-policy`,
|
|
628
|
+
query: scopeQuery(scope)
|
|
629
|
+
});
|
|
630
|
+
}
|
|
489
631
|
}
|
|
490
632
|
};
|
|
491
633
|
}
|
|
634
|
+
function segmentParam(s) {
|
|
635
|
+
return `${s.key}:${s.value}`;
|
|
636
|
+
}
|
|
637
|
+
function scopeQuery(scope) {
|
|
638
|
+
switch (scope.kind) {
|
|
639
|
+
case "tenant":
|
|
640
|
+
return { scopeKind: "tenant" };
|
|
641
|
+
case "org":
|
|
642
|
+
return { scopeKind: "org", scopeId: scope.orgId };
|
|
643
|
+
case "project":
|
|
644
|
+
return { scopeKind: "project", scopeId: scope.projectId };
|
|
645
|
+
case "segment":
|
|
646
|
+
return {
|
|
647
|
+
scopeKind: "segment",
|
|
648
|
+
scopeId: scope.projectId,
|
|
649
|
+
segment: scope.path.map(segmentParam)
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
}
|
|
492
653
|
|
|
493
654
|
// src/scope-wire.ts
|
|
494
655
|
function scopeForBody(scope) {
|
|
@@ -537,12 +698,7 @@ function makeApprovalsClient(transport) {
|
|
|
537
698
|
}
|
|
538
699
|
}
|
|
539
700
|
});
|
|
540
|
-
return
|
|
541
|
-
items: page.data,
|
|
542
|
-
...page.nextCursor !== void 0 && {
|
|
543
|
-
nextCursor: page.nextCursor
|
|
544
|
-
}
|
|
545
|
-
};
|
|
701
|
+
return listPage(page);
|
|
546
702
|
},
|
|
547
703
|
async get(id) {
|
|
548
704
|
return transport.request({
|
|
@@ -610,12 +766,7 @@ function makeApprovalsClient(transport) {
|
|
|
610
766
|
...filter?.role !== void 0 && { role: filter.role }
|
|
611
767
|
}
|
|
612
768
|
});
|
|
613
|
-
return
|
|
614
|
-
items: page.data,
|
|
615
|
-
...page.nextCursor !== void 0 && {
|
|
616
|
-
nextCursor: page.nextCursor
|
|
617
|
-
}
|
|
618
|
-
};
|
|
769
|
+
return listPage(page);
|
|
619
770
|
},
|
|
620
771
|
async get(id) {
|
|
621
772
|
return transport.request({
|
|
@@ -716,12 +867,7 @@ function makeArtifactsClient(transport) {
|
|
|
716
867
|
...filter?.contentType !== void 0 && { contentType: filter.contentType }
|
|
717
868
|
}
|
|
718
869
|
});
|
|
719
|
-
return
|
|
720
|
-
items: page.data,
|
|
721
|
-
...page.nextCursor !== void 0 && {
|
|
722
|
-
nextCursor: page.nextCursor
|
|
723
|
-
}
|
|
724
|
-
};
|
|
870
|
+
return listPage(page);
|
|
725
871
|
},
|
|
726
872
|
async delete(blobId, options) {
|
|
727
873
|
return transport.request({
|
|
@@ -769,7 +915,8 @@ function makeAuditClient(transport) {
|
|
|
769
915
|
...filter?.outcome !== void 0 && { outcome: filter.outcome },
|
|
770
916
|
...filter?.runId !== void 0 && { runId: filter.runId },
|
|
771
917
|
...filter?.from !== void 0 && { from: filter.from },
|
|
772
|
-
...filter?.to !== void 0 && { to: filter.to }
|
|
918
|
+
...filter?.to !== void 0 && { to: filter.to },
|
|
919
|
+
...filter?.order !== void 0 && { order: filter.order }
|
|
773
920
|
}
|
|
774
921
|
});
|
|
775
922
|
}
|
|
@@ -783,10 +930,11 @@ function makeAuthClient(transport) {
|
|
|
783
930
|
return {
|
|
784
931
|
providers: {
|
|
785
932
|
async list() {
|
|
786
|
-
|
|
933
|
+
const page = await transport.request({
|
|
787
934
|
method: "GET",
|
|
788
935
|
path: "/v1/auth/providers"
|
|
789
936
|
});
|
|
937
|
+
return { ...page, hasMore: page.hasMore ?? false };
|
|
790
938
|
},
|
|
791
939
|
async register(input, options) {
|
|
792
940
|
return transport.request({
|
|
@@ -915,12 +1063,7 @@ function makeCapabilitiesClient(transport) {
|
|
|
915
1063
|
...filter?.feature !== void 0 && { feature: filter.feature }
|
|
916
1064
|
}
|
|
917
1065
|
});
|
|
918
|
-
return
|
|
919
|
-
items: page.data,
|
|
920
|
-
...page.nextCursor !== void 0 && {
|
|
921
|
-
nextCursor: page.nextCursor
|
|
922
|
-
}
|
|
923
|
-
};
|
|
1066
|
+
return listPage(page);
|
|
924
1067
|
},
|
|
925
1068
|
async get(capabilityId) {
|
|
926
1069
|
return transport.request({
|
|
@@ -947,12 +1090,7 @@ function makeCapabilitiesClient(transport) {
|
|
|
947
1090
|
...filter?.feature !== void 0 && { feature: filter.feature }
|
|
948
1091
|
}
|
|
949
1092
|
});
|
|
950
|
-
return
|
|
951
|
-
items: page.data,
|
|
952
|
-
...page.nextCursor !== void 0 && {
|
|
953
|
-
nextCursor: page.nextCursor
|
|
954
|
-
}
|
|
955
|
-
};
|
|
1093
|
+
return listPage(page);
|
|
956
1094
|
},
|
|
957
1095
|
async get(id) {
|
|
958
1096
|
return transport.request({
|
|
@@ -1082,13 +1220,11 @@ function makeConversationsClient(transport) {
|
|
|
1082
1220
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1083
1221
|
...statusParam !== void 0 && { status: statusParam },
|
|
1084
1222
|
...filter?.scope !== void 0 && scopeToQuery(filter.scope),
|
|
1085
|
-
...filter?.agent !== void 0 && { agentId: filter.agent }
|
|
1223
|
+
...filter?.agent !== void 0 && { agentId: filter.agent },
|
|
1224
|
+
...filter?.replays !== void 0 && { replays: filter.replays }
|
|
1086
1225
|
}
|
|
1087
1226
|
});
|
|
1088
|
-
return
|
|
1089
|
-
items: page.data,
|
|
1090
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1091
|
-
};
|
|
1227
|
+
return listPage(page);
|
|
1092
1228
|
},
|
|
1093
1229
|
async close(id, options) {
|
|
1094
1230
|
return transport.request({
|
|
@@ -1109,10 +1245,7 @@ function makeConversationsClient(transport) {
|
|
|
1109
1245
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1110
1246
|
}
|
|
1111
1247
|
});
|
|
1112
|
-
return
|
|
1113
|
-
items: page.data,
|
|
1114
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1115
|
-
};
|
|
1248
|
+
return listPage(page);
|
|
1116
1249
|
}
|
|
1117
1250
|
};
|
|
1118
1251
|
}
|
|
@@ -1154,12 +1287,7 @@ function makeCostClient(transport) {
|
|
|
1154
1287
|
...filterQuery(filter ?? {})
|
|
1155
1288
|
}
|
|
1156
1289
|
});
|
|
1157
|
-
return
|
|
1158
|
-
items: page.data,
|
|
1159
|
-
...page.nextCursor !== void 0 && {
|
|
1160
|
-
nextCursor: page.nextCursor
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1290
|
+
return listPage(page);
|
|
1163
1291
|
},
|
|
1164
1292
|
async get(recordId, options) {
|
|
1165
1293
|
return transport.request({
|
|
@@ -1169,7 +1297,7 @@ function makeCostClient(transport) {
|
|
|
1169
1297
|
});
|
|
1170
1298
|
},
|
|
1171
1299
|
async summary(input) {
|
|
1172
|
-
const { from, to, groupBy, ...filter } = input;
|
|
1300
|
+
const { from, to, groupBy, limit, ...filter } = input;
|
|
1173
1301
|
return transport.request({
|
|
1174
1302
|
method: "GET",
|
|
1175
1303
|
path: "/v1/cost/aggregate",
|
|
@@ -1177,7 +1305,8 @@ function makeCostClient(transport) {
|
|
|
1177
1305
|
...filterQuery(filter),
|
|
1178
1306
|
from,
|
|
1179
1307
|
to,
|
|
1180
|
-
...groupBy !== void 0 && { groupBy: groupBy.join(",") }
|
|
1308
|
+
...groupBy !== void 0 && { groupBy: groupBy.join(",") },
|
|
1309
|
+
...limit !== void 0 && { limit }
|
|
1181
1310
|
}
|
|
1182
1311
|
});
|
|
1183
1312
|
}
|
|
@@ -1272,6 +1401,7 @@ function makeEnvClient(transport) {
|
|
|
1272
1401
|
});
|
|
1273
1402
|
return {
|
|
1274
1403
|
data: page.data,
|
|
1404
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
1275
1405
|
...page.nextCursor !== void 0 && {
|
|
1276
1406
|
nextCursor: page.nextCursor
|
|
1277
1407
|
}
|
|
@@ -1366,6 +1496,10 @@ function tryReadRevisionConflict(err) {
|
|
|
1366
1496
|
}
|
|
1367
1497
|
|
|
1368
1498
|
// src/resources/eval-runs.ts
|
|
1499
|
+
function comparisonOf(run) {
|
|
1500
|
+
const result = run.result;
|
|
1501
|
+
return run.kind === "judged" && result?.summary !== void 0 && Array.isArray(result.perCase) ? result : void 0;
|
|
1502
|
+
}
|
|
1369
1503
|
function makeEvalRunsClient(transport) {
|
|
1370
1504
|
const seg = (s) => encodeURIComponent(s);
|
|
1371
1505
|
return {
|
|
@@ -1645,6 +1779,58 @@ function makeEventsClient(_transport) {
|
|
|
1645
1779
|
|
|
1646
1780
|
// src/resources/flows.ts
|
|
1647
1781
|
function makeFlowsClient(transport) {
|
|
1782
|
+
const list = async (id, filter) => {
|
|
1783
|
+
const page = await transport.request({
|
|
1784
|
+
method: "GET",
|
|
1785
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions`,
|
|
1786
|
+
query: {
|
|
1787
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1788
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1789
|
+
}
|
|
1790
|
+
});
|
|
1791
|
+
return listPage(page);
|
|
1792
|
+
};
|
|
1793
|
+
const versions = Object.assign(
|
|
1794
|
+
(id, filter) => list(id, filter),
|
|
1795
|
+
{
|
|
1796
|
+
list,
|
|
1797
|
+
async get(id, version) {
|
|
1798
|
+
return transport.request({
|
|
1799
|
+
method: "GET",
|
|
1800
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}`
|
|
1801
|
+
});
|
|
1802
|
+
},
|
|
1803
|
+
async unregister(id, version, options) {
|
|
1804
|
+
const wire = await transport.request({
|
|
1805
|
+
method: "POST",
|
|
1806
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/unregister`,
|
|
1807
|
+
body: {},
|
|
1808
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1809
|
+
idempotencyKey: options.idempotencyKey
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
return {
|
|
1813
|
+
flowId: wire.flowId,
|
|
1814
|
+
version: wire.version,
|
|
1815
|
+
unregistered: wire.unregistered
|
|
1816
|
+
};
|
|
1817
|
+
},
|
|
1818
|
+
async reinstate(id, version, options) {
|
|
1819
|
+
const wire = await transport.request({
|
|
1820
|
+
method: "POST",
|
|
1821
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/reinstate`,
|
|
1822
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1823
|
+
idempotencyKey: options.idempotencyKey
|
|
1824
|
+
}
|
|
1825
|
+
});
|
|
1826
|
+
return {
|
|
1827
|
+
flowId: wire.flowId,
|
|
1828
|
+
version: wire.version,
|
|
1829
|
+
wasTombstoned: wire.wasTombstoned
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
);
|
|
1648
1834
|
return {
|
|
1649
1835
|
async define(flow, options) {
|
|
1650
1836
|
const result = await transport.request({
|
|
@@ -1684,59 +1870,72 @@ function makeFlowsClient(transport) {
|
|
|
1684
1870
|
...filter?.name !== void 0 && { name: filter.name }
|
|
1685
1871
|
}
|
|
1686
1872
|
});
|
|
1687
|
-
return
|
|
1688
|
-
items: page.data,
|
|
1689
|
-
...page.nextCursor !== void 0 && {
|
|
1690
|
-
nextCursor: page.nextCursor
|
|
1691
|
-
}
|
|
1692
|
-
};
|
|
1873
|
+
return listPage(page);
|
|
1693
1874
|
},
|
|
1694
|
-
|
|
1695
|
-
|
|
1875
|
+
versions,
|
|
1876
|
+
getVersion: (id, version) => versions.get(id, version),
|
|
1877
|
+
async delete(id, version, options) {
|
|
1878
|
+
await versions.unregister(id, version, options);
|
|
1879
|
+
},
|
|
1880
|
+
reinstateVersion: (id, version, options) => versions.reinstate(id, version, options)
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
// src/resources/gate-policies.ts
|
|
1885
|
+
function makeGatePoliciesClient(transport) {
|
|
1886
|
+
const seg = (s) => encodeURIComponent(s);
|
|
1887
|
+
return {
|
|
1888
|
+
async list(filter) {
|
|
1889
|
+
return transport.request({
|
|
1696
1890
|
method: "GET",
|
|
1697
|
-
path:
|
|
1891
|
+
path: "/v1/gate-policies",
|
|
1698
1892
|
query: {
|
|
1893
|
+
...filter?.agentId !== void 0 && { agentId: filter.agentId },
|
|
1894
|
+
...filter?.scope !== void 0 && scopeQuery(filter.scope),
|
|
1699
1895
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1700
1896
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1701
1897
|
}
|
|
1702
1898
|
});
|
|
1703
|
-
return {
|
|
1704
|
-
items: page.data,
|
|
1705
|
-
...page.nextCursor !== void 0 && {
|
|
1706
|
-
nextCursor: page.nextCursor
|
|
1707
|
-
}
|
|
1708
|
-
};
|
|
1709
1899
|
},
|
|
1710
|
-
async
|
|
1900
|
+
async get(policyId) {
|
|
1711
1901
|
return transport.request({
|
|
1712
1902
|
method: "GET",
|
|
1713
|
-
path: `/v1/
|
|
1903
|
+
path: `/v1/gate-policies/${seg(policyId)}`
|
|
1714
1904
|
});
|
|
1715
1905
|
},
|
|
1716
|
-
async
|
|
1717
|
-
|
|
1906
|
+
async publish(input, options) {
|
|
1907
|
+
return transport.request({
|
|
1718
1908
|
method: "POST",
|
|
1719
|
-
path:
|
|
1720
|
-
body:
|
|
1721
|
-
|
|
1722
|
-
...options?.idempotencyKey !== void 0 && {
|
|
1723
|
-
idempotencyKey: options.idempotencyKey
|
|
1724
|
-
}
|
|
1909
|
+
path: "/v1/gate-policies",
|
|
1910
|
+
body: input,
|
|
1911
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1725
1912
|
});
|
|
1726
1913
|
},
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
}
|
|
1914
|
+
versions: {
|
|
1915
|
+
async list(policyId) {
|
|
1916
|
+
return transport.request({
|
|
1917
|
+
method: "GET",
|
|
1918
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions`
|
|
1919
|
+
});
|
|
1920
|
+
},
|
|
1921
|
+
async get(policyId, version) {
|
|
1922
|
+
return transport.request({
|
|
1923
|
+
method: "GET",
|
|
1924
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}`
|
|
1925
|
+
});
|
|
1926
|
+
},
|
|
1927
|
+
async unregister(policyId, version) {
|
|
1928
|
+
return transport.request({
|
|
1929
|
+
method: "POST",
|
|
1930
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/unregister`
|
|
1931
|
+
});
|
|
1932
|
+
},
|
|
1933
|
+
async reinstate(policyId, version) {
|
|
1934
|
+
return transport.request({
|
|
1935
|
+
method: "POST",
|
|
1936
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/reinstate`
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1740
1939
|
}
|
|
1741
1940
|
};
|
|
1742
1941
|
}
|
|
@@ -1768,12 +1967,7 @@ function makeGuardrailsClient(transport) {
|
|
|
1768
1967
|
...filter?.name !== void 0 && { name: filter.name }
|
|
1769
1968
|
}
|
|
1770
1969
|
});
|
|
1771
|
-
return
|
|
1772
|
-
items: page.data,
|
|
1773
|
-
...page.nextCursor !== void 0 && {
|
|
1774
|
-
nextCursor: page.nextCursor
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1970
|
+
return listPage(page);
|
|
1777
1971
|
},
|
|
1778
1972
|
async delete(id, options) {
|
|
1779
1973
|
return transport.request({
|
|
@@ -1856,7 +2050,7 @@ function makeIdentityClient(transport) {
|
|
|
1856
2050
|
}
|
|
1857
2051
|
|
|
1858
2052
|
// src/resources/judge-classes.ts
|
|
1859
|
-
function
|
|
2053
|
+
function scopeQuery2(scope) {
|
|
1860
2054
|
if (scope.kind === "tenant") return { scopeKind: "tenant" };
|
|
1861
2055
|
if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
|
|
1862
2056
|
return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
|
|
@@ -1879,13 +2073,10 @@ function makeJudgeClassesClient(transport) {
|
|
|
1879
2073
|
query: {
|
|
1880
2074
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1881
2075
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1882
|
-
...filter?.scope !== void 0 &&
|
|
2076
|
+
...filter?.scope !== void 0 && scopeQuery2(filter.scope)
|
|
1883
2077
|
}
|
|
1884
2078
|
});
|
|
1885
|
-
return
|
|
1886
|
-
items: page.data,
|
|
1887
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1888
|
-
};
|
|
2079
|
+
return listPage(page);
|
|
1889
2080
|
},
|
|
1890
2081
|
async get(judgeClassId) {
|
|
1891
2082
|
return transport.request({
|
|
@@ -1941,10 +2132,7 @@ function makeJudgmentsClient(transport) {
|
|
|
1941
2132
|
...filter?.scope !== void 0 && scopeToQuery(filter.scope)
|
|
1942
2133
|
}
|
|
1943
2134
|
});
|
|
1944
|
-
return
|
|
1945
|
-
items: page.data,
|
|
1946
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1947
|
-
};
|
|
2135
|
+
return listPage(page);
|
|
1948
2136
|
},
|
|
1949
2137
|
async get(judgmentId) {
|
|
1950
2138
|
return transport.request({
|
|
@@ -1978,12 +2166,7 @@ function makeMcpClient(transport) {
|
|
|
1978
2166
|
...filter?.transport !== void 0 && { transport: filter.transport }
|
|
1979
2167
|
}
|
|
1980
2168
|
});
|
|
1981
|
-
return
|
|
1982
|
-
items: page.data,
|
|
1983
|
-
...page.nextCursor !== void 0 && {
|
|
1984
|
-
nextCursor: page.nextCursor
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
2169
|
+
return listPage(page);
|
|
1987
2170
|
},
|
|
1988
2171
|
async register(input, options) {
|
|
1989
2172
|
const { scope, ...endpoint } = input;
|
|
@@ -2121,12 +2304,7 @@ function makeMemoryClient(transport) {
|
|
|
2121
2304
|
...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) }
|
|
2122
2305
|
}
|
|
2123
2306
|
});
|
|
2124
|
-
return
|
|
2125
|
-
items: page.data,
|
|
2126
|
-
...page.nextCursor !== void 0 && {
|
|
2127
|
-
nextCursor: page.nextCursor
|
|
2128
|
-
}
|
|
2129
|
-
};
|
|
2307
|
+
return listPage(page);
|
|
2130
2308
|
},
|
|
2131
2309
|
async delete(id, options) {
|
|
2132
2310
|
return transport.request({
|
|
@@ -2207,10 +2385,7 @@ function makeObservationsClient(transport) {
|
|
|
2207
2385
|
...filter?.until !== void 0 && { until: filter.until }
|
|
2208
2386
|
}
|
|
2209
2387
|
});
|
|
2210
|
-
return
|
|
2211
|
-
items: page.data,
|
|
2212
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
2213
|
-
};
|
|
2388
|
+
return listPage(page);
|
|
2214
2389
|
},
|
|
2215
2390
|
async patterns(_input) {
|
|
2216
2391
|
throw new KindgiApiError(
|
|
@@ -2323,8 +2498,9 @@ function makePacksClient(_transport) {
|
|
|
2323
2498
|
|
|
2324
2499
|
// src/resources/policies.ts
|
|
2325
2500
|
function makePoliciesClient(transport) {
|
|
2326
|
-
|
|
2327
|
-
|
|
2501
|
+
const client = {
|
|
2502
|
+
author: (spec, options) => client.publish(spec, options),
|
|
2503
|
+
async publish(spec, options) {
|
|
2328
2504
|
const result = await transport.request({
|
|
2329
2505
|
method: "POST",
|
|
2330
2506
|
path: "/v1/policies",
|
|
@@ -2361,12 +2537,7 @@ function makePoliciesClient(transport) {
|
|
|
2361
2537
|
...filter?.name !== void 0 && { name: filter.name }
|
|
2362
2538
|
}
|
|
2363
2539
|
});
|
|
2364
|
-
return
|
|
2365
|
-
items: page.data,
|
|
2366
|
-
...page.nextCursor !== void 0 && {
|
|
2367
|
-
nextCursor: page.nextCursor
|
|
2368
|
-
}
|
|
2369
|
-
};
|
|
2540
|
+
return listPage(page);
|
|
2370
2541
|
},
|
|
2371
2542
|
async versions(id, filter) {
|
|
2372
2543
|
const page = await transport.request({
|
|
@@ -2378,12 +2549,7 @@ function makePoliciesClient(transport) {
|
|
|
2378
2549
|
...filter?.includeTombstoned === true && { includeTombstoned: "true" }
|
|
2379
2550
|
}
|
|
2380
2551
|
});
|
|
2381
|
-
return
|
|
2382
|
-
items: page.data,
|
|
2383
|
-
...page.nextCursor !== void 0 && {
|
|
2384
|
-
nextCursor: page.nextCursor
|
|
2385
|
-
}
|
|
2386
|
-
};
|
|
2552
|
+
return listPage(page);
|
|
2387
2553
|
},
|
|
2388
2554
|
async getVersion(id, version) {
|
|
2389
2555
|
return transport.request({
|
|
@@ -2433,6 +2599,7 @@ function makePoliciesClient(transport) {
|
|
|
2433
2599
|
);
|
|
2434
2600
|
}
|
|
2435
2601
|
};
|
|
2602
|
+
return client;
|
|
2436
2603
|
}
|
|
2437
2604
|
|
|
2438
2605
|
// src/resources/projects.ts
|
|
@@ -2550,10 +2717,7 @@ function makeProvenanceClient(transport) {
|
|
|
2550
2717
|
}
|
|
2551
2718
|
}
|
|
2552
2719
|
});
|
|
2553
|
-
return
|
|
2554
|
-
items: page.data,
|
|
2555
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
2556
|
-
};
|
|
2720
|
+
return listPage(page);
|
|
2557
2721
|
},
|
|
2558
2722
|
async export(input) {
|
|
2559
2723
|
return transport.request({
|
|
@@ -2622,6 +2786,40 @@ function makeProvidersClient(transport) {
|
|
|
2622
2786
|
};
|
|
2623
2787
|
}
|
|
2624
2788
|
|
|
2789
|
+
// src/resources/retention.ts
|
|
2790
|
+
function makeRetentionClient(transport) {
|
|
2791
|
+
return {
|
|
2792
|
+
async scheduled(filter) {
|
|
2793
|
+
const page = await transport.request({
|
|
2794
|
+
method: "GET",
|
|
2795
|
+
path: "/v1/retention/scheduled",
|
|
2796
|
+
query: {
|
|
2797
|
+
...filter?.domain !== void 0 && { domain: filter.domain },
|
|
2798
|
+
...filter?.pastGraceOnly === true && { pastGraceOnly: "true" },
|
|
2799
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2800
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
return { ...page, hasMore: page.hasMore ?? page.nextCursor !== void 0 };
|
|
2804
|
+
},
|
|
2805
|
+
async sweep(input) {
|
|
2806
|
+
const body = input?.maxPerDomain !== void 0 ? { maxPerDomain: input.maxPerDomain } : {};
|
|
2807
|
+
if (input?.domain !== void 0) {
|
|
2808
|
+
return transport.request({
|
|
2809
|
+
method: "POST",
|
|
2810
|
+
path: `/v1/retention/sweep/${encodeURIComponent(input.domain)}`,
|
|
2811
|
+
body
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
return transport.request({
|
|
2815
|
+
method: "POST",
|
|
2816
|
+
path: "/v1/retention/sweep",
|
|
2817
|
+
body
|
|
2818
|
+
});
|
|
2819
|
+
}
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2625
2823
|
// src/run-follow.ts
|
|
2626
2824
|
var MAX_REFRESHES_IN_A_ROW = 3;
|
|
2627
2825
|
var TERMINAL_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -2700,12 +2898,14 @@ function makeRunsClient(transport) {
|
|
|
2700
2898
|
agent: input.agent,
|
|
2701
2899
|
...input.agentVersion !== void 0 && { agentVersion: input.agentVersion },
|
|
2702
2900
|
...input.projectId !== void 0 && { projectId: input.projectId },
|
|
2901
|
+
...input.segments !== void 0 && { segments: input.segments },
|
|
2703
2902
|
input: input.input,
|
|
2704
2903
|
...input.options !== void 0 && { options: input.options }
|
|
2705
2904
|
} : {
|
|
2706
2905
|
flow: input.flow,
|
|
2707
2906
|
...input.flowVersion !== void 0 && { flowVersion: input.flowVersion },
|
|
2708
2907
|
...input.projectId !== void 0 && { projectId: input.projectId },
|
|
2908
|
+
...input.segments !== void 0 && { segments: input.segments },
|
|
2709
2909
|
input: input.input,
|
|
2710
2910
|
...input.options !== void 0 && { options: input.options }
|
|
2711
2911
|
};
|
|
@@ -2957,6 +3157,7 @@ function makeSecretsClient(transport) {
|
|
|
2957
3157
|
});
|
|
2958
3158
|
return {
|
|
2959
3159
|
data: page.data,
|
|
3160
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
2960
3161
|
...page.nextCursor !== void 0 && {
|
|
2961
3162
|
nextCursor: page.nextCursor
|
|
2962
3163
|
}
|
|
@@ -3011,6 +3212,7 @@ function makeSecretsClient(transport) {
|
|
|
3011
3212
|
});
|
|
3012
3213
|
return {
|
|
3013
3214
|
data: page.data,
|
|
3215
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
3014
3216
|
...page.nextCursor !== void 0 && {
|
|
3015
3217
|
nextCursor: page.nextCursor
|
|
3016
3218
|
}
|
|
@@ -3251,12 +3453,7 @@ function makeSupervisorClient(transport) {
|
|
|
3251
3453
|
...input.tier !== void 0 && { tier: input.tier }
|
|
3252
3454
|
}
|
|
3253
3455
|
});
|
|
3254
|
-
return
|
|
3255
|
-
items: page.data,
|
|
3256
|
-
...page.nextCursor !== void 0 && {
|
|
3257
|
-
nextCursor: page.nextCursor
|
|
3258
|
-
}
|
|
3259
|
-
};
|
|
3456
|
+
return listPage(page);
|
|
3260
3457
|
},
|
|
3261
3458
|
async get(supervisorId, id) {
|
|
3262
3459
|
return transport.request({
|
|
@@ -3494,10 +3691,7 @@ function makeTokensClient(transport) {
|
|
|
3494
3691
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
3495
3692
|
}
|
|
3496
3693
|
});
|
|
3497
|
-
return {
|
|
3498
|
-
items: page.data.map(fromWire2),
|
|
3499
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3500
|
-
};
|
|
3694
|
+
return listPage({ ...page, data: page.data.map(fromWire2) });
|
|
3501
3695
|
},
|
|
3502
3696
|
async get(id) {
|
|
3503
3697
|
const wire = await transport.request({
|
|
@@ -3532,29 +3726,8 @@ function makeTokensClient(transport) {
|
|
|
3532
3726
|
|
|
3533
3727
|
// src/resources/tools.ts
|
|
3534
3728
|
function makeToolsClient(transport) {
|
|
3535
|
-
|
|
3536
|
-
async list(filter) {
|
|
3537
|
-
const page = await transport.request({
|
|
3538
|
-
method: "GET",
|
|
3539
|
-
path: "/v1/tools",
|
|
3540
|
-
query: {
|
|
3541
|
-
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3542
|
-
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
3543
|
-
...filter?.name !== void 0 && { name: filter.name }
|
|
3544
|
-
}
|
|
3545
|
-
});
|
|
3546
|
-
return {
|
|
3547
|
-
items: page.data,
|
|
3548
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3549
|
-
};
|
|
3550
|
-
},
|
|
3551
|
-
async get(id) {
|
|
3552
|
-
return transport.request({
|
|
3553
|
-
method: "GET",
|
|
3554
|
-
path: `/v1/tools/${encodeURIComponent(id)}`
|
|
3555
|
-
});
|
|
3556
|
-
},
|
|
3557
|
-
async listVersions(id, filter) {
|
|
3729
|
+
const versions = {
|
|
3730
|
+
async list(id, filter) {
|
|
3558
3731
|
const page = await transport.request({
|
|
3559
3732
|
method: "GET",
|
|
3560
3733
|
path: `/v1/tools/${encodeURIComponent(id)}/versions`,
|
|
@@ -3564,18 +3737,15 @@ function makeToolsClient(transport) {
|
|
|
3564
3737
|
...filter?.includeTombstoned === true && { includeTombstoned: "true" }
|
|
3565
3738
|
}
|
|
3566
3739
|
});
|
|
3567
|
-
return
|
|
3568
|
-
items: page.data,
|
|
3569
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3570
|
-
};
|
|
3740
|
+
return listPage(page);
|
|
3571
3741
|
},
|
|
3572
|
-
async
|
|
3742
|
+
async get(id, version) {
|
|
3573
3743
|
return transport.request({
|
|
3574
3744
|
method: "GET",
|
|
3575
3745
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}`
|
|
3576
3746
|
});
|
|
3577
3747
|
},
|
|
3578
|
-
async
|
|
3748
|
+
async reinstate(id, version, options) {
|
|
3579
3749
|
const wire = await transport.request({
|
|
3580
3750
|
method: "POST",
|
|
3581
3751
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/reinstate`,
|
|
@@ -3589,7 +3759,7 @@ function makeToolsClient(transport) {
|
|
|
3589
3759
|
wasTombstoned: wire.wasTombstoned
|
|
3590
3760
|
};
|
|
3591
3761
|
},
|
|
3592
|
-
async
|
|
3762
|
+
async unregister(id, version, options) {
|
|
3593
3763
|
const wire = await transport.request({
|
|
3594
3764
|
method: "POST",
|
|
3595
3765
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/unregister`,
|
|
@@ -3602,7 +3772,43 @@ function makeToolsClient(transport) {
|
|
|
3602
3772
|
version: wire.version,
|
|
3603
3773
|
unregistered: wire.unregistered
|
|
3604
3774
|
};
|
|
3775
|
+
}
|
|
3776
|
+
};
|
|
3777
|
+
return {
|
|
3778
|
+
async list(filter) {
|
|
3779
|
+
const page = await transport.request({
|
|
3780
|
+
method: "GET",
|
|
3781
|
+
path: "/v1/tools",
|
|
3782
|
+
query: {
|
|
3783
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3784
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
3785
|
+
...filter?.name !== void 0 && { name: filter.name }
|
|
3786
|
+
}
|
|
3787
|
+
});
|
|
3788
|
+
return listPage(page);
|
|
3789
|
+
},
|
|
3790
|
+
async get(id) {
|
|
3791
|
+
return transport.request({
|
|
3792
|
+
method: "GET",
|
|
3793
|
+
path: `/v1/tools/${encodeURIComponent(id)}`
|
|
3794
|
+
});
|
|
3605
3795
|
},
|
|
3796
|
+
versions,
|
|
3797
|
+
async register(manifest, options) {
|
|
3798
|
+
const result = await transport.request({
|
|
3799
|
+
method: "POST",
|
|
3800
|
+
path: "/v1/tools",
|
|
3801
|
+
body: { ...manifest, projectId: options.projectId },
|
|
3802
|
+
...options.idempotencyKey !== void 0 && {
|
|
3803
|
+
idempotencyKey: options.idempotencyKey
|
|
3804
|
+
}
|
|
3805
|
+
});
|
|
3806
|
+
return { toolId: result.toolId };
|
|
3807
|
+
},
|
|
3808
|
+
listVersions: (id, filter) => versions.list(id, filter),
|
|
3809
|
+
getVersion: (id, version) => versions.get(id, version),
|
|
3810
|
+
reinstateVersion: (id, version, options) => versions.reinstate(id, version, options),
|
|
3811
|
+
unregisterVersion: (id, version, options) => versions.unregister(id, version, options),
|
|
3606
3812
|
async invoke(_id, _input) {
|
|
3607
3813
|
throw new KindgiApiError(
|
|
3608
3814
|
notYetWired(
|
|
@@ -3655,12 +3861,7 @@ function makeUsersClient(transport) {
|
|
|
3655
3861
|
...filter?.query !== void 0 && { query: filter.query }
|
|
3656
3862
|
}
|
|
3657
3863
|
});
|
|
3658
|
-
return
|
|
3659
|
-
items: page.data,
|
|
3660
|
-
...page.nextCursor !== void 0 && {
|
|
3661
|
-
nextCursor: page.nextCursor
|
|
3662
|
-
}
|
|
3663
|
-
};
|
|
3864
|
+
return listPage(page);
|
|
3664
3865
|
},
|
|
3665
3866
|
async update(_id, _patch) {
|
|
3666
3867
|
throw new KindgiApiError(
|
|
@@ -3684,12 +3885,7 @@ function makeUsersClient(transport) {
|
|
|
3684
3885
|
method: "GET",
|
|
3685
3886
|
path: `/v1/identity/users/${encodeURIComponent(userId)}/sessions`
|
|
3686
3887
|
});
|
|
3687
|
-
return
|
|
3688
|
-
items: page.data,
|
|
3689
|
-
...page.nextCursor !== void 0 && {
|
|
3690
|
-
nextCursor: page.nextCursor
|
|
3691
|
-
}
|
|
3692
|
-
};
|
|
3888
|
+
return listPage(page);
|
|
3693
3889
|
},
|
|
3694
3890
|
async revokeAll(userId, options) {
|
|
3695
3891
|
return transport.request({
|
|
@@ -3920,7 +4116,9 @@ function createTransport(options) {
|
|
|
3920
4116
|
} catch {
|
|
3921
4117
|
body = void 0;
|
|
3922
4118
|
}
|
|
3923
|
-
throw new KindgiApiError(
|
|
4119
|
+
throw new KindgiApiError(
|
|
4120
|
+
fromWire(unwrapErrorEnvelope(body, response.status), response.status)
|
|
4121
|
+
);
|
|
3924
4122
|
}
|
|
3925
4123
|
};
|
|
3926
4124
|
}
|
|
@@ -3932,7 +4130,8 @@ function buildUrl(apiUrl, path, query) {
|
|
|
3932
4130
|
for (const key of Object.keys(query)) {
|
|
3933
4131
|
const value = query[key];
|
|
3934
4132
|
if (value === void 0) continue;
|
|
3935
|
-
|
|
4133
|
+
const values = typeof value === "object" ? value : [String(value)];
|
|
4134
|
+
for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
|
|
3936
4135
|
}
|
|
3937
4136
|
return params.length === 0 ? base : `${base}?${params.join("&")}`;
|
|
3938
4137
|
}
|
|
@@ -3990,6 +4189,8 @@ function createClient(options) {
|
|
|
3990
4189
|
adapters: makeAdaptersClient(transport),
|
|
3991
4190
|
providers: makeProvidersClient(transport),
|
|
3992
4191
|
policies: makePoliciesClient(transport),
|
|
4192
|
+
gatePolicies: makeGatePoliciesClient(transport),
|
|
4193
|
+
retention: makeRetentionClient(transport),
|
|
3993
4194
|
projects: makeProjectsClient(transport),
|
|
3994
4195
|
env: makeEnvClient(transport),
|
|
3995
4196
|
secrets: makeSecretsClient(transport),
|
|
@@ -4018,6 +4219,6 @@ function createClient(options) {
|
|
|
4018
4219
|
};
|
|
4019
4220
|
}
|
|
4020
4221
|
|
|
4021
|
-
export { KindgiApiError, SseHttpError, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData };
|
|
4222
|
+
export { KindgiApiError, SseHttpError, comparisonOf, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData };
|
|
4022
4223
|
//# sourceMappingURL=index.js.map
|
|
4023
4224
|
//# sourceMappingURL=index.js.map
|