@compresr/sdk 1.2.0 → 1.3.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 (71) hide show
  1. package/dist/cjs/clients/compression.d.ts +67 -30
  2. package/dist/cjs/clients/compression.d.ts.map +1 -1
  3. package/dist/cjs/clients/compression.js +98 -76
  4. package/dist/cjs/clients/compression.js.map +1 -1
  5. package/dist/cjs/config/constants.d.ts +0 -6
  6. package/dist/cjs/config/constants.d.ts.map +1 -1
  7. package/dist/cjs/config/constants.js +0 -6
  8. package/dist/cjs/config/constants.js.map +1 -1
  9. package/dist/cjs/config/endpoints.d.ts +1 -0
  10. package/dist/cjs/config/endpoints.d.ts.map +1 -1
  11. package/dist/cjs/config/endpoints.js +1 -0
  12. package/dist/cjs/config/endpoints.js.map +1 -1
  13. package/dist/cjs/http/client.d.ts.map +1 -1
  14. package/dist/cjs/http/client.js +5 -4
  15. package/dist/cjs/http/client.js.map +1 -1
  16. package/dist/cjs/index.d.ts +1 -1
  17. package/dist/cjs/index.d.ts.map +1 -1
  18. package/dist/cjs/index.js +3 -2
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/schemas/compression.d.ts +75 -21
  21. package/dist/cjs/schemas/compression.d.ts.map +1 -1
  22. package/dist/cjs/schemas/compression.js +26 -9
  23. package/dist/cjs/schemas/compression.js.map +1 -1
  24. package/dist/cjs/schemas/index.d.ts +1 -2
  25. package/dist/cjs/schemas/index.d.ts.map +1 -1
  26. package/dist/cjs/schemas/index.js +3 -9
  27. package/dist/cjs/schemas/index.js.map +1 -1
  28. package/dist/cjs/version.d.ts +6 -0
  29. package/dist/cjs/version.d.ts.map +1 -0
  30. package/dist/cjs/version.js +9 -0
  31. package/dist/cjs/version.js.map +1 -0
  32. package/dist/esm/clients/compression.d.ts +67 -30
  33. package/dist/esm/clients/compression.d.ts.map +1 -1
  34. package/dist/esm/clients/compression.js +100 -78
  35. package/dist/esm/clients/compression.js.map +1 -1
  36. package/dist/esm/config/constants.d.ts +0 -6
  37. package/dist/esm/config/constants.d.ts.map +1 -1
  38. package/dist/esm/config/constants.js +0 -6
  39. package/dist/esm/config/constants.js.map +1 -1
  40. package/dist/esm/config/endpoints.d.ts +1 -0
  41. package/dist/esm/config/endpoints.d.ts.map +1 -1
  42. package/dist/esm/config/endpoints.js +1 -0
  43. package/dist/esm/config/endpoints.js.map +1 -1
  44. package/dist/esm/http/client.d.ts.map +1 -1
  45. package/dist/esm/http/client.js +3 -2
  46. package/dist/esm/http/client.js.map +1 -1
  47. package/dist/esm/index.d.ts +1 -1
  48. package/dist/esm/index.d.ts.map +1 -1
  49. package/dist/esm/index.js +2 -2
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/esm/schemas/compression.d.ts +75 -21
  52. package/dist/esm/schemas/compression.d.ts.map +1 -1
  53. package/dist/esm/schemas/compression.js +25 -8
  54. package/dist/esm/schemas/compression.js.map +1 -1
  55. package/dist/esm/schemas/index.d.ts +1 -2
  56. package/dist/esm/schemas/index.d.ts.map +1 -1
  57. package/dist/esm/schemas/index.js +1 -3
  58. package/dist/esm/schemas/index.js.map +1 -1
  59. package/dist/esm/version.d.ts +6 -0
  60. package/dist/esm/version.d.ts.map +1 -0
  61. package/dist/esm/version.js +6 -0
  62. package/dist/esm/version.js.map +1 -0
  63. package/package.json +3 -3
  64. package/dist/cjs/schemas/search.d.ts +0 -184
  65. package/dist/cjs/schemas/search.d.ts.map +0 -1
  66. package/dist/cjs/schemas/search.js +0 -75
  67. package/dist/cjs/schemas/search.js.map +0 -1
  68. package/dist/esm/schemas/search.d.ts +0 -184
  69. package/dist/esm/schemas/search.d.ts.map +0 -1
  70. package/dist/esm/schemas/search.js +0 -72
  71. package/dist/esm/schemas/search.js.map +0 -1
