@kindgi/client 0.1.3 → 0.1.4-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
@@ -107,6 +107,8 @@ function fromWire(body) {
107
107
  case "provider-already-registered":
108
108
  case "proposal-invalid-state-transition":
109
109
  case "approval-not-decided":
110
+ case "slug-conflict":
111
+ case "project-default-already-exists":
110
112
  return { code: "conflict", message, reason: code };
111
113
  case "invalid-request":
112
114
  case "validation-failed":
@@ -461,6 +463,16 @@ function makeAgentsClient(transport) {
461
463
  idempotencyKey: options.idempotencyKey
462
464
  }
463
465
  });
466
+ },
467
+ async derive(agentId, input, options) {
468
+ return transport.request({
469
+ method: "POST",
470
+ path: `/v1/agents/${seg(agentId)}/versions`,
471
+ body: input,
472
+ ...options?.idempotencyKey !== void 0 && {
473
+ idempotencyKey: options.idempotencyKey
474
+ }
475
+ });
464
476
  }
465
477
  },
466
478
  async reinstateVersion(agentId, version, options) {
@@ -826,6 +838,72 @@ function makeAuthClient(transport) {
826
838
  };
827
839
  }
828
840
 
841
+ // src/resources/blocks.ts
842
+ function makeBlocksClient(transport) {
843
+ const seg = (s) => encodeURIComponent(s);
844
+ return {
845
+ async publish(input, options) {
846
+ return transport.request({
847
+ method: "POST",
848
+ path: "/v1/blocks",
849
+ body: { ...input, projectId: options.projectId },
850
+ ...options.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
851
+ });
852
+ },
853
+ async list(filter) {
854
+ return transport.request({
855
+ method: "GET",
856
+ path: "/v1/blocks",
857
+ query: {
858
+ ...filter?.limit !== void 0 && { limit: filter.limit },
859
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
860
+ ...filter?.kind !== void 0 && { kind: filter.kind },
861
+ ...filter?.name !== void 0 && { name: filter.name },
862
+ ...filter?.scope !== void 0 && scopeToQuery(filter.scope)
863
+ }
864
+ });
865
+ },
866
+ async get(blockId) {
867
+ return transport.request({ method: "GET", path: `/v1/blocks/${seg(blockId)}` });
868
+ },
869
+ versions: {
870
+ async list(blockId, filter) {
871
+ return transport.request({
872
+ method: "GET",
873
+ path: `/v1/blocks/${seg(blockId)}/versions`,
874
+ query: {
875
+ ...filter?.limit !== void 0 && { limit: filter.limit },
876
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
877
+ ...filter?.includeTombstoned !== void 0 && {
878
+ includeTombstoned: filter.includeTombstoned
879
+ }
880
+ }
881
+ });
882
+ },
883
+ async get(blockId, version) {
884
+ return transport.request({
885
+ method: "GET",
886
+ path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}`
887
+ });
888
+ },
889
+ async unregister(blockId, version, options) {
890
+ return transport.request({
891
+ method: "POST",
892
+ path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/unregister`,
893
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
894
+ });
895
+ },
896
+ async reinstate(blockId, version, options) {
897
+ return transport.request({
898
+ method: "POST",
899
+ path: `/v1/blocks/${seg(blockId)}/versions/${seg(version)}/reinstate`,
900
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
901
+ });
902
+ }
903
+ }
904
+ };
905
+ }
906
+
829
907
  // src/resources/capabilities.ts
830
908
  function makeCapabilitiesClient(transport) {
831
909
  return {
@@ -1378,6 +1456,24 @@ function makeEvalSuitesClient(transport) {
1378
1456
  path: `/v1/eval-suites/${seg(suiteId)}`
1379
1457
  });
1380
1458
  },
