@inkeep/agents-cli 0.41.1 → 0.41.2
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/commands/init.js
CHANGED
|
@@ -230,6 +230,10 @@ async function localInitCommand(options) {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
if (existsSync(configPath)) {
|
|
233
|
+
if (options?.interactive === false) {
|
|
234
|
+
console.log(chalk.yellow(`Config file already exists at ${configPath}, skipping creation.`));
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
233
237
|
const overwrite = await p.confirm({
|
|
234
238
|
message: `${basename(configPath)} already exists. Overwrite?`,
|
|
235
239
|
initialValue: false
|
|
@@ -243,46 +247,58 @@ async function localInitCommand(options) {
|
|
|
243
247
|
return;
|
|
244
248
|
}
|
|
245
249
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
+
let tenantId;
|
|
251
|
+
let manageApiUrl;
|
|
252
|
+
let runApiUrl;
|
|
253
|
+
if (options?.interactive === false) {
|
|
254
|
+
tenantId = "default";
|
|
255
|
+
manageApiUrl = "http://localhost:3002";
|
|
256
|
+
runApiUrl = "http://localhost:3003";
|
|
257
|
+
} else {
|
|
258
|
+
const tenantIdInput = await p.text({
|
|
259
|
+
message: "Enter your tenant ID:",
|
|
260
|
+
validate: (input) => {
|
|
261
|
+
if (!input || input.trim() === "") return "Tenant ID is required";
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
if (p.isCancel(tenantIdInput)) {
|
|
265
|
+
p.cancel("Operation cancelled");
|
|
266
|
+
process.exit(0);
|
|
250
267
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (input && input.trim() !== "") {
|
|
259
|
-
new URL(input);
|
|
268
|
+
tenantId = tenantIdInput;
|
|
269
|
+
const validateUrl = (input) => {
|
|
270
|
+
try {
|
|
271
|
+
if (input && input.trim() !== "") {
|
|
272
|
+
new URL(input);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
260
275
|
return;
|
|
276
|
+
} catch {
|
|
277
|
+
return "Please enter a valid URL";
|
|
261
278
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
279
|
+
};
|
|
280
|
+
const manageApiUrlInput = await p.text({
|
|
281
|
+
message: "Enter the Management API URL:",
|
|
282
|
+
placeholder: "http://localhost:3002",
|
|
283
|
+
initialValue: "http://localhost:3002",
|
|
284
|
+
validate: validateUrl
|
|
285
|
+
});
|
|
286
|
+
if (p.isCancel(manageApiUrlInput)) {
|
|
287
|
+
p.cancel("Operation cancelled");
|
|
288
|
+
process.exit(0);
|
|
265
289
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
message: "Enter the Run API URL:",
|
|
279
|
-
placeholder: "http://localhost:3003",
|
|
280
|
-
initialValue: "http://localhost:3003",
|
|
281
|
-
validate: validateUrl
|
|
282
|
-
});
|
|
283
|
-
if (p.isCancel(runApiUrl)) {
|
|
284
|
-
p.cancel("Operation cancelled");
|
|
285
|
-
process.exit(0);
|
|
290
|
+
manageApiUrl = manageApiUrlInput;
|
|
291
|
+
const runApiUrlInput = await p.text({
|
|
292
|
+
message: "Enter the Run API URL:",
|
|
293
|
+
placeholder: "http://localhost:3003",
|
|
294
|
+
initialValue: "http://localhost:3003",
|
|
295
|
+
validate: validateUrl
|
|
296
|
+
});
|
|
297
|
+
if (p.isCancel(runApiUrlInput)) {
|
|
298
|
+
p.cancel("Operation cancelled");
|
|
299
|
+
process.exit(0);
|
|
300
|
+
}
|
|
301
|
+
runApiUrl = runApiUrlInput;
|
|
286
302
|
}
|
|
287
303
|
const configContent = `import { defineConfig } from '@inkeep/agents-cli/config';
|
|
288
304
|
|
|
@@ -299,6 +315,36 @@ export default defineConfig({
|
|
|
299
315
|
try {
|
|
300
316
|
writeFileSync(configPath, configContent);
|
|
301
317
|
console.log(chalk.green("✓"), `Created ${chalk.cyan(configPath)}`);
|
|
318
|
+
try {
|
|
319
|
+
const profileManager = new ProfileManager();
|
|
320
|
+
const localProfile = {
|
|
321
|
+
remote: {
|
|
322
|
+
manageApi: manageApiUrl,
|
|
323
|
+
manageUi: "http://localhost:3001",
|
|
324
|
+
runApi: runApiUrl
|
|
325
|
+
},
|
|
326
|
+
credential: "none",
|
|
327
|
+
environment: "development"
|
|
328
|
+
};
|
|
329
|
+
if (profileManager.profilesFileExists()) if (profileManager.loadProfiles().profiles.local) {
|
|
330
|
+
profileManager.setActiveProfile("local");
|
|
331
|
+
console.log(chalk.green("✓"), "Set local profile as active");
|
|
332
|
+
} else {
|
|
333
|
+
profileManager.addProfile("local", localProfile);
|
|
334
|
+
profileManager.setActiveProfile("local");
|
|
335
|
+
console.log(chalk.green("✓"), "Created and activated local profile");
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
const profilesConfig = {
|
|
339
|
+
activeProfile: "local",
|
|
340
|
+
profiles: { local: localProfile }
|
|
341
|
+
};
|
|
342
|
+
profileManager.saveProfiles(profilesConfig);
|
|
343
|
+
console.log(chalk.green("✓"), "Created local profile");
|
|
344
|
+
}
|
|
345
|
+
} catch (profileError) {
|
|
346
|
+
console.log(chalk.yellow("⚠"), "Could not set up local profile:", profileError instanceof Error ? profileError.message : String(profileError));
|
|
347
|
+
}
|
|
302
348
|
console.log(chalk.gray("\nYou can now use the Inkeep CLI commands."));
|
|
303
349
|
const configDir = dirname(configPath);
|
|
304
350
|
if (configDir !== process.cwd()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_PROFILES_CONFIG, explicitRemoteSchema, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema } from "./types.js";
|
|
1
|
+
import { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_LOCAL_PROFILE, DEFAULT_PROFILES_CONFIG, LOCAL_REMOTE, explicitRemoteSchema, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema } from "./types.js";
|
|
2
2
|
import { ProfileError, ProfileManager, profileManager } from "./profile-manager.js";
|
|
3
3
|
|
|
4
|
-
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_PROFILES_CONFIG, ProfileError, ProfileManager, explicitRemoteSchema, profileManager, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema };
|
|
4
|
+
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_LOCAL_PROFILE, DEFAULT_PROFILES_CONFIG, LOCAL_REMOTE, ProfileError, ProfileManager, explicitRemoteSchema, profileManager, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema };
|
|
@@ -57,6 +57,23 @@ const DEFAULT_PROFILES_CONFIG = {
|
|
|
57
57
|
activeProfile: "cloud",
|
|
58
58
|
profiles: { cloud: DEFAULT_CLOUD_PROFILE }
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Baked-in URLs for local development deployment
|
|
62
|
+
*/
|
|
63
|
+
const LOCAL_REMOTE = {
|
|
64
|
+
manageApi: "http://localhost:3002",
|
|
65
|
+
manageUi: "http://localhost:3001",
|
|
66
|
+
runApi: "http://localhost:3003"
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Default local profile configuration
|
|
70
|
+
* Note: credential is 'none' as local deployments typically don't require auth
|
|
71
|
+
*/
|
|
72
|
+
const DEFAULT_LOCAL_PROFILE = {
|
|
73
|
+
remote: LOCAL_REMOTE,
|
|
74
|
+
credential: "none",
|
|
75
|
+
environment: "development"
|
|
76
|
+
};
|
|
60
77
|
|
|
61
78
|
//#endregion
|
|
62
|
-
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_PROFILES_CONFIG, explicitRemoteSchema, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema };
|
|
79
|
+
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_LOCAL_PROFILE, DEFAULT_PROFILES_CONFIG, LOCAL_REMOTE, explicitRemoteSchema, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.2",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"ts-morph": "^26.0.0",
|
|
41
41
|
"tsx": "^4.20.5",
|
|
42
42
|
"yaml": "^2.7.0",
|
|
43
|
-
"@inkeep/agents-core": "^0.41.
|
|
44
|
-
"@inkeep/agents-sdk": "^0.41.
|
|
43
|
+
"@inkeep/agents-core": "^0.41.2",
|
|
44
|
+
"@inkeep/agents-sdk": "^0.41.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/degit": "^2.8.6",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"build": "tsdown",
|
|
77
77
|
"cli": "node ./dist/index.js",
|
|
78
78
|
"postinstall": "node scripts/ensure-keytar.mjs || true",
|
|
79
|
-
"dev": "
|
|
79
|
+
"dev": "pnpm build --watch",
|
|
80
80
|
"test": "node -e \"process.exit(process.env.CI ? 0 : 1)\" && vitest --run --config vitest.config.ci.ts || vitest --run",
|
|
81
81
|
"test:debug": "vitest --run --reporter=verbose --no-coverage",
|
|
82
82
|
"test:watch": "vitest",
|