@inkeep/create-agents 0.0.0-dev-20260225020733 → 0.0.0-dev-20260225024044
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/__tests__/utils.test.js +8 -2
- package/dist/utils.js +7 -1
- package/package.json +2 -2
|
@@ -376,13 +376,19 @@ describe('createAgents - Template and Project ID Logic', () => {
|
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
378
|
describe('Environment file generation', () => {
|
|
379
|
-
it('should
|
|
379
|
+
it('should generate a unique INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET', async () => {
|
|
380
380
|
await createAgents({
|
|
381
381
|
dirName: 'test-dir',
|
|
382
382
|
openAiKey: 'test-openai-key',
|
|
383
383
|
anthropicKey: 'test-anthropic-key',
|
|
384
384
|
});
|
|
385
|
-
|
|
385
|
+
const envWriteCall = vi.mocked(fs.writeFile).mock.calls.find((call) => call[0] === '.env');
|
|
386
|
+
expect(envWriteCall).toBeDefined();
|
|
387
|
+
const envContent = envWriteCall?.[1];
|
|
388
|
+
const match = envContent.match(/INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET=(.+)/);
|
|
389
|
+
expect(match).not.toBeNull();
|
|
390
|
+
expect(match?.[1]).not.toBe('test-bypass-secret-for-ci');
|
|
391
|
+
expect(match?.[1]).toHaveLength(64);
|
|
386
392
|
});
|
|
387
393
|
it('should inject CLI-prompted API keys into the .env', async () => {
|
|
388
394
|
await createAgents({
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { exec } from 'node:child_process';
|
|
2
|
+
import crypto from 'node:crypto';
|
|
2
3
|
import { readFileSync } from 'node:fs';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
@@ -509,6 +510,7 @@ async function createWorkspaceStructure() {
|
|
|
509
510
|
await fs.ensureDir(`src`);
|
|
510
511
|
}
|
|
511
512
|
async function createEnvironmentFiles(config) {
|
|
513
|
+
const bypassSecret = crypto.randomBytes(32).toString('hex');
|
|
512
514
|
let envExampleContent;
|
|
513
515
|
try {
|
|
514
516
|
envExampleContent = await fs.readFile('.env.example', 'utf-8');
|
|
@@ -523,6 +525,7 @@ async function createEnvironmentFiles(config) {
|
|
|
523
525
|
GOOGLE_GENERATIVE_AI_API_KEY: config.googleKey || '',
|
|
524
526
|
AZURE_API_KEY: config.azureKey || '',
|
|
525
527
|
DEFAULT_PROJECT_ID: config.projectId,
|
|
528
|
+
INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET: bypassSecret,
|
|
526
529
|
};
|
|
527
530
|
for (let i = 0; i < lines.length; i++) {
|
|
528
531
|
for (const [varName, value] of Object.entries(injections)) {
|
|
@@ -539,8 +542,11 @@ async function createInkeepConfig(config) {
|
|
|
539
542
|
const config = defineConfig({
|
|
540
543
|
tenantId: "${config.tenantId}",
|
|
541
544
|
agentsApi: {
|
|
542
|
-
|
|
545
|
+
// Using 127.0.0.1 instead of localhost to avoid IPv6/IPv4 resolution issues
|
|
546
|
+
url: 'http://127.0.0.1:3002',
|
|
547
|
+
apiKey: process.env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET,
|
|
543
548
|
},
|
|
549
|
+
manageUiUrl: 'http://localhost:3000',
|
|
544
550
|
});
|
|
545
551
|
|
|
546
552
|
export default config;`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/create-agents",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260225024044",
|
|
4
4
|
"description": "Create an Inkeep Agent Framework project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"degit": "^2.8.4",
|
|
34
34
|
"fs-extra": "^11.0.0",
|
|
35
35
|
"picocolors": "^1.0.0",
|
|
36
|
-
"@inkeep/agents-core": "0.0.0-dev-
|
|
36
|
+
"@inkeep/agents-core": "0.0.0-dev-20260225024044"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/degit": "^2.8.6",
|