1459
+ async buildFromJudgments(suiteId, input, options) {
1460
+ return transport.request({
1461
+ method: "POST",
1462
+ path: `/v1/eval-suites/${seg(suiteId)}/versions/from-judgments`,
1463
+ body: input,
1464
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1465
+ });
1466
+ },
1467
+ async listCases(suiteId, version, query) {
1468
+ return transport.request({
1469
+ method: "GET",
1470
+ path: `/v1/eval-suites/${seg(suiteId)}/versions/${seg(version)}/cases`,
1471
+ query: {
1472
+ ...query?.limit !== void 0 && { limit: query.limit },
1473
+ ...query?.cursor !== void 0 && { cursor: query.cursor }
1474
+ }
1475
+ });
1476
+ },
1381
1477
  versions: {
1382
1478
  async list(suiteId, filter) {
1383
1479
  return transport.request({
@@ -1761,6 +1857,115 @@ function makeIdentityClient(transport) {
1761
1857
  };
1762
1858
  }
1763
1859
 
1860
+ // src/resources/judge-classes.ts
1861
+ function scopeQuery(scope) {
1862
+ if (scope.kind === "tenant") return { scopeKind: "tenant" };
1863
+ if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
1864
+ return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
1865
+ }
1866
+ function makeJudgeClassesClient(transport) {
1867
+ const withKey = (options) => options?.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {};
1868
+ return {
1869
+ async create(input, options) {
1870
+ return transport.request({
1871
+ method: "POST",
1872
+ path: "/v1/judge-classes",
1873
+ body: input,
1874
+ ...withKey(options)
1875
+ });
1876
+ },
1877
+ async list(filter) {
1878
+ const page = await transport.request({
1879
+ method: "GET",
1880
+ path: "/v1/judge-classes",
1881
+ query: {
1882
+ ...filter?.limit !== void 0 && { limit: filter.limit },
1883
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
1884
+ ...filter?.scope !== void 0 && scopeQuery(filter.scope)
1885
+ }
1886
+ });
1887
+ return {
1888
+ items: page.data,
1889
+ ...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
1890
+ };
1891
+ },
1892
+ async get(judgeClassId) {
1893
+ return transport.request({
1894
+ method: "GET",
1895
+ path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}`
1896
+ });
1897
+ },
1898
+ async update(judgeClassId, input, options) {
1899
+ return transport.request({
1900
+ method: "PATCH",
1901
+ path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}`,
1902
+ body: input,
1903
+ ...withKey(options)
1904
+ });
1905
+ },
1906
+ async unregister(judgeClassId, options) {
1907
+ await transport.request({
1908
+ method: "POST",
1909
+ path: `/v1/judge-classes/${encodeURIComponent(judgeClassId)}/unregister`,
1910
+ body: {},
1911
+ discardResponse: true,
1912
+ ...withKey(options)
1913
+ });
1914
+ }
1915
+ };
1916
+ }
1917
+
1918
+ // src/resources/judgments.ts
1919
+ function makeJudgmentsClient(transport) {
1920
+ return {
1921
+ async create(input, options) {
1922
+ return transport.request({
1923
+ method: "POST",
1924
+ path: "/v1/judgments",
1925
+ body: input,
1926
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1927
+ });
1928
+ },
1929
+ async list(filter) {
1930
+ const page = await transport.request({
1931
+ method: "GET",
1932
+ path: "/v1/judgments",
1933
+ query: {
1934
+ ...filter?.limit !== void 0 && { limit: filter.limit },
1935
+ ...filter?.cursor !== void 0 && { cursor: filter.cursor },
1936
+ ...filter?.runId !== void 0 && { runId: filter.runId },
1937
+ ...filter?.agentId !== void 0 && { agentId: filter.agentId },
1938
+ ...filter?.agentVersion !== void 0 && { agentVersion: filter.agentVersion },
1939
+ ...filter?.flowId !== void 0 && { flowId: filter.flowId },
1940
+ ...filter?.verdict !== void 0 && { verdict: filter.verdict },
1941
+ ...filter?.judgeClassId !== void 0 && { judgeClassId: filter.judgeClassId },
1942
+ ...filter?.participantId !== void 0 && { participantId: filter.participantId },
1943
+ ...filter?.scope !== void 0 && scopeToQuery(filter.scope)
1944
+ }
1945
+ });
1946
+ return {
1947
+ items: page.data,
1948
+ ...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
1949
+ };
1950
+ },
1951
+ async get(judgmentId) {
1952
+ return transport.request({
1953
+ method: "GET",
1954
+ path: `/v1/judgments/${encodeURIComponent(judgmentId)}`
1955
+ });
1956
+ },
1957
+ async unregister(judgmentId, options) {
1958
+ await transport.request({
1959
+ method: "POST",
1960
+ path: `/v1/judgments/${encodeURIComponent(judgmentId)}/unregister`,
1961
+ body: {},
1962
+ discardResponse: true,
1963
+ ...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
1964
+ });
1965
+ }
1966
+ };
1967
+ }
1968
+
1764
1969
  // src/resources/mcp.ts
1765
1970
  function makeMcpClient(transport) {
1766
1971
  return {
@@ -2599,6 +2804,8 @@ function makeRunsClient(transport) {
2599
2804
  },
2600
2805
  ...filter?.topLevel !== void 0 && { topLevel: String(filter.topLevel) },
2601
2806
  ...filter?.agentId !== void 0 && { agentId: filter.agentId },
2807
+ ...filter?.replays !== void 0 && { replays: filter.replays },
2808
+ ...filter?.evalRunId !== void 0 && { evalRunId: filter.evalRunId },
2602
2809
  ...filter?.includeOutput === true && { include: "output" }
2603
2810
  }
2604
2811
  });
@@ -3792,7 +3999,10 @@ function createClient(options) {
3792
3999
  compliance: makeComplianceClient(transport),
3793
4000
  audit: makeAuditClient(transport),
3794
4001
  evalSuites: makeEvalSuitesClient(transport),
4002
+ blocks: makeBlocksClient(transport),
3795
4003
  evalRuns: makeEvalRunsClient(transport),
4004
+ judgments: makeJudgmentsClient(transport),
4005
+ judgeClasses: makeJudgeClassesClient(transport),
3796
4006
  users: makeUsersClient(transport),
3797
4007
  identity: makeIdentityClient(transport),
3798
4008
  auth: makeAuthClient(transport),