@inkeep/create-agents 0.33.2 → 0.34.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.
@@ -32,6 +32,7 @@ describe('create-agents quickstart e2e', () => {
32
32
  createAgentsPrefix,
33
33
  '--local-templates-prefix',
34
34
  projectTemplatesPrefix,
35
+ '--skip-inkeep-cli',
35
36
  ], testDir);
36
37
  // Verify the CLI completed successfully
37
38
  expect(result.exitCode, `CLI failed with exit code ${result.exitCode}\nstdout: ${result.stdout}\nstderr: ${result.stderr}`).toBe(0);
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ program
13
13
  .option('--disable-git', 'Disable git initialization')
14
14
  .option('--local-agents-prefix <local-agents-prefix>', 'Local prefix for create-agents-template')
15
15
  .option('--local-templates-prefix <local-templates-prefix>', 'Local prefix for project templates')
16
+ .option('--skip-inkeep-cli', 'Skip installing Inkeep CLI globally')
16
17
  .parse();
17
18
  async function main() {
18
19
  const options = program.opts();
@@ -27,6 +28,7 @@ async function main() {
27
28
  disableGit: options.disableGit,
28
29
  localAgentsPrefix: options.localAgentsPrefix,
29
30
  localTemplatesPrefix: options.localTemplatesPrefix,
31
+ skipInkeepCli: options.skipInkeepCli,
30
32
  });
31
33
  }
32
34
  catch (error) {
package/dist/templates.js CHANGED
@@ -261,6 +261,18 @@ export async function getAvailableTemplates(localPrefix) {
261
261
  }
262
262
  // Fetch the list of templates from your repo
263
263
  const response = await fetch(`https://api.github.com/repos/inkeep/agents/contents/agents-cookbook/template-projects`);
264
- const contents = await response.json();
264
+ if (!response.ok) {
265
+ throw new Error(`Failed to fetch templates. Please check your internet connection and try again.`);
266
+ }
267
+ let contents;
268
+ try {
269
+ contents = await response.json();
270
+ }
271
+ catch (error) {
272
+ throw new Error(`Failed to parse templates response. Please check your internet connection and try again. ${error}`);
273
+ }
274
+ if (!Array.isArray(contents)) {
275
+ throw new Error('Unexpected response format from templates. Please check your internet connection and try again');
276
+ }
265
277
  return contents.filter((item) => item.type === 'dir').map((item) => item.name);
266
278
  }
package/dist/utils.d.ts CHANGED
@@ -42,5 +42,6 @@ export declare const createAgents: (args?: {
42
42
  disableGit?: boolean;
43
43
  localAgentsPrefix?: string;
44
44
  localTemplatesPrefix?: string;
45
+ skipInkeepCli?: boolean;
45
46
  }) => Promise<void>;
46
47
  export declare function createCommand(dirName?: string, options?: any): Promise<void>;
package/dist/utils.js CHANGED
@@ -67,7 +67,8 @@ export const defaultAnthropicModelConfigurations = {
67
67
  },
68
68
  };
69
69
  export const createAgents = async (args = {}) => {
70
- let { dirName, openAiKey, anthropicKey, googleKey, template, customProjectId, disableGit, localAgentsPrefix, localTemplatesPrefix, } = args;
70
+ let { dirName, openAiKey, anthropicKey, googleKey, template, customProjectId, disableGit, localAgentsPrefix, localTemplatesPrefix, skipInkeepCli, } = args;
71
+ console.log('skipInkeepCli', skipInkeepCli);
71
72
  const tenantId = 'default';
72
73
  let projectId;
73
74
  let templateName;
@@ -255,6 +256,14 @@ export const createAgents = async (args = {}) => {
255
256
  }
256
257
  await checkPortsAvailability();
257
258
  s.stop();
259
+ if (!skipInkeepCli) {
260
+ const installInkeepCLIResponse = await p.confirm({
261
+ message: 'Would you like to install the Inkeep CLI globally?',
262
+ });
263
+ if (!p.isCancel(installInkeepCLIResponse) && installInkeepCLIResponse) {
264
+ await installInkeepCLIGlobally();
265
+ }
266
+ }
258
267
  p.note(`${color.green('✓')} Workspace created at: ${color.cyan(directoryPath)}\n\n` +
259
268
  `${color.yellow('Next steps:')}\n` +
260
269
  ` cd ${dirName}\n` +
@@ -348,6 +357,30 @@ export const myProject = project({
348
357
  await fs.writeFile(`src/projects/${config.projectId}/index.ts`, customIndexContent);
349
358
  }
350
359
  }
360
+ async function installInkeepCLIGlobally() {
361
+ const s = p.spinner();
362
+ s.start('Installing Inkeep CLI globally with pnpm...');
363
+ try {
364
+ await execAsync('pnpm add -g @inkeep/agents-cli');
365
+ s.stop('✓ Inkeep CLI installed successfully with pnpm');
366
+ return;
367
+ }
368
+ catch (_pnpmError) {
369
+ s.message('pnpm failed, trying npm...');
370
+ try {
371
+ await execAsync('npm install -g @inkeep/agents-cli');
372
+ s.stop('✓ Inkeep CLI installed successfully with npm');
373
+ return;
374
+ }
375
+ catch (_npmError) {
376
+ s.stop('⚠️ Could not automatically install Inkeep CLI globally');
377
+ console.warn('You can install it manually later by running:');
378
+ console.warn(' npm install -g @inkeep/agents-cli');
379
+ console.warn(' or');
380
+ console.warn(' pnpm add -g @inkeep/agents-cli\n');
381
+ }
382
+ }
383
+ }
351
384
  async function installDependencies() {
352
385
  try {
353
386
  const { stderr } = await execAsync('pnpm install');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/create-agents",
3
- "version": "0.33.2",
3
+ "version": "0.34.0",
4
4
  "description": "Create an Inkeep Agent Framework project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "drizzle-kit": "^0.31.5",
35
35
  "fs-extra": "^11.0.0",
36
36
  "picocolors": "^1.0.0",
37
- "@inkeep/agents-core": "0.33.2"
37
+ "@inkeep/agents-core": "0.34.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/degit": "^2.8.6",