@next-ai-ready/actions 0.1.0-alpha.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 next-ai-ready contributors
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.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @next-ai-ready/actions
2
+
3
+ defineAction registry, Zod validation, schema emission.
4
+
5
+ Part of [next-ai-ready](../../README.md). 🚧 Pre-alpha.
@@ -0,0 +1,108 @@
1
+ import { ActionDefinition, SchemaLike, ActionsManifest, ActionContext } from '@next-ai-ready/core';
2
+ export { ActionDefinition, SchemaLike } from '@next-ai-ready/core';
3
+
4
+ /**
5
+ * Author an action.
6
+ *
7
+ * ```ts
8
+ * import { defineAction } from "@next-ai-ready/actions"
9
+ * import { z } from "zod"
10
+ *
11
+ * export const search = defineAction({
12
+ * name: "search_products",
13
+ * description: "Full-text search across the product catalogue.",
14
+ * whenToUse: "When the user asks to find a product by name or feature.",
15
+ * public: true,
16
+ * input: z.object({ query: z.string().min(1), limit: z.number().int().max(50).optional() }),
17
+ * output: z.object({ items: z.array(z.object({ id: z.string(), title: z.string() })) }),
18
+ * handler: async ({ query, limit = 10 }) => ({ items: await search(query, limit) }),
19
+ * })
20
+ * ```
21
+ *
22
+ * Identity-typed: validation and registry insertion happen in `registry.ts`
23
+ * (called by `defineActions()`), not here. This keeps `defineAction` a
24
+ * compile-time-only construct so it tree-shakes cleanly.
25
+ */
26
+ declare function defineAction<I, O>(def: ActionDefinition<I, O>): ActionDefinition<I, O>;
27
+
28
+ /**
29
+ * Type-erased action — the storage type used everywhere we no longer have
30
+ * the user's input/output generics in scope. `unknown` is wrong here because
31
+ * the handler is contravariant in its input parameter; `any` is the only
32
+ * sound erasure that lets `ActionDefinition<X, Y>` widen on insertion.
33
+ */
34
+ type AnyAction = ActionDefinition<any, any>;
35
+ declare function registerActions(actions: ReadonlyArray<AnyAction>): void;
36
+ declare function getAction(name: string): AnyAction | undefined;
37
+ declare function listActions(): AnyAction[];
38
+ declare function clearRegistry(): void;
39
+ /**
40
+ * Convenience for users: `defineActions([...])` registers and returns the
41
+ * array, so the same module can be both imported for side-effects (runtime)
42
+ * and inspected (build CLI dynamic import).
43
+ */
44
+ declare function defineActions<A extends ReadonlyArray<AnyAction>>(actions: A): A;
45
+
46
+ /**
47
+ * Convert a Zod schema to JSON Schema 2020-12.
48
+ *
49
+ * Implementation note: we use Zod v4's built-in `z.toJSONSchema()`. We do
50
+ * NOT depend on the older `zod-to-json-schema` package — it targets Zod v3
51
+ * and silently emits empty objects when fed Zod v4 schemas. If a user passes
52
+ * a non-Zod `SchemaLike`, we fail loudly so build artifacts can never be
53
+ * silently empty.
54
+ *
55
+ * The output is OpenAPI 3.1 / JSON Schema 2020-12 compatible. We strip the
56
+ * `$schema` header since each action gets inlined into a larger document.
57
+ */
58
+ declare function schemaToJsonSchema(schema: SchemaLike): Record<string, unknown>;
59
+
60
+ /**
61
+ * Serialize the current registry into an `ActionsManifest`.
62
+ *
63
+ * The manifest is the contract between build-time and emission-time tools
64
+ * (OpenAPI, MCP, llms.txt action callouts). It contains *no functions* —
65
+ * just metadata + JSON Schemas — so it's safe to bundle into a serverless
66
+ * function or ship to a CDN.
67
+ */
68
+ declare function buildActionsManifest(): ActionsManifest;
69
+
70
+ /**
71
+ * Build a full `ActionContext` from a Fetch API `Request`. Exported because
72
+ * the Next route handler also needs to construct one before calling into
73
+ * userland — keeping the construction logic in one place avoids drift.
74
+ */
75
+ declare function buildActionContext(request: Request, extras?: {
76
+ caller?: string;
77
+ }): ActionContext;
78
+ interface InvokeResultOk<O = unknown> {
79
+ ok: true;
80
+ data: O;
81
+ action: string;
82
+ latencyMs: number;
83
+ }
84
+ interface InvokeResultErr {
85
+ ok: false;
86
+ action: string;
87
+ latencyMs: number;
88
+ status: number;
89
+ code: "not_found" | "not_public" | "unauthorized" | "invalid_input" | "handler_error";
90
+ message: string;
91
+ details?: unknown;
92
+ }
93
+ type InvokeResult<O = unknown> = InvokeResultOk<O> | InvokeResultErr;
94
+ /**
95
+ * Resolve + validate + call one action by name.
96
+ *
97
+ * This is the heart of the Capability plane. The runtime route handler in
98
+ * `@next-ai-ready/next` is a thin wrapper around this — it parses the
99
+ * Request body and turns `InvokeResult` into a `Response`.
100
+ *
101
+ * Security rules (ADR-010):
102
+ * • Action MUST have `public: true` to be reachable.
103
+ * • If `auth` is defined, it MUST return truthy.
104
+ * • Input MUST pass `safeParse`. We never throw raw zod errors back.
105
+ */
106
+ declare function invokeAction(name: string, rawInput: unknown, ctxOrRequest: ActionContext | Request): Promise<InvokeResult>;
107
+
108
+ export { type AnyAction, type InvokeResult, type InvokeResultErr, type InvokeResultOk, buildActionContext, buildActionsManifest, clearRegistry, defineAction, defineActions, getAction, invokeAction, listActions, registerActions, schemaToJsonSchema };
package/dist/index.js ADDED
@@ -0,0 +1,152 @@
1
+ // src/define-action.ts
2
+ function defineAction(def) {
3
+ if (!/^[a-z][a-z0-9_]*$/.test(def.name)) {
4
+ throw new Error(
5
+ `[next-ai-ready] Action name "${def.name}" must be snake_case (lowercase letters, digits, underscores).`
6
+ );
7
+ }
8
+ return def;
9
+ }
10
+
11
+ // src/registry.ts
12
+ var registry = /* @__PURE__ */ new Map();
13
+ function registerActions(actions) {
14
+ for (const action of actions) {
15
+ if (registry.has(action.name)) {
16
+ throw new Error(`[next-ai-ready] Duplicate action name: "${action.name}"`);
17
+ }
18
+ registry.set(action.name, action);
19
+ }
20
+ }
21
+ function getAction(name) {
22
+ return registry.get(name);
23
+ }
24
+ function listActions() {
25
+ return [...registry.values()].sort((a, b) => a.name.localeCompare(b.name));
26
+ }
27
+ function clearRegistry() {
28
+ registry.clear();
29
+ }
30
+ function defineActions(actions) {
31
+ registerActions(actions);
32
+ return actions;
33
+ }
34
+
35
+ // src/schema.ts
36
+ import { z } from "zod";
37
+ function schemaToJsonSchema(schema) {
38
+ if (!isZodSchema(schema)) {
39
+ throw new Error(
40
+ "[next-ai-ready] Only Zod schemas are currently supported for action input/output. If you need another validator, please open an issue."
41
+ );
42
+ }
43
+ const json = z.toJSONSchema(schema);
44
+ if ("$schema" in json) delete json.$schema;
45
+ return json;
46
+ }
47
+ function isZodSchema(s) {
48
+ return typeof s === "object" && s !== null && "_def" in s;
49
+ }
50
+
51
+ // src/manifest.ts
52
+ function buildActionsManifest() {
53
+ const entries = listActions().map(toEntry).sort((a, b) => a.name.localeCompare(b.name));
54
+ return { actions: entries, generatedAt: (/* @__PURE__ */ new Date()).toISOString() };
55
+ }
56
+ function toEntry(def) {
57
+ return {
58
+ name: def.name,
59
+ description: def.description,
60
+ whenToUse: def.whenToUse,
61
+ whenNotToUse: def.whenNotToUse,
62
+ tags: def.tags,
63
+ public: def.public === true,
64
+ inputSchema: schemaToJsonSchema(def.input),
65
+ outputSchema: def.output ? schemaToJsonSchema(def.output) : void 0,
66
+ examples: def.examples
67
+ };
68
+ }
69
+
70
+ // src/invoke.ts
71
+ function buildActionContext(request, extras = {}) {
72
+ const headers = request.headers;
73
+ return {
74
+ request,
75
+ headers,
76
+ cookies: {
77
+ get(name) {
78
+ const raw = headers.get("cookie") ?? "";
79
+ for (const part of raw.split(/;\s*/)) {
80
+ const eq = part.indexOf("=");
81
+ if (eq < 0) continue;
82
+ if (decodeURIComponent(part.slice(0, eq)) === name) {
83
+ return { value: decodeURIComponent(part.slice(eq + 1)) };
84
+ }
85
+ }
86
+ return void 0;
87
+ }
88
+ },
89
+ caller: extras.caller
90
+ };
91
+ }
92
+ async function invokeAction(name, rawInput, ctxOrRequest) {
93
+ const ctx = ctxOrRequest instanceof Request ? buildActionContext(ctxOrRequest) : ctxOrRequest;
94
+ const t0 = Date.now();
95
+ const action = getAction(name);
96
+ if (!action) {
97
+ return { ok: false, action: name, latencyMs: 0, status: 404, code: "not_found", message: `Unknown action: ${name}` };
98
+ }
99
+ if (!action.public) {
100
+ return { ok: false, action: name, latencyMs: 0, status: 404, code: "not_public", message: `Action "${name}" is not exposed.` };
101
+ }
102
+ if (action.auth) {
103
+ const allowed = await action.auth(ctx.request);
104
+ if (!allowed) {
105
+ return { ok: false, action: name, latencyMs: Date.now() - t0, status: 401, code: "unauthorized", message: "Unauthorized." };
106
+ }
107
+ }
108
+ const parsed = action.input.safeParse(rawInput);
109
+ if (!parsed.success) {
110
+ return {
111
+ ok: false,
112
+ action: name,
113
+ latencyMs: Date.now() - t0,
114
+ status: 400,
115
+ code: "invalid_input",
116
+ message: "Invalid input.",
117
+ details: extractZodIssues(parsed.error)
118
+ };
119
+ }
120
+ try {
121
+ const data = await action.handler(parsed.data, ctx);
122
+ return { ok: true, action: name, latencyMs: Date.now() - t0, data };
123
+ } catch (err) {
124
+ return {
125
+ ok: false,
126
+ action: name,
127
+ latencyMs: Date.now() - t0,
128
+ status: 500,
129
+ code: "handler_error",
130
+ message: err instanceof Error ? err.message : String(err)
131
+ };
132
+ }
133
+ }
134
+ function extractZodIssues(err) {
135
+ if (err && typeof err === "object" && "issues" in err) {
136
+ return err.issues;
137
+ }
138
+ return void 0;
139
+ }
140
+ export {
141
+ buildActionContext,
142
+ buildActionsManifest,
143
+ clearRegistry,
144
+ defineAction,
145
+ defineActions,
146
+ getAction,
147
+ invokeAction,
148
+ listActions,
149
+ registerActions,
150
+ schemaToJsonSchema
151
+ };
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/define-action.ts","../src/registry.ts","../src/schema.ts","../src/manifest.ts","../src/invoke.ts"],"sourcesContent":["import type { ActionDefinition, SchemaLike } from \"@next-ai-ready/core\";\n\n/**\n * Author an action.\n *\n * ```ts\n * import { defineAction } from \"@next-ai-ready/actions\"\n * import { z } from \"zod\"\n *\n * export const search = defineAction({\n * name: \"search_products\",\n * description: \"Full-text search across the product catalogue.\",\n * whenToUse: \"When the user asks to find a product by name or feature.\",\n * public: true,\n * input: z.object({ query: z.string().min(1), limit: z.number().int().max(50).optional() }),\n * output: z.object({ items: z.array(z.object({ id: z.string(), title: z.string() })) }),\n * handler: async ({ query, limit = 10 }) => ({ items: await search(query, limit) }),\n * })\n * ```\n *\n * Identity-typed: validation and registry insertion happen in `registry.ts`\n * (called by `defineActions()`), not here. This keeps `defineAction` a\n * compile-time-only construct so it tree-shakes cleanly.\n */\nexport function defineAction<I, O>(def: ActionDefinition<I, O>): ActionDefinition<I, O> {\n if (!/^[a-z][a-z0-9_]*$/.test(def.name)) {\n throw new Error(\n `[next-ai-ready] Action name \"${def.name}\" must be snake_case (lowercase letters, digits, underscores).`,\n );\n }\n return def;\n}\n\n/** Re-export for downstream packages that don't want to depend on core directly. */\nexport type { ActionDefinition, SchemaLike };\n","import type { ActionDefinition } from \"@next-ai-ready/core\";\n\n/**\n * Type-erased action — the storage type used everywhere we no longer have\n * the user's input/output generics in scope. `unknown` is wrong here because\n * the handler is contravariant in its input parameter; `any` is the only\n * sound erasure that lets `ActionDefinition<X, Y>` widen on insertion.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyAction = ActionDefinition<any, any>;\n\n/**\n * Process-global action registry.\n *\n * The user's `actions/index.ts` is imported once per process (by the build\n * CLI at build time, and by each `/api/actions/<name>` route at runtime).\n * It calls `registerActions(...)` to populate this singleton.\n *\n * We do NOT auto-register from `defineAction` itself — that would couple\n * authoring to a singleton and break tree-shaking. Authors collect their\n * actions into an array and pass them here exactly once.\n */\nconst registry = new Map<string, AnyAction>();\n\nexport function registerActions(actions: ReadonlyArray<AnyAction>): void {\n for (const action of actions) {\n if (registry.has(action.name)) {\n throw new Error(`[next-ai-ready] Duplicate action name: \"${action.name}\"`);\n }\n registry.set(action.name, action);\n }\n}\n\nexport function getAction(name: string): AnyAction | undefined {\n return registry.get(name);\n}\n\nexport function listActions(): AnyAction[] {\n return [...registry.values()].sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport function clearRegistry(): void {\n registry.clear();\n}\n\n/**\n * Convenience for users: `defineActions([...])` registers and returns the\n * array, so the same module can be both imported for side-effects (runtime)\n * and inspected (build CLI dynamic import).\n */\nexport function defineActions<A extends ReadonlyArray<AnyAction>>(actions: A): A {\n registerActions(actions);\n return actions;\n}\n","import { z } from \"zod\";\nimport type { SchemaLike } from \"@next-ai-ready/core\";\n\n/**\n * Convert a Zod schema to JSON Schema 2020-12.\n *\n * Implementation note: we use Zod v4's built-in `z.toJSONSchema()`. We do\n * NOT depend on the older `zod-to-json-schema` package — it targets Zod v3\n * and silently emits empty objects when fed Zod v4 schemas. If a user passes\n * a non-Zod `SchemaLike`, we fail loudly so build artifacts can never be\n * silently empty.\n *\n * The output is OpenAPI 3.1 / JSON Schema 2020-12 compatible. We strip the\n * `$schema` header since each action gets inlined into a larger document.\n */\nexport function schemaToJsonSchema(schema: SchemaLike): Record<string, unknown> {\n if (!isZodSchema(schema)) {\n throw new Error(\n \"[next-ai-ready] Only Zod schemas are currently supported for action input/output. \" +\n \"If you need another validator, please open an issue.\",\n );\n }\n const json = z.toJSONSchema(schema as unknown as Parameters<typeof z.toJSONSchema>[0]);\n if (\"$schema\" in json) delete (json as Record<string, unknown>).$schema;\n return json as Record<string, unknown>;\n}\n\nfunction isZodSchema(s: SchemaLike): boolean {\n return typeof s === \"object\" && s !== null && \"_def\" in s;\n}\n","import type {\n ActionDefinition,\n ActionManifestEntry,\n ActionsManifest,\n} from \"@next-ai-ready/core\";\nimport { schemaToJsonSchema } from \"./schema.js\";\nimport { listActions } from \"./registry.js\";\n\n/**\n * Serialize the current registry into an `ActionsManifest`.\n *\n * The manifest is the contract between build-time and emission-time tools\n * (OpenAPI, MCP, llms.txt action callouts). It contains *no functions* —\n * just metadata + JSON Schemas — so it's safe to bundle into a serverless\n * function or ship to a CDN.\n */\nexport function buildActionsManifest(): ActionsManifest {\n const entries = listActions()\n .map(toEntry)\n .sort((a, b) => a.name.localeCompare(b.name));\n return { actions: entries, generatedAt: new Date().toISOString() };\n}\n\nfunction toEntry(def: ActionDefinition<unknown, unknown>): ActionManifestEntry {\n return {\n name: def.name,\n description: def.description,\n whenToUse: def.whenToUse,\n whenNotToUse: def.whenNotToUse,\n tags: def.tags,\n public: def.public === true,\n inputSchema: schemaToJsonSchema(def.input),\n outputSchema: def.output ? schemaToJsonSchema(def.output) : undefined,\n examples: def.examples,\n };\n}\n","import type { ActionContext } from \"@next-ai-ready/core\";\nimport { getAction } from \"./registry.js\";\n\n/**\n * Build a full `ActionContext` from a Fetch API `Request`. Exported because\n * the Next route handler also needs to construct one before calling into\n * userland — keeping the construction logic in one place avoids drift.\n */\nexport function buildActionContext(request: Request, extras: { caller?: string } = {}): ActionContext {\n const headers = request.headers;\n return {\n request,\n headers,\n cookies: {\n get(name: string) {\n const raw = headers.get(\"cookie\") ?? \"\";\n for (const part of raw.split(/;\\s*/)) {\n const eq = part.indexOf(\"=\");\n if (eq < 0) continue;\n if (decodeURIComponent(part.slice(0, eq)) === name) {\n return { value: decodeURIComponent(part.slice(eq + 1)) };\n }\n }\n return undefined;\n },\n },\n caller: extras.caller,\n };\n}\n\nexport interface InvokeResultOk<O = unknown> {\n ok: true;\n data: O;\n action: string;\n latencyMs: number;\n}\nexport interface InvokeResultErr {\n ok: false;\n action: string;\n latencyMs: number;\n status: number;\n code: \"not_found\" | \"not_public\" | \"unauthorized\" | \"invalid_input\" | \"handler_error\";\n message: string;\n details?: unknown;\n}\nexport type InvokeResult<O = unknown> = InvokeResultOk<O> | InvokeResultErr;\n\n/**\n * Resolve + validate + call one action by name.\n *\n * This is the heart of the Capability plane. The runtime route handler in\n * `@next-ai-ready/next` is a thin wrapper around this — it parses the\n * Request body and turns `InvokeResult` into a `Response`.\n *\n * Security rules (ADR-010):\n * • Action MUST have `public: true` to be reachable.\n * • If `auth` is defined, it MUST return truthy.\n * • Input MUST pass `safeParse`. We never throw raw zod errors back.\n */\nexport async function invokeAction(\n name: string,\n rawInput: unknown,\n ctxOrRequest: ActionContext | Request,\n): Promise<InvokeResult> {\n const ctx: ActionContext = ctxOrRequest instanceof Request ? buildActionContext(ctxOrRequest) : ctxOrRequest;\n const t0 = Date.now();\n const action = getAction(name);\n if (!action) {\n return { ok: false, action: name, latencyMs: 0, status: 404, code: \"not_found\", message: `Unknown action: ${name}` };\n }\n if (!action.public) {\n return { ok: false, action: name, latencyMs: 0, status: 404, code: \"not_public\", message: `Action \"${name}\" is not exposed.` };\n }\n if (action.auth) {\n const allowed = await action.auth(ctx.request);\n if (!allowed) {\n return { ok: false, action: name, latencyMs: Date.now() - t0, status: 401, code: \"unauthorized\", message: \"Unauthorized.\" };\n }\n }\n const parsed = action.input.safeParse(rawInput);\n if (!parsed.success) {\n return {\n ok: false,\n action: name,\n latencyMs: Date.now() - t0,\n status: 400,\n code: \"invalid_input\",\n message: \"Invalid input.\",\n details: extractZodIssues(parsed.error),\n };\n }\n try {\n const data = await action.handler(parsed.data, ctx);\n return { ok: true, action: name, latencyMs: Date.now() - t0, data };\n } catch (err) {\n return {\n ok: false,\n action: name,\n latencyMs: Date.now() - t0,\n status: 500,\n code: \"handler_error\",\n message: err instanceof Error ? err.message : String(err),\n };\n }\n}\n\nfunction extractZodIssues(err: unknown): unknown {\n if (err && typeof err === \"object\" && \"issues\" in err) {\n return (err as { issues: unknown }).issues;\n }\n return undefined;\n}\n"],"mappings":";AAwBO,SAAS,aAAmB,KAAqD;AACtF,MAAI,CAAC,oBAAoB,KAAK,IAAI,IAAI,GAAG;AACvC,UAAM,IAAI;AAAA,MACR,gCAAgC,IAAI,IAAI;AAAA,IAC1C;AAAA,EACF;AACA,SAAO;AACT;;;ACTA,IAAM,WAAW,oBAAI,IAAuB;AAErC,SAAS,gBAAgB,SAAyC;AACvE,aAAW,UAAU,SAAS;AAC5B,QAAI,SAAS,IAAI,OAAO,IAAI,GAAG;AAC7B,YAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,GAAG;AAAA,IAC3E;AACA,aAAS,IAAI,OAAO,MAAM,MAAM;AAAA,EAClC;AACF;AAEO,SAAS,UAAU,MAAqC;AAC7D,SAAO,SAAS,IAAI,IAAI;AAC1B;AAEO,SAAS,cAA2B;AACzC,SAAO,CAAC,GAAG,SAAS,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAC3E;AAEO,SAAS,gBAAsB;AACpC,WAAS,MAAM;AACjB;AAOO,SAAS,cAAkD,SAAe;AAC/E,kBAAgB,OAAO;AACvB,SAAO;AACT;;;ACrDA,SAAS,SAAS;AAeX,SAAS,mBAAmB,QAA6C;AAC9E,MAAI,CAAC,YAAY,MAAM,GAAG;AACxB,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,QAAM,OAAO,EAAE,aAAa,MAAyD;AACrF,MAAI,aAAa,KAAM,QAAQ,KAAiC;AAChE,SAAO;AACT;AAEA,SAAS,YAAY,GAAwB;AAC3C,SAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,UAAU;AAC1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D,WAAQ,IAA4B;AAAA,EACtC;AACA,SAAO;AACT;","names":[]}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@next-ai-ready/actions",
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "defineAction registry, Zod validation, schema emission.",
5
+ "license": "MIT",
6
+ "type": "module",
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
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "dependencies": {
21
+ "@next-ai-ready/core": "0.1.0-alpha.0",
22
+ "zod": "^4.4.3"
23
+ },
24
+ "devDependencies": {
25
+ "tsup": "^8.3.0",
26
+ "typescript": "^5.6.0",
27
+ "vitest": "^2.1.0"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "dev": "tsup --watch",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vitest run --passWithNoTests",
34
+ "clean": "rm -rf dist .turbo"
35
+ }
36
+ }