@tooluminati/angular 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +13 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +12 -0
  5. package/dist/inject-web-mcp-registry.d.ts +4 -0
  6. package/dist/inject-web-mcp-registry.d.ts.map +1 -0
  7. package/dist/inject-web-mcp-registry.js +19 -0
  8. package/dist/provide-web-mcp-registry.d.ts +19 -0
  9. package/dist/provide-web-mcp-registry.d.ts.map +1 -0
  10. package/dist/provide-web-mcp-registry.js +79 -0
  11. package/dist/register-web-mcp-tool.d.ts +9 -0
  12. package/dist/register-web-mcp-tool.d.ts.map +1 -0
  13. package/dist/register-web-mcp-tool.js +64 -0
  14. package/dist/register-web-mcp-tools.d.ts +3 -0
  15. package/dist/register-web-mcp-tools.d.ts.map +1 -0
  16. package/dist/register-web-mcp-tools.js +20 -0
  17. package/dist/stable-tool.d.ts +4 -0
  18. package/dist/stable-tool.d.ts.map +1 -0
  19. package/dist/stable-tool.js +9 -0
  20. package/dist/test-setup.d.ts +5 -0
  21. package/dist/test-setup.d.ts.map +1 -0
  22. package/dist/test-setup.js +8 -0
  23. package/dist/web-mcp-context.d.ts +14 -0
  24. package/dist/web-mcp-context.d.ts.map +1 -0
  25. package/dist/web-mcp-context.js +2 -0
  26. package/dist/web-mcp-scope.component.d.ts +11 -0
  27. package/dist/web-mcp-scope.component.d.ts.map +1 -0
  28. package/dist/web-mcp-scope.component.js +43 -0
  29. package/dist/web-mcp-security-banner.component.d.ts +13 -0
  30. package/dist/web-mcp-security-banner.component.d.ts.map +1 -0
  31. package/dist/web-mcp-security-banner.component.js +64 -0
  32. package/dist/web-mcp-security-banner.d.ts +7 -0
  33. package/dist/web-mcp-security-banner.d.ts.map +1 -0
  34. package/dist/web-mcp-security-banner.js +17 -0
  35. package/package.json +56 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jitterbox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @experimental Tooluminati Angular bindings — public APIs may change.
