actionmcp 0.0.0-stage → 0.2.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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -2
  3. package/dist/analyzer/config.d.ts +15 -0
  4. package/dist/analyzer/config.js +43 -0
  5. package/dist/analyzer/diagnostics.js +136 -0
  6. package/dist/analyzer/explicit.js +128 -0
  7. package/dist/analyzer/index.js +191 -0
  8. package/dist/analyzer/jsdoc.js +32 -0
  9. package/dist/analyzer/options.js +65 -0
  10. package/dist/analyzer/routes.js +105 -0
  11. package/dist/analyzer/scan.js +292 -0
  12. package/dist/analyzer/source.js +100 -0
  13. package/dist/analyzer/toolchain.js +27 -0
  14. package/dist/analyzer/types.js +141 -0
  15. package/dist/cli/bin.d.ts +1 -0
  16. package/dist/cli/bin.js +5 -0
  17. package/dist/cli/commands.js +107 -0
  18. package/dist/cli/environment.js +53 -0
  19. package/dist/cli/index.js +97 -0
  20. package/dist/cli/output.js +27 -0
  21. package/dist/cli/project.js +33 -0
  22. package/dist/client.d.ts +6 -0
  23. package/dist/client.js +4 -0
  24. package/dist/config.d.ts +9 -0
  25. package/dist/config.js +84 -0
  26. package/dist/core/compare.js +6 -0
  27. package/dist/core/events.js +12 -0
  28. package/dist/core/execute.js +70 -0
  29. package/dist/core/formdata.js +15 -0
  30. package/dist/core/guards.js +8 -0
  31. package/dist/core/match.js +16 -0
  32. package/dist/core/names.js +51 -0
  33. package/dist/core/result.d.ts +18 -0
  34. package/dist/core/result.js +85 -0
  35. package/dist/core/schema.d.ts +6 -0
  36. package/dist/core/schema.js +90 -0
  37. package/dist/core/types.d.ts +34 -0
  38. package/dist/core/webmcp.js +95 -0
  39. package/dist/generator/index.js +36 -0
  40. package/dist/generator/render.js +91 -0
  41. package/dist/generator/watch.js +76 -0
  42. package/dist/index.d.ts +8 -0
  43. package/dist/index.js +5 -0
  44. package/dist/next/NavigateTool.js +40 -0
  45. package/dist/next/config-store.js +12 -0
  46. package/dist/next/redirect.js +15 -0
  47. package/dist/next/routes.d.ts +3 -0
  48. package/dist/next/routes.js +62 -0
  49. package/dist/react/AgentTools.d.ts +14 -0
  50. package/dist/react/AgentTools.js +35 -0
  51. package/dist/react/Confirm.d.ts +3 -0
  52. package/dist/react/Confirm.js +149 -0
  53. package/dist/react/Devtools.d.ts +2 -0
  54. package/dist/react/Devtools.js +13 -0
  55. package/dist/react/DevtoolsPanel.js +223 -0
  56. package/dist/react/Provider.d.ts +6 -0
  57. package/dist/react/Provider.js +23 -0
  58. package/dist/react/Registrar.js +12 -0
  59. package/dist/react/context.d.ts +24 -0
  60. package/dist/react/context.js +5 -0
  61. package/dist/react/useAgentTools.js +105 -0
  62. package/dist/registry.d.ts +4 -0
  63. package/dist/registry.js +4 -0
  64. package/dist/server/agent.d.ts +43 -0
  65. package/dist/server/agent.js +34 -0
  66. package/dist/server/index.d.ts +6 -0
  67. package/dist/server/index.js +4 -0
  68. package/dist/server/registry.d.ts +53 -0
  69. package/dist/server/registry.js +93 -0
  70. package/dist/server/resolve.js +68 -0
  71. package/package.json +102 -4
