Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
e285df9
add lint scripts for agents-cli, agents-cookbook and test-agents
dimaMachina Jan 17, 2026
baefb40
apply fixes
dimaMachina Jan 17, 2026
c98012f
apply fixes
dimaMachina Jan 17, 2026
969235f
apply fixes
dimaMachina Jan 17, 2026
6161333
apply fixes
dimaMachina Jan 17, 2026
611c04a
apply fixes
dimaMachina Jan 17, 2026
6839fa3
apply fixes
dimaMachina Jan 17, 2026
6ec130d
apply fixes
dimaMachina Jan 17, 2026
474010c
apply fixes
dimaMachina Jan 17, 2026
e477ad3
apply fixes
dimaMachina Jan 17, 2026
3760eb3
apply fixes
dimaMachina Jan 17, 2026
2050054
apply fixes
dimaMachina Jan 17, 2026
aec9a32
apply fixes
dimaMachina Jan 17, 2026
2f126ef
apply fixes
dimaMachina Jan 17, 2026
bd02883
apply fixes
dimaMachina Jan 17, 2026
9c10342
apply fixes
dimaMachina Jan 17, 2026
b49ffd5
apply fixes
dimaMachina Jan 17, 2026
3b7b9ff
apply fixes
dimaMachina Jan 17, 2026
0e2a322
apply fixes
dimaMachina Jan 17, 2026
3fce1bf
apply fixes
dimaMachina Jan 17, 2026
6ae9e79
apply fixes
dimaMachina Jan 17, 2026
23b018b
apply fixes
dimaMachina Jan 17, 2026
90168fe
apply fixes
dimaMachina Jan 17, 2026
d74eebd
apply fixes
dimaMachina Jan 17, 2026
2e4a17f
apply fixes
dimaMachina Jan 17, 2026
e2975c3
apply fixes
dimaMachina Jan 17, 2026
3dc2fbe
apply fixes
dimaMachina Jan 17, 2026
5521ab3
apply fixes
dimaMachina Jan 17, 2026
5864059
apply fixes
dimaMachina Jan 17, 2026
0c527fc
apply fixes
dimaMachina Jan 17, 2026
e097b69
apply fixes
dimaMachina Jan 17, 2026
9888c6d
apply fixes
dimaMachina Jan 17, 2026
828beaf
apply fixes
dimaMachina Jan 17, 2026
a322e4f
apply fixes
dimaMachina Jan 17, 2026
ecf6003
apply fixes
dimaMachina Jan 17, 2026
52a1a29
apply fixes
dimaMachina Jan 17, 2026
4546405
apply fixes
dimaMachina Jan 17, 2026
02ae906
apply fixes
dimaMachina Jan 17, 2026
a4bbe3c
apply fixes
dimaMachina Jan 17, 2026
e11d4b9
apply fixes
dimaMachina Jan 17, 2026
b4b9666
apply fixes
dimaMachina Jan 17, 2026
2035408
apply fixes
dimaMachina Jan 17, 2026
bb97aaf
apply fixes
dimaMachina Jan 17, 2026
15fc0f3
apply fixes
dimaMachina Jan 17, 2026
024fb69
apply fixes
dimaMachina Jan 17, 2026
6ba1de1
apply fixes
dimaMachina Jan 17, 2026
b9763d5
apply fixes
dimaMachina Jan 17, 2026
bf80d88
apply fixes
dimaMachina Jan 17, 2026
28f65a5
apply fixes
dimaMachina Jan 17, 2026
70d185c
apply fixes
dimaMachina Jan 17, 2026
53dbdbd
apply fixes
dimaMachina Jan 17, 2026
cd46ccf
apply fixes
dimaMachina Jan 17, 2026
8990cae
apply fixes
dimaMachina Jan 17, 2026
4d48425
apply fixes
dimaMachina Jan 17, 2026
cad7d77
apply fixes
dimaMachina Jan 17, 2026
2439fb0
apply fixes
dimaMachina Jan 17, 2026
0ecf637
apply fixes
dimaMachina Jan 17, 2026
339966a
apply fixes
dimaMachina Jan 17, 2026
b917bfa
apply fixes
dimaMachina Jan 17, 2026
8716436
apply fixes
dimaMachina Jan 17, 2026
c59d57c
apply fixes
dimaMachina Jan 17, 2026
4e0a39e
apply fixes
dimaMachina Jan 17, 2026
6f85028
apply fixes
dimaMachina Jan 17, 2026
3d4f8e2
apply fixes
dimaMachina Jan 17, 2026
ac5dfbd
apply fixes
dimaMachina Jan 17, 2026
9fdc6a1
apply fixes
dimaMachina Jan 17, 2026
9662cff
apply fixes
dimaMachina Jan 17, 2026
2cba117
apply fixes
dimaMachina Jan 17, 2026
e742c84
apply fixes
dimaMachina Jan 17, 2026
109df5a
apply fixes
dimaMachina Jan 17, 2026
c3dbcf6
apply fixes
dimaMachina Jan 17, 2026
9d8db96
apply fixes
dimaMachina Jan 17, 2026
743db43
apply fixes
dimaMachina Jan 17, 2026
85360c9
apply fixes
dimaMachina Jan 17, 2026
1f6e711
apply fixes
dimaMachina Jan 17, 2026
ddb7cd6
apply fixes
dimaMachina Jan 17, 2026
6ca3bf2
apply fixes
dimaMachina Jan 17, 2026
837b52c
apply fixes
dimaMachina Jan 17, 2026
1f29946
add changeset
dimaMachina Jan 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fancy-cups-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-cli": minor
---

