@inkeep/agents-cli 0.0.0-dev-20250911195722 → 0.0.0-dev-20250911212652
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +321 -271
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -115,55 +115,55 @@ async function loadConfigFromFile(configPath) {
|
|
|
115
115
|
}
|
|
116
116
|
try {
|
|
117
117
|
const module = await importWithTypeScriptSupport(resolvedPath);
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
118
|
+
const config2 = module.default || module.config;
|
|
119
|
+
if (!config2) {
|
|
120
120
|
throw new Error(`No config exported from ${resolvedPath}`);
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return config2;
|
|
123
123
|
} catch (error43) {
|
|
124
124
|
console.warn(`Warning: Failed to load config file ${resolvedPath}:`, error43);
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
async function loadConfig(configPath) {
|
|
129
|
-
const
|
|
129
|
+
const config2 = {
|
|
130
130
|
agentsManageApiUrl: "http://localhost:3002",
|
|
131
131
|
agentsRunApiUrl: "http://localhost:3003",
|
|
132
132
|
manageUiUrl: "http://localhost:3000"
|
|
133
133
|
};
|
|
134
134
|
const fileConfig = await loadConfigFromFile(configPath);
|
|
135
135
|
if (fileConfig) {
|
|
136
|
-
Object.assign(
|
|
136
|
+
Object.assign(config2, fileConfig);
|
|
137
137
|
}
|
|
138
138
|
if (process.env.INKEEP_AGENTS_MANAGE_API_URL) {
|
|
139
|
-
|
|
139
|
+
config2.agentsManageApiUrl = process.env.INKEEP_AGENTS_MANAGE_API_URL;
|
|
140
140
|
}
|
|
141
141
|
if (process.env.INKEEP_AGENTS_RUN_API_URL) {
|
|
142
|
-
|
|
142
|
+
config2.agentsRunApiUrl = process.env.INKEEP_AGENTS_RUN_API_URL;
|
|
143
143
|
}
|
|
144
|
-
return
|
|
144
|
+
return config2;
|
|
145
145
|
}
|
|
146
146
|
async function getTenantId(configPath) {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
147
|
+
const config2 = await loadConfig(configPath);
|
|
148
|
+
return config2.tenantId;
|
|
149
149
|
}
|
|
150
150
|
async function getProjectId(configPath) {
|
|
151
|
-
const
|
|
152
|
-
return
|
|
151
|
+
const config2 = await loadConfig(configPath);
|
|
152
|
+
return config2.projectId || "default";
|
|
153
153
|
}
|
|
154
154
|
async function getAgentsManageApiUrl(overrideUrl, configPath) {
|
|
155
155
|
if (overrideUrl) {
|
|
156
156
|
return overrideUrl;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
return
|
|
158
|
+
const config2 = await loadConfig(configPath);
|
|
159
|
+
return config2.agentsManageApiUrl || "http://localhost:3002";
|
|
160
160
|
}
|
|
161
161
|
async function getAgentsRunApiUrl(overrideUrl, configPath) {
|
|
162
162
|
if (overrideUrl) {
|
|
163
163
|
return overrideUrl;
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
return
|
|
165
|
+
const config2 = await loadConfig(configPath);
|
|
166
|
+
return config2.agentsRunApiUrl || "http://localhost:3003";
|
|
167
167
|
}
|
|
168
168
|
async function validateConfiguration(tenantIdFlag, agentsManageApiUrlFlag, agentsRunApiUrlFlag, configFilePath) {
|
|
169
169
|
if (configFilePath && tenantIdFlag) {
|
|
@@ -172,11 +172,11 @@ async function validateConfiguration(tenantIdFlag, agentsManageApiUrlFlag, agent
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
if (configFilePath) {
|
|
175
|
-
const
|
|
176
|
-
const tenantId2 =
|
|
177
|
-
const projectId2 =
|
|
178
|
-
const agentsManageApiUrl2 = agentsManageApiUrlFlag ||
|
|
179
|
-
const agentsRunApiUrl2 = agentsRunApiUrlFlag ||
|
|
175
|
+
const config3 = await loadConfig(configFilePath);
|
|
176
|
+
const tenantId2 = config3.tenantId;
|
|
177
|
+
const projectId2 = config3.projectId || "default";
|
|
178
|
+
const agentsManageApiUrl2 = agentsManageApiUrlFlag || config3.agentsManageApiUrl;
|
|
179
|
+
const agentsRunApiUrl2 = agentsRunApiUrlFlag || config3.agentsRunApiUrl;
|
|
180
180
|
if (!tenantId2) {
|
|
181
181
|
throw new Error(
|
|
182
182
|
`Tenant ID is missing from configuration file: ${configFilePath}
|
|
@@ -197,7 +197,7 @@ Please ensure your config file exports a valid configuration with agentsRunApiUr
|
|
|
197
197
|
}
|
|
198
198
|
const sources2 = {
|
|
199
199
|
tenantId: `config file (${configFilePath})`,
|
|
200
|
-
projectId:
|
|
200
|
+
projectId: config3.projectId ? `config file (${configFilePath})` : "default",
|
|
201
201
|
agentsManageApiUrl: agentsManageApiUrlFlag ? "command-line flag (--agents-manage-api-url)" : `config file (${configFilePath})`,
|
|
202
202
|
agentsRunApiUrl: agentsRunApiUrlFlag ? "command-line flag (--agents-run-api-url)" : `config file (${configFilePath})`,
|
|
203
203
|
configFile: configFilePath
|
|
@@ -207,8 +207,8 @@ Please ensure your config file exports a valid configuration with agentsRunApiUr
|
|
|
207
207
|
projectId: projectId2,
|
|
208
208
|
agentsManageApiUrl: agentsManageApiUrl2,
|
|
209
209
|
agentsRunApiUrl: agentsRunApiUrl2,
|
|
210
|
-
manageUiUrl:
|
|
211
|
-
modelSettings:
|
|
210
|
+
manageUiUrl: config3.manageUiUrl,
|
|
211
|
+
modelSettings: config3.modelSettings || void 0,
|
|
212
212
|
sources: sources2
|
|
213
213
|
};
|
|
214
214
|
}
|
|
@@ -234,11 +234,11 @@ Please ensure your config file exports a valid configuration with agentsRunApiUr
|
|
|
234
234
|
"Invalid configuration:\n--tenant-id requires --agents-manage-api-url and --agents-run-api-url to be provided as well.\nPlease provide both --tenant-id and --agents-manage-api-url and --agents-run-api-url together."
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
const tenantId =
|
|
239
|
-
const projectId =
|
|
240
|
-
const agentsManageApiUrl = agentsManageApiUrlFlag ||
|
|
241
|
-
const agentsRunApiUrl = agentsRunApiUrlFlag ||
|
|
237
|
+
const config2 = await loadConfig();
|
|
238
|
+
const tenantId = config2.tenantId;
|
|
239
|
+
const projectId = config2.projectId || "default";
|
|
240
|
+
const agentsManageApiUrl = agentsManageApiUrlFlag || config2.agentsManageApiUrl;
|
|
241
|
+
const agentsRunApiUrl = agentsRunApiUrlFlag || config2.agentsRunApiUrl;
|
|
242
242
|
if (!tenantId) {
|
|
243
243
|
const configFile2 = findConfigFile();
|
|
244
244
|
if (!configFile2) {
|
|
@@ -284,7 +284,7 @@ Please either:
|
|
|
284
284
|
}
|
|
285
285
|
const sources = {
|
|
286
286
|
tenantId: `config file (${configFile})`,
|
|
287
|
-
projectId:
|
|
287
|
+
projectId: config2.projectId ? configFile ? `config file (${configFile})` : "config" : "default",
|
|
288
288
|
agentsManageApiUrl: agentsManageApiUrlSource,
|
|
289
289
|
agentsRunApiUrl: agentsRunApiUrlSource,
|
|
290
290
|
configFile: configFile || void 0
|
|
@@ -294,8 +294,8 @@ Please either:
|
|
|
294
294
|
projectId,
|
|
295
295
|
agentsManageApiUrl,
|
|
296
296
|
agentsRunApiUrl,
|
|
297
|
-
manageUiUrl:
|
|
298
|
-
modelSettings:
|
|
297
|
+
manageUiUrl: config2.manageUiUrl,
|
|
298
|
+
modelSettings: config2.modelSettings || void 0,
|
|
299
299
|
sources
|
|
300
300
|
};
|
|
301
301
|
}
|
|
@@ -4829,20 +4829,20 @@ var require_compile = __commonJS({
|
|
|
4829
4829
|
var util_1 = require_util();
|
|
4830
4830
|
var validate_1 = require_validate();
|
|
4831
4831
|
var SchemaEnv = class {
|
|
4832
|
-
constructor(
|
|
4832
|
+
constructor(env) {
|
|
4833
4833
|
var _a;
|
|
4834
4834
|
this.refs = {};
|
|
4835
4835
|
this.dynamicAnchors = {};
|
|
4836
4836
|
let schema;
|
|
4837
|
-
if (typeof
|
|
4838
|
-
schema =
|
|
4839
|
-
this.schema =
|
|
4840
|
-
this.schemaId =
|
|
4841
|
-
this.root =
|
|
4842
|
-
this.baseId = (_a =
|
|
4843
|
-
this.schemaPath =
|
|
4844
|
-
this.localRefs =
|
|
4845
|
-
this.meta =
|
|
4837
|
+
if (typeof env.schema == "object")
|
|
4838
|
+
schema = env.schema;
|
|
4839
|
+
this.schema = env.schema;
|
|
4840
|
+
this.schemaId = env.schemaId;
|
|
4841
|
+
this.root = env.root || this;
|
|
4842
|
+
this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
|
|
4843
|
+
this.schemaPath = env.schemaPath;
|
|
4844
|
+
this.localRefs = env.localRefs;
|
|
4845
|
+
this.meta = env.meta;
|
|
4846
4846
|
this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
|
|
4847
4847
|
this.refs = {};
|
|
4848
4848
|
}
|
|
@@ -5026,15 +5026,15 @@ var require_compile = __commonJS({
|
|
|
5026
5026
|
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
5027
5027
|
}
|
|
5028
5028
|
}
|
|
5029
|
-
let
|
|
5029
|
+
let env;
|
|
5030
5030
|
if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
|
|
5031
5031
|
const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
|
|
5032
|
-
|
|
5032
|
+
env = resolveSchema.call(this, root, $ref);
|
|
5033
5033
|
}
|
|
5034
5034
|
const { schemaId } = this.opts;
|
|
5035
|
-
|
|
5036
|
-
if (
|
|
5037
|
-
return
|
|
5035
|
+
env = env || new SchemaEnv({ schema, schemaId, root, baseId });
|
|
5036
|
+
if (env.schema !== env.root.schema)
|
|
5037
|
+
return env;
|
|
5038
5038
|
return void 0;
|
|
5039
5039
|
}
|
|
5040
5040
|
}
|
|
@@ -5183,8 +5183,8 @@ var require_utils = __commonJS({
|
|
|
5183
5183
|
}
|
|
5184
5184
|
return ind;
|
|
5185
5185
|
}
|
|
5186
|
-
function removeDotSegments(
|
|
5187
|
-
let input =
|
|
5186
|
+
function removeDotSegments(path3) {
|
|
5187
|
+
let input = path3;
|
|
5188
5188
|
const output = [];
|
|
5189
5189
|
let nextSlash = -1;
|
|
5190
5190
|
let len = 0;
|
|
@@ -5384,8 +5384,8 @@ var require_schemes = __commonJS({
|
|
|
5384
5384
|
wsComponent.secure = void 0;
|
|
5385
5385
|
}
|
|
5386
5386
|
if (wsComponent.resourceName) {
|
|
5387
|
-
const [
|
|
5388
|
-
wsComponent.path =
|
|
5387
|
+
const [path3, query] = wsComponent.resourceName.split("?");
|
|
5388
|
+
wsComponent.path = path3 && path3 !== "/" ? path3 : void 0;
|
|
5389
5389
|
wsComponent.query = query;
|
|
5390
5390
|
wsComponent.resourceName = void 0;
|
|
5391
5391
|
}
|
|
@@ -5538,24 +5538,24 @@ var require_fast_uri = __commonJS({
|
|
|
5538
5538
|
function normalize(uri, options) {
|
|
5539
5539
|
if (typeof uri === "string") {
|
|
5540
5540
|
uri = /** @type {T} */
|
|
5541
|
-
serialize2(
|
|
5541
|
+
serialize2(parse4(uri, options), options);
|
|
5542
5542
|
} else if (typeof uri === "object") {
|
|
5543
5543
|
uri = /** @type {T} */
|
|
5544
|
-
|
|
5544
|
+
parse4(serialize2(uri, options), options);
|
|
5545
5545
|
}
|
|
5546
5546
|
return uri;
|
|
5547
5547
|
}
|
|
5548
5548
|
function resolve5(baseURI, relativeURI, options) {
|
|
5549
5549
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
5550
|
-
const resolved = resolveComponent(
|
|
5550
|
+
const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
5551
5551
|
schemelessOptions.skipEscape = true;
|
|
5552
5552
|
return serialize2(resolved, schemelessOptions);
|
|
5553
5553
|
}
|
|
5554
5554
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
5555
5555
|
const target = {};
|
|
5556
5556
|
if (!skipNormalization) {
|
|
5557
|
-
base =
|
|
5558
|
-
relative =
|
|
5557
|
+
base = parse4(serialize2(base, options), options);
|
|
5558
|
+
relative = parse4(serialize2(relative, options), options);
|
|
5559
5559
|
}
|
|
5560
5560
|
options = options || {};
|
|
5561
5561
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -5607,13 +5607,13 @@ var require_fast_uri = __commonJS({
|
|
|
5607
5607
|
function equal(uriA, uriB, options) {
|
|
5608
5608
|
if (typeof uriA === "string") {
|
|
5609
5609
|
uriA = unescape(uriA);
|
|
5610
|
-
uriA = serialize2(normalizeComponentEncoding(
|
|
5610
|
+
uriA = serialize2(normalizeComponentEncoding(parse4(uriA, options), true), { ...options, skipEscape: true });
|
|
5611
5611
|
} else if (typeof uriA === "object") {
|
|
5612
5612
|
uriA = serialize2(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
5613
5613
|
}
|
|
5614
5614
|
if (typeof uriB === "string") {
|
|
5615
5615
|
uriB = unescape(uriB);
|
|
5616
|
-
uriB = serialize2(normalizeComponentEncoding(
|
|
5616
|
+
uriB = serialize2(normalizeComponentEncoding(parse4(uriB, options), true), { ...options, skipEscape: true });
|
|
5617
5617
|
} else if (typeof uriB === "object") {
|
|
5618
5618
|
uriB = serialize2(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
5619
5619
|
}
|
|
@@ -5682,7 +5682,7 @@ var require_fast_uri = __commonJS({
|
|
|
5682
5682
|
return uriTokens.join("");
|
|
5683
5683
|
}
|
|
5684
5684
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
5685
|
-
function
|
|
5685
|
+
function parse4(uri, opts) {
|
|
5686
5686
|
const options = Object.assign({}, opts);
|
|
5687
5687
|
const parsed = {
|
|
5688
5688
|
scheme: void 0,
|
|
@@ -5776,7 +5776,7 @@ var require_fast_uri = __commonJS({
|
|
|
5776
5776
|
resolveComponent,
|
|
5777
5777
|
equal,
|
|
5778
5778
|
serialize: serialize2,
|
|
5779
|
-
parse:
|
|
5779
|
+
parse: parse4
|
|
5780
5780
|
};
|
|
5781
5781
|
module.exports = fastUri;
|
|
5782
5782
|
module.exports.default = fastUri;
|
|
@@ -6442,8 +6442,8 @@ var require_ref = __commonJS({
|
|
|
6442
6442
|
schemaType: "string",
|
|
6443
6443
|
code(cxt) {
|
|
6444
6444
|
const { gen, schema: $ref, it } = cxt;
|
|
6445
|
-
const { baseId, schemaEnv:
|
|
6446
|
-
const { root } =
|
|
6445
|
+
const { baseId, schemaEnv: env, validateName, opts, self } = it;
|
|
6446
|
+
const { root } = env;
|
|
6447
6447
|
if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
|
|
6448
6448
|
return callRootRef();
|
|
6449
6449
|
const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
|
|
@@ -6453,8 +6453,8 @@ var require_ref = __commonJS({
|
|
|
6453
6453
|
return callValidate(schOrEnv);
|
|
6454
6454
|
return inlineRefSchema(schOrEnv);
|
|
6455
6455
|
function callRootRef() {
|
|
6456
|
-
if (
|
|
6457
|
-
return callRef(cxt, validateName,
|
|
6456
|
+
if (env === root)
|
|
6457
|
+
return callRef(cxt, validateName, env, env.$async);
|
|
6458
6458
|
const rootName = gen.scopeValue("root", { ref: root });
|
|
6459
6459
|
return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
|
|
6460
6460
|
}
|
|
@@ -6484,14 +6484,14 @@ var require_ref = __commonJS({
|
|
|
6484
6484
|
exports.getValidate = getValidate;
|
|
6485
6485
|
function callRef(cxt, v2, sch, $async) {
|
|
6486
6486
|
const { gen, it } = cxt;
|
|
6487
|
-
const { allErrors, schemaEnv:
|
|
6487
|
+
const { allErrors, schemaEnv: env, opts } = it;
|
|
6488
6488
|
const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
|
|
6489
6489
|
if ($async)
|
|
6490
6490
|
callAsyncRef();
|
|
6491
6491
|
else
|
|
6492
6492
|
callSyncRef();
|
|
6493
6493
|
function callAsyncRef() {
|
|
6494
|
-
if (!
|
|
6494
|
+
if (!env.$async)
|
|
6495
6495
|
throw new Error("async schema referenced by sync schema");
|
|
6496
6496
|
const valid = gen.let("valid");
|
|
6497
6497
|
gen.try(() => {
|
|
@@ -9002,7 +9002,7 @@ var require_uri_all = __commonJS({
|
|
|
9002
9002
|
}
|
|
9003
9003
|
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
|
|
9004
9004
|
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
|
|
9005
|
-
function
|
|
9005
|
+
function parse4(uriString) {
|
|
9006
9006
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
9007
9007
|
var components = {};
|
|
9008
9008
|
var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
@@ -9171,8 +9171,8 @@ var require_uri_all = __commonJS({
|
|
|
9171
9171
|
var skipNormalization = arguments[3];
|
|
9172
9172
|
var target = {};
|
|
9173
9173
|
if (!skipNormalization) {
|
|
9174
|
-
base2 =
|
|
9175
|
-
relative =
|
|
9174
|
+
base2 = parse4(serialize2(base2, options), options);
|
|
9175
|
+
relative = parse4(serialize2(relative, options), options);
|
|
9176
9176
|
}
|
|
9177
9177
|
options = options || {};
|
|
9178
9178
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -9223,24 +9223,24 @@ var require_uri_all = __commonJS({
|
|
|
9223
9223
|
}
|
|
9224
9224
|
function resolve5(baseURI, relativeURI, options) {
|
|
9225
9225
|
var schemelessOptions = assign({ scheme: "null" }, options);
|
|
9226
|
-
return serialize2(resolveComponents(
|
|
9226
|
+
return serialize2(resolveComponents(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
9227
9227
|
}
|
|
9228
9228
|
function normalize(uri, options) {
|
|
9229
9229
|
if (typeof uri === "string") {
|
|
9230
|
-
uri = serialize2(
|
|
9230
|
+
uri = serialize2(parse4(uri, options), options);
|
|
9231
9231
|
} else if (typeOf(uri) === "object") {
|
|
9232
|
-
uri =
|
|
9232
|
+
uri = parse4(serialize2(uri, options), options);
|
|
9233
9233
|
}
|
|
9234
9234
|
return uri;
|
|
9235
9235
|
}
|
|
9236
9236
|
function equal(uriA, uriB, options) {
|
|
9237
9237
|
if (typeof uriA === "string") {
|
|
9238
|
-
uriA = serialize2(
|
|
9238
|
+
uriA = serialize2(parse4(uriA, options), options);
|
|
9239
9239
|
} else if (typeOf(uriA) === "object") {
|
|
9240
9240
|
uriA = serialize2(uriA, options);
|
|
9241
9241
|
}
|
|
9242
9242
|
if (typeof uriB === "string") {
|
|
9243
|
-
uriB = serialize2(
|
|
9243
|
+
uriB = serialize2(parse4(uriB, options), options);
|
|
9244
9244
|
} else if (typeOf(uriB) === "object") {
|
|
9245
9245
|
uriB = serialize2(uriB, options);
|
|
9246
9246
|
}
|
|
@@ -9255,7 +9255,7 @@ var require_uri_all = __commonJS({
|
|
|
9255
9255
|
var handler = {
|
|
9256
9256
|
scheme: "http",
|
|
9257
9257
|
domainHost: true,
|
|
9258
|
-
parse: function
|
|
9258
|
+
parse: function parse5(components, options) {
|
|
9259
9259
|
if (!components.host) {
|
|
9260
9260
|
components.error = components.error || "HTTP URIs must have a host.";
|
|
9261
9261
|
}
|
|
@@ -9284,7 +9284,7 @@ var require_uri_all = __commonJS({
|
|
|
9284
9284
|
var handler$2 = {
|
|
9285
9285
|
scheme: "ws",
|
|
9286
9286
|
domainHost: true,
|
|
9287
|
-
parse: function
|
|
9287
|
+
parse: function parse5(components, options) {
|
|
9288
9288
|
var wsComponents = components;
|
|
9289
9289
|
wsComponents.secure = isSecure(wsComponents);
|
|
9290
9290
|
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
@@ -9301,8 +9301,8 @@ var require_uri_all = __commonJS({
|
|
|
9301
9301
|
wsComponents.secure = void 0;
|
|
9302
9302
|
}
|
|
9303
9303
|
if (wsComponents.resourceName) {
|
|
9304
|
-
var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
|
|
9305
|
-
wsComponents.path =
|
|
9304
|
+
var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path3 = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
|
|
9305
|
+
wsComponents.path = path3 && path3 !== "/" ? path3 : void 0;
|
|
9306
9306
|
wsComponents.query = query;
|
|
9307
9307
|
wsComponents.resourceName = void 0;
|
|
9308
9308
|
}
|
|
@@ -9457,7 +9457,7 @@ var require_uri_all = __commonJS({
|
|
|
9457
9457
|
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
9458
9458
|
var handler$6 = {
|
|
9459
9459
|
scheme: "urn:uuid",
|
|
9460
|
-
parse: function
|
|
9460
|
+
parse: function parse5(urnComponents, options) {
|
|
9461
9461
|
var uuidComponents = urnComponents;
|
|
9462
9462
|
uuidComponents.uuid = uuidComponents.nss;
|
|
9463
9463
|
uuidComponents.nss = void 0;
|
|
@@ -9482,7 +9482,7 @@ var require_uri_all = __commonJS({
|
|
|
9482
9482
|
exports2.SCHEMES = SCHEMES;
|
|
9483
9483
|
exports2.pctEncChar = pctEncChar;
|
|
9484
9484
|
exports2.pctDecChars = pctDecChars;
|
|
9485
|
-
exports2.parse =
|
|
9485
|
+
exports2.parse = parse4;
|
|
9486
9486
|
exports2.removeDotSegments = removeDotSegments;
|
|
9487
9487
|
exports2.serialize = serialize2;
|
|
9488
9488
|
exports2.resolveComponents = resolveComponents;
|
|
@@ -9642,12 +9642,12 @@ var require_util2 = __commonJS({
|
|
|
9642
9642
|
return "'" + escapeQuotes(str) + "'";
|
|
9643
9643
|
}
|
|
9644
9644
|
function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
|
|
9645
|
-
var
|
|
9646
|
-
return joinPaths(currentPath,
|
|
9645
|
+
var path3 = jsonPointers ? "'/' + " + expr + (isNumber ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'";
|
|
9646
|
+
return joinPaths(currentPath, path3);
|
|
9647
9647
|
}
|
|
9648
9648
|
function getPath2(currentPath, prop, jsonPointers) {
|
|
9649
|
-
var
|
|
9650
|
-
return joinPaths(currentPath,
|
|
9649
|
+
var path3 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop));
|
|
9650
|
+
return joinPaths(currentPath, path3);
|
|
9651
9651
|
}
|
|
9652
9652
|
var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
|
|
9653
9653
|
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
@@ -14712,9 +14712,9 @@ import chalk7 from "chalk";
|
|
|
14712
14712
|
import inquirer4 from "inquirer";
|
|
14713
14713
|
import ora5 from "ora";
|
|
14714
14714
|
async function chatCommandEnhanced(graphIdInput, options) {
|
|
14715
|
-
let
|
|
14715
|
+
let config2;
|
|
14716
14716
|
try {
|
|
14717
|
-
|
|
14717
|
+
config2 = await validateConfiguration(
|
|
14718
14718
|
options?.tenantId,
|
|
14719
14719
|
options?.agentsManageApiUrl,
|
|
14720
14720
|
options?.agentsRunApiUrl,
|
|
@@ -14725,19 +14725,19 @@ async function chatCommandEnhanced(graphIdInput, options) {
|
|
|
14725
14725
|
process.exit(1);
|
|
14726
14726
|
}
|
|
14727
14727
|
console.log(chalk7.gray("Using configuration:"));
|
|
14728
|
-
console.log(chalk7.gray(` \u2022 Tenant ID: ${
|
|
14729
|
-
console.log(chalk7.gray(` \u2022 Management API: ${
|
|
14730
|
-
console.log(chalk7.gray(` \u2022 Execution API: ${
|
|
14728
|
+
console.log(chalk7.gray(` \u2022 Tenant ID: ${config2.sources.tenantId}`));
|
|
14729
|
+
console.log(chalk7.gray(` \u2022 Management API: ${config2.sources.agentsManageApiUrl}`));
|
|
14730
|
+
console.log(chalk7.gray(` \u2022 Execution API: ${config2.sources.agentsRunApiUrl}`));
|
|
14731
14731
|
console.log();
|
|
14732
14732
|
const managementApi = await ManagementApiClient.create(
|
|
14733
|
-
|
|
14733
|
+
config2.agentsManageApiUrl,
|
|
14734
14734
|
options?.configFilePath,
|
|
14735
|
-
|
|
14735
|
+
config2.tenantId
|
|
14736
14736
|
);
|
|
14737
14737
|
const executionApi = await ExecutionApiClient.create(
|
|
14738
|
-
|
|
14738
|
+
config2.agentsRunApiUrl,
|
|
14739
14739
|
options?.configFilePath,
|
|
14740
|
-
|
|
14740
|
+
config2.tenantId
|
|
14741
14741
|
);
|
|
14742
14742
|
let graphId = graphIdInput;
|
|
14743
14743
|
if (!graphId) {
|
|
@@ -15033,12 +15033,12 @@ async function configGetCommand(key, options) {
|
|
|
15033
15033
|
const content = readFileSync(configPath, "utf-8");
|
|
15034
15034
|
const tenantIdMatch = content.match(/tenantId:\s*['"]([^'"]+)['"]/);
|
|
15035
15035
|
const apiUrlMatch = content.match(/apiUrl:\s*['"]([^'"]+)['"]/);
|
|
15036
|
-
const
|
|
15036
|
+
const config2 = {
|
|
15037
15037
|
tenantId: tenantIdMatch ? tenantIdMatch[1] : void 0,
|
|
15038
15038
|
apiUrl: apiUrlMatch ? apiUrlMatch[1] : void 0
|
|
15039
15039
|
};
|
|
15040
15040
|
if (key) {
|
|
15041
|
-
const value =
|
|
15041
|
+
const value = config2[key];
|
|
15042
15042
|
if (value !== void 0) {
|
|
15043
15043
|
console.log(value);
|
|
15044
15044
|
} else {
|
|
@@ -15049,8 +15049,8 @@ async function configGetCommand(key, options) {
|
|
|
15049
15049
|
} else {
|
|
15050
15050
|
console.log(chalk.cyan("Current configuration:"));
|
|
15051
15051
|
console.log(chalk.gray(" Config file:"), configPath);
|
|
15052
|
-
console.log(chalk.gray(" Tenant ID:"),
|
|
15053
|
-
console.log(chalk.gray(" API URL:"),
|
|
15052
|
+
console.log(chalk.gray(" Tenant ID:"), config2.tenantId || chalk.yellow("(not set)"));
|
|
15053
|
+
console.log(chalk.gray(" API URL:"), config2.apiUrl || chalk.yellow("(not set)"));
|
|
15054
15054
|
}
|
|
15055
15055
|
} catch (error43) {
|
|
15056
15056
|
console.error(chalk.red("Failed to read configuration:"), error43);
|
|
@@ -15230,7 +15230,7 @@ var createAgents = async (args = {}) => {
|
|
|
15230
15230
|
}
|
|
15231
15231
|
await fs.ensureDir(directoryPath);
|
|
15232
15232
|
process.chdir(directoryPath);
|
|
15233
|
-
const
|
|
15233
|
+
const config2 = {
|
|
15234
15234
|
dirName,
|
|
15235
15235
|
tenantId,
|
|
15236
15236
|
projectId,
|
|
@@ -15244,11 +15244,11 @@ var createAgents = async (args = {}) => {
|
|
|
15244
15244
|
s2.message("Creating package configurations...");
|
|
15245
15245
|
await setupPackageConfigurations(dirName);
|
|
15246
15246
|
s2.message("Setting up environment files...");
|
|
15247
|
-
await createEnvironmentFiles(
|
|
15247
|
+
await createEnvironmentFiles(config2);
|
|
15248
15248
|
s2.message("Creating service files...");
|
|
15249
|
-
await createServiceFiles(
|
|
15249
|
+
await createServiceFiles(config2);
|
|
15250
15250
|
s2.message("Creating documentation...");
|
|
15251
|
-
await createDocumentation(
|
|
15251
|
+
await createDocumentation(config2);
|
|
15252
15252
|
s2.message("Setting up Turbo...");
|
|
15253
15253
|
await createTurboConfig();
|
|
15254
15254
|
s2.message("Installing dependencies (this may take a while)...");
|
|
@@ -15395,7 +15395,7 @@ async function setupPackageConfigurations(dirName) {
|
|
|
15395
15395
|
await fs.writeJson("apps/manage-api/tsconfig.json", apiTsConfig, { spaces: 2 });
|
|
15396
15396
|
await fs.writeJson("apps/run-api/tsconfig.json", apiTsConfig, { spaces: 2 });
|
|
15397
15397
|
}
|
|
15398
|
-
async function createEnvironmentFiles(
|
|
15398
|
+
async function createEnvironmentFiles(config2) {
|
|
15399
15399
|
const envContent = `# Environment
|
|
15400
15400
|
ENVIRONMENT=development
|
|
15401
15401
|
|
|
@@ -15403,19 +15403,19 @@ ENVIRONMENT=development
|
|
|
15403
15403
|
DB_FILE_NAME=file:./local.db
|
|
15404
15404
|
|
|
15405
15405
|
# AI Provider Keys
|
|
15406
|
-
ANTHROPIC_API_KEY=${
|
|
15407
|
-
OPENAI_API_KEY=${
|
|
15406
|
+
ANTHROPIC_API_KEY=${config2.anthropicKey || "your-anthropic-key-here"}
|
|
15407
|
+
OPENAI_API_KEY=${config2.openAiKey || "your-openai-key-here"}
|
|
15408
15408
|
|
|
15409
15409
|
# Logging
|
|
15410
15410
|
LOG_LEVEL=debug
|
|
15411
15411
|
|
|
15412
15412
|
# Service Ports
|
|
15413
|
-
MANAGE_API_PORT=${
|
|
15414
|
-
RUN_API_PORT=${
|
|
15413
|
+
MANAGE_API_PORT=${config2.manageApiPort}
|
|
15414
|
+
RUN_API_PORT=${config2.runApiPort}
|
|
15415
15415
|
|
|
15416
15416
|
# UI Configuration (for dashboard)
|
|
15417
|
-
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${
|
|
15418
|
-
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${
|
|
15417
|
+
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${config2.manageApiPort}
|
|
15418
|
+
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${config2.runApiPort}
|
|
15419
15419
|
`;
|
|
15420
15420
|
await fs.writeFile(".env", envContent);
|
|
15421
15421
|
const envExample = envContent.replace(/=.+$/gm, "=");
|
|
@@ -15427,8 +15427,8 @@ ENVIRONMENT=development
|
|
|
15427
15427
|
DB_FILE_NAME=file:../../local.db
|
|
15428
15428
|
|
|
15429
15429
|
# AI Provider Keys
|
|
15430
|
-
ANTHROPIC_API_KEY=${
|
|
15431
|
-
OPENAI_API_KEY=${
|
|
15430
|
+
ANTHROPIC_API_KEY=${config2.anthropicKey || "your-anthropic-key-here"}
|
|
15431
|
+
OPENAI_API_KEY=${config2.openAiKey || "your-openai-key-here"}
|
|
15432
15432
|
`;
|
|
15433
15433
|
const manageApiEnvContent = `# Environment
|
|
15434
15434
|
ENVIRONMENT=development
|
|
@@ -15514,7 +15514,7 @@ pids/
|
|
|
15514
15514
|
};
|
|
15515
15515
|
await fs.writeJson("biome.json", biomeConfig, { spaces: 2 });
|
|
15516
15516
|
}
|
|
15517
|
-
async function createServiceFiles(
|
|
15517
|
+
async function createServiceFiles(config2) {
|
|
15518
15518
|
const agentsGraph = `import { agent, agentGraph } from '@inkeep/agents-sdk';
|
|
15519
15519
|
|
|
15520
15520
|
// Router agent - the entry point that routes users to specialist agents
|
|
@@ -15534,18 +15534,18 @@ export const graph = agentGraph({
|
|
|
15534
15534
|
defaultAgent: helloAgent,
|
|
15535
15535
|
agents: () => [helloAgent],
|
|
15536
15536
|
});`;
|
|
15537
|
-
await fs.writeFile(`src/${
|
|
15537
|
+
await fs.writeFile(`src/${config2.projectId}/hello.graph.ts`, agentsGraph);
|
|
15538
15538
|
const inkeepConfig = `import { defineConfig } from '@inkeep/agents-cli/config';
|
|
15539
15539
|
|
|
15540
15540
|
const config = defineConfig({
|
|
15541
|
-
tenantId: "${
|
|
15542
|
-
projectId: "${
|
|
15541
|
+
tenantId: "${config2.tenantId}",
|
|
15542
|
+
projectId: "${config2.projectId}",
|
|
15543
15543
|
agentsManageApiUrl: \`http://localhost:\${process.env.MANAGE_API_PORT || '3002'}\`,
|
|
15544
15544
|
agentsRunApiUrl: \`http://localhost:\${process.env.RUN_API_PORT || '3003'}\`,
|
|
15545
15545
|
});
|
|
15546
15546
|
|
|
15547
15547
|
export default config;`;
|
|
15548
|
-
await fs.writeFile(`src/${
|
|
15548
|
+
await fs.writeFile(`src/${config2.projectId}/inkeep.config.ts`, inkeepConfig);
|
|
15549
15549
|
const projectEnvContent = `# Environment
|
|
15550
15550
|
ENVIRONMENT=development
|
|
15551
15551
|
|
|
@@ -15553,11 +15553,11 @@ ENVIRONMENT=development
|
|
|
15553
15553
|
DB_FILE_NAME=file:../../local.db
|
|
15554
15554
|
|
|
15555
15555
|
# UI Configuration (for dashboard)
|
|
15556
|
-
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${
|
|
15557
|
-
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${
|
|
15556
|
+
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${config2.manageApiPort}
|
|
15557
|
+
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${config2.runApiPort}
|
|
15558
15558
|
|
|
15559
15559
|
`;
|
|
15560
|
-
await fs.writeFile(`src/${
|
|
15560
|
+
await fs.writeFile(`src/${config2.projectId}/.env`, projectEnvContent);
|
|
15561
15561
|
const credentialStoresFile = `import {
|
|
15562
15562
|
InMemoryCredentialStore,
|
|
15563
15563
|
createNangoCredentialStore,
|
|
@@ -15698,8 +15698,8 @@ async function createTurboConfig() {
|
|
|
15698
15698
|
};
|
|
15699
15699
|
await fs.writeJson("turbo.json", turboConfig, { spaces: 2 });
|
|
15700
15700
|
}
|
|
15701
|
-
async function createDocumentation(
|
|
15702
|
-
const readme = `# ${
|
|
15701
|
+
async function createDocumentation(config2) {
|
|
15702
|
+
const readme = `# ${config2.dirName}
|
|
15703
15703
|
|
|
15704
15704
|
An Inkeep Agent Framework project with multi-service architecture.
|
|
15705
15705
|
|
|
@@ -15728,7 +15728,7 @@ This project follows a workspace structure with the following services:
|
|
|
15728
15728
|
3. **Deploy your first agent graph:**
|
|
15729
15729
|
\`\`\`bash
|
|
15730
15730
|
# Navigate to your project's graph directory
|
|
15731
|
-
cd src/${
|
|
15731
|
+
cd src/${config2.projectId}/
|
|
15732
15732
|
|
|
15733
15733
|
# Push the hello graph to create it
|
|
15734
15734
|
npx inkeep push hello.graph.ts
|
|
@@ -15739,9 +15739,9 @@ This project follows a workspace structure with the following services:
|
|
|
15739
15739
|
## Project Structure
|
|
15740
15740
|
|
|
15741
15741
|
\`\`\`
|
|
15742
|
-
${
|
|
15742
|
+
${config2.dirName}/
|
|
15743
15743
|
\u251C\u2500\u2500 src/
|
|
15744
|
-
\u2502 \u251C\u2500\u2500 /${
|
|
15744
|
+
\u2502 \u251C\u2500\u2500 /${config2.projectId} # Agent configurations
|
|
15745
15745
|
\u251C\u2500\u2500 apps/
|
|
15746
15746
|
\u2502 \u251C\u2500\u2500 manage-api/ # Agents Management API service
|
|
15747
15747
|
\u2502 \u251C\u2500\u2500 run-api/ # Agents Run API service
|
|
@@ -15759,7 +15759,7 @@ Environment variables are defined in the following places:
|
|
|
15759
15759
|
|
|
15760
15760
|
- \`apps/manage-api/.env\`: Agents Management API environment variables
|
|
15761
15761
|
- \`apps/run-api/.env\`: Agents Run API environment variables
|
|
15762
|
-
- \`src/${
|
|
15762
|
+
- \`src/${config2.projectId}/.env\`: Inkeep CLI environment variables
|
|
15763
15763
|
- \`.env\`: Root environment variables
|
|
15764
15764
|
|
|
15765
15765
|
To change the API keys used by your agents modify \`apps/run-api/.env\`. You are required to define at least one LLM provider key.
|
|
@@ -15784,17 +15784,17 @@ After changing the API Service ports make sure that you modify the dashboard API
|
|
|
15784
15784
|
|
|
15785
15785
|
\`\`\`bash
|
|
15786
15786
|
# UI Configuration (for dashboard)
|
|
15787
|
-
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${
|
|
15788
|
-
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${
|
|
15787
|
+
NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL=http://localhost:${config2.manageApiPort}
|
|
15788
|
+
NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL=http://localhost:${config2.runApiPort}
|
|
15789
15789
|
\`\`\`
|
|
15790
15790
|
|
|
15791
15791
|
### Agent Configuration
|
|
15792
15792
|
|
|
15793
|
-
Your agents are defined in \`src/${
|
|
15793
|
+
Your agents are defined in \`src/${config2.projectId}/index.ts\`. The default setup includes:
|
|
15794
15794
|
|
|
15795
15795
|
- **Hello Agent**: A hello agent that just says hello.
|
|
15796
15796
|
|
|
15797
|
-
Your inkeep configuration is defined in \`src/${
|
|
15797
|
+
Your inkeep configuration is defined in \`src/${config2.projectId}/inkeep.config.ts\`. The inkeep configuration is used to configure defaults for the inkeep CLI. The configuration includes:
|
|
15798
15798
|
|
|
15799
15799
|
- \`tenantId\`: The tenant ID
|
|
15800
15800
|
- \`projectId\`: The project ID
|
|
@@ -15806,15 +15806,15 @@ Your inkeep configuration is defined in \`src/${config3.projectId}/inkeep.config
|
|
|
15806
15806
|
|
|
15807
15807
|
### Updating Your Agents
|
|
15808
15808
|
|
|
15809
|
-
1. Edit \`src/${
|
|
15809
|
+
1. Edit \`src/${config2.projectId}/index.ts\`
|
|
15810
15810
|
2. Push the graph to the platform to update: \`npx inkeep push hello.graph.ts\`
|
|
15811
15811
|
|
|
15812
15812
|
### API Documentation
|
|
15813
15813
|
|
|
15814
15814
|
Once services are running, view the OpenAPI documentation:
|
|
15815
15815
|
|
|
15816
|
-
- Management API: http://localhost:${
|
|
15817
|
-
- Execution API: http://localhost:${
|
|
15816
|
+
- Management API: http://localhost:${config2.manageApiPort}/docs
|
|
15817
|
+
- Execution API: http://localhost:${config2.runApiPort}/docs
|
|
15818
15818
|
|
|
15819
15819
|
## Learn More
|
|
15820
15820
|
|
|
@@ -15824,9 +15824,9 @@ Once services are running, view the OpenAPI documentation:
|
|
|
15824
15824
|
|
|
15825
15825
|
## Inkeep CLI commands
|
|
15826
15826
|
|
|
15827
|
-
- Ensure you are runnning commands from \`cd src/${
|
|
15827
|
+
- Ensure you are runnning commands from \`cd src/${config2.projectId}\`.
|
|
15828
15828
|
- Validate the \`inkeep.config.ts\` file has the correct api urls.
|
|
15829
|
-
- Validate that the \`.env\` file in \`src/${
|
|
15829
|
+
- Validate that the \`.env\` file in \`src/${config2.projectId}\` has the correct \`DB_FILE_NAME\`.
|
|
15830
15830
|
|
|
15831
15831
|
### Services won't start
|
|
15832
15832
|
|
|
@@ -16190,9 +16190,9 @@ import chalk4 from "chalk";
|
|
|
16190
16190
|
import Table from "cli-table3";
|
|
16191
16191
|
import ora2 from "ora";
|
|
16192
16192
|
async function listGraphsCommand(options) {
|
|
16193
|
-
let
|
|
16193
|
+
let config2;
|
|
16194
16194
|
try {
|
|
16195
|
-
|
|
16195
|
+
config2 = await validateConfiguration(
|
|
16196
16196
|
options.tenantId,
|
|
16197
16197
|
options.agentsManageApiUrl,
|
|
16198
16198
|
void 0,
|
|
@@ -16204,13 +16204,13 @@ async function listGraphsCommand(options) {
|
|
|
16204
16204
|
process.exit(1);
|
|
16205
16205
|
}
|
|
16206
16206
|
console.log(chalk4.gray("Using configuration:"));
|
|
16207
|
-
console.log(chalk4.gray(` \u2022 Tenant ID: ${
|
|
16208
|
-
console.log(chalk4.gray(` \u2022 API URL: ${
|
|
16207
|
+
console.log(chalk4.gray(` \u2022 Tenant ID: ${config2.sources.tenantId}`));
|
|
16208
|
+
console.log(chalk4.gray(` \u2022 API URL: ${config2.sources.agentsManageApiUrl}`));
|
|
16209
16209
|
console.log();
|
|
16210
16210
|
const api = await ManagementApiClient.create(
|
|
16211
|
-
|
|
16211
|
+
config2.agentsManageApiUrl,
|
|
16212
16212
|
options.configFilePath,
|
|
16213
|
-
|
|
16213
|
+
config2.tenantId
|
|
16214
16214
|
);
|
|
16215
16215
|
const spinner2 = ora2("Fetching graphs...").start();
|
|
16216
16216
|
try {
|
|
@@ -16287,16 +16287,16 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16287
16287
|
}
|
|
16288
16288
|
return value;
|
|
16289
16289
|
}
|
|
16290
|
-
function shouldIgnorePath(
|
|
16290
|
+
function shouldIgnorePath(path3) {
|
|
16291
16291
|
return ignorePaths.some((ignorePath) => {
|
|
16292
16292
|
if (ignorePath.endsWith("*")) {
|
|
16293
|
-
return
|
|
16293
|
+
return path3.startsWith(ignorePath.slice(0, -1));
|
|
16294
16294
|
}
|
|
16295
|
-
return
|
|
16295
|
+
return path3 === ignorePath;
|
|
16296
16296
|
});
|
|
16297
16297
|
}
|
|
16298
|
-
function compareValues(value1, value2,
|
|
16299
|
-
if (shouldIgnorePath(
|
|
16298
|
+
function compareValues(value1, value2, path3 = "") {
|
|
16299
|
+
if (shouldIgnorePath(path3)) {
|
|
16300
16300
|
return true;
|
|
16301
16301
|
}
|
|
16302
16302
|
if (value1 === null || value1 === void 0) {
|
|
@@ -16304,7 +16304,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16304
16304
|
return true;
|
|
16305
16305
|
}
|
|
16306
16306
|
differences.push({
|
|
16307
|
-
path:
|
|
16307
|
+
path: path3,
|
|
16308
16308
|
type: "different",
|
|
16309
16309
|
value1,
|
|
16310
16310
|
value2,
|
|
@@ -16314,7 +16314,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16314
16314
|
}
|
|
16315
16315
|
if (value2 === null || value2 === void 0) {
|
|
16316
16316
|
differences.push({
|
|
16317
|
-
path:
|
|
16317
|
+
path: path3,
|
|
16318
16318
|
type: "different",
|
|
16319
16319
|
value1,
|
|
16320
16320
|
value2,
|
|
@@ -16324,7 +16324,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16324
16324
|
}
|
|
16325
16325
|
if (typeof value1 !== typeof value2) {
|
|
16326
16326
|
differences.push({
|
|
16327
|
-
path:
|
|
16327
|
+
path: path3,
|
|
16328
16328
|
type: "type_mismatch",
|
|
16329
16329
|
value1,
|
|
16330
16330
|
value2,
|
|
@@ -16337,7 +16337,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16337
16337
|
const normalized2 = normalizeValue(value2);
|
|
16338
16338
|
if (normalized1 !== normalized2) {
|
|
16339
16339
|
differences.push({
|
|
16340
|
-
path:
|
|
16340
|
+
path: path3,
|
|
16341
16341
|
type: "different",
|
|
16342
16342
|
value1,
|
|
16343
16343
|
value2,
|
|
@@ -16350,7 +16350,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16350
16350
|
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
16351
16351
|
if (value1.length !== value2.length) {
|
|
16352
16352
|
differences.push({
|
|
16353
|
-
path:
|
|
16353
|
+
path: path3,
|
|
16354
16354
|
type: "different",
|
|
16355
16355
|
value1: value1.length,
|
|
16356
16356
|
value2: value2.length,
|
|
@@ -16366,11 +16366,11 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16366
16366
|
(a, b2) => JSON.stringify(a).localeCompare(JSON.stringify(b2))
|
|
16367
16367
|
);
|
|
16368
16368
|
for (let i2 = 0; i2 < sorted1.length; i2++) {
|
|
16369
|
-
compareValues(sorted1[i2], sorted2[i2], `${
|
|
16369
|
+
compareValues(sorted1[i2], sorted2[i2], `${path3}[${i2}]`);
|
|
16370
16370
|
}
|
|
16371
16371
|
} else {
|
|
16372
16372
|
for (let i2 = 0; i2 < value1.length; i2++) {
|
|
16373
|
-
compareValues(value1[i2], value2[i2], `${
|
|
16373
|
+
compareValues(value1[i2], value2[i2], `${path3}[${i2}]`);
|
|
16374
16374
|
}
|
|
16375
16375
|
}
|
|
16376
16376
|
return true;
|
|
@@ -16381,7 +16381,7 @@ function compareJsonObjects(obj1, obj2, options = {}) {
|
|
|
16381
16381
|
const allKeys = /* @__PURE__ */ new Set([...keys1, ...keys2]);
|
|
16382
16382
|
stats.totalKeys += allKeys.size;
|
|
16383
16383
|
for (const key of allKeys) {
|
|
16384
|
-
const currentPath =
|
|
16384
|
+
const currentPath = path3 ? `${path3}.${key}` : key;
|
|
16385
16385
|
if (!keys1.includes(key)) {
|
|
16386
16386
|
differences.push({
|
|
16387
16387
|
path: currentPath,
|
|
@@ -16449,12 +16449,12 @@ init_esm_shims();
|
|
|
16449
16449
|
import { anthropic, createAnthropic } from "@ai-sdk/anthropic";
|
|
16450
16450
|
import { createOpenAI, openai } from "@ai-sdk/openai";
|
|
16451
16451
|
import { generateText } from "ai";
|
|
16452
|
-
function createModel(
|
|
16453
|
-
if (!
|
|
16452
|
+
function createModel(config2) {
|
|
16453
|
+
if (!config2.model) {
|
|
16454
16454
|
throw new Error("Model configuration is required for pull command");
|
|
16455
16455
|
}
|
|
16456
|
-
const modelString =
|
|
16457
|
-
const providerOptions =
|
|
16456
|
+
const modelString = config2.model;
|
|
16457
|
+
const providerOptions = config2.providerOptions;
|
|
16458
16458
|
const { provider, modelName } = parseModelString(modelString);
|
|
16459
16459
|
switch (provider) {
|
|
16460
16460
|
case "anthropic":
|
|
@@ -16487,11 +16487,11 @@ function parseModelString(modelString) {
|
|
|
16487
16487
|
};
|
|
16488
16488
|
}
|
|
16489
16489
|
async function generateTypeScriptFileWithLLM(graphData, graphId, outputFilePath, modelSettings, retryContext) {
|
|
16490
|
-
const
|
|
16490
|
+
const fs2 = await import("fs");
|
|
16491
16491
|
let existingContent = "";
|
|
16492
16492
|
let fileExists = false;
|
|
16493
16493
|
try {
|
|
16494
|
-
existingContent =
|
|
16494
|
+
existingContent = fs2.readFileSync(outputFilePath, "utf-8");
|
|
16495
16495
|
fileExists = true;
|
|
16496
16496
|
} catch {
|
|
16497
16497
|
fileExists = false;
|
|
@@ -16507,7 +16507,7 @@ async function generateTypeScriptFileWithLLM(graphData, graphId, outputFilePath,
|
|
|
16507
16507
|
maxOutputTokens: 16e3
|
|
16508
16508
|
// Increased to handle large TypeScript files
|
|
16509
16509
|
});
|
|
16510
|
-
|
|
16510
|
+
fs2.writeFileSync(outputFilePath, text3, "utf-8");
|
|
16511
16511
|
console.log(`\u2705 Successfully generated TypeScript file: ${outputFilePath}`);
|
|
16512
16512
|
} catch (error43) {
|
|
16513
16513
|
console.error("\u274C Error generating TypeScript file with LLM:", error43);
|
|
@@ -16671,9 +16671,9 @@ async function convertTypeScriptToJson(graphPath) {
|
|
|
16671
16671
|
async function pullCommand(graphId, options) {
|
|
16672
16672
|
const spinner2 = ora3("Loading configuration...").start();
|
|
16673
16673
|
try {
|
|
16674
|
-
let
|
|
16674
|
+
let config2;
|
|
16675
16675
|
try {
|
|
16676
|
-
|
|
16676
|
+
config2 = await validateConfiguration(
|
|
16677
16677
|
options.tenantId,
|
|
16678
16678
|
options.apiUrl,
|
|
16679
16679
|
options.configFilePath
|
|
@@ -16691,7 +16691,7 @@ async function pullCommand(graphId, options) {
|
|
|
16691
16691
|
);
|
|
16692
16692
|
spinner2.text = "Fetching graph from API...";
|
|
16693
16693
|
const response = await fetch(
|
|
16694
|
-
`${
|
|
16694
|
+
`${config2.agentsManageApiUrl}/tenants/${config2.tenantId}/crud/projects/${config2.projectId}/graph/${graphId}`,
|
|
16695
16695
|
{
|
|
16696
16696
|
method: "GET",
|
|
16697
16697
|
headers: {
|
|
@@ -16720,7 +16720,7 @@ async function pullCommand(graphId, options) {
|
|
|
16720
16720
|
console.log(chalk5.gray(` \u2022 View the file: ${outputFilePath}`));
|
|
16721
16721
|
console.log(chalk5.gray(` \u2022 Use the data in your application`));
|
|
16722
16722
|
} else {
|
|
16723
|
-
if (!
|
|
16723
|
+
if (!config2.modelSettings?.pull) {
|
|
16724
16724
|
spinner2.fail("Pull model configuration is required for TypeScript generation");
|
|
16725
16725
|
console.error(chalk5.red("Error: No pull model found in configuration."));
|
|
16726
16726
|
console.error(chalk5.yellow("Please add pull model to your inkeep.config.ts file."));
|
|
@@ -16746,7 +16746,7 @@ async function pullCommand(graphId, options) {
|
|
|
16746
16746
|
graphData,
|
|
16747
16747
|
graphId,
|
|
16748
16748
|
outputFilePath,
|
|
16749
|
-
|
|
16749
|
+
config2.modelSettings.pull,
|
|
16750
16750
|
{
|
|
16751
16751
|
attempt,
|
|
16752
16752
|
maxRetries,
|
|
@@ -17613,10 +17613,10 @@ function mergeDefs(...defs) {
|
|
|
17613
17613
|
function cloneDef(schema) {
|
|
17614
17614
|
return mergeDefs(schema._zod.def);
|
|
17615
17615
|
}
|
|
17616
|
-
function getElementAtPath(obj,
|
|
17617
|
-
if (!
|
|
17616
|
+
function getElementAtPath(obj, path3) {
|
|
17617
|
+
if (!path3)
|
|
17618
17618
|
return obj;
|
|
17619
|
-
return
|
|
17619
|
+
return path3.reduce((acc, key) => acc?.[key], obj);
|
|
17620
17620
|
}
|
|
17621
17621
|
function promiseAllObject(promisesObj) {
|
|
17622
17622
|
const keys = Object.keys(promisesObj);
|
|
@@ -17975,21 +17975,21 @@ function aborted(x2, startIndex = 0) {
|
|
|
17975
17975
|
}
|
|
17976
17976
|
return false;
|
|
17977
17977
|
}
|
|
17978
|
-
function prefixIssues(
|
|
17978
|
+
function prefixIssues(path3, issues) {
|
|
17979
17979
|
return issues.map((iss) => {
|
|
17980
17980
|
var _a;
|
|
17981
17981
|
(_a = iss).path ?? (_a.path = []);
|
|
17982
|
-
iss.path.unshift(
|
|
17982
|
+
iss.path.unshift(path3);
|
|
17983
17983
|
return iss;
|
|
17984
17984
|
});
|
|
17985
17985
|
}
|
|
17986
17986
|
function unwrapMessage(message) {
|
|
17987
17987
|
return typeof message === "string" ? message : message?.message;
|
|
17988
17988
|
}
|
|
17989
|
-
function finalizeIssue(iss, ctx,
|
|
17989
|
+
function finalizeIssue(iss, ctx, config2) {
|
|
17990
17990
|
const full = { ...iss, path: iss.path ?? [] };
|
|
17991
17991
|
if (!iss.message) {
|
|
17992
|
-
const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(
|
|
17992
|
+
const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
17993
17993
|
full.message = message;
|
|
17994
17994
|
}
|
|
17995
17995
|
delete full.inst;
|
|
@@ -18147,7 +18147,7 @@ function treeifyError(error43, _mapper) {
|
|
|
18147
18147
|
return issue2.message;
|
|
18148
18148
|
};
|
|
18149
18149
|
const result = { errors: [] };
|
|
18150
|
-
const processError = (error44,
|
|
18150
|
+
const processError = (error44, path3 = []) => {
|
|
18151
18151
|
var _a, _b;
|
|
18152
18152
|
for (const issue2 of error44.issues) {
|
|
18153
18153
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -18157,7 +18157,7 @@ function treeifyError(error43, _mapper) {
|
|
|
18157
18157
|
} else if (issue2.code === "invalid_element") {
|
|
18158
18158
|
processError({ issues: issue2.issues }, issue2.path);
|
|
18159
18159
|
} else {
|
|
18160
|
-
const fullpath = [...
|
|
18160
|
+
const fullpath = [...path3, ...issue2.path];
|
|
18161
18161
|
if (fullpath.length === 0) {
|
|
18162
18162
|
result.errors.push(mapper(issue2));
|
|
18163
18163
|
continue;
|
|
@@ -18189,8 +18189,8 @@ function treeifyError(error43, _mapper) {
|
|
|
18189
18189
|
}
|
|
18190
18190
|
function toDotPath(_path) {
|
|
18191
18191
|
const segs = [];
|
|
18192
|
-
const
|
|
18193
|
-
for (const seg of
|
|
18192
|
+
const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
18193
|
+
for (const seg of path3) {
|
|
18194
18194
|
if (typeof seg === "number")
|
|
18195
18195
|
segs.push(`[${seg}]`);
|
|
18196
18196
|
else if (typeof seg === "symbol")
|
|
@@ -28982,8 +28982,8 @@ var LoggerFactory = class {
|
|
|
28982
28982
|
/**
|
|
28983
28983
|
* Configure the logger factory
|
|
28984
28984
|
*/
|
|
28985
|
-
configure(
|
|
28986
|
-
this.config =
|
|
28985
|
+
configure(config2) {
|
|
28986
|
+
this.config = config2;
|
|
28987
28987
|
this.loggers.clear();
|
|
28988
28988
|
}
|
|
28989
28989
|
/**
|
|
@@ -28991,7 +28991,11 @@ var LoggerFactory = class {
|
|
|
28991
28991
|
*/
|
|
28992
28992
|
getLogger(name) {
|
|
28993
28993
|
if (this.loggers.has(name)) {
|
|
28994
|
-
|
|
28994
|
+
const logger12 = this.loggers.get(name);
|
|
28995
|
+
if (!logger12) {
|
|
28996
|
+
throw new Error(`Logger '${name}' not found in cache`);
|
|
28997
|
+
}
|
|
28998
|
+
return logger12;
|
|
28995
28999
|
}
|
|
28996
29000
|
let logger11;
|
|
28997
29001
|
if (this.config.loggerFactory) {
|
|
@@ -29561,9 +29565,9 @@ var HonoRequest = class {
|
|
|
29561
29565
|
routeIndex = 0;
|
|
29562
29566
|
path;
|
|
29563
29567
|
bodyCache = {};
|
|
29564
|
-
constructor(request,
|
|
29568
|
+
constructor(request, path3 = "/", matchResult = [[]]) {
|
|
29565
29569
|
this.raw = request;
|
|
29566
|
-
this.path =
|
|
29570
|
+
this.path = path3;
|
|
29567
29571
|
this.#matchResult = matchResult;
|
|
29568
29572
|
this.#validatedData = {};
|
|
29569
29573
|
}
|
|
@@ -31404,14 +31408,14 @@ init_esm_shims();
|
|
|
31404
31408
|
init_esm_shims();
|
|
31405
31409
|
import { createClient } from "@libsql/client";
|
|
31406
31410
|
import { drizzle } from "drizzle-orm/libsql";
|
|
31407
|
-
function createDatabaseClient(
|
|
31411
|
+
function createDatabaseClient(config2) {
|
|
31408
31412
|
const client = createClient({
|
|
31409
|
-
url:
|
|
31410
|
-
authToken:
|
|
31413
|
+
url: config2.url,
|
|
31414
|
+
authToken: config2.authToken
|
|
31411
31415
|
});
|
|
31412
31416
|
return drizzle(client, {
|
|
31413
31417
|
schema: schema_exports,
|
|
31414
|
-
logger:
|
|
31418
|
+
logger: config2.logger
|
|
31415
31419
|
});
|
|
31416
31420
|
}
|
|
31417
31421
|
|
|
@@ -32249,18 +32253,18 @@ var ProxyTracer = (
|
|
|
32249
32253
|
return this._getTracer().startSpan(name, options, context);
|
|
32250
32254
|
};
|
|
32251
32255
|
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
32252
|
-
var
|
|
32253
|
-
return Reflect.apply(
|
|
32256
|
+
var tracer2 = this._getTracer();
|
|
32257
|
+
return Reflect.apply(tracer2.startActiveSpan, tracer2, arguments);
|
|
32254
32258
|
};
|
|
32255
32259
|
ProxyTracer2.prototype._getTracer = function() {
|
|
32256
32260
|
if (this._delegate) {
|
|
32257
32261
|
return this._delegate;
|
|
32258
32262
|
}
|
|
32259
|
-
var
|
|
32260
|
-
if (!
|
|
32263
|
+
var tracer2 = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
32264
|
+
if (!tracer2) {
|
|
32261
32265
|
return NOOP_TRACER;
|
|
32262
32266
|
}
|
|
32263
|
-
this._delegate =
|
|
32267
|
+
this._delegate = tracer2;
|
|
32264
32268
|
return this._delegate;
|
|
32265
32269
|
};
|
|
32266
32270
|
return ProxyTracer2;
|
|
@@ -33028,8 +33032,8 @@ function getErrorMap2() {
|
|
|
33028
33032
|
// ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
33029
33033
|
init_esm_shims();
|
|
33030
33034
|
var makeIssue = (params) => {
|
|
33031
|
-
const { data, path:
|
|
33032
|
-
const fullPath = [...
|
|
33035
|
+
const { data, path: path3, errorMaps, issueData } = params;
|
|
33036
|
+
const fullPath = [...path3, ...issueData.path || []];
|
|
33033
33037
|
const fullIssue = {
|
|
33034
33038
|
...issueData,
|
|
33035
33039
|
path: fullPath
|
|
@@ -33149,11 +33153,11 @@ var errorUtil;
|
|
|
33149
33153
|
|
|
33150
33154
|
// ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
33151
33155
|
var ParseInputLazyPath = class {
|
|
33152
|
-
constructor(parent, value,
|
|
33156
|
+
constructor(parent, value, path3, key) {
|
|
33153
33157
|
this._cachedPath = [];
|
|
33154
33158
|
this.parent = parent;
|
|
33155
33159
|
this.data = value;
|
|
33156
|
-
this._path =
|
|
33160
|
+
this._path = path3;
|
|
33157
33161
|
this._key = key;
|
|
33158
33162
|
}
|
|
33159
33163
|
get path() {
|
|
@@ -37913,57 +37917,9 @@ var k = u(p2(function(t2) {
|
|
|
37913
37917
|
return null != t2;
|
|
37914
37918
|
}));
|
|
37915
37919
|
|
|
37916
|
-
// ../packages/agents-core/src/utils/tracer.ts
|
|
37920
|
+
// ../packages/agents-core/src/utils/tracer-factory.ts
|
|
37917
37921
|
init_esm_shims();
|
|
37918
|
-
|
|
37919
|
-
// ../packages/agents-core/src/env.ts
|
|
37920
|
-
init_esm_shims();
|
|
37921
|
-
import fs2 from "fs";
|
|
37922
|
-
import path3 from "path";
|
|
37923
|
-
import * as dotenv2 from "dotenv";
|
|
37924
|
-
dotenv2.config({ quiet: true });
|
|
37925
|
-
var environmentSchema = external_exports.enum(["development", "pentest", "production", "test"]);
|
|
37926
|
-
var criticalEnv = external_exports.object({
|
|
37927
|
-
ENVIRONMENT: environmentSchema
|
|
37928
|
-
}).parse(process.env);
|
|
37929
|
-
var loadEnvFile = () => {
|
|
37930
|
-
const envPath = path3.resolve(process.cwd(), `.env.${criticalEnv.ENVIRONMENT}.nonsecret`);
|
|
37931
|
-
if (fs2.existsSync(envPath)) {
|
|
37932
|
-
const envConfig = dotenv2.parse(fs2.readFileSync(envPath));
|
|
37933
|
-
for (const k2 in envConfig) {
|
|
37934
|
-
if (!(k2 in process.env)) {
|
|
37935
|
-
process.env[k2] = envConfig[k2];
|
|
37936
|
-
}
|
|
37937
|
-
}
|
|
37938
|
-
}
|
|
37939
|
-
};
|
|
37940
|
-
loadEnvFile();
|
|
37941
|
-
var envSchema = external_exports.object({
|
|
37942
|
-
ENVIRONMENT: external_exports.enum(["development", "production", "pentest", "test"]).optional(),
|
|
37943
|
-
DB_FILE_NAME: external_exports.string().default("file:../../local.db"),
|
|
37944
|
-
OTEL_TRACES_FORCE_FLUSH_ENABLED: external_exports.stringbool().optional()
|
|
37945
|
-
});
|
|
37946
|
-
var parseEnv = () => {
|
|
37947
|
-
try {
|
|
37948
|
-
const parsedEnv = envSchema.parse(process.env);
|
|
37949
|
-
return parsedEnv;
|
|
37950
|
-
} catch (error43) {
|
|
37951
|
-
if (error43 instanceof external_exports.ZodError) {
|
|
37952
|
-
const missingVars = error43.issues.map((issue2) => issue2.path.join("."));
|
|
37953
|
-
throw new Error(
|
|
37954
|
-
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
37955
|
-
${error43.message}`
|
|
37956
|
-
);
|
|
37957
|
-
}
|
|
37958
|
-
throw error43;
|
|
37959
|
-
}
|
|
37960
|
-
};
|
|
37961
|
-
var env = parseEnv();
|
|
37962
|
-
|
|
37963
|
-
// ../packages/agents-core/src/utils/tracer.ts
|
|
37964
37922
|
var logger4 = getLogger("tracer");
|
|
37965
|
-
var SERVICE_NAME = "inkeep-chat";
|
|
37966
|
-
var SERVICE_VERSION = "1.0.0";
|
|
37967
37923
|
var createNoOpSpan = () => ({
|
|
37968
37924
|
setAttributes: () => ({}),
|
|
37969
37925
|
recordException: () => ({}),
|
|
@@ -37992,29 +37948,124 @@ var noopTracer = {
|
|
|
37992
37948
|
return createNoOpSpan();
|
|
37993
37949
|
}
|
|
37994
37950
|
};
|
|
37995
|
-
|
|
37996
|
-
|
|
37997
|
-
|
|
37998
|
-
|
|
37999
|
-
|
|
38000
|
-
|
|
38001
|
-
logger4.debug(
|
|
38002
|
-
{ error: error43 instanceof Error ? error43.message : "Unknown error" },
|
|
38003
|
-
"OpenTelemetry tracer not available, using no-op tracer"
|
|
38004
|
-
);
|
|
38005
|
-
globalTracerInstance = noopTracer;
|
|
38006
|
-
}
|
|
37951
|
+
function getTracer(serviceName, serviceVersion) {
|
|
37952
|
+
try {
|
|
37953
|
+
return trace.getTracer(serviceName, serviceVersion);
|
|
37954
|
+
} catch (_error) {
|
|
37955
|
+
logger4.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
|
|
37956
|
+
return noopTracer;
|
|
38007
37957
|
}
|
|
38008
|
-
return globalTracerInstance;
|
|
38009
37958
|
}
|
|
38010
37959
|
|
|
37960
|
+
// ../packages/agents-core/src/utils/tracer.ts
|
|
37961
|
+
init_esm_shims();
|
|
37962
|
+
|
|
37963
|
+
// ../packages/agents-core/package.json
|
|
37964
|
+
var package_default = {
|
|
37965
|
+
name: "@inkeep/agents-core",
|
|
37966
|
+
version: "0.1.4",
|
|
37967
|
+
description: "Core database schema, types, and validation schemas for Inkeep Agent Framework",
|
|
37968
|
+
type: "module",
|
|
37969
|
+
license: "SEE LICENSE IN LICENSE.md",
|
|
37970
|
+
main: "./src/index.ts",
|
|
37971
|
+
exports: {
|
|
37972
|
+
".": "./src/index.ts",
|
|
37973
|
+
"./schema": "./src/db/schema.ts",
|
|
37974
|
+
"./types": "./src/types/index.ts",
|
|
37975
|
+
"./validation": "./src/validation/index.ts",
|
|
37976
|
+
"./client-exports": "./src/client-exports.ts"
|
|
37977
|
+
},
|
|
37978
|
+
scripts: {
|
|
37979
|
+
build: "tsup",
|
|
37980
|
+
prepare: "pnpm build",
|
|
37981
|
+
test: "vitest --run",
|
|
37982
|
+
"test:unit": "vitest --run src/__tests__ --exclude src/__tests__/integration/**",
|
|
37983
|
+
"test:integration": "vitest --run src/__tests__/integration/",
|
|
37984
|
+
"test:coverage": "vitest --run --coverage",
|
|
37985
|
+
"test:watch": "vitest --watch",
|
|
37986
|
+
lint: "biome lint src",
|
|
37987
|
+
"lint:fix": "biome check --write src",
|
|
37988
|
+
format: "biome format --write src",
|
|
37989
|
+
"format:check": "biome format src",
|
|
37990
|
+
typecheck: "tsc --noEmit",
|
|
37991
|
+
"db:generate": "drizzle-kit generate",
|
|
37992
|
+
"db:push": "drizzle-kit push",
|
|
37993
|
+
"db:migrate": "drizzle-kit migrate",
|
|
37994
|
+
"db:clean": "tsx src/db/clean.ts",
|
|
37995
|
+
"db:studio": "drizzle-kit studio",
|
|
37996
|
+
"db:check": "drizzle-kit check",
|
|
37997
|
+
"db:reset-schema": "rm -rf drizzle/* && echo 'All migration files removed, generating new schema' && drizzle-kit generate",
|
|
37998
|
+
prepack: "clean-package",
|
|
37999
|
+
postpack: "clean-package restore"
|
|
38000
|
+
},
|
|
38001
|
+
"clean-package": "./clean-package.config.json",
|
|
38002
|
+
dependencies: {
|
|
38003
|
+
"@hono/node-server": "^1.14.3",
|
|
38004
|
+
"@hono/zod-openapi": "^1.0.2",
|
|
38005
|
+
"@libsql/client": "^0.15.7",
|
|
38006
|
+
"@modelcontextprotocol/sdk": "^1.17.2",
|
|
38007
|
+
"@nangohq/node": "^0.66.0",
|
|
38008
|
+
"@nangohq/types": "^0.66.0",
|
|
38009
|
+
"@opentelemetry/api": "^1.9.0",
|
|
38010
|
+
"@opentelemetry/auto-instrumentations-node": "^0.62.0",
|
|
38011
|
+
"@opentelemetry/baggage-span-processor": "^0.4.0",
|
|
38012
|
+
"@opentelemetry/exporter-jaeger": "^2.0.1",
|
|
38013
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.203.0",
|
|
38014
|
+
"@opentelemetry/sdk-metrics": "^2.0.1",
|
|
38015
|
+
"@opentelemetry/sdk-node": "^0.203.0",
|
|
38016
|
+
"@opentelemetry/sdk-trace-node": "^2.0.1",
|
|
38017
|
+
"@opentelemetry/semantic-conventions": "^1.34.0",
|
|
38018
|
+
ai: "5.0.11",
|
|
38019
|
+
ajv: "^8.17.1",
|
|
38020
|
+
"ajv-formats": "^3.0.1",
|
|
38021
|
+
dotenv: "^17.2.1",
|
|
38022
|
+
"drizzle-orm": "^0.44.4",
|
|
38023
|
+
"drizzle-zod": "^0.8.2",
|
|
38024
|
+
"exit-hook": "^4.0.0",
|
|
38025
|
+
hono: "^4.8.10",
|
|
38026
|
+
jmespath: "^0.16.0",
|
|
38027
|
+
keytar: "^7.9.0",
|
|
38028
|
+
nanoid: "^5.0.9",
|
|
38029
|
+
"ts-pattern": "^5.7.1",
|
|
38030
|
+
zod: "^4.1.5"
|
|
38031
|
+
},
|
|
38032
|
+
devDependencies: {
|
|
38033
|
+
"@types/jmespath": "^0.15.2",
|
|
38034
|
+
"@types/node": "^20.11.24",
|
|
38035
|
+
"@vitest/coverage-v8": "^2.0.0",
|
|
38036
|
+
"clean-package": "^2.2.0",
|
|
38037
|
+
"drizzle-kit": "^0.31.4",
|
|
38038
|
+
typescript: "^5.9.2",
|
|
38039
|
+
vitest: "^3.1.4"
|
|
38040
|
+
},
|
|
38041
|
+
engines: {
|
|
38042
|
+
node: ">=22.0.0"
|
|
38043
|
+
},
|
|
38044
|
+
publishConfig: {
|
|
38045
|
+
access: "restricted",
|
|
38046
|
+
registry: "https://registry.npmjs.org/"
|
|
38047
|
+
},
|
|
38048
|
+
files: [
|
|
38049
|
+
"dist",
|
|
38050
|
+
"README.md",
|
|
38051
|
+
"LICENSE.md"
|
|
38052
|
+
],
|
|
38053
|
+
repository: {
|
|
38054
|
+
type: "git",
|
|
38055
|
+
url: "git+https://github.com/inkeep/agents.git",
|
|
38056
|
+
directory: "packages/agents-core"
|
|
38057
|
+
}
|
|
38058
|
+
};
|
|
38059
|
+
|
|
38060
|
+
// ../packages/agents-core/src/utils/tracer.ts
|
|
38061
|
+
var tracer = getTracer("agents-core", package_default.version);
|
|
38062
|
+
|
|
38011
38063
|
// ../packages/agents-core/src/context/contextCache.ts
|
|
38012
38064
|
init_esm_shims();
|
|
38013
38065
|
var logger5 = getLogger("context-cache");
|
|
38014
38066
|
|
|
38015
38067
|
// ../packages/agents-core/src/context/ContextResolver.ts
|
|
38016
38068
|
var logger6 = getLogger("context-resolver");
|
|
38017
|
-
var tracer = getGlobalTracer();
|
|
38018
38069
|
|
|
38019
38070
|
// ../packages/agents-core/src/middleware/contextValidation.ts
|
|
38020
38071
|
var logger7 = getLogger("context-validation");
|
|
@@ -38026,7 +38077,6 @@ var logger8 = getLogger("context-fetcher");
|
|
|
38026
38077
|
// ../packages/agents-core/src/context/context.ts
|
|
38027
38078
|
init_esm_shims();
|
|
38028
38079
|
var logger9 = getLogger("context");
|
|
38029
|
-
var tracer2 = getGlobalTracer();
|
|
38030
38080
|
|
|
38031
38081
|
// ../packages/agents-core/src/credential-stores/index.ts
|
|
38032
38082
|
init_esm_shims();
|
|
@@ -38141,9 +38191,9 @@ async function pushCommand(graphPath, options) {
|
|
|
38141
38191
|
const graphKey = graphExports[0];
|
|
38142
38192
|
const graph = module[graphKey];
|
|
38143
38193
|
spinner2.text = "Loading configuration...";
|
|
38144
|
-
let
|
|
38194
|
+
let config2;
|
|
38145
38195
|
try {
|
|
38146
|
-
|
|
38196
|
+
config2 = await validateConfiguration(
|
|
38147
38197
|
options.tenantId,
|
|
38148
38198
|
options.agentsManageApiUrl,
|
|
38149
38199
|
void 0,
|
|
@@ -38157,12 +38207,12 @@ async function pushCommand(graphPath, options) {
|
|
|
38157
38207
|
}
|
|
38158
38208
|
spinner2.succeed("Configuration loaded");
|
|
38159
38209
|
console.log(chalk6.gray("Configuration sources:"));
|
|
38160
|
-
console.log(chalk6.gray(` \u2022 Tenant ID: ${
|
|
38161
|
-
console.log(chalk6.gray(` \u2022 Project ID: ${
|
|
38162
|
-
console.log(chalk6.gray(` \u2022 API URL: ${
|
|
38163
|
-
const tenantId =
|
|
38164
|
-
const projectId =
|
|
38165
|
-
const agentsManageApiUrl =
|
|
38210
|
+
console.log(chalk6.gray(` \u2022 Tenant ID: ${config2.sources.tenantId}`));
|
|
38211
|
+
console.log(chalk6.gray(` \u2022 Project ID: ${config2.sources.projectId}`));
|
|
38212
|
+
console.log(chalk6.gray(` \u2022 API URL: ${config2.sources.agentsManageApiUrl}`));
|
|
38213
|
+
const tenantId = config2.tenantId;
|
|
38214
|
+
const projectId = config2.projectId;
|
|
38215
|
+
const agentsManageApiUrl = config2.agentsManageApiUrl;
|
|
38166
38216
|
spinner2.text = "Validating project...";
|
|
38167
38217
|
let dbUrl = process.env.DB_FILE_NAME || "local.db";
|
|
38168
38218
|
if (dbUrl !== ":memory:" && !dbUrl.startsWith("file:") && !dbUrl.startsWith("libsql:") && !dbUrl.startsWith("http")) {
|
|
@@ -38217,7 +38267,7 @@ async function pushCommand(graphPath, options) {
|
|
|
38217
38267
|
default: ""
|
|
38218
38268
|
}
|
|
38219
38269
|
]);
|
|
38220
|
-
let models =
|
|
38270
|
+
let models = config2.modelSettings;
|
|
38221
38271
|
if (!models || !models.base) {
|
|
38222
38272
|
spinner2.stop();
|
|
38223
38273
|
console.log(chalk6.cyan("\nNow let's configure the AI models for this project."));
|
|
@@ -38247,9 +38297,9 @@ async function pushCommand(graphPath, options) {
|
|
|
38247
38297
|
spinner2.succeed(`Project "${existingProject.name || projectId}" validated`);
|
|
38248
38298
|
}
|
|
38249
38299
|
await ManagementApiClient.create(
|
|
38250
|
-
|
|
38300
|
+
config2.agentsManageApiUrl,
|
|
38251
38301
|
options.configFilePath,
|
|
38252
|
-
|
|
38302
|
+
config2.tenantId
|
|
38253
38303
|
);
|
|
38254
38304
|
if (typeof graph.setConfig === "function") {
|
|
38255
38305
|
graph.setConfig(tenantId, projectId, agentsManageApiUrl);
|
|
@@ -38306,7 +38356,7 @@ async function pushCommand(graphPath, options) {
|
|
|
38306
38356
|
console.log(chalk6.gray(` \u2022 Relations: ${stats.relationCount}`));
|
|
38307
38357
|
console.log(chalk6.green("\n\u2728 Next steps:"));
|
|
38308
38358
|
try {
|
|
38309
|
-
const viewGraphUrl = buildGraphViewUrl(
|
|
38359
|
+
const viewGraphUrl = buildGraphViewUrl(config2.manageUiUrl, tenantId, projectId, graphId);
|
|
38310
38360
|
console.log(chalk6.gray(` \u2022 View graph in UI: ${chalk6.cyan(viewGraphUrl)}`));
|
|
38311
38361
|
} catch (error43) {
|
|
38312
38362
|
console.debug("Could not generate UI link:", error43);
|
|
@@ -38335,8 +38385,8 @@ program.name("inkeep").description("CLI tool for Inkeep Agent Framework").versio
|
|
|
38335
38385
|
program.command("create [directory]").description("Create a new Inkeep Agent Framework Starter Directory").option("--tenant-id <tenant-id>", "Tenant ID").option("--project-id <project-id>", "Project ID").option("--openai-key <openai-key>", "OpenAI API key").option("--anthropic-key <anthropic-key>", "Anthropic API key").option("--manage-api-port <port>", "Management API port", "3002").option("--run-api-port <port>", "Run API port", "3003").action(async (directory, options) => {
|
|
38336
38386
|
await createCommand(directory, options);
|
|
38337
38387
|
});
|
|
38338
|
-
program.command("init [path]").description("Initialize a new Inkeep configuration file").option("--no-interactive", "Skip interactive path selection").action(async (
|
|
38339
|
-
await initCommand({ path:
|
|
38388
|
+
program.command("init [path]").description("Initialize a new Inkeep configuration file").option("--no-interactive", "Skip interactive path selection").action(async (path3, options) => {
|
|
38389
|
+
await initCommand({ path: path3, ...options });
|
|
38340
38390
|
});
|
|
38341
38391
|
var configCommand = program.command("config").description("Manage Inkeep configuration");
|
|
38342
38392
|
configCommand.command("get [key]").description("Get configuration value(s)").option("--config-file-path <path>", "Path to configuration file").action(async (key, options) => {
|