@@ -0,0 +1,105 @@
1
+ "use client";
2
+ import { useCallback, useContext, useEffect, useRef, useState } from "react";
3
+ import { executeTool } from "../core/execute.js";
4
+ import { registerTools, resolveModelContext } from "../core/webmcp.js";
5
+ import { ConfirmDialog } from "./Confirm.js";
6
+ import { AgentToolsContext } from "./context.js";
7
+ import { jsx } from "react/jsx-runtime";
8
+ // src/react/useAgentTools.tsx
9
+ function useAgentTools(tools, registration) {
10
+ const { polyfill = false, exposedTo, recoverError } = registration;
11
+ const hooks = useContext(AgentToolsContext);
12
+ const [pending, setPending] = useState([]);
13
+ const unsettled = useRef(/* @__PURE__ */ new Set());
14
+ const confirm = useCallback((call, tool, signal) => new Promise((resolve) => {
15
+ const confirmation = {
16
+ call,
17
+ tool,
18
+ settle: (accepted) => {
19
+ unsettled.current.delete(confirmation);
20
+ setPending((queue) => queue.filter((entry) => entry !== confirmation));
21
+ resolve(accepted);
22
+ }
23
+ };
24
+ unsettled.current.add(confirmation);
25
+ signal.addEventListener("abort", () => confirmation.settle(false), { once: true });
26
+ setPending((queue) => [...queue, confirmation]);
27
+ }), []);
28
+ const latest = useRef({
29
+ tools,
30
+ hooks,
31
+ recoverError
32
+ });
33
+ useEffect(() => {
34
+ latest.current = {
35
+ tools,
36
+ hooks,
37
+ recoverError
38
+ };
39
+ });
40
+ const registrationKey = JSON.stringify([
41
+ tools,
42
+ exposedTo,
43
+ polyfill
44
+ ]);
45
+ const [stable, setStable] = useState({
46
+ key: registrationKey,
47
+ tools,
48
+ exposedTo,
49
+ polyfill
50
+ });
51
+ if (stable.key !== registrationKey) setStable({
52
+ key: registrationKey,
53
+ tools,
54
+ exposedTo,
55
+ polyfill
56
+ });
57
+ useEffect(() => {
58
+ const controller = new AbortController();
59
+ const { signal } = controller;
60
+ const definitions = stable.tools.map(({ action: _action, confirm: _confirm, adapter: _adapter, ...definition }, index) => ({
61
+ ...definition,
62
+ execute: (input, options) => {
63
+ const current = latest.current;
64
+ const tool = current.tools[index];
65
+ if (!tool) throw new DOMException("The tool is no longer registered.", "InvalidStateError");
66
+ return executeTool(tool, input, options.signal, {
67
+ confirm,
68
+ onBeforeExecute: current.hooks.onBeforeExecute,
69
+ onAfterExecute: current.hooks.onAfterExecute,
70
+ recoverError: current.recoverError
71
+ });
72
+ }
73
+ }));
74
+ resolveModelContext(stable.polyfill, signal).then((context) => {
75
+ if (!context || signal.aborted) return;
76
+ return registerTools(context, definitions, {
77
+ signal,
78
+ exposedTo: stable.exposedTo,
79
+ onCollision: (requested, registered) => {
80
+ if (process.env.NODE_ENV !== "production") console.warn(`actionmcp: the tool name "${requested}" is taken, so the tool is registered as "${registered}".`);
81
+ }
82
+ });
83
+ });
84
+ return () => controller.abort();
85
+ }, [stable, confirm]);
86
+ useEffect(() => {
87
+ const confirmations = unsettled.current;
88
+ return () => {
89
+ for (const confirmation of confirmations) confirmation.settle(false);
90
+ };
91
+ }, []);
92
+ const current = pending[0];
93
+ if (!current) return null;
94
+ const Confirm = hooks.confirmComponent ?? ConfirmDialog;
95
+ return /* @__PURE__ */ jsx(Confirm, {
96
+ call: current.call,
97
+ title: current.tool.title,
98
+ description: current.tool.description,
99
+ inputSchema: current.tool.inputSchema,
100
+ labels: hooks.confirmLabels,
101
+ onConfirm: () => current.settle(true),
102
+ onCancel: () => current.settle(false)
103
+ });
104
+ }
105
+ export { useAgentTools };
@@ -0,0 +1,4 @@
1
+ import { AgentToolRegistry } from "./server/registry.js";
2
+ import "./server/index.js";
3
+ declare const _default: AgentToolRegistry;
4
+ export { _default as default };
@@ -0,0 +1,4 @@
1
+ import { createRegistry } from "./server/registry.js";
2
+ // src/registry.ts
3
+ var registry_default = createRegistry({});
4
+ export { registry_default as default };
@@ -0,0 +1,43 @@
1
+ import { StandardSchemaV1 } from "@standard-schema/spec";
2
+ import { AgentResult } from "../core/result.js";
3
+ import { ConfirmPolicy } from "../core/types.js";
4
+ export declare const AGENT_META: unique symbol;
5
+ export interface ToolBehaviorOptions {
6
+ name?: string;
7
+ title?: string;
8
+ description: string;
9
+ readOnly?: boolean;
10
+ consequential?: boolean;
11
+ untrustedOutput?: boolean;
12
+ confirm?: ConfirmPolicy;
13
+ }
14
+ export interface AgentToolOptions extends ToolBehaviorOptions {
15
+ input?: StandardSchemaV1 | undefined;
16
+ output?: StandardSchemaV1 | undefined;
17
+ }
18
+ export interface AgentToolMeta {
19
+ readonly options: AgentToolOptions;
20
+ }
21
+ export interface AgentToolMarker {
22
+ readonly [AGENT_META]: AgentToolMeta;
23
+ }
24
+ export type AgentTool<Args extends unknown[] = never[], Data = unknown> = ((...args: Args) => Promise<AgentResult<Data>>) & AgentToolMarker;
25
+ type InputOf<Schema extends StandardSchemaV1> = StandardSchemaV1.InferInput<Schema>;
26
+ type OutputOf<Schema extends StandardSchemaV1> = StandardSchemaV1.InferOutput<Schema>;
27
+ export declare function agent<Input extends StandardSchemaV1, Output extends StandardSchemaV1>(options: ToolBehaviorOptions & {
28
+ input: Input;
29
+ output: Output;
30
+ }, handler: (input: OutputOf<Input>) => Promise<InputOf<Output>>): AgentTool<[input: InputOf<Input>], OutputOf<Output>>;
31
+ export declare function agent<Input extends StandardSchemaV1, Data>(options: ToolBehaviorOptions & {
32
+ input: Input;
33
+ output?: undefined;
34
+ }, handler: (input: OutputOf<Input>) => Promise<Data>): AgentTool<[input: InputOf<Input>], Data>;
35
+ export declare function agent<Output extends StandardSchemaV1>(options: ToolBehaviorOptions & {
36
+ input?: undefined;
37
+ output: Output;
38
+ }, handler: () => Promise<InputOf<Output>>): AgentTool<[], OutputOf<Output>>;
39
+ export declare function agent<Data>(options: ToolBehaviorOptions & {
40
+ input?: undefined;
41
+ output?: undefined;
42
+ }, handler: () => Promise<Data>): AgentTool<[], Data>;
43
+ export {};
@@ -0,0 +1,34 @@
1
+ import { isNonEmptyString } from "../core/guards.js";
2
+ import { AgentToolError, GENERIC_FAILURE_MESSAGE, INVALID_INPUT_MESSAGE, INVALID_OUTPUT_MESSAGE, fail, isFrameworkSignal, succeed } from "../core/result.js";
3
+ import { validateWithSchema } from "../core/schema.js";
4
+ // src/server/agent.ts
5
+ const AGENT_META = Symbol.for("actionmcp.meta");
6
+ function agent(options, handler) {
7
+ if (!isNonEmptyString(options.description)) throw new TypeError("agent() requires a non-empty description.");
8
+ const execute = async (input) => runHandler(options, handler, input);
9
+ return Object.defineProperty(execute, AGENT_META, { value: { options } });
10
+ }
11
+ function readAgentMeta(value) {
12
+ return typeof value === "function" ? value[AGENT_META] : void 0;
13
+ }
14
+ async function runHandler(options, handler, rawInput) {
15
+ let input;
16
+ if (options.input) {
17
+ const validation = await validateWithSchema(options.input, rawInput);
18
+ if (!validation.ok) return fail("invalid_input", INVALID_INPUT_MESSAGE, validation.issues);
19
+ input = validation.value;
20
+ }
21
+ try {
22
+ const data = await handler(input);
23
+ if (!options.output) return succeed(data);
24
+ const validation = await validateWithSchema(options.output, data);
25
+ return validation.ok ? succeed(validation.value) : fail("failed", INVALID_OUTPUT_MESSAGE);
26
+ } catch (error) {
27
+ if (isFrameworkSignal(error)) throw error;
28
+ if (error instanceof AgentToolError) return fail(error.code, error.message);
29
+ console.error(error);
30
+ const exposeMessage = process.env.NODE_ENV !== "production" && error instanceof Error;
31
+ return fail("failed", exposeMessage ? error.message : GENERIC_FAILURE_MESSAGE);
32
+ }
33
+ }
34
+ export { AGENT_META, agent, readAgentMeta };
@@ -0,0 +1,6 @@
1
+ import { AgentTool, AgentToolMarker, AgentToolOptions, ToolBehaviorOptions, agent } from "./agent.js";
2
+ import { AdaptedAction, AgentToolDefinition, AgentToolRegistry, JsdocToolEntry, RegistrySources, createRegistry, defineAgentTools, fromFormAction, fromFormDataAction, fromSafeAction, tool } from "./registry.js";
3
+ import { AgentError, AgentErrorCode, AgentResult, AgentToolError } from "../core/result.js";
4
+ import { AgentSchema, SchemaIssue } from "../core/schema.js";
5
+ import { ConfirmPolicy, JsonSchema, RouteEntry, ToolAdapter, ToolAnnotations } from "../core/types.js";
6
+ export { type AdaptedAction, type AgentError, type AgentErrorCode, type AgentResult, type AgentSchema, type AgentTool, type AgentToolDefinition, AgentToolError, type AgentToolMarker, type AgentToolOptions, type AgentToolRegistry, type ConfirmPolicy, type JsdocToolEntry, type JsonSchema, type RegistrySources, type RouteEntry, type SchemaIssue, type ToolAdapter, type ToolAnnotations, type ToolBehaviorOptions, agent, createRegistry, defineAgentTools, fromFormAction, fromFormDataAction, fromSafeAction, tool };
@@ -0,0 +1,4 @@
1
+ import { agent } from "./agent.js";
2
+ import { createRegistry, defineAgentTools, fromFormAction, fromFormDataAction, fromSafeAction, tool } from "./registry.js";
3
+ import { AgentToolError } from "../core/result.js";
4
+ export { AgentToolError, agent, createRegistry, defineAgentTools, fromFormAction, fromFormDataAction, fromSafeAction, tool };
@@ -0,0 +1,53 @@
1
+ import { StandardSchemaV1 } from "@standard-schema/spec";
2
+ import { ConfirmPolicy, JsonSchema, RouteEntry, ServerFunction, ToolAdapter, ToolAnnotations } from "../core/types.js";
3
+ import { AgentToolOptions } from "./agent.js";
4
+ declare const REGISTRY: unique symbol;
5
+ export type ToolKind = 'agent' | 'jsdoc' | 'explicit';
6
+ export interface AdaptedAction {
7
+ readonly action: ServerFunction;
8
+ readonly adapter: ToolAdapter;
9
+ }
10
+ export interface AgentToolDefinition {
11
+ readonly action: ServerFunction;
12
+ readonly options: AgentToolOptions;
13
+ readonly adapter?: ToolAdapter;
14
+ }
15
+ export interface JsdocToolEntry {
16
+ action: ServerFunction;
17
+ description: string;
18
+ inputSchema?: JsonSchema;
19
+ annotations?: Partial<ToolAnnotations>;
20
+ adapter?: ToolAdapter;
21
+ validated: false;
22
+ }
23
+ export interface RegistryEntry {
24
+ readonly name: string;
25
+ readonly kind: ToolKind;
26
+ readonly action: ServerFunction;
27
+ readonly title?: string;
28
+ readonly description: string;
29
+ readonly input?: StandardSchemaV1;
30
+ readonly output?: StandardSchemaV1;
31
+ readonly inputSchema?: JsonSchema;
32
+ readonly annotations: ToolAnnotations;
33
+ readonly confirm: ConfirmPolicy;
34
+ readonly adapter?: ToolAdapter;
35
+ }
36
+ export interface AgentToolRegistry {
37
+ readonly [REGISTRY]: true;
38
+ readonly entries: readonly RegistryEntry[];
39
+ readonly routes: readonly RouteEntry[];
40
+ }
41
+ export interface RegistrySources {
42
+ agent?: Record<string, ServerFunction>;
43
+ jsdoc?: Record<string, JsdocToolEntry>;
44
+ explicit?: AgentToolRegistry;
45
+ routes?: RouteEntry[];
46
+ }
47
+ export declare function fromFormDataAction(action: (previousState: never, formData: FormData) => Promise<unknown>): AdaptedAction;
48
+ export declare function fromFormAction(action: (formData: FormData) => Promise<unknown>): AdaptedAction;
49
+ export declare function fromSafeAction(action: (input: never) => Promise<unknown>): AdaptedAction;
50
+ export declare function tool(action: ServerFunction | AdaptedAction, options: AgentToolOptions): AgentToolDefinition;
51
+ export declare function defineAgentTools(tools: Record<string, AgentToolDefinition | ServerFunction>): AgentToolRegistry;
52
+ export declare function createRegistry(sources: RegistrySources): AgentToolRegistry;
53
+ export {};
@@ -0,0 +1,93 @@
1
+ import { isNonEmptyString } from "../core/guards.js";
2
+ import { readAgentMeta } from "./agent.js";
3
+ // src/server/registry.ts
4
+ const REGISTRY = Symbol.for("actionmcp.registry");
5
+ function fromFormDataAction(action) {
6
+ return {
7
+ action,
8
+ adapter: "formdata"
9
+ };
10
+ }
11
+ function fromFormAction(action) {
12
+ return {
13
+ action,
14
+ adapter: "form"
15
+ };
16
+ }
17
+ function fromSafeAction(action) {
18
+ return {
19
+ action,
20
+ adapter: "safe-action"
21
+ };
22
+ }
23
+ function tool(action, options) {
24
+ if (!isNonEmptyString(options.description)) throw new TypeError("tool() requires a non-empty description.");
25
+ return typeof action === "function" ? {
26
+ action,
27
+ options
28
+ } : {
29
+ action: action.action,
30
+ options,
31
+ adapter: action.adapter
32
+ };
33
+ }
34
+ function defineAgentTools(tools) {
35
+ return buildRegistry(Object.entries(tools).map(([key, definition]) => typeof definition === "function" ? entryFromAgent(key, definition) : entryFromOptions(key, "explicit", definition)), []);
36
+ }
37
+ function createRegistry(sources) {
38
+ const explicit = sources.explicit?.entries ?? [];
39
+ const explicitActions = new Set(explicit.map((entry) => entry.action));
40
+ return buildRegistry([...[...Object.entries(sources.agent ?? {}).map(([name, action]) => entryFromAgent(name, action)), ...Object.entries(sources.jsdoc ?? {}).map(([name, entry]) => entryFromJsdoc(name, entry))].filter((entry) => !explicitActions.has(entry.action)), ...explicit], [...sources.routes ?? [], ...sources.explicit?.routes ?? []]);
41
+ }
42
+ function buildRegistry(entries, routes) {
43
+ return {
44
+ [REGISTRY]: true,
45
+ entries,
46
+ routes
47
+ };
48
+ }
49
+ function entryFromAgent(name, action) {
50
+ const meta = readAgentMeta(action);
51
+ if (!meta) throw new TypeError(`The export registered as "${name}" is not wrapped in agent().`);
52
+ return entryFromOptions(name, "agent", {
53
+ action,
54
+ options: meta.options
55
+ });
56
+ }
57
+ function entryFromOptions(key, kind, definition) {
58
+ const { action, options, adapter } = definition;
59
+ return {
60
+ name: options.name ?? key,
61
+ kind,
62
+ action,
63
+ description: options.description,
64
+ annotations: resolveAnnotations(options.readOnly, options.consequential, options.untrustedOutput),
65
+ confirm: options.confirm ?? "consequential",
66
+ ...options.title ? { title: options.title } : {},
67
+ ...options.input ? { input: options.input } : {},
68
+ ...options.output ? { output: options.output } : {},
69
+ ...adapter ? { adapter } : {}
70
+ };
71
+ }
72
+ function entryFromJsdoc(name, entry) {
73
+ const { readOnlyHint, consequentialHint, untrustedContentHint } = entry.annotations ?? {};
74
+ return {
75
+ name,
76
+ kind: "jsdoc",
77
+ action: entry.action,
78
+ description: entry.description,
79
+ annotations: resolveAnnotations(readOnlyHint, consequentialHint, untrustedContentHint),
80
+ confirm: "consequential",
81
+ ...entry.inputSchema ? { inputSchema: entry.inputSchema } : {},
82
+ ...entry.adapter ? { adapter: entry.adapter } : {}
83
+ };
84
+ }
85
+ function resolveAnnotations(readOnly, consequential, untrustedOutput) {
86
+ const readOnlyHint = readOnly ?? false;
87
+ return {
88
+ readOnlyHint,
89
+ consequentialHint: consequential ?? !readOnlyHint,
90
+ untrustedContentHint: untrustedOutput ?? false
91
+ };
92
+ }
93
+ export { createRegistry, defineAgentTools, fromFormAction, fromFormDataAction, fromSafeAction, resolveAnnotations, tool };
@@ -0,0 +1,68 @@
1
+ import { createSelector } from "../core/match.js";
2
+ import { applyPrefix, checkToolNames, describeNameIssue } from "../core/names.js";
3
+ import { convertSchema } from "../core/schema.js";
4
+ // src/server/resolve.ts
5
+ const resolved = /* @__PURE__ */ new WeakMap();
6
+ function resolveTools(registry) {
7
+ let tools = resolved.get(registry);
8
+ if (!tools) {
9
+ tools = registry.entries.map(resolveEntry);
10
+ resolved.set(registry, tools);
11
+ }
12
+ return tools;
13
+ }
14
+ function selectTools(registry, selection) {
15
+ const isSelected = createSelector(selection);
16
+ const tools = resolveTools(registry).filter((tool) => isSelected(tool.name)).map((tool) => ({
17
+ ...tool,
18
+ name: applyPrefix(tool.name, selection.prefix)
19
+ }));
20
+ const issues = checkToolNames(tools.map((tool) => tool.name));
21
+ if (issues.length === 0) return tools;
22
+ const message = issues.map(describeNameIssue).join(" ");
23
+ if (process.env.NODE_ENV !== "production") throw new Error(`actionmcp: ${message}`);
24
+ console.warn(`actionmcp: ${message}`);
25
+ const rejected = new Set(issues.map((issue) => issue.name));
26
+ return tools.filter((tool) => !rejected.has(tool.name));
27
+ }
28
+ function wrapOutputSchema(data) {
29
+ return {
30
+ type: "object",
31
+ properties: {
32
+ ok: { type: "boolean" },
33
+ data,
34
+ error: {
35
+ type: "object",
36
+ properties: {
37
+ code: { type: "string" },
38
+ message: { type: "string" }
39
+ },
40
+ required: ["code", "message"]
41
+ }
42
+ },
43
+ required: ["ok"]
44
+ };
45
+ }
46
+ function resolveEntry(entry) {
47
+ const inputSchema = entry.inputSchema ?? convertEntrySchema(entry, "input");
48
+ const outputSchema = convertEntrySchema(entry, "output");
49
+ return {
50
+ name: entry.name,
51
+ description: entry.description,
52
+ annotations: entry.annotations,
53
+ confirm: entry.confirm,
54
+ action: entry.action,
55
+ ...entry.title ? { title: entry.title } : {},
56
+ ...inputSchema ? { inputSchema } : {},
57
+ ...outputSchema ? { outputSchema: wrapOutputSchema(outputSchema) } : {},
58
+ ...entry.adapter ? { adapter: entry.adapter } : {}
59
+ };
60
+ }
61
+ function convertEntrySchema(entry, direction) {
62
+ const schema = entry[direction];
63
+ if (!schema) return void 0;
64
+ const conversion = convertSchema(schema, direction);
65
+ if (conversion.ok) return conversion.schema;
66
+ if (process.env.NODE_ENV !== "production") console.warn(`actionmcp: AT101 The ${direction} schema of "${entry.name}" cannot be converted to JSON Schema, so the tool is registered without it. ${conversion.reason}`);
67
+ }
68
+ export { resolveTools, selectTools, wrapOutputSchema };
package/package.json CHANGED
@@ -1,6 +1,104 @@
1
1
  {
2
2
  "name": "actionmcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "WebMCP tools from your Server Actions. Opt-in, typed, safe by default.",
5
+ "license": "MIT",
6
+ "author": "Valentin Galfre",
7
+ "homepage": "https://github.com/galfrevn/actionmcp#readme",
8
+ "bugs": "https://github.com/galfrevn/actionmcp/issues",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/galfrevn/actionmcp.git",
12
+ "directory": "packages/actionmcp"
13
+ },
14
+ "keywords": [
15
+ "webmcp",
16
+ "mcp",
17
+ "nextjs",
18
+ "server-actions",
19
+ "server-functions",
20
+ "ai-agents",
21
+ "standard-schema"
22
+ ],
23
+ "type": "module",
24
+ "sideEffects": false,
25
+ "bin": {
26
+ "actionmcp": "dist/cli/bin.js"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "provenance": true
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "./server": {
41
+ "types": "./dist/server/index.d.ts",
42
+ "default": "./dist/server/index.js"
43
+ },
44
+ "./client": {
45
+ "types": "./dist/client.d.ts",
46
+ "default": "./dist/client.js"
47
+ },
48
+ "./config": {
49
+ "types": "./dist/config.d.ts",
50
+ "default": "./dist/config.js"
51
+ },
52
+ "./registry": {
53
+ "types": "./dist/registry.d.ts",
54
+ "default": "./dist/registry.js"
55
+ },
56
+ "./package.json": "./package.json"
57
+ },
58
+ "scripts": {
59
+ "build": "tsdown",
60
+ "test": "vitest run --coverage",
61
+ "typecheck": "tsc --noEmit"
62
+ },
63
+ "engines": {
64
+ "node": ">=22.18"
65
+ },
66
+ "peerDependencies": {
67
+ "next": "^16.0.0",
68
+ "react": "^19.2.0",
69
+ "react-dom": "^19.2.0",
70
+ "ts-json-schema-generator": "^2.10.0"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "ts-json-schema-generator": {
74
+ "optional": true
75
+ }
76
+ },
77
+ "dependencies": {
78
+ "@standard-schema/spec": "^1.1.0",
79
+ "@w3c/webmcp-polyfill": "^0.2.0",
80
+ "oxc-parser": "^0.160.0",
81
+ "tinyglobby": "^0.2.17",
82
+ "webmcp-types": "^0.2.0"
83
+ },
84
+ "devDependencies": {
85
+ "@types/node": "^24.19.2",
86
+ "@types/react": "^19.2.0",
87
+ "@types/react-dom": "^19.2.0",
88
+ "@valibot/to-json-schema": "^1.8.0",
89
+ "@vitest/coverage-v8": "^5.0.0",
90
+ "arktype": "^2.2.10",
91
+ "jsdom": "^27.0.0",
92
+ "next": "16.4.6",
93
+ "next-safe-action": "^8.7.4",
94
+ "react": "19.3.1",
95
+ "react-dom": "19.3.1",
96
+ "rolldown": "^1.3.3",
97
+ "ts-json-schema-generator": "~2.10.0",
98
+ "tsdown": "^0.23.7",
99
+ "typescript": "~6.0.3",
100
+ "valibot": "^1.5.0",
101
+ "vitest": "^5.0.0",
102
+ "zod": "^4.6.7"
103
+ }
104
+ }