@inkeep/agents-cli 0.0.0-dev-20260117013710 → 0.0.0-dev-20260117173149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/commands/init.js +6 -6
  2. package/dist/commands/pull-v3/component-parser.js +0 -2
  3. package/dist/commands/pull-v3/component-updater.js +122 -64
  4. package/dist/commands/pull-v3/components/agent-generator.js +3 -3
  5. package/dist/commands/pull-v3/components/artifact-component-generator.js +7 -7
  6. package/dist/commands/pull-v3/components/context-config-generator.js +6 -6
  7. package/dist/commands/pull-v3/components/credential-generator.js +4 -4
  8. package/dist/commands/pull-v3/components/data-component-generator.js +4 -4
  9. package/dist/commands/pull-v3/components/environment-generator.js +10 -7
  10. package/dist/commands/pull-v3/components/function-tool-generator.js +5 -7
  11. package/dist/commands/pull-v3/components/mcp-tool-generator.js +5 -5
  12. package/dist/commands/pull-v3/components/project-generator.js +4 -4
  13. package/dist/commands/pull-v3/components/status-component-generator.js +6 -6
  14. package/dist/commands/pull-v3/index.js +22 -27
  15. package/dist/commands/pull-v3/introspect-generator.js +7 -7
  16. package/dist/commands/pull-v3/llm-content-merger.js +1 -1
  17. package/dist/commands/pull-v3/new-component-generator.js +5 -16
  18. package/dist/commands/pull-v3/project-comparator.js +49 -49
  19. package/dist/commands/pull-v3/project-validator.js +5 -4
  20. package/dist/commands/pull-v3/targeted-typescript-placeholders.js +2 -2
  21. package/dist/commands/pull-v3/utils/component-registry.js +4 -7
  22. package/dist/commands/pull-v3/utils/component-tracker.js +1 -1
  23. package/dist/commands/pull-v3/utils/generator-utils.js +2 -2
  24. package/dist/commands/push.js +5 -5
  25. package/dist/utils/ci-environment.js +1 -1
  26. package/dist/utils/config.js +1 -1
  27. package/dist/utils/json-comparison.js +3 -3
  28. package/dist/utils/profile-config.js +1 -1
  29. package/dist/utils/profiles/profile-manager.js +1 -1
  30. package/dist/utils/templates.js +0 -2
  31. package/package.json +6 -4
@@ -5,10 +5,10 @@ import chalk from "chalk";
5
5
  /**
6
6
  * Compare two projects and classify all changes using direct component comparison
7
7
  */
