@promptev/context-engine 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +93 -5
  2. package/dist/cli.js +1761 -501
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{config-Bt9bUQqU.d.ts → config-CNnASw5X.d.cts} +42 -5
  5. package/dist/{config-Bl9U789m.d.cts → config-CdlSkKgV.d.ts} +42 -5
  6. package/dist/express.cjs +925 -151
  7. package/dist/express.cjs.map +1 -1
  8. package/dist/express.d.cts +11 -4
  9. package/dist/express.d.ts +11 -4
  10. package/dist/express.js +926 -152
  11. package/dist/express.js.map +1 -1
  12. package/dist/fastify.cjs +923 -151
  13. package/dist/fastify.cjs.map +1 -1
  14. package/dist/fastify.d.cts +8 -4
  15. package/dist/fastify.d.ts +8 -4
  16. package/dist/fastify.js +924 -152
  17. package/dist/fastify.js.map +1 -1
  18. package/dist/{governance-BDkcv4qZ.d.cts → governance-D8g6Wyvb.d.cts} +8 -2
  19. package/dist/{governance-XIScatRO.d.ts → governance-XFVgtEdV.d.ts} +8 -2
  20. package/dist/graph/index.cjs +122 -43
  21. package/dist/graph/index.cjs.map +1 -1
  22. package/dist/graph/index.d.cts +5 -3
  23. package/dist/graph/index.d.ts +5 -3
  24. package/dist/graph/index.js +122 -43
  25. package/dist/graph/index.js.map +1 -1
  26. package/dist/hono.cjs +923 -151
  27. package/dist/hono.cjs.map +1 -1
  28. package/dist/hono.d.cts +8 -4
  29. package/dist/hono.d.ts +8 -4
  30. package/dist/hono.js +924 -152
  31. package/dist/hono.js.map +1 -1
  32. package/dist/index.cjs +2186 -910
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +70 -107
  35. package/dist/index.d.ts +70 -107
  36. package/dist/index.js +2186 -908
  37. package/dist/index.js.map +1 -1
  38. package/dist/mcp.cjs +100 -14
  39. package/dist/mcp.cjs.map +1 -1
  40. package/dist/mcp.d.cts +5 -0
  41. package/dist/mcp.d.ts +5 -0
  42. package/dist/mcp.js +100 -14
  43. package/dist/mcp.js.map +1 -1
  44. package/dist/migrations/sql/0003_tools.sql +2 -0
  45. package/dist/migrations/sql/0004_acl_indexes.sql +23 -2
  46. package/dist/{redaction-BmDSWJ7h.d.cts → redaction-BqD_DEUQ.d.cts} +22 -1
  47. package/dist/{redaction-BmDSWJ7h.d.ts → redaction-BqD_DEUQ.d.ts} +22 -1
  48. package/dist/redaction-presidio.d.cts +1 -1
  49. package/dist/redaction-presidio.d.ts +1 -1
  50. package/dist/{router-CrxZ2y_Z.d.ts → router-B_DTkQgU.d.ts} +17 -2
  51. package/dist/{router-OPgSoYAB.d.cts → router-Dsv3fv0R.d.cts} +17 -2
  52. package/dist/storage-DU1JRno5.d.cts +164 -0
  53. package/dist/storage-Dvt2ZxsV.d.ts +164 -0
  54. package/package.json +61 -23
  55. package/src/migrations/sql/0003_tools.sql +2 -0
  56. package/src/migrations/sql/0004_acl_indexes.sql +23 -2
  57. package/dist/embeddings-B-jZ42mk.d.cts +0 -67
  58. package/dist/embeddings-DaSdAZN3.d.ts +0 -67
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { R as RedactionPolicy, b as RedactionRuleInit } from './redaction-BmDSWJ7h.js';
2
+ import { R as RedactionPolicy, b as RedactionRuleInit } from './redaction-BqD_DEUQ.cjs';
3
3
 
