@inkeep/agents-cli 0.41.2 → 0.43.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.
- package/README.md +13 -20
- package/dist/api.js +8 -8
- package/dist/commands/init.js +19 -39
- package/dist/commands/list-agents.js +1 -1
- package/dist/commands/login.js +4 -4
- package/dist/commands/profile.js +7 -26
- package/dist/commands/pull-v3/component-parser.js +0 -2
- package/dist/commands/pull-v3/component-updater.js +122 -64
- package/dist/commands/pull-v3/components/agent-generator.js +17 -3
- package/dist/commands/pull-v3/components/artifact-component-generator.js +7 -7
- package/dist/commands/pull-v3/components/context-config-generator.js +6 -6
- package/dist/commands/pull-v3/components/credential-generator.js +4 -4
- package/dist/commands/pull-v3/components/data-component-generator.js +4 -4
- package/dist/commands/pull-v3/components/environment-generator.js +10 -7
- package/dist/commands/pull-v3/components/function-tool-generator.js +5 -7
- package/dist/commands/pull-v3/components/mcp-tool-generator.js +5 -5
- package/dist/commands/pull-v3/components/project-generator.js +4 -4
- package/dist/commands/pull-v3/components/status-component-generator.js +6 -6
- package/dist/commands/pull-v3/components/trigger-generator.js +185 -0
- package/dist/commands/pull-v3/index.js +25 -30
- package/dist/commands/pull-v3/introspect-generator.js +15 -7
- package/dist/commands/pull-v3/llm-content-merger.js +1 -1
- package/dist/commands/pull-v3/new-component-generator.js +5 -16
- package/dist/commands/pull-v3/project-comparator.js +49 -49
- package/dist/commands/pull-v3/project-validator.js +5 -4
- package/dist/commands/pull-v3/targeted-typescript-placeholders.js +2 -2
- package/dist/commands/pull-v3/utils/component-registry.js +9 -7
- package/dist/commands/pull-v3/utils/component-tracker.js +1 -1
- package/dist/commands/pull-v3/utils/generator-utils.js +2 -2
- package/dist/commands/push.js +9 -9
- package/dist/commands/status.js +4 -8
- package/dist/index.js +2 -2
- package/dist/utils/ci-environment.js +4 -6
- package/dist/utils/cli-pipeline.js +8 -12
- package/dist/utils/config.js +17 -25
- package/dist/utils/json-comparison.js +3 -3
- package/dist/utils/profile-config.js +4 -6
- package/dist/utils/profiles/profile-manager.js +1 -1
- package/dist/utils/profiles/types.js +6 -9
- package/dist/utils/templates.js +3 -5
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -47,13 +47,13 @@ configCommand.command("set <key> <value>").description("Set a configuration valu
|
|
|
47
47
|
configCommand.command("list").description("List all configuration values").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
|
|
48
48
|
await configListCommand({ config: options.config || options.configFilePath });
|
|
49
49
|
});
|
|
50
|
-
program.command("push").description("Push a project configuration to the backend").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--profile <name>", "Profile to use for remote URLs and authentication").option("--tenant-id <id>", "Override tenant ID").option("--agents-
|
|
50
|
+
program.command("push").description("Push a project configuration to the backend").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--profile <name>", "Profile to use for remote URLs and authentication").option("--tenant-id <id>", "Override tenant ID").option("--agents-api-url <url>", "Override agents API URL").option("--env <environment>", "Environment to use for credential resolution (e.g., development, production)").option("--json", "Generate project data JSON file instead of pushing to backend").option("--all", "Push all projects found in current directory tree").option("--tag <tag>", "Use tagged config file (e.g., --tag prod loads prod.__inkeep.config.ts__)").option("--quiet", "Suppress profile/config logging").action(async (options) => {
|
|
51
51
|
await pushCommand(options);
|
|
52
52
|
});
|
|
53
53
|
program.command("pull").description("Pull project configuration with clean, efficient code generation").option("--project <project-id>", "Project ID to pull (or path to project directory). If in project directory, validates against local project ID.").option("--config <path>", "Path to configuration file").option("--profile <name>", "Profile to use for remote URLs and authentication").option("--env <environment>", "Environment file to generate (development, staging, production). Defaults to development").option("--json", "Output project data as JSON instead of generating files").option("--debug", "Enable debug logging").option("--verbose", "Enable verbose logging").option("--force", "Force regeneration even if no changes detected").option("--introspect", "Completely regenerate all files from scratch (no comparison needed)").option("--all", "Pull all projects for current tenant").option("--tag <tag>", "Use tagged config file (e.g., --tag prod loads prod.__inkeep.config.ts__)").option("--quiet", "Suppress profile/config logging").action(async (options) => {
|
|
54
54
|
await pullV3Command(options);
|
|
55
55
|
});
|
|
56
|
-
program.command("list-agent").description("List all available agents for a specific project").requiredOption("--project <project-id>", "Project ID to list agent for").option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-
|
|
56
|
+
program.command("list-agent").description("List all available agents for a specific project").requiredOption("--project <project-id>", "Project ID to list agent for").option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-api-url <url>", "Agents API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
|
|
57
57
|
const config = options.config || options.configFilePath;
|
|
58
58
|
await listAgentsCommand({
|
|
59
59
|
...options,
|
|
@@ -47,23 +47,21 @@ async function detectCIEnvironment() {
|
|
|
47
47
|
}
|
|
48
48
|
function loadCIEnvironmentConfig() {
|
|
49
49
|
const apiKey = process.env.INKEEP_API_KEY;
|
|
50
|
-
const
|
|
51
|
-
const runApiUrl = process.env.INKEEP_RUN_API_URL;
|
|
50
|
+
const agentsApiUrl = process.env.INKEEP_AGENTS_API_URL;
|
|
52
51
|
const environment = process.env.INKEEP_ENVIRONMENT || "production";
|
|
53
52
|
const tenantId = process.env.INKEEP_TENANT_ID;
|
|
54
53
|
if (!apiKey) return null;
|
|
55
54
|
return {
|
|
56
55
|
isCI: true,
|
|
57
56
|
apiKey,
|
|
58
|
-
|
|
59
|
-
runApiUrl: runApiUrl || "https://run-api.inkeep.com",
|
|
57
|
+
agentsApiUrl: agentsApiUrl || "https://agents-api.inkeep.com",
|
|
60
58
|
environment,
|
|
61
59
|
tenantId
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
62
|
function logCIConfig(config, reason) {
|
|
65
63
|
console.log(chalk.yellow(`CI mode detected (${reason})`));
|
|
66
|
-
console.log(chalk.gray(` Remote: ${config.
|
|
64
|
+
console.log(chalk.gray(` Remote: ${config.agentsApiUrl}`));
|
|
67
65
|
console.log(chalk.gray(` Environment: ${config.environment}`));
|
|
68
66
|
console.log(chalk.gray(` Auth: API key (INKEEP_API_KEY)`));
|
|
69
67
|
if (config.tenantId) console.log(chalk.gray(` Tenant: ${config.tenantId}`));
|
|
@@ -71,7 +69,7 @@ function logCIConfig(config, reason) {
|
|
|
71
69
|
function getAuthHeaders(config, isCI = false) {
|
|
72
70
|
const headers = {};
|
|
73
71
|
if (isCI && config.apiKey) headers["X-API-Key"] = config.apiKey;
|
|
74
|
-
else if (config.accessToken) headers
|
|
72
|
+
else if (config.accessToken) headers.Authorization = `Bearer ${config.accessToken}`;
|
|
75
73
|
return headers;
|
|
76
74
|
}
|
|
77
75
|
function validateCIConfig(config) {
|
|
@@ -45,9 +45,8 @@ async function initializeCommand(options = {}) {
|
|
|
45
45
|
if (ciDetection.isCI) {
|
|
46
46
|
const config$1 = await validateConfiguration(configPath, tag);
|
|
47
47
|
if (ciConfig) {
|
|
48
|
-
if (ciConfig.
|
|
49
|
-
if (ciConfig.
|
|
50
|
-
if (ciConfig.apiKey) config$1.agentsManageApiKey = ciConfig.apiKey;
|
|
48
|
+
if (ciConfig.agentsApiUrl) config$1.agentsApiUrl = ciConfig.agentsApiUrl;
|
|
49
|
+
if (ciConfig.apiKey) config$1.agentsApiKey = ciConfig.apiKey;
|
|
51
50
|
if (ciConfig.tenantId) config$1.tenantId = ciConfig.tenantId;
|
|
52
51
|
}
|
|
53
52
|
if (s) s.stop("Configuration loaded");
|
|
@@ -55,7 +54,7 @@ async function initializeCommand(options = {}) {
|
|
|
55
54
|
else {
|
|
56
55
|
console.log(chalk.yellow(`CI mode detected (${ciDetection.reason})`));
|
|
57
56
|
console.log(chalk.gray(` Using config file settings (no INKEEP_API_KEY set)`));
|
|
58
|
-
console.log(chalk.gray(` Remote: ${config$1.
|
|
57
|
+
console.log(chalk.gray(` Remote: ${config$1.agentsApiUrl}`));
|
|
59
58
|
}
|
|
60
59
|
return {
|
|
61
60
|
config: config$1,
|
|
@@ -91,10 +90,9 @@ async function initializeCommand(options = {}) {
|
|
|
91
90
|
} catch {}
|
|
92
91
|
const config = await validateConfiguration(configPath, tag);
|
|
93
92
|
if (profile) {
|
|
94
|
-
config.
|
|
95
|
-
config.agentsRunApiUrl = profile.remote.runApi;
|
|
93
|
+
config.agentsApiUrl = profile.remote.api;
|
|
96
94
|
config.manageUiUrl = profile.remote.manageUi;
|
|
97
|
-
if (profileAccessToken) config.
|
|
95
|
+
if (profileAccessToken) config.agentsApiKey = profileAccessToken;
|
|
98
96
|
if (profileOrganizationId) config.tenantId = profileOrganizationId;
|
|
99
97
|
}
|
|
100
98
|
if (s) s.stop("Configuration loaded");
|
|
@@ -102,14 +100,13 @@ async function initializeCommand(options = {}) {
|
|
|
102
100
|
const expiryText = authExpiry ? ` (expires in ${authExpiry})` : "";
|
|
103
101
|
const authStatus = isAuthenticated ? chalk.green("authenticated") + expiryText : chalk.yellow("not authenticated");
|
|
104
102
|
console.log(chalk.gray(`Using profile: ${chalk.cyan(profile.name)}`));
|
|
105
|
-
console.log(chalk.gray(` Remote: ${config.
|
|
103
|
+
console.log(chalk.gray(` Remote: ${config.agentsApiUrl}`));
|
|
106
104
|
console.log(chalk.gray(` Environment: ${profile.environment}`));
|
|
107
105
|
console.log(chalk.gray(` Auth: ${authStatus}`));
|
|
108
106
|
} else {
|
|
109
107
|
console.log(chalk.gray("Configuration:"));
|
|
110
108
|
console.log(chalk.gray(` • Tenant ID: ${config.tenantId}`));
|
|
111
|
-
console.log(chalk.gray(` •
|
|
112
|
-
console.log(chalk.gray(` • Run API URL: ${config.agentsRunApiUrl}`));
|
|
109
|
+
console.log(chalk.gray(` • Agents API URL: ${config.agentsApiUrl}`));
|
|
113
110
|
if (config.sources.configFile) console.log(chalk.gray(` • Config file: ${config.sources.configFile}`));
|
|
114
111
|
}
|
|
115
112
|
return {
|
|
@@ -130,8 +127,7 @@ async function initializeCommand(options = {}) {
|
|
|
130
127
|
else if (error.message.includes("tenantId") || error.message.includes("API URL")) {
|
|
131
128
|
console.log(chalk.yellow("\nHint: Ensure your inkeep.config.ts has all required fields:"));
|
|
132
129
|
console.log(chalk.gray(" - tenantId"));
|
|
133
|
-
console.log(chalk.gray(" -
|
|
134
|
-
console.log(chalk.gray(" - agentsRunApiUrl (or agentsRunApi.url)"));
|
|
130
|
+
console.log(chalk.gray(" - agentsApiUrl (or agentsApi.url)"));
|
|
135
131
|
}
|
|
136
132
|
process.exit(1);
|
|
137
133
|
}
|
package/dist/utils/config.js
CHANGED
|
@@ -13,15 +13,14 @@ const logger = getLogger("config");
|
|
|
13
13
|
function maskSensitiveConfig(config) {
|
|
14
14
|
if (!config) return config;
|
|
15
15
|
const masked = { ...config };
|
|
16
|
-
if (masked.
|
|
17
|
-
if (masked.agentsRunApiKey) masked.agentsRunApiKey = `***${masked.agentsRunApiKey.slice(-4)}`;
|
|
16
|
+
if (masked.agentsApiKey) masked.agentsApiKey = `***${masked.agentsApiKey.slice(-4)}`;
|
|
18
17
|
return masked;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Type guard to check if config uses nested format
|
|
22
21
|
*/
|
|
23
22
|
function isNestedConfig(config) {
|
|
24
|
-
return config &&
|
|
23
|
+
return config && config.agentsApi !== void 0;
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
26
|
* Normalize config from either flat or nested format to internal format
|
|
@@ -29,17 +28,14 @@ function isNestedConfig(config) {
|
|
|
29
28
|
function normalizeConfig(config) {
|
|
30
29
|
if (isNestedConfig(config)) return {
|
|
31
30
|
tenantId: config.tenantId,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
agentsManageApiKey: config.agentsManageApi?.apiKey,
|
|
35
|
-
agentsRunApiKey: config.agentsRunApi?.apiKey,
|
|
31
|
+
agentsApiUrl: config.agentsApi?.url,
|
|
32
|
+
agentsApiKey: config.agentsApi?.apiKey,
|
|
36
33
|
manageUiUrl: config.manageUiUrl,
|
|
37
34
|
outputDirectory: config.outputDirectory
|
|
38
35
|
};
|
|
39
36
|
return {
|
|
40
37
|
tenantId: config.tenantId,
|
|
41
|
-
|
|
42
|
-
agentsRunApiUrl: config.agentsRunApiUrl,
|
|
38
|
+
agentsApiUrl: config.agentsApiUrl,
|
|
43
39
|
manageUiUrl: config.manageUiUrl,
|
|
44
40
|
outputDirectory: config.outputDirectory
|
|
45
41
|
};
|
|
@@ -205,8 +201,7 @@ async function loadConfigFromFile(configPath, tag) {
|
|
|
205
201
|
*/
|
|
206
202
|
async function loadConfig(configPath, tag) {
|
|
207
203
|
const config = {
|
|
208
|
-
|
|
209
|
-
agentsRunApiUrl: "http://localhost:3003",
|
|
204
|
+
agentsApiUrl: "http://localhost:3002",
|
|
210
205
|
manageUiUrl: "http://localhost:3000"
|
|
211
206
|
};
|
|
212
207
|
const fileConfig = await loadConfigFromFile(configPath, tag);
|
|
@@ -226,7 +221,7 @@ async function loadConfig(configPath, tag) {
|
|
|
226
221
|
* Configuration priority:
|
|
227
222
|
* 1. Config file (inkeep.config.ts or --config path/to/config.ts)
|
|
228
223
|
* 2. CLI credentials (from `inkeep login`) - for API key and tenant ID fallback
|
|
229
|
-
* 3. Default values (http://localhost:3002
|
|
224
|
+
* 3. Default values (http://localhost:3002)
|
|
230
225
|
*
|
|
231
226
|
* Note: API URLs and keys are loaded ONLY from the config file, NOT from environment
|
|
232
227
|
* variables or CLI flags. This ensures explicit control over where the CLI connects.
|
|
@@ -236,15 +231,15 @@ async function loadConfig(configPath, tag) {
|
|
|
236
231
|
*
|
|
237
232
|
* @param configPath - explicit path to config file (from --config parameter)
|
|
238
233
|
* @param tag - optional tag for environment-specific config (e.g., 'prod', 'staging')
|
|
239
|
-
* @returns configuration with tenantId,
|
|
234
|
+
* @returns configuration with tenantId, agentsApiUrl, and source info
|
|
240
235
|
*/
|
|
241
236
|
async function validateConfiguration(configPath, tag) {
|
|
242
237
|
const config = await loadConfig(configPath, tag);
|
|
243
238
|
const actualConfigFile = configPath || findConfigFile(process.cwd(), tag);
|
|
244
239
|
let cliCredentials = null;
|
|
245
|
-
try {
|
|
240
|
+
if (!(process.env.CI === "true" || process.env.CI === "1" || !!process.env.GITHUB_ACTIONS)) try {
|
|
246
241
|
const credentials = await loadCredentials();
|
|
247
|
-
if (credentials
|
|
242
|
+
if (credentials?.accessToken && credentials.organizationId) {
|
|
248
243
|
cliCredentials = {
|
|
249
244
|
accessToken: credentials.accessToken,
|
|
250
245
|
organizationId: credentials.organizationId
|
|
@@ -254,8 +249,9 @@ async function validateConfiguration(configPath, tag) {
|
|
|
254
249
|
} catch {
|
|
255
250
|
logger.debug({}, "Could not load CLI credentials");
|
|
256
251
|
}
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
else logger.debug({}, "Skipping keychain credential loading in CI environment");
|
|
253
|
+
if (!config.agentsApiKey && cliCredentials) {
|
|
254
|
+
config.agentsApiKey = cliCredentials.accessToken;
|
|
259
255
|
logger.info({}, "Using CLI session token as API key");
|
|
260
256
|
}
|
|
261
257
|
if (!config.tenantId && cliCredentials) {
|
|
@@ -267,20 +263,16 @@ async function validateConfiguration(configPath, tag) {
|
|
|
267
263
|
or run "inkeep login" to authenticate with Inkeep Cloud.`);
|
|
268
264
|
throw new Error("No configuration found. Please:\n 1. Run \"inkeep login\" to authenticate with Inkeep Cloud\n 2. Or create \"inkeep.config.ts\" by running \"inkeep init\"\n 3. Or provide --config to specify a config file path");
|
|
269
265
|
}
|
|
270
|
-
if (!config.
|
|
271
|
-
if (!config.agentsRunApiUrl) throw new Error(`Agents Run API URL is missing from config file${actualConfigFile ? `: ${actualConfigFile}` : ""}\nPlease add agentsRunApiUrl to your configuration file`);
|
|
266
|
+
if (!config.agentsApiUrl) throw new Error(`Agents API URL is missing from config file${actualConfigFile ? `: ${actualConfigFile}` : ""}\nPlease add agentsApiUrl to your configuration file`);
|
|
272
267
|
const sources = {
|
|
273
268
|
tenantId: cliCredentials && !actualConfigFile ? "CLI login (organization ID)" : actualConfigFile ? `config file (${actualConfigFile})` : "default",
|
|
274
|
-
|
|
275
|
-
agentsRunApiUrl: actualConfigFile ? `config file (${actualConfigFile})` : "default value"
|
|
269
|
+
agentsApiUrl: actualConfigFile ? `config file (${actualConfigFile})` : "default value"
|
|
276
270
|
};
|
|
277
271
|
if (actualConfigFile) sources.configFile = actualConfigFile;
|
|
278
272
|
return {
|
|
279
273
|
tenantId: config.tenantId,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
agentsManageApiKey: config.agentsManageApiKey,
|
|
283
|
-
agentsRunApiKey: config.agentsRunApiKey,
|
|
274
|
+
agentsApiUrl: config.agentsApiUrl,
|
|
275
|
+
agentsApiKey: config.agentsApiKey,
|
|
284
276
|
manageUiUrl: config.manageUiUrl,
|
|
285
277
|
sources
|
|
286
278
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
|
|
3
1
|
//#region src/utils/json-comparison.ts
|
|
4
2
|
/**
|
|
5
3
|
* Deep compare two FullProjectDefinition objects
|
|
@@ -86,7 +84,9 @@ function compareProjectDefinitions(original, generated) {
|
|
|
86
84
|
const filterIgnoredFields = (item) => {
|
|
87
85
|
if (typeof item === "object" && item !== null) {
|
|
88
86
|
const filtered = { ...item };
|
|
89
|
-
allIgnoredFields$1.forEach((field) =>
|
|
87
|
+
allIgnoredFields$1.forEach((field) => {
|
|
88
|
+
delete filtered[field];
|
|
89
|
+
});
|
|
90
90
|
return JSON.stringify(filtered);
|
|
91
91
|
}
|
|
92
92
|
return item;
|
|
@@ -28,8 +28,7 @@ async function resolveProfileConfig(options = {}) {
|
|
|
28
28
|
} catch {
|
|
29
29
|
return {
|
|
30
30
|
profileName: "default",
|
|
31
|
-
|
|
32
|
-
agentsRunApiUrl: "http://localhost:3003",
|
|
31
|
+
agentsApiUrl: "http://localhost:3002",
|
|
33
32
|
manageUiUrl: "http://localhost:3000",
|
|
34
33
|
environment: "development",
|
|
35
34
|
credentialKey: "auth-credentials",
|
|
@@ -55,8 +54,7 @@ async function resolveProfileConfig(options = {}) {
|
|
|
55
54
|
return {
|
|
56
55
|
profileName,
|
|
57
56
|
tenantId: credentials?.organizationId,
|
|
58
|
-
|
|
59
|
-
agentsRunApiUrl: profile.remote.runApi,
|
|
57
|
+
agentsApiUrl: profile.remote.api,
|
|
60
58
|
manageUiUrl: profile.remote.manageUi,
|
|
61
59
|
environment: profile.environment,
|
|
62
60
|
credentialKey: profile.credential,
|
|
@@ -68,7 +66,7 @@ async function resolveProfileConfig(options = {}) {
|
|
|
68
66
|
function logProfileConfig(config, quiet = false) {
|
|
69
67
|
if (quiet) return;
|
|
70
68
|
console.log(chalk.gray(`Using profile: ${chalk.cyan(config.profileName)}`));
|
|
71
|
-
console.log(chalk.gray(` Remote: ${config.
|
|
69
|
+
console.log(chalk.gray(` Remote: ${config.agentsApiUrl}`));
|
|
72
70
|
console.log(chalk.gray(` Environment: ${config.environment}`));
|
|
73
71
|
if (config.isAuthenticated) {
|
|
74
72
|
const expiryText = config.authExpiry ? ` (expires in ${config.authExpiry})` : "";
|
|
@@ -77,7 +75,7 @@ function logProfileConfig(config, quiet = false) {
|
|
|
77
75
|
}
|
|
78
76
|
function getAuthHeaders(config) {
|
|
79
77
|
const headers = {};
|
|
80
|
-
if (config.accessToken) headers
|
|
78
|
+
if (config.accessToken) headers.Authorization = `Bearer ${config.accessToken}`;
|
|
81
79
|
return headers;
|
|
82
80
|
}
|
|
83
81
|
|
|
@@ -2,7 +2,7 @@ import { __require } from "../../_virtual/rolldown_runtime.js";
|
|
|
2
2
|
import { CLOUD_REMOTE, DEFAULT_PROFILES_CONFIG, profileNameSchema, profilesConfigSchema } from "./types.js";
|
|
3
3
|
import { getLogger } from "@inkeep/agents-core";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
5
|
-
import {
|
|
5
|
+
import { join } from "node:path";
|
|
6
6
|
import { homedir, tmpdir } from "node:os";
|
|
7
7
|
import * as yaml from "yaml";
|
|
8
8
|
|
|
@@ -5,17 +5,15 @@ import { z } from "zod";
|
|
|
5
5
|
* Baked-in URLs for Inkeep Cloud deployment
|
|
6
6
|
*/
|
|
7
7
|
const CLOUD_REMOTE = {
|
|
8
|
-
|
|
9
|
-
manageUi: "https://manage.inkeep.com"
|
|
10
|
-
runApi: "https://run-api.inkeep.com"
|
|
8
|
+
api: "https://agents-api.inkeep.com",
|
|
9
|
+
manageUi: "https://manage.inkeep.com"
|
|
11
10
|
};
|
|
12
11
|
/**
|
|
13
12
|
* Schema for explicit remote URLs (custom/local deployments)
|
|
14
13
|
*/
|
|
15
14
|
const explicitRemoteSchema = z.object({
|
|
16
|
-
|
|
17
|
-
manageUi: z.string().url("manageUi must be a valid URL")
|
|
18
|
-
runApi: z.string().url("runApi must be a valid URL")
|
|
15
|
+
api: z.string().url("api must be a valid URL"),
|
|
16
|
+
manageUi: z.string().url("manageUi must be a valid URL")
|
|
19
17
|
});
|
|
20
18
|
/**
|
|
21
19
|
* Schema for remote configuration - either 'cloud' shorthand or explicit URLs
|
|
@@ -61,9 +59,8 @@ const DEFAULT_PROFILES_CONFIG = {
|
|
|
61
59
|
* Baked-in URLs for local development deployment
|
|
62
60
|
*/
|
|
63
61
|
const LOCAL_REMOTE = {
|
|
64
|
-
|
|
65
|
-
manageUi: "http://localhost:3001"
|
|
66
|
-
runApi: "http://localhost:3003"
|
|
62
|
+
api: "http://localhost:3002",
|
|
63
|
+
manageUi: "http://localhost:3001"
|
|
67
64
|
};
|
|
68
65
|
/**
|
|
69
66
|
* Default local profile configuration
|
package/dist/utils/templates.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { getLogger } from "@inkeep/agents-core";
|
|
2
1
|
import path from "node:path";
|
|
3
2
|
import fs from "fs-extra";
|
|
4
3
|
import degit from "degit";
|
|
5
4
|
|
|
6
5
|
//#region src/utils/templates.ts
|
|
7
|
-
getLogger("templates");
|
|
8
6
|
async function cloneTemplate(templatePath, targetPath, replacements) {
|
|
9
7
|
await fs.mkdir(targetPath, { recursive: true });
|
|
10
8
|
const emitter = degit(templatePath.replace("https://github.com/", ""));
|
|
11
9
|
try {
|
|
12
10
|
await emitter.clone(targetPath);
|
|
13
11
|
if (replacements && replacements.length > 0) await replaceContentInFiles(targetPath, replacements);
|
|
14
|
-
} catch (
|
|
15
|
-
console.log(`❌ Error cloning template: ${
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.log(`❌ Error cloning template: ${error}`);
|
|
16
14
|
process.exit(1);
|
|
17
15
|
}
|
|
18
16
|
}
|
|
@@ -23,7 +21,7 @@ async function cloneTemplateLocal(templatePath, targetPath, replacements) {
|
|
|
23
21
|
overwrite: true,
|
|
24
22
|
errorOnExist: false
|
|
25
23
|
});
|
|
26
|
-
if (replacements
|
|
24
|
+
if (replacements?.length) await replaceContentInFiles(targetPath, replacements);
|
|
27
25
|
} catch (error) {
|
|
28
26
|
console.error(`Failed to clone template from ${templatePath}:`, error);
|
|
29
27
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,27 +34,25 @@
|
|
|
34
34
|
"find-up": "^7.0.0",
|
|
35
35
|
"fs-extra": "^11.2.0",
|
|
36
36
|
"json-schema-to-zod": "^2.6.1",
|
|
37
|
-
"keytar": "^7.9.0",
|
|
38
37
|
"langfuse-vercel": "^3.38.6",
|
|
39
38
|
"open": "^10.2.0",
|
|
40
39
|
"ts-morph": "^26.0.0",
|
|
41
40
|
"tsx": "^4.20.5",
|
|
42
41
|
"yaml": "^2.7.0",
|
|
43
|
-
"
|
|
44
|
-
"@inkeep/agents-
|
|
42
|
+
"zod": "^4.1.11",
|
|
43
|
+
"@inkeep/agents-core": "^0.43.0",
|
|
44
|
+
"@inkeep/agents-sdk": "^0.43.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/degit": "^2.8.6",
|
|
48
48
|
"@types/fs-extra": "^11.0.4",
|
|
49
49
|
"@types/node": "^20.10.0",
|
|
50
50
|
"@vitest/coverage-v8": "^3.2.4",
|
|
51
|
-
"tsdown": "^0.18.0",
|
|
52
51
|
"typescript": "^5.9.2",
|
|
53
52
|
"vitest": "^3.2.4"
|
|
54
53
|
},
|
|
55
54
|
"peerDependencies": {
|
|
56
|
-
"@inkeep/agents-manage-ui": "*"
|
|
57
|
-
"zod": "^4.1.11"
|
|
55
|
+
"@inkeep/agents-manage-ui": "*"
|
|
58
56
|
},
|
|
59
57
|
"publishConfig": {
|
|
60
58
|
"access": "public",
|
|
@@ -73,9 +71,10 @@
|
|
|
73
71
|
},
|
|
74
72
|
"scripts": {
|
|
75
73
|
"knip": "knip --directory .. --workspace agents-cli --dependencies",
|
|
74
|
+
"lint": "biome lint --error-on-warnings",
|
|
75
|
+
"lint:fix": "biome check --write",
|
|
76
76
|
"build": "tsdown",
|
|
77
77
|
"cli": "node ./dist/index.js",
|
|
78
|
-
"postinstall": "node scripts/ensure-keytar.mjs || true",
|
|
79
78
|
"dev": "pnpm build --watch",
|
|
80
79
|
"test": "node -e \"process.exit(process.env.CI ? 0 : 1)\" && vitest --run --config vitest.config.ci.ts || vitest --run",
|
|
81
80
|
"test:debug": "vitest --run --reporter=verbose --no-coverage",
|