angular/packages/core/package.json
Douglas Parker b2c0c91f8f refactor(core): implement declareWebMcpTool
This is a relatively light wrapper around `navigator.modelContext.registerTool` which ties tool registration to the lifecycle of an `Injector`. When the `Injector` is destroyed, the tool is automatically unregistered. This makes it easier to create WebMCP tools without having to worry about managing unregistration.

I went a little off-spec by providing the `AbortSignal` to the `execute` function. I suspect something like this will be added eventually and there are some early discussions of that, but AFAICT, this behavior is not defined yet so I'm making something up instead so the `execute` function can observe a cancellation based on the `Injector` being destroyed.

This uses `@mcp-b/webmcp-polyfill` for testing, as it provides a small `modelContextTesting` utility for listing and invoking WebMCP tools. Unfortunately it is slightly out of date of the current Chrome spec (it requires `modelContext.unregisterTool` to be called, whereas the spec recently removed this option and expects you to provide an `AbortSignal` to `registerTool`). My slightly hacky solution for the moment is to both trigger the `AbortSignal` and also call `unregisterTool` safely. In production, only the `AbortSignal` happens, but in testing the `unregisterTool` code path is used. Hopefully this will get smoothed out as the spec matures and `@mcp-b/webmcp-polyfill` updates over time.
2026-05-06 14:13:20 -07:00

55 lines
1.3 KiB
JSON

{
"name": "@angular/core",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular - the core framework",
"author": "angular",
"license": "MIT",
"engines": {
"node": "^22.22.0 || ^24.13.1 || >=26.0.0"
},
"exports": {
"./schematics/*": {
"default": "./schematics/*.js"
},
"./event-dispatch-contract.min.js": {
"default": "./event-dispatch-contract.min.js"
}
},
"dependencies": {
"tslib": "^2.3.0"
},
"devDependencies": {
"@mcp-b/webmcp-polyfill": "^2.2.0",
"@mcp-b/webmcp-types": "^2.2.0"
},
"peerDependencies": {
"@angular/compiler": "0.0.0-PLACEHOLDER",
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.15.0 || ~0.16.0"
},
"peerDependenciesMeta": {
"@angular/compiler": {
"optional": true
},
"zone.js": {
"optional": true
}
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.git",
"directory": "packages/core"
},
"ng-update": {
"migrations": "./schematics/migrations.json",
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"angular": {
"bestPractices": {
"format": "markdown",
"path": "./resources/best-practices.md"
}
},
"schematics": "./schematics/collection.json",
"sideEffects": false
}