cencori 1.8.2 → 1.9.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.
Files changed (48) hide show
  1. package/README.md +21 -0
  2. package/dist/ai/index.d.mts +14 -1
  3. package/dist/ai/index.d.ts +14 -1
  4. package/dist/ai/index.js +43 -3
  5. package/dist/ai/index.js.map +1 -1
  6. package/dist/ai/index.mjs +43 -3
  7. package/dist/ai/index.mjs.map +1 -1
  8. package/dist/compute/index.d.mts +1 -1
  9. package/dist/compute/index.d.ts +1 -1
  10. package/dist/documents/index.d.mts +1 -1
  11. package/dist/documents/index.d.ts +1 -1
  12. package/dist/index.d.mts +68 -9
  13. package/dist/index.d.ts +68 -9
  14. package/dist/index.js +187 -19
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +186 -19
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/judgment/index.d.mts +128 -0
  19. package/dist/judgment/index.d.ts +128 -0
  20. package/dist/judgment/index.js +79 -0
  21. package/dist/judgment/index.js.map +1 -0
  22. package/dist/judgment/index.mjs +54 -0
  23. package/dist/judgment/index.mjs.map +1 -0
  24. package/dist/memory/index.d.mts +1 -1
  25. package/dist/memory/index.d.ts +1 -1
  26. package/dist/storage/index.d.mts +5 -7
  27. package/dist/storage/index.d.ts +5 -7
  28. package/dist/storage/index.js +6 -8
  29. package/dist/storage/index.js.map +1 -1
  30. package/dist/storage/index.mjs +6 -8
  31. package/dist/storage/index.mjs.map +1 -1
  32. package/dist/telemetry/index.d.mts +1 -1
  33. package/dist/telemetry/index.d.ts +1 -1
  34. package/dist/{types-CAhDuNTz.d.mts → types-D91o22Gb.d.mts} +28 -1
  35. package/dist/{types-CAhDuNTz.d.ts → types-D91o22Gb.d.ts} +28 -1
  36. package/dist/vercel/index.js +66 -6
  37. package/dist/vercel/index.js.map +1 -1
  38. package/dist/vercel/index.mjs +66 -6
  39. package/dist/vercel/index.mjs.map +1 -1
  40. package/dist/vision/index.d.mts +1 -1
  41. package/dist/vision/index.d.ts +1 -1
  42. package/dist/voice/index.d.mts +1 -1
  43. package/dist/voice/index.d.ts +1 -1
  44. package/dist/web/index.d.mts +1 -1
  45. package/dist/web/index.d.ts +1 -1
  46. package/dist/workflow/index.d.mts +1 -1
  47. package/dist/workflow/index.d.ts +1 -1
  48. package/package.json +6 -1
