@kindgi/client 0.1.3 → 0.1.4-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +216 -0
- package/dist/index.d.cts +2365 -155
- package/dist/index.d.ts +2365 -155
- package/dist/index.js +216 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -105,6 +105,9 @@ function fromWire(body) {
|
|
|
105
105
|
case "provider-already-registered":
|
|
106
106
|
case "proposal-invalid-state-transition":
|
|
107
107
|
case "approval-not-decided":
|
|
108
|
+
case "slug-conflict":
|
|
109
|
+
case "project-default-already-exists":
|
|
110
|
+
case "registry-read-only":
|
|
108
111
|
return { code: "conflict", message, reason: code };
|
|
109
112
|
case "invalid-request":
|
|
110
113
|
case "validation-failed":
|
|
@@ -459,6 +462,16 @@ function makeAgentsClient(transport) {
|
|
|
459
462
|
idempotencyKey: options.idempotencyKey
|
|
460
463
|
}
|
|
461
464
|
});
|
|
465
|
+
},
|
|
466
|
+
async derive(agentId, input, options) {
|
|
467
|
+
return transport.request({
|
|
468
|
+
method: "POST",
|
|
469
|
+
path: `/v1/agents/${seg(agentId)}/versions`,
|
|
470
|
+
body: input,
|
|
471
|
+
...options?.idempotencyKey !== void 0 && {
|
|
472
|
+
idempotencyKey: options.idempotencyKey
|
|
473
|
+
}
|
|
474
|
+
});
|
|
462
475
|
}
|
|
463
476
|
},
|
|
464
477
|
async reinstateVersion(agentId, version, options) {
|
|
@@ -824,6 +837,72 @@ function makeAuthClient(transport) {
|
|
|
824
837
|
};
|
|
825
838
|
}
|
|
826
839
|
|
|
840
|
+
// src/resources/blocks.ts
|
|
841
|
+
function makeBlocksClient(transport) {
|
|
842
|
+
const seg = (s) => encodeURIComponent(s);
|
|
843
|
+
return {
|
|
844
|
+
async publish(input, options) {
|
|
845
|
+
return transport.request({
|
|
846
|
+
method: "POST",
|
|
847
|
+
path: "/v1/blocks",
|
|
848
|
+
body: { ...input, projectId: options.projectId },
|
|
849
|
+
...options.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
850
|
+
});
|
|
851
|
+
},
|
|
852
|
+
async list(filter) {
|
|
853
|
+
return transport.request({
|
|
854
|
+
method: "GET",
|
|
855
|
+
path: "/v1/blocks",
|
|
856
|
+
query: {
|
|
857
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
858
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
859
|
+
...filter?.kind !== void 0 && { kind: filter.kind },
|
|
860
|
+
...filter?.name !== void 0 && { name: filter.name },
|
|
861
|
+
...filter?.scope !== void 0 && scopeToQuery(filter.scope)
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
},
|
|
865
|
+
async get(blockId) {
|
|
866
|
+
return transport.request({ method: "GET", path: `/v1/blocks/${seg(blockId)}` });
|
|
867
|
+
},
|
|
868
|
+
versions: {
|
|
869
|
+
async list(blockId, filter) {
|
|
870
|
+
return transport.request({
|
|
871
|
+
method: "GET",
|
|
872
|
+
path: `/v1/blocks/${seg(blockId)}/versions`,
|
|
873
|
+
query: {
|
|
874
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
875
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
876
|
+
...filter?.includeTombstoned !== void 0 && {
|
|
877
|
+
includeTombstoned: filter.includeTombstoned
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
},
|
|
882
|
+
async get(blockId, version) {
|
|
883
|
+
return transport.request({
|
|
884
|
+
method: "GET",
|
|
885
|
+
path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}`
|
|
886
|
+
});
|
|
887
|
+
},
|
|
888
|
+
async unregister(blockId, version, options) {
|
|
889
|
+
return transport.request({
|
|
890
|
+
method: "POST",
|
|
891
|
+
path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/unregister`,
|
|
892
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
893
|
+
});
|
|
894
|
+
},
|
|
895
|
+
async reinstate(blockId, version, options) {
|
|
896
|
+
return transport.request({
|
|
897
|
+
method: "POST",
|
|
898
|
+
path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/reinstate`,
|
|
899
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
|
|
827
906
|
// src/resources/capabilities.ts
|
|
828
907
|
function makeCapabilitiesClient(transport) {
|
|
829
908
|
return {
|
|
@@ -1288,6 +1367,10 @@ function tryReadRevisionConflict(err) {
|
|
|
1288
1367
|
}
|
|
1289
1368
|
|
|
1290
1369
|
// src/resources/eval-runs.ts
|
|
1370
|
+
function comparisonOf(run) {
|
|
1371
|
+
const result = run.result;
|
|
1372
|
+
return run.kind === "judged" && result?.summary !== void 0 && Array.isArray(result.perCase) ? result : void 0;
|
|
1373
|
+
}
|
|
1291
1374
|
function makeEvalRunsClient(transport) {
|
|
1292
1375
|
const seg = (s) => encodeURIComponent(s);
|
|
1293
1376
|
return {
|
|
@@ -1376,6 +1459,24 @@ function makeEvalSuitesClient(transport) {
|
|
|
1376
1459
|
path: `/v1/eval-suites/${seg(suiteId)}`
|
|
1377
1460
|
});
|
|
1378
1461
|
},
|
|
1462
|
+
async buildFromJudgments(suiteId, input, options) {
|
|
1463
|
+
return transport.request({
|
|
1464
|
+
method: "POST",
|
|
1465
|
+
path: `/v1/eval-suites/${seg(suiteId)}/versions/from-judgments`,
|
|
1466
|
+
body: input,
|
|
1467
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1468
|
+
});
|
|
1469
|
+
},
|
|
1470
|
+
async listCases(suiteId, version, query) {
|
|
1471
|
+
return transport.request({
|
|
1472
|
+
method: "GET",
|
|
1473
|
+
path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}/cases`,
|
|
1474
|
+
query: {
|
|
1475
|
+
...query?.limit !== void 0 && { limit: query.limit },
|
|
1476
|
+
...query?.cursor !== void 0 && { cursor: query.cursor }
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
},
|
|
1379
1480
|
versions: {
|
|
1380
1481
|
async list(suiteId, filter) {
|
|
1381
1482
|
return transport.request({
|
|
@@ -1759,6 +1860,115 @@ function makeIdentityClient(transport) {
|
|
|
1759
1860
|
};
|
|
1760
1861
|
}
|
|
1761
1862
|
|
|
1863
|
+
// src/resources/judge-classes.ts
|
|
1864
|
+
function scopeQuery(scope) {
|
|
1865
|
+
if (scope.kind === "tenant") return { scopeKind: "tenant" };
|
|
1866
|
+
if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
|
|
1867
|
+
return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
|
|
1868
|
+
}
|
|
1869
|
+
function makeJudgeClassesClient(transport) {
|
|
1870
|
+
const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
|
|
1871
|
+
return {
|
|
1872
|
+
async create(input, options) {
|
|
1873
|
+
return transport.request({
|
|
1874
|
+
method: "POST",
|
|
1875
|
+
path: "/v1/judge-classes",
|
|
1876
|
+
body: input,
|
|
1877
|
+
...withKey(options)
|
|
1878
|
+
});
|
|
1879
|
+
},
|
|
1880
|
+
async list(filter) {
|
|
1881
|
+
const page = await transport.request({
|
|
1882
|
+
method: "GET",
|
|
1883
|
+
path: "/v1/judge-classes",
|
|
1884
|
+
query: {
|
|
1885
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1886
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1887
|
+
...filter?.scope !== void 0 && scopeQuery(filter.scope)
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
return {
|
|
1891
|
+
items: page.data,
|
|
1892
|
+
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1893
|
+
};
|
|
1894
|
+
},
|
|
1895
|
+
async get(judgeClassId) {
|
|
1896
|
+
return transport.request({
|
|
1897
|
+
method: "GET",
|
|
1898
|
+
path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}`
|
|
1899
|
+
});
|
|
1900
|
+
},
|
|
1901
|
+
async update(judgeClassId, input, options) {
|
|
1902
|
+
return transport.request({
|
|
1903
|
+
method: "PATCH",
|
|
1904
|
+
path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}`,
|
|
1905
|
+
body: input,
|
|
1906
|
+
...withKey(options)
|
|
1907
|
+
});
|
|
1908
|
+
},
|
|
1909
|
+
async unregister(judgeClassId, options) {
|
|
1910
|
+
await transport.request({
|
|
1911
|
+
method: "POST",
|
|
1912
|
+
path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}/unregister`,
|
|
1913
|
+
body: {},
|
|
1914
|
+
discardResponse: true,
|
|
1915
|
+
...withKey(options)
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
// src/resources/judgments.ts
|
|
1922
|
+
function makeJudgmentsClient(transport) {
|
|
1923
|
+
return {
|
|
1924
|
+
async create(input, options) {
|
|
1925
|
+
return transport.request({
|
|
1926
|
+
method: "POST",
|
|
1927
|
+
path: "/v1/judgments",
|
|
1928
|
+
body: input,
|
|
1929
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1930
|
+
});
|
|
1931
|
+
},
|
|
1932
|
+
async list(filter) {
|
|
1933
|
+
const page = await transport.request({
|
|
1934
|
+
method: "GET",
|
|
1935
|
+
path: "/v1/judgments",
|
|
1936
|
+
query: {
|
|
1937
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1938
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1939
|
+
...filter?.runId !== void 0 && { runId: filter.runId },
|
|
1940
|
+
...filter?.agentId !== void 0 && { agentId: filter.agentId },
|
|
1941
|
+
...filter?.agentVersion !== void 0 && { agentVersion: filter.agentVersion },
|
|
1942
|
+
...filter?.flowId !== void 0 && { flowId: filter.flowId },
|
|
1943
|
+
...filter?.verdict !== void 0 && { verdict: filter.verdict },
|
|
1944
|
+
...filter?.judgeClassId !== void 0 && { judgeClassId: filter.judgeClassId },
|
|
1945
|
+
...filter?.participantId !== void 0 && { participantId: filter.participantId },
|
|
1946
|
+
...filter?.scope !== void 0 && scopeToQuery(filter.scope)
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
return {
|
|
1950
|
+
items: page.data,
|
|
1951
|
+
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1952
|
+
};
|
|
1953
|
+
},
|
|
1954
|
+
async get(judgmentId) {
|
|
1955
|
+
return transport.request({
|
|
1956
|
+
method: "GET",
|
|
1957
|
+
path: `/v1/judgments/${encodeURIComponent(judgmentId)}`
|
|
1958
|
+
});
|
|
1959
|
+
},
|
|
1960
|
+
async unregister(judgmentId, options) {
|
|
1961
|
+
await transport.request({
|
|
1962
|
+
method: "POST",
|
|
1963
|
+
path: `/v1/judgments/${encodeURIComponent(judgmentId)}/unregister`,
|
|
1964
|
+
body: {},
|
|
1965
|
+
discardResponse: true,
|
|
1966
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1762
1972
|
// src/resources/mcp.ts
|
|
1763
1973
|
function makeMcpClient(transport) {
|
|
1764
1974
|
return {
|
|
@@ -2597,6 +2807,8 @@ function makeRunsClient(transport) {
|
|
|
2597
2807
|
},
|
|
2598
2808
|
...filter?.topLevel !== void 0 && { topLevel: String(filter.topLevel) },
|
|
2599
2809
|
...filter?.agentId !== void 0 && { agentId: filter.agentId },
|
|
2810
|
+
...filter?.replays !== void 0 && { replays: filter.replays },
|
|
2811
|
+
...filter?.evalRunId !== void 0 && { evalRunId: filter.evalRunId },
|
|
2600
2812
|
...filter?.includeOutput === true && { include: "output" }
|
|
2601
2813
|
}
|
|
2602
2814
|
});
|
|
@@ -3790,7 +4002,10 @@ function createClient(options) {
|
|
|
3790
4002
|
compliance: makeComplianceClient(transport),
|
|
3791
4003
|
audit: makeAuditClient(transport),
|
|
3792
4004
|
evalSuites: makeEvalSuitesClient(transport),
|
|
4005
|
+
blocks: makeBlocksClient(transport),
|
|
3793
4006
|
evalRuns: makeEvalRunsClient(transport),
|
|
4007
|
+
judgments: makeJudgmentsClient(transport),
|
|
4008
|
+
judgeClasses: makeJudgeClassesClient(transport),
|
|
3794
4009
|
users: makeUsersClient(transport),
|
|
3795
4010
|
identity: makeIdentityClient(transport),
|
|
3796
4011
|
auth: makeAuthClient(transport),
|
|
@@ -3808,6 +4023,6 @@ function createClient(options) {
|
|
|
3808
4023
|
};
|
|
3809
4024
|
}
|
|
3810
4025
|
|
|
3811
|
-
export { KindgiApiError, SseHttpError, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData };
|
|
4026
|
+
export { KindgiApiError, SseHttpError, comparisonOf, createClient, followRun, fromWire, notImplementedInPreview, notYetWired, readSse, subscribeToRun, unwrapSseData };
|
|
3812
4027
|
//# sourceMappingURL=index.js.map
|
|
3813
4028
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindgi/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-rc.1",
|
|
4
4
|
"description": "TypeScript client SDK for Kindgi™ — the sovereign AI OS. Preview: wire-generated from openapi.json via typed-openapi, ergonomic hand-authored resource clients (Transport, KindgiApiError, SSE with Last-Event-Id resume).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"zod": "^4.6.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@kindgi/agents": "0.1.
|
|
49
|
-
"@kindgi/api": "0.1.
|
|
50
|
-
"@kindgi/flow": "0.1.
|
|
51
|
-
"@kindgi/platform": "0.1.
|
|
52
|
-
"@kindgi/runtime": "0.1.
|
|
53
|
-
"@kindgi/types": "0.1.
|
|
48
|
+
"@kindgi/agents": "0.1.4-rc.1",
|
|
49
|
+
"@kindgi/api": "0.1.4-rc.1",
|
|
50
|
+
"@kindgi/flow": "0.1.4-rc.1",
|
|
51
|
+
"@kindgi/platform": "0.1.4-rc.1",
|
|
52
|
+
"@kindgi/runtime": "0.1.4-rc.1",
|
|
53
|
+
"@kindgi/types": "0.1.4-rc.1",
|
|
54
54
|
"@types/node": "^22.10.5",
|
|
55
55
|
"dts-bundle-generator": "^9.5.1",
|
|
56
56
|
"tsup": "^8.5.1",
|