add lint script and fix lint warnings
2 changes: 2 additions & 0 deletions agents-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
},
"scripts": {
"knip": "knip --directory .. --workspace agents-cli --dependencies",
"lint": "biome lint --error-on-warnings",
"lint:fix": "biome check --write",
"build": "tsdown",
"cli": "node ./dist/index.js",
"postinstall": "node scripts/ensure-keytar.mjs || true",
Expand Down
6 changes: 3 additions & 3 deletions agents-cli/scripts/ensure-keytar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Ensures keytar native module is built for local development.
* This is needed because pnpm doesn't always trigger native module builds.
*/
import { execSync } from 'child_process';
import { createRequire } from 'module';
import { dirname, join } from 'path';
import { execSync } from 'node:child_process';
import { createRequire } from 'node:module';
import { dirname } from 'node:path';

const require = createRequire(import.meta.url);

Expand Down
4 changes: 2 additions & 2 deletions agents-cli/src/__tests__/utils/ci-environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ describe('CI Environment', () => {
it('should return X-API-Key header in CI mode', () => {
const headers = getAuthHeaders({ apiKey: 'test-api-key' }, true);
expect(headers['X-API-Key']).toBe('test-api-key');
expect(headers['Authorization']).toBeUndefined();
expect(headers.Authorization).toBeUndefined();
});

it('should return Authorization Bearer header in interactive mode', () => {
const headers = getAuthHeaders({ accessToken: 'test-token' }, false);
expect(headers['Authorization']).toBe('Bearer test-token');
expect(headers.Authorization).toBe('Bearer test-token');
expect(headers['X-API-Key']).toBeUndefined();
});

Expand Down
4 changes: 2 additions & 2 deletions agents-cli/src/__tests__/utils/config-batch.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readdirSync, statSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest';
import { join } from 'node:path';
import { beforeEach, describe, expect, it, type Mock, vi } from 'vitest';
import { findAllConfigFiles, findConfigFile, getConfigFileNames } from '../../utils/config';

// Mock fs module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ describe('ProfileManager', () => {
it('should return profile by name', () => {
const profile = profileManager.getProfile('local');
expect(profile).not.toBeNull();
expect(profile!.name).toBe('local');
expect(profile!.environment).toBe('development');
expect(profile?.name).toBe('local');
expect(profile?.environment).toBe('development');
});

it('should return null for nonexistent profile', () => {
Expand Down Expand Up @@ -387,7 +387,7 @@ describe('ProfileManager', () => {
profileManager.removeProfile('local');

const loaded = profileManager.loadProfiles();
expect(loaded.profiles['local']).toBeUndefined();
expect(loaded.profiles.local).toBeUndefined();
expect(Object.keys(loaded.profiles)).toEqual(['cloud']);
});

Expand Down
12 changes: 6 additions & 6 deletions agents-cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {
// Try to load existing credentials from default cloud profile
try {
const existingCreds = await loadCredentials('inkeep-cloud');
if (existingCreds && existingCreds.accessToken && existingCreds.organizationId) {
if (existingCreds?.accessToken && existingCreds.organizationId) {
credentials = {
accessToken: existingCreds.accessToken,
organizationId: existingCreds.organizationId,
Expand All @@ -112,7 +112,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {

// Re-check credentials after login
const newCreds = await loadCredentials('inkeep-cloud');
if (newCreds && newCreds.accessToken && newCreds.organizationId) {
if (newCreds?.accessToken && newCreds.organizationId) {
credentials = {
accessToken: newCreds.accessToken,
organizationId: newCreds.organizationId,
Expand All @@ -134,7 +134,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {
try {
const response = await fetch('https://manage-api.inkeep.com/api/cli/me', {
headers: {
Authorization: `Bearer ${credentials!.accessToken}`,
Authorization: `Bearer ${credentials?.accessToken}`,
},
});

Expand All @@ -152,7 +152,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {
selectedTenantName = data.organization.name;

s.stop(`Organization: ${chalk.cyan(selectedTenantName)}`);
} catch (error) {
} catch {
s.stop('Failed to fetch organizations');
console.error(chalk.red('Network error. Please check your connection.'));
process.exit(1);
Expand All @@ -168,7 +168,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {
`https://manage-api.inkeep.com/tenants/${selectedTenantId}/projects?limit=100`,
{
headers: {
Authorization: `Bearer ${credentials!.accessToken}`,
Authorization: `Bearer ${credentials?.accessToken}`,
},
}
);
Expand All @@ -183,7 +183,7 @@ async function cloudInitCommand(options?: InitOptions): Promise<void> {
projects = data.data || [];

s.stop(`Found ${projects.length} project(s)`);
} catch (error) {
} catch {
s.stop('Failed to fetch projects');
console.error(chalk.red('Network error. Please check your connection.'));
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion agents-cli/src/commands/profile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as p from '@clack/prompts';
import chalk from 'chalk';
import { CLOUD_REMOTE, type Profile, ProfileError, ProfileManager } from '../utils/profiles';
import { type Profile, ProfileError, ProfileManager } from '../utils/profiles';

const profileManager = new ProfileManager();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: allow in test
/**
* End-to-end integration tests for introspect generator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ describe('Project Validator - Key Listener Leak Prevention', () => {
// Expected
}
await new Promise((resolve) => setTimeout(resolve, 50));

const firstCallOnceCount = mockStdin.once.mock.calls.length;
const firstCallRemoveAllCount = mockStdin.removeAllListeners.mock.calls.length;

// Reset for second call
mockStdin.removeAllListeners.mockClear();
mockStdin.once.mockClear();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: allow in test

/**
* Manual CLI test script for introspect functionality
Expand Down
4 changes: 2 additions & 2 deletions agents-cli/src/commands/pull-v3/component-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ describe('Component Parser', () => {

beforeEach(() => {
// Create temporary test directory
testDir = join(tmpdir(), 'component-parser-test-' + Date.now());
testDir = join(tmpdir(), `component-parser-test-${Date.now()}`);
mkdirSync(testDir, { recursive: true });
});

afterEach(() => {
// Clean up test directory
try {
rmSync(testDir, { recursive: true, force: true });
} catch (error) {
} catch {
// Ignore cleanup errors
}
});
Expand Down
4 changes: 0 additions & 4 deletions agents-cli/src/commands/pull-v3/component-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
import { extname, join, relative } from 'node:path';
import chalk from 'chalk';
import { type CallExpression, Node, type ObjectLiteralExpression, Project } from 'ts-morph';
import { ComponentRegistry, type ComponentType } from './utils/component-registry';

Expand Down Expand Up @@ -485,9 +484,6 @@ export function buildComponentRegistryFromParsing(
}
stats.byType[component.type] = (stats.byType[component.type] || 0) + 1;
}

const total = stats.exported + stats.inline;

return registry;
}

Expand Down
Loading
Loading