@@ -5,33 +5,81 @@
5
5
  */
6
6
  import { z } from 'zod';
7
7
  /**
8
- * Compress request schema
8
+ * Compress request schema (single context only)
9
+ * For multiple contexts, use the /batch endpoint.
9
10
  */
10
11
  export declare const CompressRequestSchema: z.ZodObject<{
11
- context: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
12
+ context: z.ZodString;
12
13
  compression_model_name: z.ZodString;
13
14
  query: z.ZodOptional<z.ZodString>;
14
15
  target_compression_ratio: z.ZodOptional<z.ZodNumber>;
15
16
  coarse: z.ZodOptional<z.ZodBoolean>;
17
+ heuristic_chunking: z.ZodOptional<z.ZodBoolean>;
18
+ disable_placeholders: z.ZodOptional<z.ZodBoolean>;
16
19
  source: z.ZodDefault<z.ZodString>;
17
20
  }, "strip", z.ZodTypeAny, {
18
- context: string | string[];
21
+ context: string;
19
22
  compression_model_name: string;
20
23
  source: string;
21
24
  query?: string | undefined;
22
25
  target_compression_ratio?: number | undefined;
23
26
  coarse?: boolean | undefined;
27
+ heuristic_chunking?: boolean | undefined;
28
+ disable_placeholders?: boolean | undefined;
24
29
  }, {
25
- context: string | string[];
30
+ context: string;
26
31
  compression_model_name: string;
27
32
  query?: string | undefined;
28
33
  target_compression_ratio?: number | undefined;
29
34
  coarse?: boolean | undefined;
35
+ heuristic_chunking?: boolean | undefined;
36
+ disable_placeholders?: boolean | undefined;
30
37
  source?: string | undefined;
31
38
  }>;
32
39
  export type CompressRequest = z.infer<typeof CompressRequestSchema>;
33
40
  /**
34
- * Batch compression input (single item)
41
+ * Agnostic batch input (no query required)
42
+ */
43
+ export declare const AgnosticBatchInputSchema: z.ZodObject<{
44
+ context: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ context: string;
47
+ }, {
48
+ context: string;
49
+ }>;
50
+ export type AgnosticBatchInput = z.infer<typeof AgnosticBatchInputSchema>;
51
+ /**
52
+ * Agnostic batch compression request
53
+ */
54
+ export declare const AgnosticBatchRequestSchema: z.ZodObject<{
55
+ inputs: z.ZodArray<z.ZodObject<{
56
+ context: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ context: string;
59
+ }, {
60
+ context: string;
61
+ }>, "many">;
62
+ compression_model_name: z.ZodString;
63
+ target_compression_ratio: z.ZodOptional<z.ZodNumber>;
64
+ source: z.ZodDefault<z.ZodString>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ compression_model_name: string;
67
+ source: string;
68
+ inputs: {
69
+ context: string;
70
+ }[];
71
+ target_compression_ratio?: number | undefined;
72
+ }, {
73
+ compression_model_name: string;
74
+ inputs: {
75
+ context: string;
76
+ }[];
77
+ target_compression_ratio?: number | undefined;
78
+ source?: string | undefined;
79
+ }>;
80
+ export type AgnosticBatchRequest = z.infer<typeof AgnosticBatchRequestSchema>;
81
+ /**
82
+ * Query-specific batch compression input (query required)
35
83
  */
