@inkeep/create-agents 0.43.0 → 0.45.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.
|
@@ -4,6 +4,9 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
|
4
4
|
import { cleanupDir, createTempDir, linkLocalPackages, runCommand, runCreateAgentsCLI, verifyDirectoryStructure, verifyFile, waitForServerReady, } from './utils';
|
|
5
5
|
// Use 127.0.0.1 instead of localhost to avoid IPv6/IPv4 resolution issues on CI (Ubuntu)
|
|
6
6
|
const manageApiUrl = 'http://127.0.0.1:3002';
|
|
7
|
+
// Use a test bypass secret for authentication in CI
|
|
8
|
+
// This bypasses the need for a real login/API key
|
|
9
|
+
const TEST_BYPASS_SECRET = 'e2e-test-bypass-secret-for-ci-testing-only';
|
|
7
10
|
describe('create-agents quickstart e2e', () => {
|
|
8
11
|
let testDir;
|
|
9
12
|
let projectDir;
|
|
@@ -75,7 +78,11 @@ describe('create-agents quickstart e2e', () => {
|
|
|
75
78
|
await linkLocalPackages(projectDir, monorepoRoot);
|
|
76
79
|
console.log('Local monorepo packages linked and dependencies installed');
|
|
77
80
|
console.log('Setting up project in database');
|
|
78
|
-
|
|
81
|
+
// Pass bypass secret so setup-dev:cloud's internal push can authenticate
|
|
82
|
+
await runCommand('pnpm', ['setup-dev:cloud'], projectDir, 600000, {
|
|
83
|
+
INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET: TEST_BYPASS_SECRET,
|
|
84
|
+
INKEEP_API_KEY: TEST_BYPASS_SECRET,
|
|
85
|
+
}); // 10 minutes for CI (includes pnpm install, migrations, server startup, push)
|
|
79
86
|
console.log('Project setup in database');
|
|
80
87
|
console.log('Starting dev servers');
|
|
81
88
|
// Start dev servers in background with output monitoring
|
|
@@ -85,6 +92,8 @@ describe('create-agents quickstart e2e', () => {
|
|
|
85
92
|
...process.env,
|
|
86
93
|
FORCE_COLOR: '0',
|
|
87
94
|
NODE_ENV: 'test',
|
|
95
|
+
// Set bypass secret for authentication in CI
|
|
96
|
+
INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET: TEST_BYPASS_SECRET,
|
|
88
97
|
},
|
|
89
98
|
cleanup: true,
|
|
90
99
|
detached: false,
|
|
@@ -122,11 +131,17 @@ describe('create-agents quickstart e2e', () => {
|
|
|
122
131
|
`src/projects/${projectId}`,
|
|
123
132
|
'--config',
|
|
124
133
|
'src/inkeep.config.ts',
|
|
125
|
-
], projectDir, 30000
|
|
134
|
+
], projectDir, 30000,
|
|
135
|
+
// Pass the bypass secret as INKEEP_API_KEY for CLI authentication in CI
|
|
136
|
+
{ INKEEP_API_KEY: TEST_BYPASS_SECRET });
|
|
126
137
|
expect(pushResult.exitCode, `Push failed with exit code ${pushResult.exitCode}\nstdout: ${pushResult.stdout}\nstderr: ${pushResult.stderr}`).toBe(0);
|
|
127
138
|
console.log('Testing API requests');
|
|
128
|
-
// Test API requests
|
|
129
|
-
const response = await fetch(`${manageApiUrl}/manage/tenants/default/projects/${projectId}
|
|
139
|
+
// Test API requests with bypass secret authentication
|
|
140
|
+
const response = await fetch(`${manageApiUrl}/manage/tenants/default/projects/${projectId}`, {
|
|
141
|
+
headers: {
|
|
142
|
+
Authorization: `Bearer ${TEST_BYPASS_SECRET}`,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
130
145
|
const data = await response.json();
|
|
131
146
|
expect(data.data.tenantId).toBe('default');
|
|
132
147
|
expect(data.data.id).toBe(projectId);
|
|
@@ -9,7 +9,8 @@ export declare function runCreateAgentsCLI(args: string[], cwd: string, timeout?
|
|
|
9
9
|
/**
|
|
10
10
|
* Run a command in the created project directory
|
|
11
11
|
*/
|
|
12
|
-
export declare function runCommand(command: string, args: string[], cwd: string, timeout?: number
|
|
12
|
+
export declare function runCommand(command: string, args: string[], cwd: string, timeout?: number, // 2 minutes default
|
|
13
|
+
envOverrides?: Record<string, string>): Promise<{
|
|
13
14
|
stdout: string;
|
|
14
15
|
stderr: string;
|
|
15
16
|
exitCode: number | undefined;
|
|
@@ -36,13 +36,13 @@ export async function runCreateAgentsCLI(args, cwd, timeout = 300000 // 5 minute
|
|
|
36
36
|
/**
|
|
37
37
|
* Run a command in the created project directory
|
|
38
38
|
*/
|
|
39
|
-
export async function runCommand(command, args, cwd, timeout = 120000 // 2 minutes default
|
|
40
|
-
) {
|
|
39
|
+
export async function runCommand(command, args, cwd, timeout = 120000, // 2 minutes default
|
|
40
|
+
envOverrides) {
|
|
41
41
|
try {
|
|
42
42
|
const result = await execa(command, args, {
|
|
43
43
|
cwd,
|
|
44
44
|
timeout,
|
|
45
|
-
env: { ...process.env, FORCE_COLOR: '0' },
|
|
45
|
+
env: { ...process.env, FORCE_COLOR: '0', ...envOverrides },
|
|
46
46
|
shell: true,
|
|
47
47
|
});
|
|
48
48
|
return {
|
package/dist/utils.js
CHANGED
|
@@ -404,6 +404,7 @@ async function createEnvironmentFiles(config) {
|
|
|
404
404
|
// Convert to forward slashes for cross-platform SQLite URI compatibility
|
|
405
405
|
const jwtSigningSecret = crypto.randomBytes(32).toString('hex');
|
|
406
406
|
const betterAuthSecret = crypto.randomBytes(32).toString('hex');
|
|
407
|
+
const manageUiPassword = crypto.randomBytes(6).toString('base64url');
|
|
407
408
|
// Generate RSA key pair for temporary JWT tokens
|
|
408
409
|
let tempJwtPrivateKey = '';
|
|
409
410
|
let tempJwtPublicKey = '';
|
|
@@ -466,12 +467,11 @@ INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY=${tempJwtPublicKey}
|
|
|
466
467
|
DEFAULT_PROJECT_ID=${config.projectId}
|
|
467
468
|
|
|
468
469
|
# Auth Configuration
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
INKEEP_AGENTS_MANAGE_UI_USERNAME=admin@example.com
|
|
471
|
+
INKEEP_AGENTS_MANAGE_UI_PASSWORD=${manageUiPassword}
|
|
471
472
|
BETTER_AUTH_SECRET=${betterAuthSecret}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
ENABLE_AUTHZ=false
|
|
473
|
+
SPICEDB_ENDPOINT=localhost:50051
|
|
474
|
+
SPICEDB_PRESHARED_KEY=dev-secret-key
|
|
475
475
|
|
|
476
476
|
`;
|
|
477
477
|
await fs.writeFile('.env', envContent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/create-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
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.
|
|
36
|
+
"@inkeep/agents-core": "0.45.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/degit": "^2.8.6",
|