feat: generate schemas from types, improve type definitions #2858
main.yml
on: pull_request
Matrix: test
build
18s
publish
0s
Annotations
25 errors
|
build
Process completed with exit code 1.
|
|
build:
src/types.ts#L395
'AssertObjectSchema' is assigned a value but never used
|
|
build:
src/types.ts#L79
'RequestParamsSchema' is defined but never used
|
|
build:
src/shared/protocol.ts#L23
'JSONRPCResponse' is defined but never used
|
|
build:
src/generated/sdk.types.ts#L1203
An interface declaring no members is equivalent to its supertype
|
|
test/client/index.test.ts > callToolStream() should yield error with additional properties when not allowed:
test/client/index.test.ts#L3968
AssertionError: expected 'result' to be 'error' // Object.is equality
Expected: "error"
Received: "result"
❯ test/client/index.test.ts:3968:30
|
|
test/client/index.test.ts > should respect server task capabilities:
test/client/index.test.ts#L3369
AssertionError: promise rejected "$ZodError: [
{
"expected": "array",… { …(3) }" instead of resolving
❯ test/client/index.test.ts:3369:5
Caused by: Caused by: $ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > should list tasks from server with pagination:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should query task list from server using listTasks:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should query task status from server using getTask:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should create task on server via tool call:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > outputSchema validation > should fail validation with additional properties when not allowed:
test/client/index.test.ts#L2302
AssertionError: promise resolved "{ content: [], …(1) }" instead of rejecting
- Expected
+ Received
- Error {
- "message": "rejected promise",
+ {
+ "content": [],
+ "structuredContent": {
+ "extraField": "not allowed",
+ "name": "John",
+ },
}
❯ test/client/index.test.ts:2302:62
|
|
test/types.test.ts > Types > ToolResultContent > should validate tool result with error in content:
test/types.test.ts#L579
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:579:36
|
|
test/types.test.ts > Types > ToolResultContent > should validate a tool result content:
test/types.test.ts#L562
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:562:36
|
|
test/types.test.ts > Types > CallToolResult with ContentBlock > should validate empty content array with default:
test/types.test.ts#L286
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:286:36
|
|
test/client/index.test.ts > callToolStream() should yield error with additional properties when not allowed:
test/client/index.test.ts#L3968
AssertionError: expected 'result' to be 'error' // Object.is equality
Expected: "error"
Received: "result"
❯ test/client/index.test.ts:3968:30
|
|
test/client/index.test.ts > should respect server task capabilities:
test/client/index.test.ts#L3369
AssertionError: promise rejected "$ZodError: [
{
"expected": "array",… { …(3) }" instead of resolving
❯ test/client/index.test.ts:3369:5
Caused by: Caused by: $ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > should list tasks from server with pagination:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should query task list from server using listTasks:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should query task status from server using getTask:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > Task-based execution > Client calling server > should create task on server via tool call:
src/server/zod-compat.ts#L85
$ZodError: [
{
"expected": "array",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected array, received undefined"
}
]
❯ new $ZodError node_modules/zod/v4/core/core.js:39:39
❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20
❯ safeParse src/server/zod-compat.ts:85:31
❯ src/shared/protocol.ts:1173:41
❯ Client._onresponse src/shared/protocol.ts:901:13
❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:623:22
❯ InMemoryTransport.send src/inMemory.ts:58:34
❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:788:50
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
|
|
test/client/index.test.ts > outputSchema validation > should fail validation with additional properties when not allowed:
test/client/index.test.ts#L2302
AssertionError: promise resolved "{ content: [], …(1) }" instead of rejecting
- Expected
+ Received
- Error {
- "message": "rejected promise",
+ {
+ "content": [],
+ "structuredContent": {
+ "extraField": "not allowed",
+ "name": "John",
+ },
}
❯ test/client/index.test.ts:2302:62
|
|
test/types.test.ts > Types > ToolResultContent > should validate tool result with error in content:
test/types.test.ts#L579
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:579:36
|
|
test/types.test.ts > Types > ToolResultContent > should validate a tool result content:
test/types.test.ts#L562
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:562:36
|
|
test/types.test.ts > Types > CallToolResult with ContentBlock > should validate empty content array with default:
test/types.test.ts#L286
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ test/types.test.ts:286:36
|