@inkeep/agents-core 0.0.0-chat-to-edit-20251119071712

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 (57) hide show
  1. package/LICENSE.md +56 -0
  2. package/README.md +458 -0
  3. package/SUPPLEMENTAL_TERMS.md +40 -0
  4. package/dist/auth-detection-CGqhPDnj.d.cts +435 -0
  5. package/dist/auth-detection-CGqhPDnj.d.ts +435 -0
  6. package/dist/chunk-7CLFCY6J.js +36 -0
  7. package/dist/chunk-A6JWG7FI.js +1689 -0
  8. package/dist/chunk-CMNLBV2A.js +39 -0
  9. package/dist/chunk-E6R6PML7.js +19 -0
  10. package/dist/chunk-OP3KPT4T.js +442 -0
  11. package/dist/chunk-TLSKVSBR.js +1234 -0
  12. package/dist/chunk-WG46C2WU.js +394 -0
  13. package/dist/chunk-YECQCT5N.js +223 -0
  14. package/dist/chunk-YFHT5M2R.js +18 -0
  15. package/dist/client-exports.cjs +3421 -0
  16. package/dist/client-exports.d.cts +292 -0
  17. package/dist/client-exports.d.ts +292 -0
  18. package/dist/client-exports.js +178 -0
  19. package/dist/constants/models.cjs +40 -0
  20. package/dist/constants/models.d.cts +42 -0
  21. package/dist/constants/models.d.ts +42 -0
  22. package/dist/constants/models.js +1 -0
  23. package/dist/db/schema.cjs +1686 -0
  24. package/dist/db/schema.d.cts +7 -0
  25. package/dist/db/schema.d.ts +7 -0
  26. package/dist/db/schema.js +1 -0
  27. package/dist/index.cjs +229792 -0
  28. package/dist/index.d.cts +5138 -0
  29. package/dist/index.d.ts +5138 -0
  30. package/dist/index.js +224908 -0
  31. package/dist/props-validation-BMR1qNiy.d.cts +15 -0
  32. package/dist/props-validation-BMR1qNiy.d.ts +15 -0
  33. package/dist/schema-C90zXlqp.d.ts +8012 -0
  34. package/dist/schema-keglUDw0.d.cts +8012 -0
  35. package/dist/types/index.cjs +64 -0
  36. package/dist/types/index.d.cts +175 -0
  37. package/dist/types/index.d.ts +175 -0
  38. package/dist/types/index.js +2 -0
  39. package/dist/utility-CXEG5391.d.cts +17265 -0
  40. package/dist/utility-CXEG5391.d.ts +17265 -0
  41. package/dist/utils/schema-conversion.cjs +236 -0
  42. package/dist/utils/schema-conversion.d.cts +26 -0
  43. package/dist/utils/schema-conversion.d.ts +26 -0
  44. package/dist/utils/schema-conversion.js +1 -0
  45. package/dist/validation/index.cjs +3521 -0
  46. package/dist/validation/index.d.cts +279 -0
  47. package/dist/validation/index.d.ts +279 -0
  48. package/dist/validation/index.js +2 -0
  49. package/drizzle/0000_exotic_mysterio.sql +398 -0
  50. package/drizzle/0001_greedy_the_phantom.sql +4 -0
  51. package/drizzle/0002_add_evaluation_features.sql +252 -0
  52. package/drizzle/0003_brave_micromax.sql +2 -0
  53. package/drizzle/meta/0000_snapshot.json +2519 -0
  54. package/drizzle/meta/0001_snapshot.json +2892 -0
  55. package/drizzle/meta/0002_snapshot.json +4485 -0
  56. package/drizzle/meta/_journal.json +34 -0
  57. package/package.json +133 -0