@@ -0,0 +1,128 @@
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
2
+
3
+ /**
4
+ * Judgment API — structured decisions from decision models.
5
+ *
6
+ * Send a state plus typed questions (noul / choice / score) and get back
7
+ * probabilities — never generated text. Any `judgment`-type catalog model
8
+ * works here through the same endpoint (TypeSafe's Jev today).
9
+ *
10
+ * @example
11
+ * const result = await cencori.judgment.judge({
12
+ * state: 'I was charged twice. Please refund the duplicate.',
13
+ * questions: {
14
+ * department: {
15
+ * type: 'choice',
16
+ * instructions: 'Which team should handle this?',
17
+ * criteria: { billing: 'Payments, invoicing, refunds', technical: 'Bugs, outages' },
18
+ * },
19
+ * requests_refund: { type: 'noul', instructions: 'Does the customer request a refund?' },
20
+ * },
21
+ * });
22
+ * console.log(result.answers.department.choice); // 'billing'
23
+ *
24
+ * @example
25
+ * const { data: models } = await cencori.judgment.listModels();
26
+ */
27
+
28
+ type JudgmentQuestionType = 'noul' | 'choice' | 'score';
29
+ /** Text, a JSON object, or an array of text values. */
30
+ type JudgmentState = string | Record<string, unknown> | unknown[];
31
+ interface NoulQuestion {
32
+ type: 'noul';
33
+ instructions: string | Record<string, unknown>;
34
+ criteria?: {
35
+ true?: string | Record<string, unknown> | null;
36
+ false?: string | Record<string, unknown> | null;
37
+ } | null;
38
+ }
39
+ interface ChoiceQuestion {
40
+ type: 'choice';
41
+ instructions: string | Record<string, unknown>;
42
+ /** 1–255 options: option name → rubric description (`null` needs none). */
43
+ criteria: Record<string, string | Record<string, unknown> | null>;
44
+ }
45
+ interface ScoreQuestion {
46
+ type: 'score';
47
+ instructions: string | Record<string, unknown>;
48
+ /** 2–10 ordered level descriptions, lowest first. */
49
+ criteria: string[];
50
+ }
51
+ type JudgmentQuestion = NoulQuestion | ChoiceQuestion | ScoreQuestion;
52
+ interface JudgeRequest {
53
+ /** What the questions are about: text, a JSON object, or an array. */
54
+ state: JudgmentState;
55
+ /** Non-empty map of question id → typed question. Answers come back under the same ids. */
56
+ questions: Record<string, JudgmentQuestion>;
57
+ /** Judgment model id. Default: `jev-latest`. */
58
+ model?: string;
59
+ }
60
+ interface NoulAnswer {
61
+ type: 'noul';
62
+ /** Probability the answer is yes, 0–1. */
63
+ noul: number;
64
+ }
65
+ interface ChoiceAnswer {
66
+ type: 'choice';
67
+ choice: string;
68
+ confidence: number;
69
+ probabilities: Record<string, number>;
70
+ }
71
+ interface ScoreAnswer {
72
+ type: 'score';
73
+ score: number;
74
+ confidence: number;
75
+ legend: Record<string, string>;
76
+ probabilities: Record<string, number>;
77
+ }
78
+ type JudgmentAnswer = NoulAnswer | ChoiceAnswer | ScoreAnswer;
79
+ interface JudgmentUsage {
80
+ input_tokens: number;
81
+ output_tokens: number;
82
+ }
83
+ interface JudgeResult {
84
+ object: 'judgment';
85
+ /** The model id that answered (aliases resolve upstream, e.g. `jev-latest` → `jev-1.13.0`). */
86
+ model: string;
87
+ answers: Record<string, JudgmentAnswer>;
88
+ usage: JudgmentUsage;
89
+ uses_byok?: boolean;
90
+ }
91
+ interface JudgmentModelInfo {
92
+ id: string;
93
+ owned_by: string;
94
+ type: 'judgment';
95
+ context_window: number;
96
+ available: boolean;
97
+ unavailable_reason?: string;
98
+ pricing: {
99
+ input_per_million: number | null;
100
+ output_per_million: number | null;
101
+ currency: 'USD';
102
+ input_display: string;
103
+ output_display: string;
104
+ note: string;
105
+ };
106
+ }
107
+ interface JudgmentModelsResponse {
108
+ object: 'list';
109
+ endpoint: string;
110
+ context_tokens: number;
111
+ data: JudgmentModelInfo[];
112
+ question_types: JudgmentQuestionType[];
113
+ default_model: string;
114
+ }
115
+ declare class JudgmentNamespace {
116
+ private config;
117
+ constructor(config: Required<CencoriConfig>);
118
+ /**
119
+ * Judge a state against typed questions. Returns one answer per
120
+ * question id with probabilities your code can branch on.
121
+ */
122
+ judge(request: JudgeRequest): Promise<JudgeResult>;
123
+ /** List the judgment models with their pricing. No API key required. */
124
+ listModels(): Promise<JudgmentModelsResponse>;
125
+ private error;
126
+ }
127
+
128
+ export { type ChoiceAnswer, type ChoiceQuestion, type JudgeRequest, type JudgeResult, type JudgmentAnswer, type JudgmentModelInfo, type JudgmentModelsResponse, JudgmentNamespace, type JudgmentQuestion, type JudgmentQuestionType, type JudgmentState, type JudgmentUsage, type NoulAnswer, type NoulQuestion, type ScoreAnswer, type ScoreQuestion };
@@ -0,0 +1,128 @@
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.js';
2
+
3
+ /**
4
+ * Judgment API — structured decisions from decision models.
5
+ *
6
+ * Send a state plus typed questions (noul / choice / score) and get back
7
+ * probabilities — never generated text. Any `judgment`-type catalog model
8
+ * works here through the same endpoint (TypeSafe's Jev today).
9
+ *
10
+ * @example
11
+ * const result = await cencori.judgment.judge({
12
+ * state: 'I was charged twice. Please refund the duplicate.',
13
+ * questions: {
14
+ * department: {
15
+ * type: 'choice',
16
+ * instructions: 'Which team should handle this?',
17
+ * criteria: { billing: 'Payments, invoicing, refunds', technical: 'Bugs, outages' },
18
+ * },
19
+ * requests_refund: { type: 'noul', instructions: 'Does the customer request a refund?' },
20
+ * },
21
+ * });
22
+ * console.log(result.answers.department.choice); // 'billing'
23
+ *
24
+ * @example
25
+ * const { data: models } = await cencori.judgment.listModels();
26
+ */
27
+
28
+ type JudgmentQuestionType = 'noul' | 'choice' | 'score';
29
+ /** Text, a JSON object, or an array of text values. */
30
+ type JudgmentState = string | Record<string, unknown> | unknown[];
31
+ interface NoulQuestion {
32
+ type: 'noul';
33
+ instructions: string | Record<string, unknown>;
34
+ criteria?: {
35
+ true?: string | Record<string, unknown> | null;
36
+ false?: string | Record<string, unknown> | null;
37
+ } | null;
38
+ }
39
+ interface ChoiceQuestion {
40
+ type: 'choice';
41
+ instructions: string | Record<string, unknown>;
42
+ /** 1–255 options: option name → rubric description (`null` needs none). */
43
+ criteria: Record<string, string | Record<string, unknown> | null>;
44
+ }
45
+ interface ScoreQuestion {
46
+ type: 'score';
47
+ instructions: string | Record<string, unknown>;
48
+ /** 2–10 ordered level descriptions, lowest first. */
49
+ criteria: string[];
50
+ }
51
+ type JudgmentQuestion = NoulQuestion | ChoiceQuestion | ScoreQuestion;
52
+ interface JudgeRequest {
53
+ /** What the questions are about: text, a JSON object, or an array. */
54
+ state: JudgmentState;
55
+ /** Non-empty map of question id → typed question. Answers come back under the same ids. */
56
+ questions: Record<string, JudgmentQuestion>;
57
+ /** Judgment model id. Default: `jev-latest`. */
58
+ model?: string;
59
+ }
60
+ interface NoulAnswer {
61
+ type: 'noul';
62
+ /** Probability the answer is yes, 0–1. */
63
+ noul: number;
64
+ }
65
+ interface ChoiceAnswer {
66
+ type: 'choice';
67
+ choice: string;
68
+ confidence: number;
69
+ probabilities: Record<string, number>;
70
+ }
71
+ interface ScoreAnswer {
72
+ type: 'score';
73
+ score: number;
74
+ confidence: number;
75
+ legend: Record<string, string>;
76
+ probabilities: Record<string, number>;
77
+ }
78
+ type JudgmentAnswer = NoulAnswer | ChoiceAnswer | ScoreAnswer;
79
+ interface JudgmentUsage {
80
+ input_tokens: number;
81
+ output_tokens: number;
82
+ }
83
+ interface JudgeResult {
84
+ object: 'judgment';
85
+ /** The model id that answered (aliases resolve upstream, e.g. `jev-latest` → `jev-1.13.0`). */
86
+ model: string;
87
+ answers: Record<string, JudgmentAnswer>;
88
+ usage: JudgmentUsage;
89
+ uses_byok?: boolean;
90
+ }
91
+ interface JudgmentModelInfo {
92
+ id: string;
93
+ owned_by: string;
94
+ type: 'judgment';
95
+ context_window: number;
96
+ available: boolean;
97
+ unavailable_reason?: string;
98
+ pricing: {
99
+ input_per_million: number | null;
100
+ output_per_million: number | null;
101
+ currency: 'USD';
102
+ input_display: string;
103
+ output_display: string;
104
+ note: string;
105
+ };
106
+ }
107
+ interface JudgmentModelsResponse {
108
+ object: 'list';
109
+ endpoint: string;
110
+ context_tokens: number;
111
+ data: JudgmentModelInfo[];
112
+ question_types: JudgmentQuestionType[];
113
+ default_model: string;
114
+ }
115
+ declare class JudgmentNamespace {
116
+ private config;
117
+ constructor(config: Required<CencoriConfig>);
118
+ /**
119
+ * Judge a state against typed questions. Returns one answer per
120
+ * question id with probabilities your code can branch on.
121
+ */
122
+ judge(request: JudgeRequest): Promise<JudgeResult>;
123
+ /** List the judgment models with their pricing. No API key required. */
124
+ listModels(): Promise<JudgmentModelsResponse>;
125
+ private error;
126
+ }
127
+
128
+ export { type ChoiceAnswer, type ChoiceQuestion, type JudgeRequest, type JudgeResult, type JudgmentAnswer, type JudgmentModelInfo, type JudgmentModelsResponse, JudgmentNamespace, type JudgmentQuestion, type JudgmentQuestionType, type JudgmentState, type JudgmentUsage, type NoulAnswer, type NoulQuestion, type ScoreAnswer, type ScoreQuestion };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/judgment/index.ts
21
+ var judgment_exports = {};
22
+ __export(judgment_exports, {
23
+ JudgmentNamespace: () => JudgmentNamespace
24
+ });
25
+ module.exports = __toCommonJS(judgment_exports);
26
+ var JudgmentNamespace = class {
27
+ constructor(config) {
28
+ this.config = config;
29
+ }
30
+ /**
31
+ * Judge a state against typed questions. Returns one answer per
32
+ * question id with probabilities your code can branch on.
33
+ */
34
+ async judge(request) {
35
+ if (request.state === void 0 || request.state === null) {
36
+ throw new Error("judgment.judge requires `state`");
37
+ }
38
+ if (!request.questions || Object.keys(request.questions).length === 0) {
39
+ throw new Error("judgment.judge requires a non-empty `questions` object");
40
+ }
41
+ const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {
42
+ method: "POST",
43
+ headers: {
44
+ "CENCORI_API_KEY": this.config.apiKey,
45
+ "Content-Type": "application/json",
46
+ ...this.config.headers
47
+ },
48
+ body: JSON.stringify(request)
49
+ });
50
+ if (!response.ok) {
51
+ throw await this.error(response, "judgment.judge");
52
+ }
53
+ return await response.json();
54
+ }
55
+ /** List the judgment models with their pricing. No API key required. */
56
+ async listModels() {
57
+ const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {
58
+ headers: this.config.headers
59
+ });
60
+ if (!response.ok) {
61
+ throw await this.error(response, "judgment.listModels");
62
+ }
63
+ return await response.json();
64
+ }
65
+ async error(response, op) {
66
+ const data = await response.json().catch(() => ({}));
67
+ const message = data && typeof data === "object" && "message" in data && typeof data.message === "string" ? data.message : `${op} failed with status ${response.status}`;
68
+ const code = data && typeof data === "object" && "error" in data && typeof data.error === "string" ? data.error : "request_failed";
69
+ const err = new Error(message);
70
+ err.code = code;
71
+ err.details = data;
72
+ return err;
73
+ }
74
+ };
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ JudgmentNamespace
78
+ });
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/judgment/index.ts"],"sourcesContent":["/**\n * Judgment API — structured decisions from decision models.\n *\n * Send a state plus typed questions (noul / choice / score) and get back\n * probabilities — never generated text. Any `judgment`-type catalog model\n * works here through the same endpoint (TypeSafe's Jev today).\n *\n * @example\n * const result = await cencori.judgment.judge({\n * state: 'I was charged twice. Please refund the duplicate.',\n * questions: {\n * department: {\n * type: 'choice',\n * instructions: 'Which team should handle this?',\n * criteria: { billing: 'Payments, invoicing, refunds', technical: 'Bugs, outages' },\n * },\n * requests_refund: { type: 'noul', instructions: 'Does the customer request a refund?' },\n * },\n * });\n * console.log(result.answers.department.choice); // 'billing'\n *\n * @example\n * const { data: models } = await cencori.judgment.listModels();\n */\n\nimport type { CencoriConfig } from '../types';\n\nexport type JudgmentQuestionType = 'noul' | 'choice' | 'score';\n\n/** Text, a JSON object, or an array of text values. */\nexport type JudgmentState = string | Record<string, unknown> | unknown[];\n\nexport interface NoulQuestion {\n type: 'noul';\n instructions: string | Record<string, unknown>;\n criteria?: { true?: string | Record<string, unknown> | null; false?: string | Record<string, unknown> | null } | null;\n}\n\nexport interface ChoiceQuestion {\n type: 'choice';\n instructions: string | Record<string, unknown>;\n /** 1–255 options: option name → rubric description (`null` needs none). */\n criteria: Record<string, string | Record<string, unknown> | null>;\n}\n\nexport interface ScoreQuestion {\n type: 'score';\n instructions: string | Record<string, unknown>;\n /** 2–10 ordered level descriptions, lowest first. */\n criteria: string[];\n}\n\nexport type JudgmentQuestion = NoulQuestion | ChoiceQuestion | ScoreQuestion;\n\nexport interface JudgeRequest {\n /** What the questions are about: text, a JSON object, or an array. */\n state: JudgmentState;\n /** Non-empty map of question id → typed question. Answers come back under the same ids. */\n questions: Record<string, JudgmentQuestion>;\n /** Judgment model id. Default: `jev-latest`. */\n model?: string;\n}\n\nexport interface NoulAnswer {\n type: 'noul';\n /** Probability the answer is yes, 0–1. */\n noul: number;\n}\n\nexport interface ChoiceAnswer {\n type: 'choice';\n choice: string;\n confidence: number;\n probabilities: Record<string, number>;\n}\n\nexport interface ScoreAnswer {\n type: 'score';\n score: number;\n confidence: number;\n legend: Record<string, string>;\n probabilities: Record<string, number>;\n}\n\nexport type JudgmentAnswer = NoulAnswer | ChoiceAnswer | ScoreAnswer;\n\nexport interface JudgmentUsage {\n input_tokens: number;\n output_tokens: number;\n}\n\nexport interface JudgeResult {\n object: 'judgment';\n /** The model id that answered (aliases resolve upstream, e.g. `jev-latest` → `jev-1.13.0`). */\n model: string;\n answers: Record<string, JudgmentAnswer>;\n usage: JudgmentUsage;\n uses_byok?: boolean;\n}\n\nexport interface JudgmentModelInfo {\n id: string;\n owned_by: string;\n type: 'judgment';\n context_window: number;\n available: boolean;\n unavailable_reason?: string;\n pricing: {\n input_per_million: number | null;\n output_per_million: number | null;\n currency: 'USD';\n input_display: string;\n output_display: string;\n note: string;\n };\n}\n\nexport interface JudgmentModelsResponse {\n object: 'list';\n endpoint: string;\n context_tokens: number;\n data: JudgmentModelInfo[];\n question_types: JudgmentQuestionType[];\n default_model: string;\n}\n\nexport class JudgmentNamespace {\n private config: Required<CencoriConfig>;\n\n constructor(config: Required<CencoriConfig>) {\n this.config = config;\n }\n\n /**\n * Judge a state against typed questions. Returns one answer per\n * question id with probabilities your code can branch on.\n */\n async judge(request: JudgeRequest): Promise<JudgeResult> {\n if (request.state === undefined || request.state === null) {\n throw new Error('judgment.judge requires `state`');\n }\n if (!request.questions || Object.keys(request.questions).length === 0) {\n throw new Error('judgment.judge requires a non-empty `questions` object');\n }\n const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {\n method: 'POST',\n headers: {\n 'CENCORI_API_KEY': this.config.apiKey,\n 'Content-Type': 'application/json',\n ...this.config.headers,\n },\n body: JSON.stringify(request),\n });\n if (!response.ok) {\n throw await this.error(response, 'judgment.judge');\n }\n return (await response.json()) as JudgeResult;\n }\n\n /** List the judgment models with their pricing. No API key required. */\n async listModels(): Promise<JudgmentModelsResponse> {\n const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {\n headers: this.config.headers,\n });\n if (!response.ok) {\n throw await this.error(response, 'judgment.listModels');\n }\n return (await response.json()) as JudgmentModelsResponse;\n }\n\n private async error(response: Response, op: string): Promise<Error> {\n const data = await response.json().catch(() => ({}));\n const message =\n (data && typeof data === 'object' && 'message' in data && typeof data.message === 'string')\n ? data.message\n : `${op} failed with status ${response.status}`;\n const code =\n (data && typeof data === 'object' && 'error' in data && typeof data.error === 'string')\n ? data.error\n : 'request_failed';\n const err = new Error(message) as Error & { code?: string; details?: unknown };\n err.code = code;\n err.details = data;\n return err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8HO,IAAM,oBAAN,MAAwB;AAAA,EAG3B,YAAY,QAAiC;AACzC,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAM,SAA6C;AACrD,QAAI,QAAQ,UAAU,UAAa,QAAQ,UAAU,MAAM;AACvD,YAAM,IAAI,MAAM,iCAAiC;AAAA,IACrD;AACA,QAAI,CAAC,QAAQ,aAAa,OAAO,KAAK,QAAQ,SAAS,EAAE,WAAW,GAAG;AACnE,YAAM,IAAI,MAAM,wDAAwD;AAAA,IAC5E;AACA,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB;AAAA,MACpE,QAAQ;AAAA,MACR,SAAS;AAAA,QACL,mBAAmB,KAAK,OAAO;AAAA,QAC/B,gBAAgB;AAAA,QAChB,GAAG,KAAK,OAAO;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,OAAO;AAAA,IAChC,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,MAAM,KAAK,MAAM,UAAU,gBAAgB;AAAA,IACrD;AACA,WAAQ,MAAM,SAAS,KAAK;AAAA,EAChC;AAAA;AAAA,EAGA,MAAM,aAA8C;AAChD,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB;AAAA,MACpE,SAAS,KAAK,OAAO;AAAA,IACzB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,MAAM,KAAK,MAAM,UAAU,qBAAqB;AAAA,IAC1D;AACA,WAAQ,MAAM,SAAS,KAAK;AAAA,EAChC;AAAA,EAEA,MAAc,MAAM,UAAoB,IAA4B;AAChE,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,OAAO,CAAC,EAAE;AACnD,UAAM,UACD,QAAQ,OAAO,SAAS,YAAY,aAAa,QAAQ,OAAO,KAAK,YAAY,WAC5E,KAAK,UACL,GAAG,EAAE,uBAAuB,SAAS,MAAM;AACrD,UAAM,OACD,QAAQ,OAAO,SAAS,YAAY,WAAW,QAAQ,OAAO,KAAK,UAAU,WACxE,KAAK,QACL;AACV,UAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,QAAI,OAAO;AACX,QAAI,UAAU;AACd,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -0,0 +1,54 @@
1
+ // src/judgment/index.ts
2
+ var JudgmentNamespace = class {
3
+ constructor(config) {
4
+ this.config = config;
5
+ }
6
+ /**
7
+ * Judge a state against typed questions. Returns one answer per
8
+ * question id with probabilities your code can branch on.
9
+ */
10
+ async judge(request) {
11
+ if (request.state === void 0 || request.state === null) {
12
+ throw new Error("judgment.judge requires `state`");
13
+ }
14
+ if (!request.questions || Object.keys(request.questions).length === 0) {
15
+ throw new Error("judgment.judge requires a non-empty `questions` object");
16
+ }
17
+ const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {
18
+ method: "POST",
19
+ headers: {
20
+ "CENCORI_API_KEY": this.config.apiKey,
21
+ "Content-Type": "application/json",
22
+ ...this.config.headers
23
+ },
24
+ body: JSON.stringify(request)
25
+ });
26
+ if (!response.ok) {
27
+ throw await this.error(response, "judgment.judge");
28
+ }
29
+ return await response.json();
30
+ }
31
+ /** List the judgment models with their pricing. No API key required. */
32
+ async listModels() {
33
+ const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {
34
+ headers: this.config.headers
35
+ });
36
+ if (!response.ok) {
37
+ throw await this.error(response, "judgment.listModels");
38
+ }
39
+ return await response.json();
40
+ }
41
+ async error(response, op) {
42
+ const data = await response.json().catch(() => ({}));
43
+ const message = data && typeof data === "object" && "message" in data && typeof data.message === "string" ? data.message : `${op} failed with status ${response.status}`;
44
+ const code = data && typeof data === "object" && "error" in data && typeof data.error === "string" ? data.error : "request_failed";
45
+ const err = new Error(message);
46
+ err.code = code;
47
+ err.details = data;
48
+ return err;
49
+ }
50
+ };
51
+ export {
52
+ JudgmentNamespace
53
+ };
54
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/judgment/index.ts"],"sourcesContent":["/**\n * Judgment API — structured decisions from decision models.\n *\n * Send a state plus typed questions (noul / choice / score) and get back\n * probabilities — never generated text. Any `judgment`-type catalog model\n * works here through the same endpoint (TypeSafe's Jev today).\n *\n * @example\n * const result = await cencori.judgment.judge({\n * state: 'I was charged twice. Please refund the duplicate.',\n * questions: {\n * department: {\n * type: 'choice',\n * instructions: 'Which team should handle this?',\n * criteria: { billing: 'Payments, invoicing, refunds', technical: 'Bugs, outages' },\n * },\n * requests_refund: { type: 'noul', instructions: 'Does the customer request a refund?' },\n * },\n * });\n * console.log(result.answers.department.choice); // 'billing'\n *\n * @example\n * const { data: models } = await cencori.judgment.listModels();\n */\n\nimport type { CencoriConfig } from '../types';\n\nexport type JudgmentQuestionType = 'noul' | 'choice' | 'score';\n\n/** Text, a JSON object, or an array of text values. */\nexport type JudgmentState = string | Record<string, unknown> | unknown[];\n\nexport interface NoulQuestion {\n type: 'noul';\n instructions: string | Record<string, unknown>;\n criteria?: { true?: string | Record<string, unknown> | null; false?: string | Record<string, unknown> | null } | null;\n}\n\nexport interface ChoiceQuestion {\n type: 'choice';\n instructions: string | Record<string, unknown>;\n /** 1–255 options: option name → rubric description (`null` needs none). */\n criteria: Record<string, string | Record<string, unknown> | null>;\n}\n\nexport interface ScoreQuestion {\n type: 'score';\n instructions: string | Record<string, unknown>;\n /** 2–10 ordered level descriptions, lowest first. */\n criteria: string[];\n}\n\nexport type JudgmentQuestion = NoulQuestion | ChoiceQuestion | ScoreQuestion;\n\nexport interface JudgeRequest {\n /** What the questions are about: text, a JSON object, or an array. */\n state: JudgmentState;\n /** Non-empty map of question id → typed question. Answers come back under the same ids. */\n questions: Record<string, JudgmentQuestion>;\n /** Judgment model id. Default: `jev-latest`. */\n model?: string;\n}\n\nexport interface NoulAnswer {\n type: 'noul';\n /** Probability the answer is yes, 0–1. */\n noul: number;\n}\n\nexport interface ChoiceAnswer {\n type: 'choice';\n choice: string;\n confidence: number;\n probabilities: Record<string, number>;\n}\n\nexport interface ScoreAnswer {\n type: 'score';\n score: number;\n confidence: number;\n legend: Record<string, string>;\n probabilities: Record<string, number>;\n}\n\nexport type JudgmentAnswer = NoulAnswer | ChoiceAnswer | ScoreAnswer;\n\nexport interface JudgmentUsage {\n input_tokens: number;\n output_tokens: number;\n}\n\nexport interface JudgeResult {\n object: 'judgment';\n /** The model id that answered (aliases resolve upstream, e.g. `jev-latest` → `jev-1.13.0`). */\n model: string;\n answers: Record<string, JudgmentAnswer>;\n usage: JudgmentUsage;\n uses_byok?: boolean;\n}\n\nexport interface JudgmentModelInfo {\n id: string;\n owned_by: string;\n type: 'judgment';\n context_window: number;\n available: boolean;\n unavailable_reason?: string;\n pricing: {\n input_per_million: number | null;\n output_per_million: number | null;\n currency: 'USD';\n input_display: string;\n output_display: string;\n note: string;\n };\n}\n\nexport interface JudgmentModelsResponse {\n object: 'list';\n endpoint: string;\n context_tokens: number;\n data: JudgmentModelInfo[];\n question_types: JudgmentQuestionType[];\n default_model: string;\n}\n\nexport class JudgmentNamespace {\n private config: Required<CencoriConfig>;\n\n constructor(config: Required<CencoriConfig>) {\n this.config = config;\n }\n\n /**\n * Judge a state against typed questions. Returns one answer per\n * question id with probabilities your code can branch on.\n */\n async judge(request: JudgeRequest): Promise<JudgeResult> {\n if (request.state === undefined || request.state === null) {\n throw new Error('judgment.judge requires `state`');\n }\n if (!request.questions || Object.keys(request.questions).length === 0) {\n throw new Error('judgment.judge requires a non-empty `questions` object');\n }\n const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {\n method: 'POST',\n headers: {\n 'CENCORI_API_KEY': this.config.apiKey,\n 'Content-Type': 'application/json',\n ...this.config.headers,\n },\n body: JSON.stringify(request),\n });\n if (!response.ok) {\n throw await this.error(response, 'judgment.judge');\n }\n return (await response.json()) as JudgeResult;\n }\n\n /** List the judgment models with their pricing. No API key required. */\n async listModels(): Promise<JudgmentModelsResponse> {\n const response = await fetch(`${this.config.baseUrl}/api/v1/judgments`, {\n headers: this.config.headers,\n });\n if (!response.ok) {\n throw await this.error(response, 'judgment.listModels');\n }\n return (await response.json()) as JudgmentModelsResponse;\n }\n\n private async error(response: Response, op: string): Promise<Error> {\n const data = await response.json().catch(() => ({}));\n const message =\n (data && typeof data === 'object' && 'message' in data && typeof data.message === 'string')\n ? data.message\n : `${op} failed with status ${response.status}`;\n const code =\n (data && typeof data === 'object' && 'error' in data && typeof data.error === 'string')\n ? data.error\n : 'request_failed';\n const err = new Error(message) as Error & { code?: string; details?: unknown };\n err.code = code;\n err.details = data;\n return err;\n }\n}\n"],"mappings":";AA8HO,IAAM,oBAAN,MAAwB;AAAA,EAG3B,YAAY,QAAiC;AACzC,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAM,SAA6C;AACrD,QAAI,QAAQ,UAAU,UAAa,QAAQ,UAAU,MAAM;AACvD,YAAM,IAAI,MAAM,iCAAiC;AAAA,IACrD;AACA,QAAI,CAAC,QAAQ,aAAa,OAAO,KAAK,QAAQ,SAAS,EAAE,WAAW,GAAG;AACnE,YAAM,IAAI,MAAM,wDAAwD;AAAA,IAC5E;AACA,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB;AAAA,MACpE,QAAQ;AAAA,MACR,SAAS;AAAA,QACL,mBAAmB,KAAK,OAAO;AAAA,QAC/B,gBAAgB;AAAA,QAChB,GAAG,KAAK,OAAO;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,OAAO;AAAA,IAChC,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,MAAM,KAAK,MAAM,UAAU,gBAAgB;AAAA,IACrD;AACA,WAAQ,MAAM,SAAS,KAAK;AAAA,EAChC;AAAA;AAAA,EAGA,MAAM,aAA8C;AAChD,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB;AAAA,MACpE,SAAS,KAAK,OAAO;AAAA,IACzB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,MAAM,KAAK,MAAM,UAAU,qBAAqB;AAAA,IAC1D;AACA,WAAQ,MAAM,SAAS,KAAK;AAAA,EAChC;AAAA,EAEA,MAAc,MAAM,UAAoB,IAA4B;AAChE,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,OAAO,CAAC,EAAE;AACnD,UAAM,UACD,QAAQ,OAAO,SAAS,YAAY,aAAa,QAAQ,OAAO,KAAK,YAAY,WAC5E,KAAK,UACL,GAAG,EAAE,uBAAuB,SAAS,MAAM;AACrD,UAAM,OACD,QAAQ,OAAO,SAAS,YAAY,WAAW,QAAQ,OAAO,KAAK,UAAU,WACxE,KAAK,QACL;AACV,UAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,QAAI,OAAO;AACX,QAAI,UAAU;AACd,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-CAhDuNTz.mjs';
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
2
2
 
