Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion examples/host-test/probe-note.txt

This file was deleted.

4 changes: 3 additions & 1 deletion examples/mcp-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ from the example package:
cd examples/mcp-app
pnpm validate
pnpm build
pnpm typecheck
pnpm exec agent-bundle eval --case status-is-healthy --trials 1
pnpm dev
```
Expand All @@ -95,6 +96,7 @@ variants, by default. Launch environment precedence is manifest env, then
`--env-file <path>` to replace the conventional files, `--no-env` to skip
them, and `--plugin-root <path>` only for a copied-artifact rehearsal.

Use `pnpm check` for validation and build without opening the Workbench. The
Use `pnpm check` for validation, build, and typecheck without opening the
Workbench. The
deterministic portable eval and fixture check read only checked-in data and
require no native Claude/Codex login or API key.
3 changes: 2 additions & 1 deletion examples/mcp-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"type": "module",
"scripts": {
"build": "agent-bundle build",
"check": "pnpm validate && pnpm build",
"check": "pnpm validate && pnpm build && pnpm typecheck",
"dev": "agent-bundle dev",
"test:browser-app": "rstest --config rstest.browser-app.config.ts",
"typecheck": "tsc -p tsconfig.json --noEmit",
"validate": "agent-bundle validate"
},
"devDependencies": {
Expand Down
11 changes: 8 additions & 3 deletions examples/mcp-app/src/compiler-status-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ export const isHealthyCompilerFixture = (value: unknown): boolean => {
|| value.service !== healthyCompilerStatus.service
|| value.status !== healthyCompilerStatus.status
|| value.summary !== healthyCompilerStatus.summary
|| !Array.isArray(value.checks)
|| value.checks.length !== healthyCompilerStatus.checks.length
) {
return false;
}

// Bind the property once: a narrowing on `value.checks` does not survive
// into the `every` callback, so the guard and the indexing share one binding.
const checks: unknown = value.checks;
if (!Array.isArray(checks) || checks.length !== healthyCompilerStatus.checks.length) {
return false;
}

return healthyCompilerStatus.checks.every((expected, index) => {
const received = value.checks[index];
const received: unknown = checks[index];
return isRecord(received)
&& received.label === expected.label
&& received.status === expected.status;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { afterEach, expect, it } from '@rstest/core';

import { mountBrowserApp, type MountedBrowserApp } from 'agent-bundle/test/browser';
import { mountBrowserApp, type MountBrowserAppOptions, type MountedBrowserApp } from 'agent-bundle/test/browser';

type BindingOperations = MountBrowserAppOptions['operations'];
type ToolCallResult = Awaited<ReturnType<BindingOperations['callTool']>>;

const statusResult = Object.freeze({
content: Object.freeze([Object.freeze({
Expand Down Expand Up @@ -33,10 +36,10 @@ const waitFor = async (predicate: () => boolean, timeoutMs = 2_000): Promise<voi
};

const operations = (options: {
readonly callTool?: () => Promise<unknown>;
readonly callTool?: () => Promise<ToolCallResult>;
readonly calls?: string[];
readonly reads?: string[];
} = {}) => ({
} = {}): BindingOperations => ({
callTool: async (_bindingId: string, request: { readonly name: string }) => {
options.calls?.push(request.name);
return options.callTool?.() ?? statusResult;
Expand Down
15 changes: 15 additions & 0 deletions examples/mcp-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx"
},
"include": [
"agent-bundle.config.ts",
"evals/**/*.ts",
"src/**/*.ts",
"src/**/*.tsx",
"tests/**/*.ts",
"tests/**/*.tsx",
"views/**/*.ts"
]
}
3 changes: 2 additions & 1 deletion website/docs/en/examples/mcp-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ After the repository-level `pnpm build`:
cd examples/mcp-app
pnpm validate
pnpm build
pnpm typecheck
pnpm exec agent-bundle eval --case status-is-healthy --trials 1
```

`pnpm check` is the validation-and-build pair without the Workbench.
`pnpm check` runs validation, build, and typecheck without the Workbench.

## Running the server on stdio

Expand Down
3 changes: 2 additions & 1 deletion website/docs/zh/examples/mcp-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ description: 'MCP App 示例:把一条服务就绪度工作流表达为生成
cd examples/mcp-app
pnpm validate
pnpm build
pnpm typecheck
pnpm exec agent-bundle eval --case status-is-healthy --trials 1
```

`pnpm check` 是不打开 Workbench 的“校验加构建”这一对
`pnpm check` 在不打开 Workbench 的情况下依次运行校验、构建和类型检查

## 在 stdio 上运行服务器

Expand Down
Loading