3
+ */
4
+ export * from './web-mcp-context';
5
+ export * from './inject-web-mcp-registry';
6
+ export * from './provide-web-mcp-registry';
7
+ export * from './register-web-mcp-tool';
8
+ export * from './register-web-mcp-tools';
9
+ export * from './stable-tool';
10
+ export * from './web-mcp-security-banner';
11
+ export * from './web-mcp-security-banner.component';
12
+ export * from './web-mcp-scope.component';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @experimental Tooluminati Angular bindings — public APIs may change.
3
+ */
4
+ export * from './web-mcp-context';
5
+ export * from './inject-web-mcp-registry';
6
+ export * from './provide-web-mcp-registry';
7
+ export * from './register-web-mcp-tool';
8
+ export * from './register-web-mcp-tools';
9
+ export * from './stable-tool';
10
+ export * from './web-mcp-security-banner';
11
+ export * from './web-mcp-security-banner.component';
12
+ export * from './web-mcp-scope.component';
@@ -0,0 +1,4 @@
1
+ import type { WebMcpRegistry } from '@tooluminati/core';
2
+ export declare function injectWebMcpContextValue(fallbackRegistry?: WebMcpRegistry): import('./web-mcp-context').WebMcpAngularContextValue;
3
+ export declare function injectWebMcpRegistry(fallbackRegistry?: WebMcpRegistry): WebMcpRegistry;
4
+ //# sourceMappingURL=inject-web-mcp-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-web-mcp-registry.d.ts","sourceRoot":"","sources":["../src/inject-web-mcp-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,wBAAgB,wBAAwB,CACtC,gBAAgB,CAAC,EAAE,cAAc,GAChC,OAAO,mBAAmB,EAAE,yBAAyB,CAiBvD;AAED,wBAAgB,oBAAoB,CAClC,gBAAgB,CAAC,EAAE,cAAc,GAChC,cAAc,CAEhB"}
@@ -0,0 +1,19 @@
1
+ import { inject } from '@angular/core';
2
+ import { WEB_MCP_CONTEXT } from './web-mcp-context';
3
+ export function injectWebMcpContextValue(fallbackRegistry) {
4
+ if (fallbackRegistry) {
5
+ return {
6
+ registry: fallbackRegistry,
7
+ enabled: true,
8
+ };
9
+ }
10
+ const context = inject(WEB_MCP_CONTEXT, { optional: true });
11
+ if (!context) {
12
+ throw new Error('injectWebMcpRegistry() called outside a WebMcp provider. ' +
13
+ 'Add provideWebMcpRegistry() to your application or route providers.');
14
+ }
15
+ return context;
16
+ }
17
+ export function injectWebMcpRegistry(fallbackRegistry) {
18
+ return injectWebMcpContextValue(fallbackRegistry).registry;
19
+ }
@@ -0,0 +1,19 @@
1
+ import { EnvironmentProviders } from '@angular/core';
2
+ import { type PolicyContext, type WebMcpRegistryOptions, type WebMcpToolDescriptor } from '@tooluminati/core';
3
+ import { type WebMcpPolicySet } from '@tooluminati/policies';
4
+ import { type WebMcpAngularContextValue } from './web-mcp-context';
5
+ export interface WebMcpRegistryConfig {
6
+ tools?: WebMcpToolDescriptor[];
7
+ enabled?: boolean;
8
+ strict?: boolean;
9
+ namespace?: string;
10
+ policies?: WebMcpPolicySet;
11
+ policyContext?: PolicyContext;
12
+ modelContext?: WebMcpRegistryOptions['modelContext'];
13
+ getAppContext?: () => unknown;
14
+ onSecurityWarning?: WebMcpRegistryOptions['onSecurityWarning'];
15
+ onError?: WebMcpRegistryOptions['onError'];
16
+ }
17
+ export declare function provideWebMcpRegistry(config?: WebMcpRegistryConfig): EnvironmentProviders;
18
+ export declare function createWebMcpRegistryForTesting(config?: WebMcpRegistryConfig): WebMcpAngularContextValue;
19
+ //# sourceMappingURL=provide-web-mcp-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provide-web-mcp-registry.d.ts","sourceRoot":"","sources":["../src/provide-web-mcp-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAMrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAC/D,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CAC5C;AAyBD,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,oBAAyB,GAChC,oBAAoB,CAwDtB;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,GAAE,oBAAyB,GAChC,yBAAyB,CAmB3B"}
@@ -0,0 +1,79 @@
1
+ import { DestroyRef, isDevMode, makeEnvironmentProviders, Optional, signal, SkipSelf, } from '@angular/core';
2
+ import { WebMcpRegistry, } from '@tooluminati/core';
3
+ import { localDevPolicy, } from '@tooluminati/policies';
4
+ import { WEB_MCP_CONTEXT, } from './web-mcp-context';
5
+ function buildContextValue(registry, config, registryRevision) {
6
+ const value = {
7
+ registry,
8
+ enabled: config.enabled ?? false,
9
+ policies: config.policies ?? localDevPolicy,
10
+ registryRevision,
11
+ };
12
+ if (config.policyContext !== undefined) {
13
+ value.policyContext = config.policyContext;
14
+ }
15
+ if (config.namespace !== undefined) {
16
+ value.namespace = config.namespace;
17
+ }
18
+ return value;
19
+ }
20
+ export function provideWebMcpRegistry(config = {}) {
21
+ return makeEnvironmentProviders([
22
+ {
23
+ provide: WEB_MCP_CONTEXT,
24
+ useFactory: (parentContext, destroyRef) => {
25
+ if (parentContext &&
26
+ config.namespace === undefined &&
27
+ isDevMode()) {
28
+ console.warn('[tooluminati] Nested WebMcp provider detected without a namespace. ' +
29
+ 'Provide namespace to avoid tool collisions.');
30
+ }
31
+ const registryRevision = signal(0, ...(ngDevMode ? [{ debugName: "registryRevision" }] : []));
32
+ const bumpRegistryRevision = () => {
33
+ registryRevision.update((value) => value + 1);
34
+ };
35
+ const registry = new WebMcpRegistry({
36
+ enabled: config.enabled ?? false,
37
+ strict: config.strict ?? false,
38
+ namespace: config.namespace,
39
+ policies: config.policies ?? localDevPolicy,
40
+ policyContext: config.policyContext,
41
+ modelContext: config.modelContext,
42
+ getAppContext: config.getAppContext,
43
+ onSecurityWarning: config.onSecurityWarning,
44
+ onError: config.onError,
45
+ onRegister: () => bumpRegistryRevision(),
46
+ });
47
+ const tools = config.tools ?? [];
48
+ const registrations = tools.map((tool) => registry.registerTool(tool, { source: 'provider' }));
49
+ destroyRef.onDestroy(() => {
50
+ for (const registration of registrations) {
51
+ registration.abort();
52
+ }
53
+ registry.unregisterAll();
54
+ bumpRegistryRevision();
55
+ });
56
+ return buildContextValue(registry, config, registryRevision);
57
+ },
58
+ deps: [[new Optional(), new SkipSelf(), WEB_MCP_CONTEXT], DestroyRef],
59
+ },
60
+ ]);
61
+ }
62
+ export function createWebMcpRegistryForTesting(config = {}) {
63
+ const registry = new WebMcpRegistry({
64
+ enabled: config.enabled ?? false,
65
+ strict: config.strict ?? false,
66
+ namespace: config.namespace,
67
+ policies: config.policies ?? localDevPolicy,
68
+ policyContext: config.policyContext,
69
+ modelContext: config.modelContext,
70
+ getAppContext: config.getAppContext,
71
+ onSecurityWarning: config.onSecurityWarning,
72
+ onError: config.onError,
73
+ });
74
+ const tools = config.tools ?? [];
75
+ for (const tool of tools) {
76
+ registry.registerTool(tool, { source: 'provider' });
77
+ }
78
+ return buildContextValue(registry, config, signal(0));
79
+ }
@@ -0,0 +1,9 @@
1
+ import { type Signal } from '@angular/core';
2
+ import type { RegisterToolOptions, WebMcpRegistry, WebMcpToolDescriptor } from '@tooluminati/core';
3
+ export interface RegisterWebMcpToolOptions extends RegisterToolOptions {
4
+ fallbackRegistry?: WebMcpRegistry;
5
+ /** Signal dependencies that trigger tool definition re-registration. */
6
+ definitionDeps?: Signal<unknown>[];
7
+ }
8
+ export declare function registerWebMcpTool<TArgs, TResult>(getTool: () => WebMcpToolDescriptor<TArgs, TResult>, options?: RegisterWebMcpToolOptions): void;
9
+ //# sourceMappingURL=register-web-mcp-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-web-mcp-tool.d.ts","sourceRoot":"","sources":["../src/register-web-mcp-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,mBAAmB,EAGnB,cAAc,EACd,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;CACpC;AAgDD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAC/C,OAAO,EAAE,MAAM,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,EACnD,OAAO,GAAE,yBAA8B,GACtC,IAAI,CA8CN"}
@@ -0,0 +1,64 @@
1
+ import { assertInInjectionContext, DestroyRef, effect, inject, untracked, } from '@angular/core';
2
+ import { injectWebMcpRegistry } from './inject-web-mcp-registry';
3
+ import { WEB_MCP_CONTEXT } from './web-mcp-context';
4
+ function stableSerialize(value) {
5
+ return JSON.stringify(value, (_key, current) => current && typeof current === 'object' && !Array.isArray(current)
6
+ ? Object.keys(current)
7
+ .sort()
8
+ .reduce((accumulator, key) => {
9
+ accumulator[key] = current[key];
10
+ return accumulator;
11
+ }, {})
12
+ : current);
13
+ }
14
+ function buildDefinitionKey(tool, options) {
15
+ return {
16
+ name: tool.name,
17
+ title: tool.title,
18
+ description: tool.description,
19
+ inputSchema: tool.inputSchema,
20
+ annotations: tool.annotations,
21
+ exposedTo: options.exposedTo,
22
+ source: options.source,
23
+ };
24
+ }
25
+ function registerToolInstance(registry, toolRef, options) {
26
+ return registry.registerTool({
27
+ ...toolRef.current,
28
+ execute: (args, executionContext) => toolRef.current.execute(args, executionContext),
29
+ }, {
30
+ ...options,
31
+ source: options.source ?? 'hook',
32
+ });
33
+ }
34
+ export function registerWebMcpTool(getTool, options = {}) {
35
+ assertInInjectionContext(registerWebMcpTool);
36
+ const registry = injectWebMcpRegistry(options.fallbackRegistry);
37
+ const context = inject(WEB_MCP_CONTEXT, { optional: true });
38
+ const destroyRef = inject(DestroyRef);
39
+ const toolRef = { current: getTool() };
40
+ let registration = registerToolInstance(registry, toolRef, options);
41
+ if (options.definitionDeps?.length) {
42
+ let lastDefinitionKey = stableSerialize(buildDefinitionKey(toolRef.current, options));
43
+ effect(() => {
44
+ for (const dep of options.definitionDeps) {
45
+ dep();
46
+ }
47
+ untracked(() => {
48
+ toolRef.current = getTool();
49
+ const definitionKey = stableSerialize(buildDefinitionKey(toolRef.current, options));
50
+ if (definitionKey === lastDefinitionKey) {
51
+ return;
52
+ }
53
+ lastDefinitionKey = definitionKey;
54
+ registration.abort();
55
+ context?.registryRevision?.update((value) => value + 1);
56
+ registration = registerToolInstance(registry, toolRef, options);
57
+ });
58
+ });
59
+ }
60
+ destroyRef.onDestroy(() => {
61
+ registration.abort();
62
+ context?.registryRevision?.update((value) => value + 1);
63
+ });
64
+ }
@@ -0,0 +1,3 @@
1
+ import type { RegisterToolOptions, WebMcpToolDescriptor } from '@tooluminati/core';
2
+ export declare function registerWebMcpTools(tools: WebMcpToolDescriptor[], options?: RegisterToolOptions): void;
3
+ //# sourceMappingURL=register-web-mcp-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-web-mcp-tools.d.ts","sourceRoot":"","sources":["../src/register-web-mcp-tools.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAI3B,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,oBAAoB,EAAE,EAC7B,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAoBN"}
@@ -0,0 +1,20 @@
1
+ import { assertInInjectionContext, DestroyRef, inject, } from '@angular/core';
2
+ import { injectWebMcpRegistry } from './inject-web-mcp-registry';
3
+ import { WEB_MCP_CONTEXT } from './web-mcp-context';
4
+ export function registerWebMcpTools(tools, options = {}) {
5
+ assertInInjectionContext(registerWebMcpTools);
6
+ const registry = injectWebMcpRegistry();
7
+ const context = inject(WEB_MCP_CONTEXT, { optional: true });
8
+ const destroyRef = inject(DestroyRef);
9
+ const source = options.source ?? 'scope';
10
+ const registrations = tools.map((tool) => registry.registerTool(tool, {
11
+ ...options,
12
+ source,
13
+ }));
14
+ destroyRef.onDestroy(() => {
15
+ for (const registration of registrations) {
16
+ registration.abort();
17
+ }
18
+ context?.registryRevision?.update((value) => value + 1);
19
+ });
20
+ }
@@ -0,0 +1,4 @@
1
+ import { type Signal } from '@angular/core';
2
+ import type { WebMcpToolDescriptor } from '@tooluminati/core';
3
+ export declare function createStableWebMcpTool<TArgs, TResult>(factory: () => WebMcpToolDescriptor<TArgs, TResult>, deps: Signal<unknown>[]): Signal<WebMcpToolDescriptor<TArgs, TResult>>;
4
+ //# sourceMappingURL=stable-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-tool.d.ts","sourceRoot":"","sources":["../src/stable-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EACnD,OAAO,EAAE,MAAM,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,EACnD,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GACtB,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAQ9C"}
@@ -0,0 +1,9 @@
1
+ import { computed } from '@angular/core';
2
+ export function createStableWebMcpTool(factory, deps) {
3
+ return computed(() => {
4
+ for (const dep of deps) {
5
+ dep();
6
+ }
7
+ return factory();
8
+ });
9
+ }
@@ -0,0 +1,5 @@
1
+ import 'zone.js';
2
+ import 'zone.js/testing';
3
+ import { type TestModuleMetadata } from '@angular/core/testing';
4
+ export declare function configureAngularTestingModule(metadata: TestModuleMetadata): void;
5
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AACjB,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAW/B,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,kBAAkB,GAC3B,IAAI,CAEN"}
@@ -0,0 +1,8 @@
1
+ import 'zone.js';
2
+ import 'zone.js/testing';
3
+ import { getTestBed, TestBed, } from '@angular/core/testing';
4
+ import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing';
5
+ getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
6
+ export function configureAngularTestingModule(metadata) {
7
+ TestBed.configureTestingModule(metadata);
8
+ }
@@ -0,0 +1,14 @@
1
+ import { InjectionToken, type WritableSignal } from '@angular/core';
2
+ import type { PolicyContext, WebMcpRegistry } from '@tooluminati/core';
3
+ import type { WebMcpPolicySet } from '@tooluminati/policies';
4
+ export interface WebMcpAngularContextValue {
5
+ registry: WebMcpRegistry;
6
+ enabled: boolean;
7
+ /** Bumps when tools register or unregister so UI can react. */
8
+ registryRevision?: WritableSignal<number>;
9
+ policies?: WebMcpPolicySet;
10
+ policyContext?: PolicyContext | undefined;
11
+ namespace?: string | undefined;
12
+ }
13
+ export declare const WEB_MCP_CONTEXT: InjectionToken<WebMcpAngularContextValue>;
14
+ //# sourceMappingURL=web-mcp-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-mcp-context.d.ts","sourceRoot":"","sources":["../src/web-mcp-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,eAAO,MAAM,eAAe,2CAE3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const WEB_MCP_CONTEXT = new InjectionToken('WEB_MCP_CONTEXT');
@@ -0,0 +1,11 @@
1
+ import type { WebMcpToolDescriptor, WebMcpToolSource } from '@tooluminati/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class WebMcpScopeComponent {
4
+ readonly tools: import("@angular/core").InputSignal<WebMcpToolDescriptor<unknown, unknown>[]>;
5
+ readonly source: import("@angular/core").InputSignal<WebMcpToolSource>;
6
+ readonly namespaceSegment: import("@angular/core").InputSignal<string | undefined>;
7
+ constructor();
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebMcpScopeComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<WebMcpScopeComponent, "web-mcp-scope", never, { "tools": { "alias": "tools"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": false; "isSignal": true; }; "namespaceSegment": { "alias": "namespaceSegment"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
10
+ }
11
+ //# sourceMappingURL=web-mcp-scope.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-mcp-scope.component.d.ts","sourceRoot":"","sources":["../src/web-mcp-scope.component.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;;AAI3B,qBAKa,oBAAoB;IAC/B,QAAQ,CAAC,KAAK,gFAA4C;IAC1D,QAAQ,CAAC,MAAM,wDAAoC;IACnD,QAAQ,CAAC,gBAAgB,0DAAwC;;yCAHtD,oBAAoB;2CAApB,oBAAoB;CAmChC"}
@@ -0,0 +1,43 @@
1
+ import { Component, DestroyRef, effect, inject, input, } from '@angular/core';
2
+ import { injectWebMcpRegistry } from './inject-web-mcp-registry';
3
+ import { WEB_MCP_CONTEXT } from './web-mcp-context';
4
+ import * as i0 from "@angular/core";
5
+ export class WebMcpScopeComponent {
6
+ tools = input.required(...(ngDevMode ? [{ debugName: "tools" }] : []));
7
+ source = input('scope', ...(ngDevMode ? [{ debugName: "source" }] : []));
8
+ namespaceSegment = input(undefined, ...(ngDevMode ? [{ debugName: "namespaceSegment" }] : []));
9
+ constructor() {
10
+ const registry = injectWebMcpRegistry();
11
+ const context = inject(WEB_MCP_CONTEXT, { optional: true });
12
+ const destroyRef = inject(DestroyRef);
13
+ effect((onCleanup) => {
14
+ const segment = this.namespaceSegment();
15
+ const scopedTools = segment
16
+ ? this.tools().map((tool) => ({
17
+ ...tool,
18
+ name: `${segment}.${tool.name}`,
19
+ }))
20
+ : this.tools();
21
+ const registrations = scopedTools.map((tool) => registry.registerTool(tool, {
22
+ source: this.source(),
23
+ }));
24
+ onCleanup(() => {
25
+ for (const registration of registrations) {
26
+ registration.abort();
27
+ }
28
+ context?.registryRevision?.update((value) => value + 1);
29
+ });
30
+ });
31
+ destroyRef.onDestroy(() => undefined);
32
+ }
33
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebMcpScopeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
34
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: WebMcpScopeComponent, isStandalone: true, selector: "web-mcp-scope", inputs: { tools: { classPropertyName: "tools", publicName: "tools", isSignal: true, isRequired: true, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, namespaceSegment: { classPropertyName: "namespaceSegment", publicName: "namespaceSegment", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '<ng-content />', isInline: true });
35
+ }
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebMcpScopeComponent, decorators: [{
37
+ type: Component,
38
+ args: [{
39
+ selector: 'web-mcp-scope',
40
+ standalone: true,
41
+ template: '<ng-content />',
42
+ }]
43
+ }], ctorParameters: () => [], propDecorators: { tools: [{ type: i0.Input, args: [{ isSignal: true, alias: "tools", required: true }] }], source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], namespaceSegment: [{ type: i0.Input, args: [{ isSignal: true, alias: "namespaceSegment", required: false }] }] } });
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class WebMcpSecurityBannerComponent {
3
+ private readonly context;
4
+ readonly banner: import("@angular/core").Signal<{
5
+ enabled: boolean;
6
+ supported: boolean;
7
+ registeredTools: string[];
8
+ message: string;
9
+ }>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebMcpSecurityBannerComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<WebMcpSecurityBannerComponent, "web-mcp-security-banner", never, {}, {}, never, never, true, never>;
12
+ }
13
+ //# sourceMappingURL=web-mcp-security-banner.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-mcp-security-banner.component.d.ts","sourceRoot":"","sources":["../src/web-mcp-security-banner.component.ts"],"names":[],"mappings":";AAIA,qBAuBa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IAEtD,QAAQ,CAAC,MAAM;;;;;OAWZ;yCAdQ,6BAA6B;2CAA7B,6BAA6B;CAezC"}
@@ -0,0 +1,64 @@
1
+ import { Component, computed } from '@angular/core';
2
+ import { injectWebMcpContextValue } from './inject-web-mcp-registry';
3
+ import { isWebMcpSupported } from '@tooluminati/core';
4
+ import * as i0 from "@angular/core";
5
+ export class WebMcpSecurityBannerComponent {
6
+ context = injectWebMcpContextValue();
7
+ banner = computed(() => {
8
+ this.context.registryRevision?.();
9
+ return {
10
+ enabled: this.context.enabled,
11
+ supported: isWebMcpSupported(),
12
+ registeredTools: this.context.registry.getRegisteredToolNames(),
13
+ message: this.context.enabled
14
+ ? 'Tooluminati diagnostics are enabled for this page.'
15
+ : 'Tooluminati diagnostics are disabled.',
16
+ };
17
+ }, ...(ngDevMode ? [{ debugName: "banner" }] : []));
18
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebMcpSecurityBannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: WebMcpSecurityBannerComponent, isStandalone: true, selector: "web-mcp-security-banner", ngImport: i0, template: `
20
+ @if (banner().enabled) {
21
+ <aside
22
+ aria-live="polite"
23
+ style="
24
+ background: #fff3cd;
25
+ border: 1px solid #ffeeba;
26
+ color: #856404;
27
+ padding: 0.75rem 1rem;
28
+ margin-bottom: 1rem;
29
+ "
30
+ >
31
+ <strong>Tooluminati diagnostics enabled.</strong>
32
+ {{ banner().message }}
33
+ Registered tools:
34
+ {{ banner().registeredTools.join(', ') || 'none' }}.
35
+ </aside>
36
+ }
37
+ `, isInline: true });
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WebMcpSecurityBannerComponent, decorators: [{
40
+ type: Component,
41
+ args: [{
42
+ selector: 'web-mcp-security-banner',
43
+ standalone: true,
44
+ template: `
45
+ @if (banner().enabled) {
46
+ <aside
47
+ aria-live="polite"
48
+ style="
49
+ background: #fff3cd;
50
+ border: 1px solid #ffeeba;
51
+ color: #856404;
52
+ padding: 0.75rem 1rem;
53
+ margin-bottom: 1rem;
54
+ "
55
+ >
56
+ <strong>Tooluminati diagnostics enabled.</strong>
57
+ {{ banner().message }}
58
+ Registered tools:
59
+ {{ banner().registeredTools.join(', ') || 'none' }}.
60
+ </aside>
61
+ }
62
+ `,
63
+ }]
64
+ }] });
@@ -0,0 +1,7 @@
1
+ export declare function webMcpSecurityBanner(): import("@angular/core").Signal<{
2
+ enabled: boolean;
3
+ supported: boolean;
4
+ registeredTools: string[];
5
+ message: string;
6
+ }>;
7
+ //# sourceMappingURL=web-mcp-security-banner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-mcp-security-banner.d.ts","sourceRoot":"","sources":["../src/web-mcp-security-banner.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB;;;;;GAenC"}
@@ -0,0 +1,17 @@
1
+ import { computed } from '@angular/core';
2
+ import { isWebMcpSupported } from '@tooluminati/core';
3
+ import { injectWebMcpContextValue } from './inject-web-mcp-registry';
4
+ export function webMcpSecurityBanner() {
5
+ const { enabled, registry, registryRevision } = injectWebMcpContextValue();
6
+ return computed(() => {
7
+ registryRevision?.();
8
+ return {
9
+ enabled,
10
+ supported: isWebMcpSupported(),
11
+ registeredTools: registry.getRegisteredToolNames(),
12
+ message: enabled
13
+ ? 'Tooluminati diagnostics are enabled for this page.'
14
+ : 'Tooluminati diagnostics are disabled.',
15
+ };
16
+ });
17
+ }
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@tooluminati/angular",
3
+ "version": "0.1.0",
4
+ "description": "Angular provider, directives, and scopes for Tooluminati.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "tslib": "^2.8.0",
19
+ "@tooluminati/policies": "0.1.0",
20
+ "@tooluminati/core": "0.1.0"
21
+ },
22
+ "peerDependencies": {
23
+ "@angular/core": "^20.0.0",
24
+ "@angular/common": "^20.0.0"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "license": "MIT",
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/jitterbox/Tooluminati.git",
36
+ "directory": "packages/angular"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/jitterbox/Tooluminati/issues"
40
+ },
41
+ "homepage": "https://github.com/jitterbox/Tooluminati#readme",
42
+ "keywords": [
43
+ "tooluminati",
44
+ "webmcp",
45
+ "angular",
46
+ "signals",
47
+ "agents"
48
+ ],
49
+ "engines": {
50
+ "node": ">=18"
51
+ },
52
+ "scripts": {
53
+ "build": "ngc -p tsconfig.build.json",
54
+ "typecheck": "ngc -p tsconfig.json --noEmit"
55
+ }
56
+ }