3
3
  /**
4
4
  * Cencori Memory SDK
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-CAhDuNTz.js';
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.js';
2
2
 
3
3
  /**
4
4
  * Cencori Memory SDK
@@ -1,4 +1,4 @@
1
- import { V as VectorSearchOptions } from '../types-CAhDuNTz.mjs';
1
+ import { V as VectorSearchOptions } from '../types-D91o22Gb.mjs';
2
2
 
3
3
  /**
4
4
  * Storage Namespace - Vector Database, Knowledge Base, RAG
@@ -35,15 +35,13 @@ declare class VectorsNamespace {
35
35
  }
36
36
  declare class KnowledgeNamespace {
37
37
  /**
38
- * Query the knowledge base
39
- *
40
- * 🚧 Coming Soon - This feature is not yet available.
38
+ * @deprecated Never implemented. Use `cencori.knowledge.search()`, or
39
+ * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
41
40
  */
42
41
  query(question: string): Promise<never>;
43
42
  /**
44
- * Add documents to knowledge base
45
- *
46
- * 🚧 Coming Soon - This feature is not yet available.
43
+ * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
44
+ * or `cencori.knowledge.addFileSource()`.
47
45
  */
48
46
  add(documents: {
49
47
  content: string;
@@ -1,4 +1,4 @@
1
- import { V as VectorSearchOptions } from '../types-CAhDuNTz.js';
1
+ import { V as VectorSearchOptions } from '../types-D91o22Gb.js';
2
2
 
3
3
  /**
4
4
  * Storage Namespace - Vector Database, Knowledge Base, RAG
@@ -35,15 +35,13 @@ declare class VectorsNamespace {
35
35
  }
36
36
  declare class KnowledgeNamespace {
37
37
  /**
38
- * Query the knowledge base
39
- *
40
- * 🚧 Coming Soon - This feature is not yet available.
38
+ * @deprecated Never implemented. Use `cencori.knowledge.search()`, or
39
+ * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
41
40
  */
42
41
  query(question: string): Promise<never>;
43
42
  /**
44
- * Add documents to knowledge base
45
- *
46
- * 🚧 Coming Soon - This feature is not yet available.
43
+ * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
44
+ * or `cencori.knowledge.addFileSource()`.
47
45
  */
48
46
  add(documents: {
49
47
  content: string;
@@ -57,23 +57,21 @@ var VectorsNamespace = class {
57
57
  };
58
58
  var KnowledgeNamespace = class {
59
59
  /**
60
- * Query the knowledge base
61
- *
62
- * 🚧 Coming Soon - This feature is not yet available.
60
+ * @deprecated Never implemented. Use `cencori.knowledge.search()`, or
61
+ * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
63
62
  */
64
63
  async query(question) {
65
64
  throw new Error(
66
- `cencori.storage.knowledge.query() is coming soon! Join our waitlist at https://cencori.com/memory`
65
+ `cencori.storage.knowledge.query() is not available. Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`
67
66
  );
68
67
  }
69
68
  /**
70
- * Add documents to knowledge base
71
- *
72
- * 🚧 Coming Soon - This feature is not yet available.
69
+ * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
70
+ * or `cencori.knowledge.addFileSource()`.
73
71
  */
74
72
  async add(documents) {
75
73
  throw new Error(
76
- `cencori.storage.knowledge.add() is coming soon! Join our waitlist at https://cencori.com/memory`
74
+ `cencori.storage.knowledge.add() is not available. Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`
77
75
  );
78
76
  }
79
77
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * Query the knowledge base\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Add documents to knowledge base\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
1
+ {"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.search()`, or\n * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is not available. ` +\n `Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`\n );\n }\n\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`\n * or `cencori.knowledge.addFileSource()`.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is not available. ` +\n `Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
@@ -33,23 +33,21 @@ var VectorsNamespace = class {
33
33
  };
34
34
  var KnowledgeNamespace = class {
35
35
  /**
36
- * Query the knowledge base
37
- *
38
- * 🚧 Coming Soon - This feature is not yet available.
36
+ * @deprecated Never implemented. Use `cencori.knowledge.search()`, or
37
+ * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
39
38
  */
40
39
  async query(question) {
41
40
  throw new Error(
42
- `cencori.storage.knowledge.query() is coming soon! Join our waitlist at https://cencori.com/memory`
41
+ `cencori.storage.knowledge.query() is not available. Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`
43
42
  );
44
43
  }
45
44
  /**
46
- * Add documents to knowledge base
47
- *
48
- * 🚧 Coming Soon - This feature is not yet available.
45
+ * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
46
+ * or `cencori.knowledge.addFileSource()`.
49
47
  */
50
48
  async add(documents) {
51
49
  throw new Error(
52
- `cencori.storage.knowledge.add() is coming soon! Join our waitlist at https://cencori.com/memory`
50
+ `cencori.storage.knowledge.add() is not available. Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`
53
51
  );
54
52
  }
55
53
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * Query the knowledge base\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Add documents to knowledge base\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
1
+ {"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.search()`, or\n * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is not available. ` +\n `Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`\n );\n }\n\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`\n * or `cencori.knowledge.addFileSource()`.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is not available. ` +\n `Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-CAhDuNTz.mjs';
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
2
2
 
3
3
  /**
4
4
  * Cencori Telemetry Client
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-CAhDuNTz.js';
1
+ import { C as CencoriConfig } from '../types-D91o22Gb.js';
2
2
 
3
3
  /**
4
4
  * Cencori Telemetry Client