8
- async function compareProjects(localProject, remoteProject, localRegistry, debug = false) {
8
+ async function compareProjects(localProject, remoteProject, debug = false) {
9
9
  if (debug) console.log(chalk.gray("\nšŸ” Comparing local and remote projects..."));
10
- if (!localProject) return createNewProjectComparison(remoteProject, debug);
11
- const changes = compareComponentsDirectly(localProject, remoteProject, localRegistry, debug);
10
+ if (!localProject) return createNewProjectComparison(remoteProject);
11
+ const changes = compareComponentsDirectly(localProject, remoteProject);
12
12
  const componentChanges = groupChangesByType(changes);
13
13
  return {
14
14
  hasChanges: changes.length > 0,
@@ -21,7 +21,7 @@ async function compareProjects(localProject, remoteProject, localRegistry, debug
21
21
  /**
22
22
  * Handle new project case (everything is added)
23
23
  */
24
- function createNewProjectComparison(project, debug) {
24
+ function createNewProjectComparison(project) {
25
25
  const changes = [];
26
26
  if (project.agents) Object.keys(project.agents).forEach((agentId) => {
27
27
  changes.push({
@@ -65,7 +65,7 @@ function createNewProjectComparison(project, debug) {
65
65
  changeType: "added"
66
66
  });
67
67
  });
68
- if (project.agents) Object.entries(project.agents).forEach(([agentId, agentData]) => {
68
+ if (project.agents) Object.values(project.agents).forEach((agentData) => {
69
69
  if (agentData.subAgents) Object.keys(agentData.subAgents).forEach((subAgentId) => {
70
70
  changes.push({
71
71
  componentType: "subAgents",
@@ -81,7 +81,7 @@ function createNewProjectComparison(project, debug) {
81
81
  changeType: "added"
82
82
  });
83
83
  });
84
- if (project.agents) Object.entries(project.agents).forEach(([agentId, agentData]) => {
84
+ if (project.agents) Object.values(project.agents).forEach((agentData) => {
85
85
  if (agentData.contextConfig) {
86
86
  const contextConfigId = agentData.contextConfig.id;
87
87
  if (!contextConfigId) return;
@@ -118,30 +118,30 @@ function createNewProjectComparison(project, debug) {
118
118
  /**
119
119
  * Direct component-by-component comparison
120
120
  */
121
- function compareComponentsDirectly(localProject, remoteProject, localRegistry, debug) {
121
+ function compareComponentsDirectly(localProject, remoteProject) {
122
122
  const changes = [];
123
- changes.push(...compareAgents(localProject.agents || {}, remoteProject.agents || {}, debug));
124
- changes.push(...compareSubAgents(localProject.agents || {}, remoteProject.agents || {}, debug));
125
- changes.push(...compareTools(localProject.tools || {}, remoteProject.tools || {}, debug));
126
- changes.push(...compareFunctionTools(localProject.functionTools || {}, remoteProject.functionTools || {}, debug));
127
- changes.push(...compareFunctions(localProject.functions || {}, remoteProject.functions || {}, debug));
128
- changes.push(...compareDataComponents(localProject.dataComponents || {}, remoteProject.dataComponents || {}, debug));
129
- changes.push(...compareArtifactComponents(localProject.artifactComponents || {}, remoteProject.artifactComponents || {}, debug));
130
- changes.push(...compareCredentials(localProject.credentialReferences || {}, remoteProject.credentialReferences || {}, debug));
131
- changes.push(...compareExternalAgents(localProject.externalAgents || {}, remoteProject.externalAgents || {}, debug));
123
+ changes.push(...compareAgents(localProject.agents || {}, remoteProject.agents || {}));
124
+ changes.push(...compareSubAgents(localProject.agents || {}, remoteProject.agents || {}));
125
+ changes.push(...compareTools(localProject.tools || {}, remoteProject.tools || {}));
126
+ changes.push(...compareFunctionTools(localProject.functionTools || {}, remoteProject.functionTools || {}));
127
+ changes.push(...compareFunctions(localProject.functions || {}, remoteProject.functions || {}));
128
+ changes.push(...compareDataComponents(localProject.dataComponents || {}, remoteProject.dataComponents || {}));
129
+ changes.push(...compareArtifactComponents(localProject.artifactComponents || {}, remoteProject.artifactComponents || {}));
130
+ changes.push(...compareCredentials(localProject.credentialReferences || {}, remoteProject.credentialReferences || {}));
131
+ changes.push(...compareExternalAgents(localProject.externalAgents || {}, remoteProject.externalAgents || {}));
132
132
  const localStatusComponents = extractStatusComponentsFromProject(localProject);
133
133
  const remoteStatusComponents = extractStatusComponentsFromProject(remoteProject);
134
- changes.push(...compareStatusComponents(localStatusComponents, remoteStatusComponents, debug));
135
- changes.push(...compareContextConfigs(localProject, remoteProject, localRegistry, debug));
136
- changes.push(...compareFetchDefinitions(localProject, remoteProject, debug));
137
- changes.push(...compareProjectModels(localProject.models, remoteProject.models, debug));
138
- changes.push(...compareProjectFields(localProject, remoteProject, debug));
134
+ changes.push(...compareStatusComponents(localStatusComponents, remoteStatusComponents));
135
+ changes.push(...compareContextConfigs(localProject, remoteProject));
136
+ changes.push(...compareFetchDefinitions(localProject, remoteProject));
137
+ changes.push(...compareProjectModels(localProject.models, remoteProject.models));
138
+ changes.push(...compareProjectFields(localProject, remoteProject));
139
139
  return changes;
140
140
  }
141
141
  /**
142
142
  * Compare agents between local and remote
143
143
  */
144
- function compareAgents(localAgents, remoteAgents, debug) {
144
+ function compareAgents(localAgents, remoteAgents) {
145
145
  const changes = [];
146
146
  const localIds = Object.keys(localAgents);
147
147
  const remoteIds = Object.keys(remoteAgents);
@@ -182,12 +182,12 @@ function compareAgents(localAgents, remoteAgents, debug) {
182
182
  * Compare subAgents between local and remote
183
183
  * Extracts subAgents from all agents and compares them as separate components
184
184
  */
185
- function compareSubAgents(localAgents, remoteAgents, debug) {
185
+ function compareSubAgents(localAgents, remoteAgents) {
186
186
  const changes = [];
187
187
  const localSubAgents = {};
188
- for (const [agentId, agentData] of Object.entries(localAgents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) localSubAgents[subAgentId] = subAgentData;
188
+ for (const agentData of Object.values(localAgents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) localSubAgents[subAgentId] = subAgentData;
189
189
  const remoteSubAgents = {};
190
- for (const [agentId, agentData] of Object.entries(remoteAgents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) remoteSubAgents[subAgentId] = subAgentData;
190
+ for (const agentData of Object.values(remoteAgents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) remoteSubAgents[subAgentId] = subAgentData;
191
191
  const localIds = Object.keys(localSubAgents);
192
192
  const remoteIds = Object.keys(remoteSubAgents);
193
193
  remoteIds.filter((id) => !localIds.includes(id)).forEach((id) => {
@@ -238,19 +238,19 @@ function generateSubAgentChangeSummary(fieldChanges) {
238
238
  /**
239
239
  * Compare tools between local and remote
240
240
  */
241
- function compareTools(localTools, remoteTools, debug) {
242
- return compareComponentMaps("tools", localTools, remoteTools, debug);
241
+ function compareTools(localTools, remoteTools) {
242
+ return compareComponentMaps("tools", localTools, remoteTools);
243
243
  }
244
244
  /**
245
245
  * Compare function tools between local and remote
246
246
  */
247
- function compareFunctionTools(localFunctionTools, remoteFunctionTools, debug) {
248
- return compareComponentMaps("functionTools", localFunctionTools, remoteFunctionTools, debug);
247
+ function compareFunctionTools(localFunctionTools, remoteFunctionTools) {
248
+ return compareComponentMaps("functionTools", localFunctionTools, remoteFunctionTools);
249
249
  }
250
250
  /**
251
251
  * Compare functions between local and remote
252
252
  */
253
- function compareFunctions(localFunctions, remoteFunctions, debug) {
253
+ function compareFunctions(localFunctions, remoteFunctions) {
254
254
  const cleanLocalFunctions = {};
255
255
  const cleanRemoteFunctions = {};
256
256
  for (const [id, func] of Object.entries(localFunctions)) cleanLocalFunctions[id] = {
@@ -265,42 +265,42 @@ function compareFunctions(localFunctions, remoteFunctions, debug) {
265
265
  executeCode: func.executeCode,
266
266
  dependencies: func.dependencies
267
267
  };
268
- return compareComponentMaps("functions", cleanLocalFunctions, cleanRemoteFunctions, debug);
268
+ return compareComponentMaps("functions", cleanLocalFunctions, cleanRemoteFunctions);
269
269
  }
270
270
  /**
271
271
  * Compare data components between local and remote
272
272
  */
273
- function compareDataComponents(localDataComponents, remoteDataComponents, debug) {
274
- return compareComponentMaps("dataComponents", localDataComponents, remoteDataComponents, debug);
273
+ function compareDataComponents(localDataComponents, remoteDataComponents) {
274
+ return compareComponentMaps("dataComponents", localDataComponents, remoteDataComponents);
275
275
  }
276
276
  /**
277
277
  * Compare artifact components between local and remote
278
278
  */
279
- function compareArtifactComponents(localArtifactComponents, remoteArtifactComponents, debug) {
280
- return compareComponentMaps("artifactComponents", localArtifactComponents, remoteArtifactComponents, debug);
279
+ function compareArtifactComponents(localArtifactComponents, remoteArtifactComponents) {
280
+ return compareComponentMaps("artifactComponents", localArtifactComponents, remoteArtifactComponents);
281
281
  }
282
282
  /**
283
283
  * Compare credentials between local and remote
284
284
  */
285
- function compareCredentials(localCredentials, remoteCredentials, debug) {
286
- return compareComponentMaps("credentials", localCredentials, remoteCredentials, debug);
285
+ function compareCredentials(localCredentials, remoteCredentials) {
286
+ return compareComponentMaps("credentials", localCredentials, remoteCredentials);
287
287
  }
288
288
  /**
289
289
  * Compare external agents between local and remote
290
290
  */
291
- function compareExternalAgents(localExternalAgents, remoteExternalAgents, debug) {
292
- return compareComponentMaps("externalAgents", localExternalAgents, remoteExternalAgents, debug);
291
+ function compareExternalAgents(localExternalAgents, remoteExternalAgents) {
292
+ return compareComponentMaps("externalAgents", localExternalAgents, remoteExternalAgents);
293
293
  }
294
294
  /**
295
295
  * Compare status components between local and remote
296
296
  */
297
- function compareStatusComponents(localStatusComponents, remoteStatusComponents, debug) {
298
- return compareComponentMaps("statusComponents", localStatusComponents, remoteStatusComponents, debug);
297
+ function compareStatusComponents(localStatusComponents, remoteStatusComponents) {
298
+ return compareComponentMaps("statusComponents", localStatusComponents, remoteStatusComponents);
299
299
  }
300
300
  /**
301
301
  * Compare project-level models
302
302
  */
303
- function compareProjectModels(localModels, remoteModels, debug) {
303
+ function compareProjectModels(localModels, remoteModels) {
304
304
  const changes = [];
305
305
  const fieldChanges = getDetailedFieldChanges("", localModels, remoteModels);
306
306
  if (fieldChanges.length > 0) {
@@ -333,7 +333,7 @@ function generateModelsChangeSummary(fieldChanges) {
333
333
  /**
334
334
  * Compare project-level fields like name, description, etc.
335
335
  */
336
- function compareProjectFields(localProject, remoteProject, debug) {
336
+ function compareProjectFields(localProject, remoteProject) {
337
337
  const changes = [];
338
338
  for (const field of [
339
339
  "name",
@@ -361,7 +361,7 @@ function compareProjectFields(localProject, remoteProject, debug) {
361
361
  /**
362
362
  * Generic component map comparison with detailed field tracking
363
363
  */
364
- function compareComponentMaps(componentType, localMap, remoteMap, debug) {
364
+ function compareComponentMaps(componentType, localMap, remoteMap) {
365
365
  const changes = [];
366
366
  const localIds = Object.keys(localMap);
367
367
  const remoteIds = Object.keys(remoteMap);
@@ -635,7 +635,7 @@ function formatValue(value) {
635
635
  const keys = Object.keys(value);
636
636
  if (keys.length <= 3) return `{${keys.map((key) => {
637
637
  const val = value[key];
638
- if (typeof val === "string") return `${key}: "${val.length > 15 ? val.substring(0, 12) + "..." : val}"`;
638
+ if (typeof val === "string") return `${key}: "${val.length > 15 ? `${val.substring(0, 12)}...` : val}"`;
639
639
  if (typeof val === "object" && val !== null) return `${key}: {...}`;
640
640
  return `${key}: ${val}`;
641
641
  }).join(", ")}}`;
@@ -811,7 +811,7 @@ function createEmptyComponentChanges() {
811
811
  /**
812
812
  * Compare contextConfig components across agents
813
813
  */
814
- function compareContextConfigs(localProject, remoteProject, localRegistry, debug) {
814
+ function compareContextConfigs(localProject, remoteProject) {
815
815
  const changes = [];
816
816
  new Set([...Object.keys(localProject.agents || {}), ...Object.keys(remoteProject.agents || {})]).forEach((agentId) => {
817
817
  const localAgent = localProject.agents?.[agentId];
@@ -848,7 +848,7 @@ function compareContextConfigs(localProject, remoteProject, localRegistry, debug
848
848
  /**
849
849
  * Compare fetchDefinition components across contextConfigs
850
850
  */
851
- function compareFetchDefinitions(localProject, remoteProject, debug) {
851
+ function compareFetchDefinitions(localProject, remoteProject) {
852
852
  const changes = [];
853
853
  const fetchDefinitions = /* @__PURE__ */ new Map();
854
854
  const extractFetchDefinitions = (contextConfig) => {
@@ -858,13 +858,13 @@ function compareFetchDefinitions(localProject, remoteProject, debug) {
858
858
  });
859
859
  return fetchDefs;
860
860
  };
861
- Object.entries(localProject.agents || {}).forEach(([agentId, agentData]) => {
861
+ Object.values(localProject.agents || {}).forEach((agentData) => {
862
862
  if (agentData.contextConfig) extractFetchDefinitions(agentData.contextConfig).forEach((fetchDef) => {
863
863
  if (!fetchDefinitions.has(fetchDef.id)) fetchDefinitions.set(fetchDef.id, {});
864
864
  fetchDefinitions.get(fetchDef.id).local = fetchDef;
865
865
  });
866
866
  });
867
- Object.entries(remoteProject.agents || {}).forEach(([agentId, agentData]) => {
867
+ Object.values(remoteProject.agents || {}).forEach((agentData) => {
868
868
  if (agentData.contextConfig) extractFetchDefinitions(agentData.contextConfig).forEach((fetchDef) => {
869
869
  if (!fetchDefinitions.has(fetchDef.id)) fetchDefinitions.set(fetchDef.id, {});
870
870
  fetchDefinitions.get(fetchDef.id).remote = fetchDef;
@@ -1,6 +1,6 @@
1
- import { buildComponentRegistryFromParsing } from "./component-parser.js";
2
1
  import { compareProjects } from "./project-comparator.js";
3
2
  import { enrichCanDelegateToWithTypes } from "./index.js";
3
+ import { buildComponentRegistryFromParsing } from "./component-parser.js";
4
4
  import { copyFileSync, existsSync, mkdirSync, readdirSync, rmSync, statSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
  import chalk from "chalk";
@@ -145,8 +145,9 @@ async function validateProjectEquivalence(tempDir, remoteProject) {
145
145
  reject(/* @__PURE__ */ new Error("getFullDefinition() timed out after 30 seconds"));
146
146
  }, 3e4);
147
147
  })]);
148
- enrichCanDelegateToWithTypes(tempProjectDefinition, false);
149
- const comparison = await compareProjects(tempProjectDefinition, remoteProject, buildComponentRegistryFromParsing(tempDir, false), true);
148
+ enrichCanDelegateToWithTypes(tempProjectDefinition);
149
+ buildComponentRegistryFromParsing(tempDir, false);
150
+ const comparison = await compareProjects(tempProjectDefinition, remoteProject, true);
150
151
  if (!comparison.hasChanges) return true;
151
152
  let hasMeaningfulDifferences = false;
152
153
  let hasAddedOrDeleted = false;
@@ -332,7 +333,7 @@ function overwriteProjectFiles(originalProjectRoot, tempDirName, tempDir) {
332
333
  mkdirSync(dirname(targetPath), { recursive: true });
333
334
  copyFileSync(sourcePath, targetPath);
334
335
  filesReplaced++;
335
- const relativePath = targetPath.replace(originalProjectRoot + "/", "");
336
+ const relativePath = targetPath.replace(`${originalProjectRoot}/`, "");
336
337
  console.log(chalk.green(` āœ… Replaced: ${relativePath}`));
337
338
  }
338
339
  }
@@ -25,7 +25,7 @@ const MIN_REPLACEMENT_LENGTH = 10;
25
25
  /**
26
26
  * Create targeted placeholders using AST parsing for better accuracy
27
27
  */
28
- function createTargetedTypeScriptPlaceholders(content, debug = false) {
28
+ function createTargetedTypeScriptPlaceholders(content) {
29
29
  const replacements = {};
30
30
  let replacedFields = 0;
31
31
  const originalSize = content.length;
@@ -141,7 +141,7 @@ function createTargetedTypeScriptPlaceholders(content, debug = false) {
141
141
  replacedFields
142
142
  }
143
143
  };
144
- } catch (error) {
144
+ } catch {
145
145
  return {
146
146
  processedContent: content,
147
147
  replacements: {},
@@ -1,6 +1,3 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
-
4
1
  //#region src/commands/pull-v3/utils/component-registry.ts
5
2
  var ComponentRegistry = class {
6
3
  components = /* @__PURE__ */ new Map();
@@ -236,7 +233,7 @@ var ComponentRegistry = class {
236
233
  const remainingPath = toFile.slice(commonLength).join("/");
237
234
  relativePath += remainingPath;
238
235
  if (relativePath.startsWith("../")) return relativePath;
239
- return "./" + relativePath;
236
+ return `./${relativePath}`;
240
237
  }
241
238
  /**
242
239
  * Get all components for debugging
@@ -309,7 +306,7 @@ function registerAllComponents(project, registry) {
309
306
  function extractStatusComponents(project) {
310
307
  const statusComponents = {};
311
308
  if (project.agents) {
312
- for (const [agentId, agentData] of Object.entries(project.agents)) if (agentData.statusUpdates && agentData.statusUpdates.statusComponents) for (const statusComp of agentData.statusUpdates.statusComponents) {
309
+ for (const agentData of Object.values(project.agents)) if (agentData.statusUpdates?.statusComponents) for (const statusComp of agentData.statusUpdates.statusComponents) {
313
310
  let statusId;
314
311
  if (typeof statusComp === "string") statusId = statusComp;
315
312
  else if (typeof statusComp === "object" && statusComp) statusId = statusComp.type;
@@ -331,7 +328,7 @@ function extractStatusComponents(project) {
331
328
  function extractSubAgents(project) {
332
329
  const subAgents = {};
333
330
  if (project.agents) {
334
- for (const [agentId, agentData] of Object.entries(project.agents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) subAgents[subAgentId] = subAgentData;
331
+ for (const agentData of Object.values(project.agents)) if (agentData.subAgents) for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) subAgents[subAgentId] = subAgentData;
335
332
  }
336
333
  return subAgents;
337
334
  }
@@ -354,7 +351,7 @@ function extractContextConfigs(project) {
354
351
  */
355
352
  function findSubAgentWithParent(project, subAgentId) {
356
353
  if (project.agents) {
357
- for (const [agentId, agentData] of Object.entries(project.agents)) if (agentData.subAgents && agentData.subAgents[subAgentId]) {
354
+ for (const [agentId, agentData] of Object.entries(project.agents)) if (agentData.subAgents?.[subAgentId]) {
358
355
  const contextConfigData = agentData.contextConfig?.id ? agentData.contextConfig : void 0;
359
356
  return {
360
357
  subAgentData: agentData.subAgents[subAgentId],
@@ -139,7 +139,7 @@ var ComponentTracker = class {
139
139
  for (let i = 0; i < fromParts.length; i++) relativePath += "../";
140
140
  relativePath += toParts.join("/");
141
141
  if (relativePath.startsWith("../")) return relativePath;
142
- return "./" + relativePath;
142
+ return `./${relativePath}`;
143
143
  }
144
144
  /**
145
145
  * Get all components as a list
@@ -17,7 +17,7 @@ function toCamelCase(str) {
17
17
  function formatString(str, quote = "'", multiline = false) {
18
18
  if (!str && str !== "") return `${quote}${quote}`;
19
19
  if (multiline && (str.includes("\n") || str.length > 80)) return `\`${str.replace(/`/g, "\\`")}\``;
20
- return `${quote}${str.replace(new RegExp(quote, "g"), "\\" + quote)}${quote}`;
20
+ return `${quote}${str.replace(new RegExp(quote, "g"), `\\${quote}`)}${quote}`;
21
21
  }
22
22
  /**
23
23
  * Check if a string contains template variables like {{user.name}}
@@ -46,7 +46,7 @@ function isContextVariable(variablePath, contextConfigData) {
46
46
  */
47
47
  function formatPromptWithContext(str, contextVarName, headersVarName, contextConfigData, quote = "'", multiline = false) {
48
48
  if (!str && str !== "") return `${quote}${quote}`;
49
- if (hasTemplateVariables(str)) return `\`${str.replace(/\{\{([^}]+)\}\}/g, (match, variablePath) => {
49
+ if (hasTemplateVariables(str)) return `\`${str.replace(/\{\{([^}]+)\}\}/g, (_match, variablePath) => {
50
50
  if (isContextVariable(variablePath, contextConfigData)) return `\${${contextVarName}.toTemplate("${variablePath}")}`;
51
51
  if (isHeadersVariable(variablePath, contextConfigData)) return `\${${headersVarName}.toTemplate("${variablePath}")}`;
52
52
  return `\${${contextVarName}.toTemplate("${variablePath}")}`;
@@ -16,7 +16,7 @@ async function pushCommand(options) {
16
16
  await pushAllProjects(options);
17
17
  return;
18
18
  }
19
- const { config, profile } = await initializeCommand({
19
+ const { config } = await initializeCommand({
20
20
  configPath: options.config,
21
21
  profileName: options.profile,
22
22
  tag: options.tag,
@@ -244,13 +244,13 @@ async function pushAllProjects(options) {
244
244
  if (projectDirs.length === 0) {
245
245
  const configPattern = options.tag ? `${options.tag}.__inkeep.config.ts__` : "inkeep.config.ts";
246
246
  console.error(chalk.red("No valid projects found."));
247
- console.log(chalk.yellow("\nHint: Projects must have an index.ts file and access to an " + configPattern + " file"));
247
+ console.log(chalk.yellow(`\nHint: Projects must have an index.ts file and access to an ${configPattern} file`));
248
248
  console.log(chalk.yellow(" (either in the same directory or in a parent directory)."));
249
249
  process.exit(1);
250
250
  }
251
251
  console.log(chalk.gray(`Found ${projectDirs.length} project(s) to push:\n`));
252
252
  for (const dir of projectDirs) {
253
- const relativePath = dir === process.cwd() ? "." : dir.replace(process.cwd() + "/", "");
253
+ const relativePath = dir === process.cwd() ? "." : dir.replace(`${process.cwd()}/`, "");
254
254
  console.log(chalk.gray(` • ${relativePath}`));
255
255
  }
256
256
  console.log();
@@ -258,7 +258,7 @@ async function pushAllProjects(options) {
258
258
  const total = projectDirs.length;
259
259
  for (let i = 0; i < projectDirs.length; i++) {
260
260
  const projectDir = projectDirs[i];
261
- const relativePath = projectDir === process.cwd() ? "." : projectDir.replace(process.cwd() + "/", "");
261
+ const relativePath = projectDir === process.cwd() ? "." : projectDir.replace(`${process.cwd()}/`, "");
262
262
  const progress = `[${i + 1}/${total}]`;
263
263
  console.log(chalk.cyan(`${progress} Pushing ${relativePath}...`));
264
264
  const result = await pushSingleProject(projectDir, options);
@@ -274,7 +274,7 @@ async function pushAllProjects(options) {
274
274
  console.log(chalk.red(` āœ— Failed: ${failed}`));
275
275
  console.log(chalk.red("\nFailed projects:"));
276
276
  for (const result of results) if (!result.success) {
277
- const relativePath = result.projectDir === process.cwd() ? "." : result.projectDir.replace(process.cwd() + "/", "");
277
+ const relativePath = result.projectDir === process.cwd() ? "." : result.projectDir.replace(`${process.cwd()}/`, "");
278
278
  console.log(chalk.red(` • ${relativePath}: ${result.error}`));
279
279
  }
280
280
  }
@@ -71,7 +71,7 @@ function logCIConfig(config, reason) {
71
71
  function getAuthHeaders(config, isCI = false) {
72
72
  const headers = {};
73
73
  if (isCI && config.apiKey) headers["X-API-Key"] = config.apiKey;
74
- else if (config.accessToken) headers["Authorization"] = `Bearer ${config.accessToken}`;
74
+ else if (config.accessToken) headers.Authorization = `Bearer ${config.accessToken}`;
75
75
  return headers;
76
76
  }
77
77
  function validateCIConfig(config) {
@@ -244,7 +244,7 @@ async function validateConfiguration(configPath, tag) {
244
244
  let cliCredentials = null;
245
245
  try {
246
246
  const credentials = await loadCredentials();
247
- if (credentials && credentials.accessToken && credentials.organizationId) {
247
+ if (credentials?.accessToken && credentials.organizationId) {
248
248
  cliCredentials = {
249
249
  accessToken: credentials.accessToken,
250
250
  organizationId: credentials.organizationId
@@ -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) => delete filtered[field]);
87
+ allIgnoredFields$1.forEach((field) => {
88
+ delete filtered[field];
89
+ });
90
90
  return JSON.stringify(filtered);
91
91
  }
92
92
  return item;
@@ -77,7 +77,7 @@ function logProfileConfig(config, quiet = false) {
77
77
  }
78
78
  function getAuthHeaders(config) {
79
79
  const headers = {};
80
- if (config.accessToken) headers["Authorization"] = `Bearer ${config.accessToken}`;
80
+ if (config.accessToken) headers.Authorization = `Bearer ${config.accessToken}`;
81
81
  return headers;
82
82
  }
83
83
 
@@ -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 { dirname, join } from "node:path";
5
+ import { join } from "node:path";
6
6
  import { homedir, tmpdir } from "node:os";
7
7
  import * as yaml from "yaml";
8
8
 
@@ -1,10 +1,8 @@
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/", ""));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.0.0-dev-20260117013710",
3
+ "version": "0.0.0-dev-20260117173149",
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.0.0-dev-20260117013710",
44
- "@inkeep/agents-sdk": "^0.0.0-dev-20260117013710"
43
+ "@inkeep/agents-core": "^0.0.0-dev-20260117173149",
44
+ "@inkeep/agents-sdk": "^0.0.0-dev-20260117173149"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/degit": "^2.8.6",
@@ -53,7 +53,7 @@
53
53
  "vitest": "^3.2.4"
54
54
  },
55
55
  "peerDependencies": {
56
- "@inkeep/agents-manage-ui": "0.0.0-dev-20260117013710",
56
+ "@inkeep/agents-manage-ui": "0.0.0-dev-20260117173149",
57
57
  "zod": "^4.1.11"
58
58
  },
59
59
  "publishConfig": {
@@ -73,6 +73,8 @@
73
73
  },
74
74
  "scripts": {
75
75
  "knip": "knip --directory .. --workspace agents-cli --dependencies",
76
+ "lint": "biome lint --error-on-warnings",
77
+ "lint:fix": "biome check --write",
76
78
  "build": "tsdown",
77
79
  "cli": "node ./dist/index.js",
78
80
  "postinstall": "node scripts/ensure-keytar.mjs || true",