36
84
  export declare const CompressBatchInputSchema: z.ZodObject<{
37
85
  context: z.ZodString;
@@ -61,6 +109,8 @@ export declare const CompressBatchRequestSchema: z.ZodObject<{
61
109
  compression_model_name: z.ZodString;
62
110
  target_compression_ratio: z.ZodOptional<z.ZodNumber>;
63
111
  coarse: z.ZodOptional<z.ZodBoolean>;
112
+ heuristic_chunking: z.ZodOptional<z.ZodBoolean>;
113
+ disable_placeholders: z.ZodOptional<z.ZodBoolean>;
64
114
  source: z.ZodDefault<z.ZodString>;
65
115
  }, "strip", z.ZodTypeAny, {
66
116
  compression_model_name: string;
@@ -71,6 +121,8 @@ export declare const CompressBatchRequestSchema: z.ZodObject<{
71
121
  }[];
72
122
  target_compression_ratio?: number | undefined;
73
123
  coarse?: boolean | undefined;
124
+ heuristic_chunking?: boolean | undefined;
125
+ disable_placeholders?: boolean | undefined;
74
126
  }, {
75
127
  compression_model_name: string;
76
128
  inputs: {
@@ -79,6 +131,8 @@ export declare const CompressBatchRequestSchema: z.ZodObject<{
79
131
  }[];
80
132
  target_compression_ratio?: number | undefined;
81
133
  coarse?: boolean | undefined;
134
+ heuristic_chunking?: boolean | undefined;
135
+ disable_placeholders?: boolean | undefined;
82
136
  source?: string | undefined;
83
137
  }>;
84
138
  export type CompressBatchRequest = z.infer<typeof CompressBatchRequestSchema>;
@@ -86,8 +140,8 @@ export type CompressBatchRequest = z.infer<typeof CompressBatchRequestSchema>;
86
140
  * Single compression result
87
141
  */
88
142
  export declare const CompressResultSchema: z.ZodObject<{
89
- original_context: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
90
- compressed_context: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
143
+ original_context: z.ZodString;
144
+ compressed_context: z.ZodString;
91
145
  original_tokens: z.ZodNumber;
92
146
  compressed_tokens: z.ZodNumber;
93
147
  actual_compression_ratio: z.ZodNumber;
@@ -95,8 +149,8 @@ export declare const CompressResultSchema: z.ZodObject<{
95
149
  duration_ms: z.ZodNumber;
96
150
  target_compression_ratio: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
97
151
  }, "strip", z.ZodTypeAny, {
98
- original_context: string | string[];
99
- compressed_context: string | string[];
152
+ original_context: string;
153
+ compressed_context: string;
100
154
  original_tokens: number;
101
155
  compressed_tokens: number;
102
156
  actual_compression_ratio: number;
@@ -104,8 +158,8 @@ export declare const CompressResultSchema: z.ZodObject<{
104
158
  duration_ms: number;
105
159
  target_compression_ratio?: number | null | undefined;
106
160
  }, {
107
- original_context: string | string[];
108
- compressed_context: string | string[];
161
+ original_context: string;
162
+ compressed_context: string;
109
163
  original_tokens: number;
110
164
  compressed_tokens: number;
111
165
  actual_compression_ratio: number;
@@ -216,8 +270,8 @@ export declare const CompressResponseSchema: z.ZodObject<{
216
270
  success: z.ZodBoolean;
217
271
  } & {
218
272
  data: z.ZodNullable<z.ZodObject<{
219
- original_context: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
220
- compressed_context: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
273
+ original_context: z.ZodString;
274
+ compressed_context: z.ZodString;
221
275
  original_tokens: z.ZodNumber;
222
276
  compressed_tokens: z.ZodNumber;
223
277
  actual_compression_ratio: z.ZodNumber;
@@ -225,8 +279,8 @@ export declare const CompressResponseSchema: z.ZodObject<{
225
279
  duration_ms: z.ZodNumber;
226
280
  target_compression_ratio: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
227
281
  }, "strip", z.ZodTypeAny, {
228
- original_context: string | string[];
229
- compressed_context: string | string[];
282
+ original_context: string;
283
+ compressed_context: string;
230
284
  original_tokens: number;
231
285
  compressed_tokens: number;
232
286
  actual_compression_ratio: number;
@@ -234,8 +288,8 @@ export declare const CompressResponseSchema: z.ZodObject<{
234
288
  duration_ms: number;
235
289
  target_compression_ratio?: number | null | undefined;
236
290
  }, {
237
- original_context: string | string[];
238
- compressed_context: string | string[];
291
+ original_context: string;
292
+ compressed_context: string;
239
293
  original_tokens: number;
240
294
  compressed_tokens: number;
241
295
  actual_compression_ratio: number;
@@ -246,8 +300,8 @@ export declare const CompressResponseSchema: z.ZodObject<{
246
300
  }, "strip", z.ZodTypeAny, {
247
301
  success: boolean;
248
302
  data: {
249
- original_context: string | string[];
250
- compressed_context: string | string[];
303
+ original_context: string;
304
+ compressed_context: string;
251
305
  original_tokens: number;
252
306
  compressed_tokens: number;
253
307
  actual_compression_ratio: number;
@@ -258,8 +312,8 @@ export declare const CompressResponseSchema: z.ZodObject<{
258
312
  }, {
259
313
  success: boolean;
260
314
  data: {
261
- original_context: string | string[];
262
- compressed_context: string | string[];
315
+ original_context: string;
316
+ compressed_context: string;
263
317
  original_tokens: number;
264
318
  compressed_tokens: number;
265
319
  actual_compression_ratio: number;
@@ -1 +1 @@
1
- {"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../../src/schemas/compression.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAUhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;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,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -9,21 +9,36 @@ import { BaseResponseSchema } from './common.js';
9
9
  // Request Schemas
10
10
  // =============================================================================
11
11
  /**
12
- * Compress request schema
12
+ * Compress request schema (single context only)
13
+ * For multiple contexts, use the /batch endpoint.
13
14
  */
14
15
  export const CompressRequestSchema = z.object({
15
- context: z.union([
16
- z.string().min(1, 'context must not be empty'),
17
- z.array(z.string().min(1, 'context item must not be empty')).min(1, 'context list must not be empty'),
18
- ]),
16
+ context: z.string().min(1, 'context must not be empty'),
19
17
  compression_model_name: z.string(),
20
18
  query: z.string().min(1, 'query must not be empty').optional(),
21
19
  target_compression_ratio: z.number().nonnegative().optional(),
22
20
  coarse: z.boolean().optional(),
21
+ heuristic_chunking: z.boolean().optional(),
22
+ disable_placeholders: z.boolean().optional(),
23
23
  source: z.string().default('sdk:typescript'),
24
24
  });
25
25
  /**
26
- * Batch compression input (single item)
26
+ * Agnostic batch input (no query required)
27
+ */
28
+ export const AgnosticBatchInputSchema = z.object({
29
+ context: z.string().min(1, 'context must not be empty'),
30
+ });
31
+ /**
32
+ * Agnostic batch compression request
33
+ */
34
+ export const AgnosticBatchRequestSchema = z.object({
35
+ inputs: z.array(AgnosticBatchInputSchema).min(1).max(100),
36
+ compression_model_name: z.string(),
37
+ target_compression_ratio: z.number().nonnegative().optional(),
38
+ source: z.string().default('sdk:typescript'),
39
+ });
40
+ /**
41
+ * Query-specific batch compression input (query required)
27
42
  */
28
43
  export const CompressBatchInputSchema = z.object({
29
44
  context: z.string().min(1, 'context must not be empty'),
@@ -37,6 +52,8 @@ export const CompressBatchRequestSchema = z.object({
37
52
  compression_model_name: z.string(),
38
53
  target_compression_ratio: z.number().nonnegative().optional(),
39
54
  coarse: z.boolean().optional(),
55
+ heuristic_chunking: z.boolean().optional(),
56
+ disable_placeholders: z.boolean().optional(),
40
57
  source: z.string().default('sdk:typescript'),
41
58
  });
42
59
  // =============================================================================
@@ -46,8 +63,8 @@ export const CompressBatchRequestSchema = z.object({
46
63
  * Single compression result
47
64
  */
48
65
  export const CompressResultSchema = z.object({
49
- original_context: z.union([z.string(), z.array(z.string())]),
50
- compressed_context: z.union([z.string(), z.array(z.string())]),
66
+ original_context: z.string(),
67
+ compressed_context: z.string(),
51
68
  original_tokens: z.number(),
52
69
  compressed_tokens: z.number(),
53
70
  actual_compression_ratio: z.number(),
@@ -1 +1 @@
1
- {"version":3,"file":"compression.js","sourceRoot":"","sources":["../../../src/schemas/compression.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CA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H,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE;IACpC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;IAC/C,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE;IACjC,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,yBAAyB,EAAE,CAAC,CAAC,MAAM,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAIH,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACnE,IAAI,EAAE,yBAAyB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
@@ -2,6 +2,5 @@
2
2
  * Schema exports
3
3
  */
4
4
  export { BaseResponseSchema, StreamChunkSchema, HealthResponseSchema, type BaseResponse, type StreamChunk, type HealthResponse, } from './common.js';
5
- export { CompressRequestSchema, CompressBatchInputSchema, CompressBatchRequestSchema, CompressResultSchema, CompressBatchItemResultSchema, CompressBatchResultSchema, CompressResponseSchema, CompressBatchResponseSchema, type CompressRequest, type CompressBatchInput, type CompressBatchRequest, type CompressResult, type CompressBatchItemResult, type CompressBatchResult, type CompressResponse, type CompressBatchResponse, } from './compression.js';
6
- export { SearchRequestSchema, IndexCreatePayloadSchema, SearchResultSchema, IndexTaskStatusSchema, SearchResponseSchema, IndexCreateResponseSchema, type SearchRequest, type IndexCreatePayload, type SearchResult, type IndexTaskStatus, type SearchResponse, type IndexCreateResponse, } from './search.js';
5
+ export { CompressRequestSchema, AgnosticBatchInputSchema, AgnosticBatchRequestSchema, CompressBatchInputSchema, CompressBatchRequestSchema, CompressResultSchema, CompressBatchItemResultSchema, CompressBatchResultSchema, CompressResponseSchema, CompressBatchResponseSchema, type CompressRequest, type AgnosticBatchInput, type AgnosticBatchRequest, type CompressBatchInput, type CompressBatchRequest, type CompressResult, type CompressBatchItemResult, type CompressBatchResult, type CompressResponse, type CompressBatchResponse, } from './compression.js';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC"}
@@ -4,7 +4,5 @@
4
4
  // Common
5
5
  export { BaseResponseSchema, StreamChunkSchema, HealthResponseSchema, } from './common.js';
6
6
  // Compression
7
- export { CompressRequestSchema, CompressBatchInputSchema, CompressBatchRequestSchema, CompressResultSchema, CompressBatchItemResultSchema, CompressBatchResultSchema, CompressResponseSchema, CompressBatchResponseSchema, } from './compression.js';
8
- // Search
9
- export { SearchRequestSchema, IndexCreatePayloadSchema, SearchResultSchema, IndexTaskStatusSchema, SearchResponseSchema, IndexCreateResponseSchema, } from './search.js';
7
+ export { CompressRequestSchema, AgnosticBatchInputSchema, AgnosticBatchRequestSchema, CompressBatchInputSchema, CompressBatchRequestSchema, CompressResultSchema, CompressBatchItemResultSchema, CompressBatchResultSchema, CompressResponseSchema, CompressBatchResponseSchema, } from './compression.js';
10
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,GAS5B,MAAM,kBAAkB,CAAC;AAE1B,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,GAO1B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,GAW5B,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SDK Version - Single source of truth
3
+ * Update this when bumping the version
4
+ */
5
+ export declare const SDK_VERSION = "1.2.0";
6
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SDK Version - Single source of truth
3
+ * Update this when bumping the version
4
+ */
5
+ export const SDK_VERSION = '1.2.0';
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compresr/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "TypeScript SDK for Compresr - Intelligent context compression to reduce LLM API costs by 30-70%",
5
5
  "author": "Compresr Team <founders@compresr.ai>",
6
6
  "license": "Apache-2.0",
@@ -64,8 +64,8 @@
64
64
  "test:watch": "vitest",
65
65
  "test:coverage": "vitest run --coverage",
66
66
  "test:integration": "vitest run --config vitest.integration.config.ts",
67
- "lint": "eslint src tests --ext .ts",
68
- "lint:fix": "eslint src tests --ext .ts --fix",
67
+ "lint": "eslint src --ext .ts",
68
+ "lint:fix": "eslint src --ext .ts --fix",
69
69
  "typecheck": "tsc --noEmit",
70
70
  "prepublishOnly": "npm run clean && npm run build && npm run test"
71
71
  },
@@ -1,184 +0,0 @@
1
- /**
2
- * Agentic Search schemas
3
- *
4
- * Schemas for agentic search endpoints (macchiato_v1).
5
- */
6
- import { z } from 'zod';
7
- /**
8
- * Search request schema
9
- */
10
- export declare const SearchRequestSchema: z.ZodObject<{
11
- query: z.ZodString;
12
- index_name: z.ZodString;
13
- compression_model_name: z.ZodString;
14
- max_time_s: z.ZodDefault<z.ZodNumber>;
15
- source: z.ZodDefault<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- compression_model_name: string;
18
- query: string;
19
- source: string;
20
- index_name: string;
21
- max_time_s: number;
22
- }, {
23
- compression_model_name: string;
24
- query: string;
25
- index_name: string;
26
- source?: string | undefined;
27
- max_time_s?: number | undefined;
28
- }>;
29
- export type SearchRequest = z.infer<typeof SearchRequestSchema>;
30
- /**
31
- * Index creation payload
32
- */
33
- export declare const IndexCreatePayloadSchema: z.ZodObject<{
34
- chunks: z.ZodArray<z.ZodString, "many">;
35
- candidate_questions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
- source_docs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
37
- }, "strip", z.ZodTypeAny, {
38
- chunks: string[];
39
- candidate_questions?: string[] | undefined;
40
- source_docs?: Record<string, unknown> | undefined;
41
- }, {
42
- chunks: string[];
43
- candidate_questions?: string[] | undefined;
44
- source_docs?: Record<string, unknown> | undefined;
45
- }>;
46
- export type IndexCreatePayload = z.infer<typeof IndexCreatePayloadSchema>;
47
- /**
48
- * Search result
49
- */
50
- export declare const SearchResultSchema: z.ZodObject<{
51
- chunks: z.ZodArray<z.ZodString, "many">;
52
- chunk_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
53
- chunks_count: z.ZodNumber;
54
- original_tokens: z.ZodNumber;
55
- compressed_tokens: z.ZodNumber;
56
- compression_ratio: z.ZodNumber;
57
- duration_ms: z.ZodDefault<z.ZodNumber>;
58
- index_name: z.ZodString;
59
- cost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
- }, "strip", z.ZodTypeAny, {
61
- original_tokens: number;
62
- compressed_tokens: number;
63
- duration_ms: number;
64
- index_name: string;
65
- chunks: string[];
66
- chunk_ids: string[];
67
- chunks_count: number;
68
- compression_ratio: number;
69
- cost?: Record<string, unknown> | undefined;
70
- }, {
71
- original_tokens: number;
72
- compressed_tokens: number;
73
- index_name: string;
74
- chunks: string[];
75
- chunks_count: number;
76
- compression_ratio: number;
77
- duration_ms?: number | undefined;
78
- chunk_ids?: string[] | undefined;
79
- cost?: Record<string, unknown> | undefined;
80
- }>;
81
- export type SearchResult = z.infer<typeof SearchResultSchema>;
82
- /**
83
- * Index task status
84
- */
85
- export declare const IndexTaskStatusSchema: z.ZodObject<{
86
- status: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
87
- task_id: z.ZodString;
88
- index_name: z.ZodOptional<z.ZodString>;
89
- num_chunks: z.ZodOptional<z.ZodNumber>;
90
- error: z.ZodOptional<z.ZodString>;
91
- }, "strip", z.ZodTypeAny, {
92
- status: "pending" | "processing" | "completed" | "failed";
93
- task_id: string;
94
- error?: string | undefined;
95
- index_name?: string | undefined;
96
- num_chunks?: number | undefined;
97
- }, {
98
- status: "pending" | "processing" | "completed" | "failed";
99
- task_id: string;
100
- error?: string | undefined;
101
- index_name?: string | undefined;
102
- num_chunks?: number | undefined;
103
- }>;
104
- export type IndexTaskStatus = z.infer<typeof IndexTaskStatusSchema>;
105
- /**
106
- * Search response
107
- */
108
- export declare const SearchResponseSchema: z.ZodObject<{
109
- success: z.ZodBoolean;
110
- } & {
111
- data: z.ZodNullable<z.ZodObject<{
112
- chunks: z.ZodArray<z.ZodString, "many">;
113
- chunk_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
114
- chunks_count: z.ZodNumber;
115
- original_tokens: z.ZodNumber;
116
- compressed_tokens: z.ZodNumber;
117
- compression_ratio: z.ZodNumber;
118
- duration_ms: z.ZodDefault<z.ZodNumber>;
119
- index_name: z.ZodString;
120
- cost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
121
- }, "strip", z.ZodTypeAny, {
122
- original_tokens: number;
123
- compressed_tokens: number;
124
- duration_ms: number;
125
- index_name: string;
126
- chunks: string[];
127
- chunk_ids: string[];
128
- chunks_count: number;
129
- compression_ratio: number;
130
- cost?: Record<string, unknown> | undefined;
131
- }, {
132
- original_tokens: number;
133
- compressed_tokens: number;
134
- index_name: string;
135
- chunks: string[];
136
- chunks_count: number;
137
- compression_ratio: number;
138
- duration_ms?: number | undefined;
139
- chunk_ids?: string[] | undefined;
140
- cost?: Record<string, unknown> | undefined;
141
- }>>;
142
- }, "strip", z.ZodTypeAny, {
143
- success: boolean;
144
- data: {
145
- original_tokens: number;
146
- compressed_tokens: number;
147
- duration_ms: number;
148
- index_name: string;
149
- chunks: string[];
150
- chunk_ids: string[];
151
- chunks_count: number;
152
- compression_ratio: number;
153
- cost?: Record<string, unknown> | undefined;
154
- } | null;
155
- }, {
156
- success: boolean;
157
- data: {
158
- original_tokens: number;
159
- compressed_tokens: number;
160
- index_name: string;
161
- chunks: string[];
162
- chunks_count: number;
163
- compression_ratio: number;
164
- duration_ms?: number | undefined;
165
- chunk_ids?: string[] | undefined;
166
- cost?: Record<string, unknown> | undefined;
167
- } | null;
168
- }>;
169
- export type SearchResponse = z.infer<typeof SearchResponseSchema>;
170
- /**
171
- * Index creation response
172
- */
173
- export declare const IndexCreateResponseSchema: z.ZodObject<{
174
- task_id: z.ZodString;
175
- status: z.ZodString;
176
- }, "strip", z.ZodTypeAny, {
177
- status: string;
178
- task_id: string;
179
- }, {
180
- status: string;
181
- task_id: string;
182
- }>;
183
- export type IndexCreateResponse = z.infer<typeof IndexCreateResponseSchema>;
184
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/schemas/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IndexCreateResponseSchema = exports.SearchResponseSchema = exports.IndexTaskStatusSchema = exports.SearchResultSchema = exports.IndexCreatePayloadSchema = exports.SearchRequestSchema = void 0;
4
- /**
5
- * Agentic Search schemas
6
- *
7
- * Schemas for agentic search endpoints (macchiato_v1).
8
- */
9
- const zod_1 = require("zod");
10
- const common_js_1 = require("./common.js");
11
- // =============================================================================
12
- // Request Schemas
13
- // =============================================================================
14
- /**
15
- * Search request schema
16
- */
17
- exports.SearchRequestSchema = zod_1.z.object({
18
- query: zod_1.z.string().min(1, 'query must not be empty'),
19
- index_name: zod_1.z.string().min(1, 'index_name must not be empty'),
20
- compression_model_name: zod_1.z.string(),
21
- max_time_s: zod_1.z.number().min(0.1).max(30).default(4.5),
22
- source: zod_1.z.string().default('sdk:typescript'),
23
- });
24
- /**
25
- * Index creation payload
26
- */
27
- exports.IndexCreatePayloadSchema = zod_1.z.object({
28
- chunks: zod_1.z.array(zod_1.z.string()),
29
- candidate_questions: zod_1.z.array(zod_1.z.string()).optional(),
30
- source_docs: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
31
- });
32
- // =============================================================================
33
- // Result Schemas
34
- // =============================================================================
35
- /**
36
- * Search result
37
- */
38
- exports.SearchResultSchema = zod_1.z.object({
39
- chunks: zod_1.z.array(zod_1.z.string()),
40
- chunk_ids: zod_1.z.array(zod_1.z.string()).default([]),
41
- chunks_count: zod_1.z.number(),
42
- original_tokens: zod_1.z.number(),
43
- compressed_tokens: zod_1.z.number(),
44
- compression_ratio: zod_1.z.number(),
45
- duration_ms: zod_1.z.number().default(0),
46
- index_name: zod_1.z.string(),
47
- cost: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
48
- });
49
- /**
50
- * Index task status
51
- */
52
- exports.IndexTaskStatusSchema = zod_1.z.object({
53
- status: zod_1.z.enum(['pending', 'processing', 'completed', 'failed']),
54
- task_id: zod_1.z.string(),
55
- index_name: zod_1.z.string().optional(),
56
- num_chunks: zod_1.z.number().optional(),
57
- error: zod_1.z.string().optional(),
58
- });
59
- // =============================================================================
60
- // Response Schemas
61
- // =============================================================================
62
- /**
63
- * Search response
64
- */
65
- exports.SearchResponseSchema = common_js_1.BaseResponseSchema.extend({
66
- data: exports.SearchResultSchema.nullable(),
67
- });
68
- /**
69
- * Index creation response
70
- */
71
- exports.IndexCreateResponseSchema = zod_1.z.object({
72
- task_id: zod_1.z.string(),
73
- status: zod_1.z.string(),
74
- });
75
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/schemas/search.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,6BAAwB;AACxB,2CAAiD;AAEjD,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;GAEG;AACU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,OAAC,CAAC,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