@@ -0,0 +1,236 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+ var pino = require('pino');
5
+ var pinoPretty = require('pino-pretty');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var pino__default = /*#__PURE__*/_interopDefault(pino);
10
+ var pinoPretty__default = /*#__PURE__*/_interopDefault(pinoPretty);
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
15
+ var PinoLogger = class {
16
+ constructor(name, config = {}) {
17
+ this.name = name;
18
+ __publicField(this, "transportConfigs", []);
19
+ __publicField(this, "pinoInstance");
20
+ __publicField(this, "options");
21
+ this.options = {
22
+ name: this.name,
23
+ level: process.env.LOG_LEVEL || (process.env.ENVIRONMENT === "test" ? "silent" : "info"),
24
+ serializers: {
25
+ obj: (value) => ({ ...value })
26
+ },
27
+ redact: ["req.headers.authorization", 'req.headers["x-inkeep-admin-authentication"]'],
28
+ ...config.options
29
+ };
30
+ if (config.transportConfigs) {
31
+ this.transportConfigs = config.transportConfigs;
32
+ }
33
+ if (this.transportConfigs.length > 0) {
34
+ this.pinoInstance = pino__default.default(this.options, pino__default.default.transport({ targets: this.transportConfigs }));
35
+ } else {
36
+ try {
37
+ const prettyStream = pinoPretty__default.default({
38
+ colorize: true,
39
+ translateTime: "HH:MM:ss",
40
+ ignore: "pid,hostname"
41
+ });
42
+ this.pinoInstance = pino__default.default(this.options, prettyStream);
43
+ } catch (error) {
44
+ console.warn("Warning: pino-pretty failed, using standard JSON output:", error);
45
+ this.pinoInstance = pino__default.default(this.options);
46
+ }
47
+ }
48
+ }
49
+ /**
50
+ * Recreate the pino instance with current transports
51
+ */
52
+ recreateInstance() {
53
+ if (this.pinoInstance && typeof this.pinoInstance.flush === "function") {
54
+ this.pinoInstance.flush();
55
+ }
56
+ if (this.transportConfigs.length === 0) {
57
+ try {
58
+ const prettyStream = pinoPretty__default.default({
59
+ colorize: true,
60
+ translateTime: "HH:MM:ss",
61
+ ignore: "pid,hostname"
62
+ });
63
+ this.pinoInstance = pino__default.default(this.options, prettyStream);
64
+ } catch (error) {
65
+ console.warn("Warning: pino-pretty failed, using standard JSON output:", error);
66
+ this.pinoInstance = pino__default.default(this.options);
67
+ }
68
+ } else {
69
+ const multiTransport = { targets: this.transportConfigs };
70
+ const pinoTransport = pino__default.default.transport(multiTransport);
71
+ this.pinoInstance = pino__default.default(this.options, pinoTransport);
72
+ }
73
+ }
74
+ /**
75
+ * Add a new transport to the logger
76
+ */
77
+ addTransport(transportConfig) {
78
+ this.transportConfigs.push(transportConfig);
79
+ this.recreateInstance();
80
+ }
81
+ /**
82
+ * Remove a transport by index
83
+ */
84
+ removeTransport(index) {
85
+ if (index >= 0 && index < this.transportConfigs.length) {
86
+ this.transportConfigs.splice(index, 1);
87
+ this.recreateInstance();
88
+ }
89
+ }
90
+ /**
91
+ * Get current transports
92
+ */
93
+ getTransports() {
94
+ return [...this.transportConfigs];
95
+ }
96
+ /**
97
+ * Update logger options
98
+ */
99
+ updateOptions(options) {
100
+ this.options = {
101
+ ...this.options,
102
+ ...options
103
+ };
104
+ this.recreateInstance();
105
+ }
106
+ /**
107
+ * Get the underlying pino instance for advanced usage
108
+ */
109
+ getPinoInstance() {
110
+ return this.pinoInstance;
111
+ }
112
+ error(data, message) {
113
+ this.pinoInstance.error(data, message);
114
+ }
115
+ warn(data, message) {
116
+ this.pinoInstance.warn(data, message);
117
+ }
118
+ info(data, message) {
119
+ this.pinoInstance.info(data, message);
120
+ }
121
+ debug(data, message) {
122
+ this.pinoInstance.debug(data, message);
123
+ }
124
+ };
125
+ var LoggerFactory = class {
126
+ constructor() {
127
+ __publicField(this, "config", {});
128
+ __publicField(this, "loggers", /* @__PURE__ */ new Map());
129
+ }
130
+ /**
131
+ * Configure the logger factory
132
+ */
133
+ configure(config) {
134
+ this.config = config;
135
+ this.loggers.clear();
136
+ }
137
+ /**
138
+ * Get or create a logger instance
139
+ */
140
+ getLogger(name) {
141
+ if (this.loggers.has(name)) {
142
+ const logger3 = this.loggers.get(name);
143
+ if (!logger3) {
144
+ throw new Error(`Logger '${name}' not found in cache`);
145
+ }
146
+ return logger3;
147
+ }
148
+ let logger2;
149
+ if (this.config.loggerFactory) {
150
+ logger2 = this.config.loggerFactory(name);
151
+ } else if (this.config.defaultLogger) {
152
+ logger2 = this.config.defaultLogger;
153
+ } else {
154
+ logger2 = new PinoLogger(name, this.config.pinoConfig);
155
+ }
156
+ this.loggers.set(name, logger2);
157
+ return logger2;
158
+ }
159
+ /**
160
+ * Reset factory to default state
161
+ */
162
+ reset() {
163
+ this.config = {};
164
+ this.loggers.clear();
165
+ }
166
+ };
167
+ var loggerFactory = new LoggerFactory();
168
+ function getLogger(name) {
169
+ return loggerFactory.getLogger(name);
170
+ }
171
+
172
+ // src/utils/schema-conversion.ts
173
+ var logger = getLogger("schema-conversion");
174
+ function convertZodToJsonSchema(zodSchema) {
175
+ try {
176
+ const jsonSchema = zod.z.toJSONSchema(zodSchema);
177
+ if (jsonSchema.$schema) {
178
+ delete jsonSchema.$schema;
179
+ }
180
+ return jsonSchema;
181
+ } catch (error) {
182
+ logger.error(
183
+ {
184
+ error: error instanceof Error ? error.message : "Unknown error",
185
+ stack: error instanceof Error ? error.stack : void 0
186
+ },
187
+ "Failed to convert Zod schema to JSON Schema"
188
+ );
189
+ throw new Error("Failed to convert Zod schema to JSON Schema");
190
+ }
191
+ }
192
+ var preview = (schema) => {
193
+ schema._def.inPreview = true;
194
+ return schema;
195
+ };
196
+ function convertZodToJsonSchemaWithPreview(zodSchema) {
197
+ const jsonSchema = convertZodToJsonSchema(zodSchema);
198
+ if (zodSchema instanceof zod.z.ZodObject && jsonSchema.properties) {
199
+ const shape = zodSchema.shape;
200
+ for (const [key, fieldSchema] of Object.entries(shape)) {
201
+ if (fieldSchema?._def?.inPreview === true) {
202
+ jsonSchema.properties[key].inPreview = true;
203
+ }
204
+ }
205
+ }
206
+ return jsonSchema;
207
+ }
208
+ function isZodSchema(value) {
209
+ return value?._def?.type === "object";
210
+ }
211
+ function extractPreviewFields(schema) {
212
+ const previewFields = [];
213
+ if (schema instanceof zod.z.ZodObject) {
214
+ const shape = schema.shape;
215
+ for (const [key, fieldSchema] of Object.entries(shape)) {
216
+ if (fieldSchema?._def?.inPreview === true) {
217
+ previewFields.push(key);
218
+ }
219
+ }
220
+ return previewFields;
221
+ }
222
+ if (schema?.type === "object" && schema.properties) {
223
+ for (const [key, prop] of Object.entries(schema.properties)) {
224
+ if (prop.inPreview === true) {
225
+ previewFields.push(key);
226
+ }
227
+ }
228
+ }
229
+ return previewFields;
230
+ }
231
+
232
+ exports.convertZodToJsonSchema = convertZodToJsonSchema;
233
+ exports.convertZodToJsonSchemaWithPreview = convertZodToJsonSchemaWithPreview;
234
+ exports.extractPreviewFields = extractPreviewFields;
235
+ exports.isZodSchema = isZodSchema;
236
+ exports.preview = preview;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Utility function for converting Zod schemas to JSON Schema
5
+ * Uses Zod's built-in toJSONSchema method
6
+ */
7
+ declare function convertZodToJsonSchema(zodSchema: any): Record<string, unknown>;
8
+ /**
9
+ * Simple helper to mark a Zod schema field as a preview field
10
+ * Adds metadata to the schema definition without modifying Zod's core
11
+ */
12
+ declare const preview: <T extends z.ZodTypeAny>(schema: T) => T;
13
+ /**
14
+ * Convert Zod schema to JSON Schema while preserving preview metadata
15
+ */
16
+ declare function convertZodToJsonSchemaWithPreview(zodSchema: z.ZodTypeAny): Record<string, unknown>;
17
+ /**
18
+ * Type guard to check if a value is a Zod schema
19
+ */
20
+ declare function isZodSchema(value: any): value is z.ZodObject<any>;
21
+ /**
22
+ * Extract preview fields from either JSON Schema or Zod schema
23
+ */
24
+ declare function extractPreviewFields(schema: any): string[];
25
+
26
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Utility function for converting Zod schemas to JSON Schema
5
+ * Uses Zod's built-in toJSONSchema method
6
+ */
7
+ declare function convertZodToJsonSchema(zodSchema: any): Record<string, unknown>;
8
+ /**
9
+ * Simple helper to mark a Zod schema field as a preview field
10
+ * Adds metadata to the schema definition without modifying Zod's core
11
+ */
12
+ declare const preview: <T extends z.ZodTypeAny>(schema: T) => T;
13
+ /**
14
+ * Convert Zod schema to JSON Schema while preserving preview metadata
15
+ */
16
+ declare function convertZodToJsonSchemaWithPreview(zodSchema: z.ZodTypeAny): Record<string, unknown>;
17
+ /**
18
+ * Type guard to check if a value is a Zod schema
19
+ */
20
+ declare function isZodSchema(value: any): value is z.ZodObject<any>;
21
+ /**
22
+ * Extract preview fields from either JSON Schema or Zod schema
23
+ */
24
+ declare function extractPreviewFields(schema: any): string[];
25
+
26
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
@@ -0,0 +1 @@
1
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from '../chunk-YECQCT5N.js';