4
4
  declare const embeddingSchema: z.ZodObject<{
5
5
  provider: z.ZodEnum<["openai", "azure_openai", "gemini", "voyage", "cohere", "custom"]>;
@@ -121,12 +121,37 @@ declare const fusionSchema: z.ZodObject<{
121
121
  declare const storageSchema: z.ZodObject<{
122
122
  backend: z.ZodDefault<z.ZodLiteral<"postgres">>;
123
123
  annExactThreshold: z.ZodDefault<z.ZodNumber>;
124
+ poolMax: z.ZodDefault<z.ZodNumber>;
125
+ poolIdleTimeoutMs: z.ZodDefault<z.ZodNumber>;
126
+ poolConnectionTimeoutMs: z.ZodDefault<z.ZodNumber>;
124
127
  }, "strip", z.ZodTypeAny, {
125
128
  backend: "postgres";
126
129
  annExactThreshold: number;
130
+ poolMax: number;
131
+ poolIdleTimeoutMs: number;
132
+ poolConnectionTimeoutMs: number;
127
133
  }, {
128
134
  backend?: "postgres" | undefined;
129
135
  annExactThreshold?: number | undefined;
136
+ poolMax?: number | undefined;
137
+ poolIdleTimeoutMs?: number | undefined;
138
+ poolConnectionTimeoutMs?: number | undefined;
139
+ }>;
140
+ declare const extractionSchema: z.ZodObject<{
141
+ maxRenderPx: z.ZodDefault<z.ZodNumber>;
142
+ visionMaxOutputTokens: z.ZodDefault<z.ZodNumber>;
143
+ pagesPerVisionBatch: z.ZodDefault<z.ZodNumber>;
144
+ ocrLanguage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ maxRenderPx: number;
147
+ visionMaxOutputTokens: number;
148
+ pagesPerVisionBatch: number;
149
+ ocrLanguage: string | null;
150
+ }, {
151
+ maxRenderPx?: number | undefined;
152
+ visionMaxOutputTokens?: number | undefined;
153
+ pagesPerVisionBatch?: number | undefined;
154
+ ocrLanguage?: string | null | undefined;
130
155
  }>;
131
156
  type EmbeddingConfig = z.infer<typeof embeddingSchema>;
132
157
  type LLMConfig = z.infer<typeof llmSchema>;
@@ -134,18 +159,23 @@ type GraphConfig = z.infer<typeof graphSchema>;
134
159
  type RerankerConfig = z.infer<typeof rerankerSchema>;
135
160
  type FusionConfig = z.infer<typeof fusionSchema>;
136
161
  type StorageConfig = z.infer<typeof storageSchema>;
162
+ type ExtractionConfig = z.infer<typeof extractionSchema>;
163
+ type EmbeddingConfigInit = z.input<typeof embeddingSchema>;
164
+ type LLMConfigInit = z.input<typeof llmSchema>;
137
165
  interface ContextEngineConfigInit {
138
166
  databaseUrl: string;
139
167
  storage?: Partial<StorageConfig>;
140
168
  defaultMode?: "hybrid" | "graph";
141
- embedding: EmbeddingConfig;
142
- llm?: LLMConfig | null;
143
- visionLlm?: LLMConfig | null;
169
+ embedding: EmbeddingConfigInit;
170
+ llm?: LLMConfigInit | null;
171
+ visionLlm?: LLMConfigInit | null;
144
172
  graph?: Partial<GraphConfig>;
145
173
  reranker?: Partial<RerankerConfig>;
146
174
  fusion?: Partial<FusionConfig>;
175
+ extraction?: Partial<ExtractionConfig>;
147
176
  enableCodeExecution?: boolean;
148
177
  secretKey?: string | null;
178
+ allowPrivateEgress?: boolean;
149
179
  redaction?: RedactionPolicy | {
150
180
  rules?: RedactionRuleInit[];
151
181
  customDetectors?: RedactionPolicy["customDetectors"];
@@ -161,8 +191,15 @@ declare class ContextEngineConfig {
161
191
  graph: GraphConfig;
162
192
  reranker: RerankerConfig;
163
193
  fusion: FusionConfig;
194
+ extraction: ExtractionConfig;
164
195
  enableCodeExecution: boolean;
165
196
  secretKey: string | null;
197
+ /**
198
+ * Lets http tools and probes reach loopback/private/link-local/metadata
199
+ * addresses. Off by default — an http tool is registered by a caller, and a
200
+ * private destination is server-side request forgery. See `tools/egress.ts`.
201
+ */
202
+ allowPrivateEgress: boolean;
166
203
  redaction: RedactionPolicy;
167
204
  constructor(init: ContextEngineConfigInit);
168
205
  private validate;
@@ -171,4 +208,4 @@ declare class ContextEngineConfig {
171
208
  }): ContextEngineConfig;
172
209
  }
173
210
 
174
- export { ContextEngineConfig as C, type EmbeddingConfig as E, type FusionConfig as F, type GraphConfig as G, type LLMConfig as L, type RerankerConfig as R, type StorageConfig as S, type ContextEngineConfigInit as a };
211
+ export { ContextEngineConfig as C, type ExtractionConfig as E, type FusionConfig as F, type GraphConfig as G, type LLMConfig as L, type RerankerConfig as R, type StorageConfig as S, type ContextEngineConfigInit as a, type EmbeddingConfig as b };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { R as RedactionPolicy, b as RedactionRuleInit } from './redaction-BmDSWJ7h.cjs';
2
+ import { R as RedactionPolicy, b as RedactionRuleInit } from './redaction-BqD_DEUQ.js';
3
3
 
4
4
  declare const embeddingSchema: z.ZodObject<{
5
5
  provider: z.ZodEnum<["openai", "azure_openai", "gemini", "voyage", "cohere", "custom"]>;
@@ -121,12 +121,37 @@ declare const fusionSchema: z.ZodObject<{
121
121
  declare const storageSchema: z.ZodObject<{
122
122
  backend: z.ZodDefault<z.ZodLiteral<"postgres">>;
123
123
  annExactThreshold: z.ZodDefault<z.ZodNumber>;
124
+ poolMax: z.ZodDefault<z.ZodNumber>;
125
+ poolIdleTimeoutMs: z.ZodDefault<z.ZodNumber>;
126
+ poolConnectionTimeoutMs: z.ZodDefault<z.ZodNumber>;
124
127
  }, "strip", z.ZodTypeAny, {
125
128
  backend: "postgres";
126
129
  annExactThreshold: number;
130
+ poolMax: number;
131
+ poolIdleTimeoutMs: number;
132
+ poolConnectionTimeoutMs: number;
127
133
  }, {
128
134
  backend?: "postgres" | undefined;
129
135
  annExactThreshold?: number | undefined;
136
+ poolMax?: number | undefined;
137
+ poolIdleTimeoutMs?: number | undefined;
138
+ poolConnectionTimeoutMs?: number | undefined;
139
+ }>;
140
+ declare const extractionSchema: z.ZodObject<{
141
+ maxRenderPx: z.ZodDefault<z.ZodNumber>;
142
+ visionMaxOutputTokens: z.ZodDefault<z.ZodNumber>;
143
+ pagesPerVisionBatch: z.ZodDefault<z.ZodNumber>;
144
+ ocrLanguage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ maxRenderPx: number;
147
+ visionMaxOutputTokens: number;
148
+ pagesPerVisionBatch: number;
149
+ ocrLanguage: string | null;
150
+ }, {
151
+ maxRenderPx?: number | undefined;
152
+ visionMaxOutputTokens?: number | undefined;
153
+ pagesPerVisionBatch?: number | undefined;
154
+ ocrLanguage?: string | null | undefined;
130
155
  }>;
131
156
  type EmbeddingConfig = z.infer<typeof embeddingSchema>;
132
157
  type LLMConfig = z.infer<typeof llmSchema>;
@@ -134,18 +159,23 @@ type GraphConfig = z.infer<typeof graphSchema>;
134
159
  type RerankerConfig = z.infer<typeof rerankerSchema>;
135
160
  type FusionConfig = z.infer<typeof fusionSchema>;
136
161
  type StorageConfig = z.infer<typeof storageSchema>;
162
+ type ExtractionConfig = z.infer<typeof extractionSchema>;
163
+ type EmbeddingConfigInit = z.input<typeof embeddingSchema>;
164
+ type LLMConfigInit = z.input<typeof llmSchema>;
137
165
  interface ContextEngineConfigInit {
138
166
  databaseUrl: string;
139
167
  storage?: Partial<StorageConfig>;
140
168
  defaultMode?: "hybrid" | "graph";
141
- embedding: EmbeddingConfig;
142
- llm?: LLMConfig | null;
143
- visionLlm?: LLMConfig | null;
169
+ embedding: EmbeddingConfigInit;
170
+ llm?: LLMConfigInit | null;
171
+ visionLlm?: LLMConfigInit | null;
144
172
  graph?: Partial<GraphConfig>;
145
173
  reranker?: Partial<RerankerConfig>;
146
174
  fusion?: Partial<FusionConfig>;
175
+ extraction?: Partial<ExtractionConfig>;
147
176
  enableCodeExecution?: boolean;
148
177
  secretKey?: string | null;
178
+ allowPrivateEgress?: boolean;
149
179
  redaction?: RedactionPolicy | {
150
180
  rules?: RedactionRuleInit[];
151
181
  customDetectors?: RedactionPolicy["customDetectors"];
@@ -161,8 +191,15 @@ declare class ContextEngineConfig {
161
191
  graph: GraphConfig;
162
192
  reranker: RerankerConfig;
163
193
  fusion: FusionConfig;
194
+ extraction: ExtractionConfig;
164
195
  enableCodeExecution: boolean;
165
196
  secretKey: string | null;
197
+ /**
198
+ * Lets http tools and probes reach loopback/private/link-local/metadata
199
+ * addresses. Off by default — an http tool is registered by a caller, and a
200
+ * private destination is server-side request forgery. See `tools/egress.ts`.
201
+ */
202
+ allowPrivateEgress: boolean;
166
203
  redaction: RedactionPolicy;
167
204
  constructor(init: ContextEngineConfigInit);
168
205
  private validate;
@@ -171,4 +208,4 @@ declare class ContextEngineConfig {
171
208
  }): ContextEngineConfig;
172
209
  }
173
210
 
174
- export { ContextEngineConfig as C, type EmbeddingConfig as E, type FusionConfig as F, type GraphConfig as G, type LLMConfig as L, type RerankerConfig as R, type StorageConfig as S, type ContextEngineConfigInit as a };
211
+ export { ContextEngineConfig as C, type ExtractionConfig as E, type FusionConfig as F, type GraphConfig as G, type LLMConfig as L, type RerankerConfig as R, type StorageConfig as S, type ContextEngineConfigInit as a, type EmbeddingConfig as b };