Skip to content
Draft
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,12 @@ jobs:
working-directory: template
run: npm run verify

# On the candidate, the kit's own check: the cli bundles the released kit and its rules.
- name: Conformance (the kit's six rules; the store rule uses the runner's docker)
working-directory: template
run: node_modules/.bin/agentage extension check
run: |
if [ "$CANDIDATE" = true ]; then node "$GITHUB_WORKSPACE/scripts/check-candidate.mjs"
else node_modules/.bin/agentage extension check; fi

template-local:
name: Template up and the e2e gate on local
Expand Down
2 changes: 1 addition & 1 deletion docs/part-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ id with no valid answer is `down` and has no route. A part routes only when a co
and the installation exposes it. An answer for an id that is not installed is refused, and so is a second pages route. The caller can
set a row to `starting` or `failed`; with its last good document the entry keeps its `app` row and
has no route. A document with an old `/api/v{N}` openapi is refused, and so is a tool that is not
`{id}__{name}` of its own id. An answer can carry `expectedId`, the id its container was listed for;
`{id}_{name}` of its own id. The old form `{id}__{name}` is still accepted for a time. An answer can carry `expectedId`, the id its container was listed for;
an answer for another id is refused as `claims another id`. When some answer is listed for an id, an
answer with no `expectedId` for that id is refused as `not listed for this id`. A bad answer never throws. Only an
installation that gives an invalid host document (two rows of one id) throws.
Expand Down
2 changes: 1 addition & 1 deletion docs/parts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ envelope is the kit's standard JSON answer shape: `{ success, data, meta? }` or
export const create = (ctx: PartContext): Router => {
/* ctx.store.query(...) */
};
// src/mcp/index.ts: tools served as {id}__{name} on POST /mcp (SDK v2, stateless)
// src/mcp/index.ts: tools served as {id}_{name} on POST /mcp (SDK v2, stateless)
export function create(ctx: McpContext) {
ctx.tool(
'echo',
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/apphost/fixtures/check/core/installation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"host": "core",
"program": { "version": "0.4.0" },
"program": { "version": "0.5.0" },
"extensions": [
{
"id": "market",
Expand Down
2 changes: 1 addition & 1 deletion packages/apphost/fixtures/check/platform/installation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"host": "platform",
"program": { "version": "0.4.0" },
"program": { "version": "0.5.0" },
"shell": { "package": "@agentage/shell-dashboard" },
"extensions": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/apphost/fixtures/check/root/installation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"host": "root",
"program": { "version": "0.4.0" },
"program": { "version": "0.5.0" },
"core": "https://core.next.agentage.io",
"extensions": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/apphost/fixtures/check/test/installation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"host": "test",
"program": { "version": "0.4.0" },
"program": { "version": "0.5.0" },
"core": "https://core.next.agentage.io",
"extensions": [
{
Expand Down
6 changes: 3 additions & 3 deletions packages/apphost/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agentage/apphost",
"version": "0.4.0",
"version": "0.5.0",
"description": "The agentage app host program: runs extensions through a runner and serves the combined discovery, the session and the shell",
"type": "module",
"license": "MIT",
Expand Down Expand Up @@ -46,10 +46,10 @@
"zod": "^4.2.0"
},
"peerDependencies": {
"@agentage/extension": "~0.22.0"
"@agentage/extension": "~0.23.0"
},
"devDependencies": {
"@agentage/extension": "~0.22.0"
"@agentage/extension": "~0.23.0"
},
"keywords": [
"agentage",
Expand Down
6 changes: 3 additions & 3 deletions packages/apphost/src/daemon-c1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const rpc = (method: string, params?: object) =>
describe('the daemon routes of C1', () => {
it('/mcp/{id} reaches the child: tools/list, tools/call; GET is 405 from the child', async () => {
await allRunning();
expect(await (await rpc('tools/list')).text()).toContain('"name":"all__echo"');
const call = await rpc('tools/call', { name: 'all__echo', arguments: { msg: 'hi' } });
expect(await (await rpc('tools/list')).text()).toContain('"name":"all_echo"');
const call = await rpc('tools/call', { name: 'all_echo', arguments: { msg: 'hi' } });
expect(await call.text()).toContain('pong hi');
expect((await fetch(at('/mcp/all'))).status).toBe(405);
});
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('the daemon routes of C1', () => {
commit: '0'.repeat(40),
state: 'running',
parts: PARTS,
tools: [{ name: 'all__echo', scope: 'all:read' }],
tools: [{ name: 'all_echo', scope: 'all:read' }],
openapi: '/api/all/openapi.json',
expose: { api: 'internal', mcp: 'internal' },
},
Expand Down
2 changes: 1 addition & 1 deletion packages/apphost/src/daemon-cli-user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const started = async (text?: string) => {
const api = async () =>
((await (await fetch(at('/api/who/me'))).json()) as { data: unknown }).data;
const tool = async () => {
const params = { name: 'who__who', arguments: {} };
const params = { name: 'who_who', arguments: {} };
const body = JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'tools/call', params });
const text = await (await fetch(at('/mcp/who'), { method: 'POST', headers: MCP, body })).text();
const line = text.split('\n').find((l) => l.startsWith('data:')) ?? `data:${text}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/apphost/src/daemon-seal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SPY_MANIFEST = {
name: '@agentage/extension-spy',
version: '0.1.0',
type: 'module',
engines: { agentage: '^0.22' },
engines: { agentage: '^0.23' },
agentage: { id: 'spy', parts: { api: true } },
};

Expand Down Expand Up @@ -80,7 +80,7 @@ describe.runIf(SEALED)('a sealed child (C2, Node at the floor)', () => {
headers: MCP,
body,
});
expect(await listed.text()).toContain('all__echo');
expect(await listed.text()).toContain('all_echo');
await vi.waitFor(
async () => {
const ticks = (await h.call('GET', '/api/all/ticks')).body as { data: { total: number } };
Expand Down
15 changes: 15 additions & 0 deletions packages/apphost/src/host-document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ describe('hostDocumentOf: the host document from the discovery of each child (J.
expect((await hostDocumentOf(entries, new Map())).extensions).toEqual([]);
});

it('tools in the new {id}_ and the old {id}__ form are listed; a foreign tool is down', async () => {
const withTool = (id: string, name: string) =>
child(200, JSON.stringify({ ...docOf(id), tools: [{ name, scope: 'public' }] }));
const entries = entriesOf(
entryOf('a', 'running', await withTool('a', 'a_echo')),
entryOf('b', 'running', await withTool('b', 'b__echo')),
entryOf('c', 'running', await withTool('c', 'cc_echo'))
);
const doc = await hostDocumentOf(entries, new Map());
expect(doc.extensions.map((e) => [e.id, e.tools?.[0]?.name])).toEqual([
['a', 'a_echo'],
['b', 'b__echo'],
]);
});

it('every row of an id: the pages row is in the document as it is in the routes', async () => {
const api = await child(200, JSON.stringify(docOf('a')));
const pages = await child(
Expand Down
5 changes: 4 additions & 1 deletion packages/extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npm install @agentage/extension express zod
```

A part is one folder in `src/`. This MCP part, from the extension template, serves the tool
`{id}__echo` on `POST /mcp`:
`{id}_echo` on `POST /mcp`:

```ts
import { type McpContext } from '@agentage/extension';
Expand All @@ -31,6 +31,9 @@ export function create(ctx: McpContext) {
}
```

Since 0.23.0 the kit names each tool `{id}_{name}`, with one underscore. Its schemas still accept
the old `{id}__{name}` for now, and refuse a tool of another id.

Start a new extension with `npx @agentage/cli extension create my-ext`: it pins this kit for you.

- The subpaths, the core client, the check report and secrets:
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/fixtures/bad-entries-exports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"engines": {
"agentage": "^0.22"
"agentage": "^0.23"
},
"agentage": {
"id": "base",
Expand All @@ -13,7 +13,7 @@
}
},
"dependencies": {
"@agentage/extension": "^0.22.0",
"@agentage/extension": "^0.23.0",
"express": "^5.1.0",
"zod": "^4.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/fixtures/bad-manifest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"engines": {
"agentage": "^0.22"
"agentage": "^0.23"
},
"agentage": {
"id": "Probe!",
Expand All @@ -13,7 +13,7 @@
}
},
"dependencies": {
"@agentage/extension": "^0.22.0",
"@agentage/extension": "^0.23.0",
"express": "^5.1.0",
"zod": "^4.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/fixtures/bad-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"engines": {
"agentage": "^0.22"
"agentage": "^0.23"
},
"agentage": {
"id": "base",
Expand All @@ -13,7 +13,7 @@
}
},
"dependencies": {
"@agentage/extension": "^0.22.0",
"@agentage/extension": "^0.23.0",
"express": "^4.19.0",
"zod": "^4.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/fixtures/bad-store-kind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"engines": {
"agentage": "^0.22"
"agentage": "^0.23"
},
"agentage": {
"id": "base",
Expand All @@ -13,7 +13,7 @@
}
},
"dependencies": {
"@agentage/extension": "^0.22.0",
"@agentage/extension": "^0.23.0",
"express": "^5.1.0",
"zod": "^4.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/fixtures/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"engines": {
"agentage": "^0.22"
"agentage": "^0.23"
},
"agentage": {
"id": "base",
Expand All @@ -13,7 +13,7 @@
}
},
"dependencies": {
"@agentage/extension": "^0.22.0",
"@agentage/extension": "^0.23.0",
"express": "^5.1.0",
"zod": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agentage/extension",
"version": "0.22.0",
"version": "0.23.0",
"description": "The agentage extension kit: create(ctx) per part (pages, ui, api, mcp, worker, cli), the store, /health, discovery, the envelope, and the build tool with up and token",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/schemas/extension-discovery.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"name": {
"type": "string",
"maxLength": 64,
"pattern": "^[a-z][a-z0-9-]*__[a-z][a-z0-9_-]*$"
"pattern": "^[a-z][a-z0-9-]*__?[a-z][a-z0-9_-]*$"
},
"scope": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/schemas/extension-record.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"name": {
"type": "string",
"maxLength": 64,
"pattern": "^[a-z][a-z0-9-]*__[a-z][a-z0-9_-]*$"
"pattern": "^[a-z][a-z0-9-]*__?[a-z][a-z0-9_-]*$"
},
"scope": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/schemas/host-document.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"name": {
"type": "string",
"maxLength": 64,
"pattern": "^[a-z][a-z0-9-]*__[a-z][a-z0-9_-]*$"
"pattern": "^[a-z][a-z0-9-]*__?[a-z][a-z0-9_-]*$"
},
"scope": {
"type": "string",
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/src/auth/part-mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ afterEach(async () => {

const start = (settings?: string) =>
startPart(dir, 'mcp', { ...authEnv(issuer, dir), AGENTAGE_SETTINGS: settings });
const CALL = { name: 'probe__echo', arguments: { msg: 'hi' } };
const CALL = { name: 'probe_echo', arguments: { msg: 'hi' } };
const message = (id: number, method: string, params: object) => ({
jsonrpc: '2.0',
id,
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('an mcp part checks tokens (C5, C7)', () => {
it('a bad argument is a failed tool with the REST error shape', async () => {
const url = await start();
const read = await issuer.bearer({ scope: 'probe:read' });
const bad = await rpc(url, 'tools/call', { name: 'probe__echo', arguments: { msg: 5 } }, read);
const bad = await rpc(url, 'tools/call', { name: 'probe_echo', arguments: { msg: 5 } }, read);
expect(bad.res.status).toBe(200);
expect(bad.body['result']).toEqual({
isError: true,
Expand All @@ -105,7 +105,7 @@ describe('an mcp part checks tokens (C5, C7)', () => {
expect((await rpc(url, 'tools/list', {})).res.status).toBe(401);
const read = await issuer.bearer({ scope: 'probe:read' });
const listed = await rpc(url, 'tools/list', {}, read);
expect(listed.body['result']?.['tools']).toMatchObject([{ name: 'probe__echo' }]);
expect(listed.body['result']?.['tools']).toMatchObject([{ name: 'probe_echo' }]);
});

it('no key and the issuer down: tools/call is 503 with Retry-After 5', async () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/extension/src/auth/token-guard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ describe('token check on mcp tools', () => {
it('each tools/call asks for its tool scope, read when it declares none', async () => {
const { asked, check } = recorder();
const s = await mcp(check);
expect((await rpc(s, 'tools/call', { name: 'probe__wipe', arguments: {} })).status).toBe(200);
await rpc(s, 'tools/call', { name: 'probe__echo', arguments: {} });
expect((await rpc(s, 'tools/call', { name: 'probe_wipe', arguments: {} })).status).toBe(200);
await rpc(s, 'tools/call', { name: 'probe_echo', arguments: {} });
await rpc(s, 'tools/list');
expect(asked).toEqual([
['Bearer aga_x', 'admin'],
Expand All @@ -142,15 +142,15 @@ describe('token check on mcp tools', () => {

it('a refused call is HTTP 403 or 503 with Retry-After, the envelope, never a tool result', async () => {
const s = await mcp(recorder(() => fail('FORBIDDEN', 'insufficient_scope probe:admin')).check);
const res = await rpc(s, 'tools/call', { name: 'probe__wipe', arguments: {} });
const res = await rpc(s, 'tools/call', { name: 'probe_wipe', arguments: {} });
expect(res.status).toBe(403);
expect(await res.json()).toMatchObject({
success: false,
error: { code: 'FORBIDDEN', message: 'insufficient_scope probe:admin' },
});
await served?.close();
const down = await mcp(recorder(() => fail('UNAVAILABLE', 'JWKS unreachable')).check);
const busy = await rpc(down, 'tools/call', { name: 'probe__echo', arguments: {} });
const busy = await rpc(down, 'tools/call', { name: 'probe_echo', arguments: {} });
expect([busy.status, busy.headers.get('retry-after')]).toEqual([503, '30']);
expect(await busy.json()).toMatchObject({ error: { code: 'UNAVAILABLE' } });
});
Expand Down
Loading