@inkeep/agents-cli 0.48.2 → 0.48.3
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/config.js +3 -1
- package/dist/commands/init.js +5 -5
- package/dist/commands/profile.js +54 -34
- package/dist/utils/cli-pipeline.js +1 -1
- package/dist/utils/config.js +4 -2
- package/dist/utils/profile-config.js +3 -2
- package/dist/utils/profiles/index.js +2 -2
- package/dist/utils/profiles/types.js +1 -10
- package/package.json +3 -3
package/dist/commands/config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LOCAL_REMOTE } from "../utils/profiles/types.js";
|
|
2
|
+
import "../utils/profiles/index.js";
|
|
1
3
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
4
|
import { join } from "node:path";
|
|
3
5
|
import chalk from "chalk";
|
|
@@ -55,7 +57,7 @@ async function configSetCommand(key, value, options) {
|
|
|
55
57
|
|
|
56
58
|
export default defineConfig({
|
|
57
59
|
tenantId: '${key === "tenantId" ? value : ""}',
|
|
58
|
-
apiUrl: '${key === "apiUrl" ? value :
|
|
60
|
+
apiUrl: '${key === "apiUrl" ? value : LOCAL_REMOTE.api}',
|
|
59
61
|
});
|
|
60
62
|
`;
|
|
61
63
|
try {
|
package/dist/commands/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { checkKeychainAvailability, loadCredentials } from "../utils/credentials.js";
|
|
2
|
-
import { DEFAULT_PROFILES_CONFIG } from "../utils/profiles/types.js";
|
|
2
|
+
import { DEFAULT_PROFILES_CONFIG, LOCAL_REMOTE } from "../utils/profiles/types.js";
|
|
3
3
|
import { ProfileManager } from "../utils/profiles/profile-manager.js";
|
|
4
4
|
import "../utils/profiles/index.js";
|
|
5
5
|
import { loginCommand } from "./login.js";
|
|
@@ -251,7 +251,7 @@ async function localInitCommand(options) {
|
|
|
251
251
|
let apiUrl;
|
|
252
252
|
if (options?.interactive === false) {
|
|
253
253
|
tenantId = "default";
|
|
254
|
-
apiUrl =
|
|
254
|
+
apiUrl = LOCAL_REMOTE.api;
|
|
255
255
|
} else {
|
|
256
256
|
const tenantIdInput = await p.text({
|
|
257
257
|
message: "Enter your tenant ID:",
|
|
@@ -277,8 +277,8 @@ async function localInitCommand(options) {
|
|
|
277
277
|
};
|
|
278
278
|
const apiUrlInput = await p.text({
|
|
279
279
|
message: "Enter the Agents API URL:",
|
|
280
|
-
placeholder:
|
|
281
|
-
initialValue:
|
|
280
|
+
placeholder: LOCAL_REMOTE.api,
|
|
281
|
+
initialValue: LOCAL_REMOTE.api,
|
|
282
282
|
validate: validateUrl
|
|
283
283
|
});
|
|
284
284
|
if (p.isCancel(apiUrlInput)) {
|
|
@@ -304,7 +304,7 @@ export default defineConfig({
|
|
|
304
304
|
const localProfile = {
|
|
305
305
|
remote: {
|
|
306
306
|
api: apiUrl,
|
|
307
|
-
manageUi:
|
|
307
|
+
manageUi: LOCAL_REMOTE.manageUi
|
|
308
308
|
},
|
|
309
309
|
credential: "none",
|
|
310
310
|
environment: "development"
|
package/dist/commands/profile.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LOCAL_REMOTE } from "../utils/profiles/types.js";
|
|
1
2
|
import { ProfileError, ProfileManager } from "../utils/profiles/profile-manager.js";
|
|
2
3
|
import "../utils/profiles/index.js";
|
|
3
4
|
import * as p from "@clack/prompts";
|
|
@@ -58,15 +59,23 @@ async function profileAddCommand(name) {
|
|
|
58
59
|
}
|
|
59
60
|
const remoteType = await p.select({
|
|
60
61
|
message: "Remote type:",
|
|
61
|
-
options: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
options: [
|
|
63
|
+
{
|
|
64
|
+
value: "cloud",
|
|
65
|
+
label: "Inkeep Cloud",
|
|
66
|
+
hint: "Default cloud deployment"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "local",
|
|
70
|
+
label: "Local",
|
|
71
|
+
hint: "Local development (localhost, no auth)"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: "custom",
|
|
75
|
+
label: "Custom",
|
|
76
|
+
hint: "Self-hosted or staging deployment"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
70
79
|
});
|
|
71
80
|
if (p.isCancel(remoteType)) {
|
|
72
81
|
p.cancel("Profile creation cancelled");
|
|
@@ -74,12 +83,13 @@ async function profileAddCommand(name) {
|
|
|
74
83
|
}
|
|
75
84
|
let remote;
|
|
76
85
|
if (remoteType === "cloud") remote = "cloud";
|
|
86
|
+
else if (remoteType === "local") remote = { ...LOCAL_REMOTE };
|
|
77
87
|
else {
|
|
78
88
|
const api = await p.text({
|
|
79
89
|
message: "Agents API URL:",
|
|
80
|
-
placeholder: "
|
|
81
|
-
initialValue: "http://localhost:3002",
|
|
90
|
+
placeholder: "https://your-agents-api.example.com",
|
|
82
91
|
validate: (value) => {
|
|
92
|
+
if (!value?.trim()) return "URL is required";
|
|
83
93
|
try {
|
|
84
94
|
new URL(value);
|
|
85
95
|
return;
|
|
@@ -94,9 +104,9 @@ async function profileAddCommand(name) {
|
|
|
94
104
|
}
|
|
95
105
|
const manageUi = await p.text({
|
|
96
106
|
message: "Manage UI URL:",
|
|
97
|
-
placeholder: "
|
|
98
|
-
initialValue: "http://localhost:3000",
|
|
107
|
+
placeholder: "https://your-manage-ui.example.com",
|
|
99
108
|
validate: (value) => {
|
|
109
|
+
if (!value?.trim()) return "URL is required";
|
|
100
110
|
try {
|
|
101
111
|
new URL(value);
|
|
102
112
|
return;
|
|
@@ -114,10 +124,11 @@ async function profileAddCommand(name) {
|
|
|
114
124
|
manageUi
|
|
115
125
|
};
|
|
116
126
|
}
|
|
127
|
+
const envDefault = remoteType === "local" ? "development" : "production";
|
|
117
128
|
const environment = await p.text({
|
|
118
129
|
message: "Environment name:",
|
|
119
|
-
placeholder:
|
|
120
|
-
initialValue:
|
|
130
|
+
placeholder: envDefault,
|
|
131
|
+
initialValue: envDefault,
|
|
121
132
|
validate: (value) => {
|
|
122
133
|
if (!value) return "Environment is required";
|
|
123
134
|
}
|
|
@@ -126,18 +137,23 @@ async function profileAddCommand(name) {
|
|
|
126
137
|
p.cancel("Profile creation cancelled");
|
|
127
138
|
process.exit(0);
|
|
128
139
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
let credential;
|
|
141
|
+
if (remoteType === "local") credential = "none";
|
|
142
|
+
else {
|
|
143
|
+
const credentialDefault = `inkeep-${profileName}`;
|
|
144
|
+
const credentialInput = await p.text({
|
|
145
|
+
message: "Credential reference:",
|
|
146
|
+
placeholder: credentialDefault,
|
|
147
|
+
initialValue: credentialDefault,
|
|
148
|
+
validate: (value) => {
|
|
149
|
+
if (!value) return "Credential reference is required";
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (p.isCancel(credentialInput)) {
|
|
153
|
+
p.cancel("Profile creation cancelled");
|
|
154
|
+
process.exit(0);
|
|
136
155
|
}
|
|
137
|
-
|
|
138
|
-
if (p.isCancel(credential)) {
|
|
139
|
-
p.cancel("Profile creation cancelled");
|
|
140
|
-
process.exit(0);
|
|
156
|
+
credential = credentialInput;
|
|
141
157
|
}
|
|
142
158
|
const profile = {
|
|
143
159
|
remote,
|
|
@@ -147,10 +163,12 @@ async function profileAddCommand(name) {
|
|
|
147
163
|
profileManager.addProfile(profileName, profile);
|
|
148
164
|
console.log();
|
|
149
165
|
console.log(chalk.green("✓"), `Profile '${chalk.cyan(profileName)}' created successfully.`);
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
if (credential !== "none") {
|
|
167
|
+
if (!await profileManager.checkCredentialExists(credential)) {
|
|
168
|
+
console.log();
|
|
169
|
+
console.log(chalk.yellow("⚠"), `Credential '${credential}' not found in keychain.`);
|
|
170
|
+
console.log(chalk.gray(" Run \"inkeep login\" to authenticate and store credentials."));
|
|
171
|
+
}
|
|
154
172
|
}
|
|
155
173
|
const switchProfile = await p.confirm({
|
|
156
174
|
message: `Switch to profile '${profileName}'?`,
|
|
@@ -195,10 +213,12 @@ async function profileCurrentCommand() {
|
|
|
195
213
|
console.log();
|
|
196
214
|
console.log(` Environment: ${profile.environment}`);
|
|
197
215
|
console.log(` Credential: ${profile.credential}`);
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
216
|
+
if (profile.credential !== "none") {
|
|
217
|
+
if (!await profileManager.checkCredentialExists(profile.credential)) {
|
|
218
|
+
console.log();
|
|
219
|
+
console.log(chalk.yellow("⚠"), `Credential '${profile.credential}' not found in keychain.`);
|
|
220
|
+
console.log(chalk.gray(" Run \"inkeep login\" to authenticate."));
|
|
221
|
+
}
|
|
202
222
|
}
|
|
203
223
|
} catch (error) {
|
|
204
224
|
handleProfileError(error);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getCredentialExpiryInfo, loadCredentials } from "./credentials.js";
|
|
2
2
|
import { detectCIEnvironment, loadCIEnvironmentConfig, logCIConfig } from "./ci-environment.js";
|
|
3
|
-
import { validateConfiguration } from "./config.js";
|
|
4
3
|
import { ProfileManager } from "./profiles/profile-manager.js";
|
|
5
4
|
import "./profiles/index.js";
|
|
5
|
+
import { validateConfiguration } from "./config.js";
|
|
6
6
|
import * as p from "@clack/prompts";
|
|
7
7
|
import chalk from "chalk";
|
|
8
8
|
|
package/dist/utils/config.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { loadCredentials } from "./credentials.js";
|
|
2
|
+
import { LOCAL_REMOTE } from "./profiles/types.js";
|
|
3
|
+
import "./profiles/index.js";
|
|
2
4
|
import { importWithTypeScriptSupport } from "./tsx-loader.js";
|
|
3
5
|
import { getLogger } from "@inkeep/agents-core";
|
|
4
6
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
@@ -210,8 +212,8 @@ async function loadConfigFromFile(configPath, tag) {
|
|
|
210
212
|
*/
|
|
211
213
|
async function loadConfig(configPath, tag) {
|
|
212
214
|
const config = {
|
|
213
|
-
agentsApiUrl:
|
|
214
|
-
manageUiUrl:
|
|
215
|
+
agentsApiUrl: LOCAL_REMOTE.api,
|
|
216
|
+
manageUiUrl: LOCAL_REMOTE.manageUi
|
|
215
217
|
};
|
|
216
218
|
const fileConfig = await loadConfigFromFile(configPath, tag);
|
|
217
219
|
if (fileConfig) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCredentialExpiryInfo, loadCredentials } from "./credentials.js";
|
|
2
|
+
import { LOCAL_REMOTE } from "./profiles/types.js";
|
|
2
3
|
import { ProfileManager } from "./profiles/profile-manager.js";
|
|
3
4
|
import "./profiles/index.js";
|
|
4
5
|
import { existsSync } from "node:fs";
|
|
@@ -28,8 +29,8 @@ async function resolveProfileConfig(options = {}) {
|
|
|
28
29
|
} catch {
|
|
29
30
|
return {
|
|
30
31
|
profileName: "default",
|
|
31
|
-
agentsApiUrl:
|
|
32
|
-
manageUiUrl:
|
|
32
|
+
agentsApiUrl: LOCAL_REMOTE.api,
|
|
33
|
+
manageUiUrl: LOCAL_REMOTE.manageUi,
|
|
33
34
|
environment: "development",
|
|
34
35
|
credentialKey: "auth-credentials",
|
|
35
36
|
isAuthenticated: false
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE,
|
|
1
|
+
import { CLOUD_REMOTE, DEFAULT_CLOUD_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,
|
|
4
|
+
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE, DEFAULT_PROFILES_CONFIG, LOCAL_REMOTE, ProfileError, ProfileManager, explicitRemoteSchema, profileManager, profileNameSchema, profileSchema, profilesConfigSchema, remoteSchema };
|
|
@@ -62,15 +62,6 @@ const LOCAL_REMOTE = {
|
|
|
62
62
|
api: "http://localhost:3002",
|
|
63
63
|
manageUi: "http://localhost:3000"
|
|
64
64
|
};
|
|
65
|
-
/**
|
|
66
|
-
* Default local profile configuration
|
|
67
|
-
* Note: credential is 'none' as local deployments typically don't require auth
|
|
68
|
-
*/
|
|
69
|
-
const DEFAULT_LOCAL_PROFILE = {
|
|
70
|
-
remote: LOCAL_REMOTE,
|
|
71
|
-
credential: "none",
|
|
72
|
-
environment: "development"
|
|
73
|
-
};
|
|
74
65
|
|
|
75
66
|
//#endregion
|
|
76
|
-
export { CLOUD_REMOTE, DEFAULT_CLOUD_PROFILE,
|
|
67
|
+
export { CLOUD_REMOTE, DEFAULT_CLOUD_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.48.
|
|
3
|
+
"version": "0.48.3",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"tsx": "^4.20.5",
|
|
41
41
|
"yaml": "^2.7.0",
|
|
42
42
|
"zod": "^4.3.6",
|
|
43
|
-
"@inkeep/agents-core": "^0.48.
|
|
44
|
-
"@inkeep/agents-sdk": "^0.48.
|
|
43
|
+
"@inkeep/agents-core": "^0.48.3",
|
|
44
|
+
"@inkeep/agents-sdk": "^0.48.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/degit": "^2.8.6",
|