Skip to content

Commit 31c1a6e

Browse files
guglielmo-sangemini-code-assist[bot]ishymko
authored
build: run tsc --noEmit on lint (#214)
# Description `tsup` does not perform strict type checking before the generation of the `d.ts` files. Adding the `tsc --noEmit` step checks for types violation. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Ivan Shymko <[email protected]>
1 parent 0e5c9fd commit 31c1a6e

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@
7171
"scripts": {
7272
"clean": "gts clean",
7373
"build": "tsup",
74-
"pretest": "npm run build",
7574
"test": "mocha \"test/**/*.spec.ts\"",
76-
"lint": "npx eslint .",
75+
"lint": "tsc --noEmit && npx eslint .",
7776
"format:readme": "prettier --write ./README.md",
7877
"lint:fix": "npx eslint . --fix",
7978
"coverage": "c8 npm run test",

src/samples/agents/movie-agent/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ const movieAgentCard: AgentCard = {
254254
url: 'https://example.com/a2a-samples', // Added provider URL
255255
},
256256
version: '0.0.2', // Incremented version
257+
protocolVersion: '0.3.0',
257258
capabilities: {
258259
streaming: true, // The new framework supports streaming
259260
pushNotifications: false, // Assuming not implemented for this agent yet

test/client/client.spec.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,14 @@ describe('A2AClient Basic Tests', () => {
343343
streaming: true,
344344
pushNotifications: true,
345345
},
346-
skills: [],
346+
skills: [
347+
{
348+
id: 'test_agent',
349+
name: 'Test Agent',
350+
description: 'Simulate the general flow of a streaming agent.',
351+
tags: ['test'],
352+
},
353+
],
347354
};
348355
return createAgentCardResponse(invalidAgentCard);
349356
}
@@ -419,7 +426,14 @@ describe('A2AClient Basic Tests', () => {
419426
streaming: true,
420427
pushNotifications: true,
421428
},
422-
skills: [],
429+
skills: [
430+
{
431+
id: 'test_agent',
432+
name: 'Test Agent',
433+
description: 'Simulate the general flow of a streaming agent.',
434+
tags: ['test'],
435+
},
436+
],
423437
};
424438
expect(() => new A2AClient(mockAgentCard as any)).to.throw(
425439
"Provided Agent Card does not contain a valid 'url' for the service endpoint."

test/client/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ export function createMockFetch(
279279

280280
// Handle API requests
281281
if (url.includes('/api')) {
282-
const authHeader = options?.headers?.['Authorization'] as string;
282+
const headers = new Headers(options?.headers);
283+
const authHeader = headers.get('Authorization');
283284

284285
// Capture auth headers if requested
285286
if (captureAuthHeaders) {

test/server/default_request_handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
TaskPushNotificationConfig,
3030
TaskState,
3131
TaskStatusUpdateEvent,
32+
TextPart,
3233
} from '../../src/index.js';
3334
import {
3435
DefaultExecutionEventBusManager,
@@ -44,7 +45,6 @@ import {
4445
import { MockPushNotificationSender } from './mocks/push_notification_sender.mock.js';
4546
import { ServerCallContext } from '../../src/server/context.js';
4647
import { MockTaskStore } from './mocks/task_store.mock.js';
47-
import { TextPart } from 'genkit/model';
4848

4949
describe('DefaultRequestHandler as A2ARequestHandler', () => {
5050
let handler: A2ARequestHandler;

test/server/jsonrpc_transport_handler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sinon from 'sinon';
44

55
import { JsonRpcTransportHandler } from '../../src/server/transports/jsonrpc_transport_handler.js';
66
import { A2ARequestHandler } from '../../src/server/request_handler/a2a_request_handler.js';
7-
import { JSONRPCErrorResponse } from '../../src/index.js';
7+
import { JSONRPCErrorResponse, JSONRPCRequest } from '../../src/index.js';
88

99
describe('JsonRpcTransportHandler', () => {
1010
let mockRequestHandler: A2ARequestHandler;
@@ -115,7 +115,7 @@ describe('JsonRpcTransportHandler', () => {
115115
});
116116

117117
it('should handle valid request with null id', async () => {
118-
const request = {
118+
const request: JSONRPCRequest = {
119119
jsonrpc: '2.0',
120120
method: 'message/send',
121121
id: null,

0 commit comments

Comments
 (0)