@agent-native/actions 0.0.0-stage → 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.
- package/README.md +41 -2
- package/dist/chunk-4X4LYULO.js +108 -0
- package/dist/chunk-4X4LYULO.js.map +1 -0
- package/dist/chunk-D66CG6AI.js +265 -0
- package/dist/chunk-D66CG6AI.js.map +1 -0
- package/dist/chunk-KWA4U6DI.js +273 -0
- package/dist/chunk-KWA4U6DI.js.map +1 -0
- package/dist/chunk-SXOEFWAM.js +147 -0
- package/dist/chunk-SXOEFWAM.js.map +1 -0
- package/dist/cli.js +1765 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-C87WZhlZ.d.ts +223 -0
- package/dist/client.d.ts +70 -0
- package/dist/client.js +110 -0
- package/dist/client.js.map +1 -0
- package/dist/contract.d.ts +251 -0
- package/dist/contract.js +372 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +251 -0
- package/dist/index.js +704 -0
- package/dist/index.js.map +1 -0
- package/dist/next-config.d.ts +16 -0
- package/dist/next-config.js +46 -0
- package/dist/next-config.js.map +1 -0
- package/dist/next-pages.d.ts +12 -0
- package/dist/next-pages.js +13 -0
- package/dist/next-pages.js.map +1 -0
- package/dist/next-server.d.ts +41 -0
- package/dist/next-server.js +96 -0
- package/dist/next-server.js.map +1 -0
- package/dist/next.d.ts +39 -0
- package/dist/next.js +68 -0
- package/dist/next.js.map +1 -0
- package/dist/nuxt.d.ts +17 -0
- package/dist/nuxt.js +22 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/react.d.ts +50 -0
- package/dist/react.js +194 -0
- package/dist/react.js.map +1 -0
- package/dist/registry-CIe_aYoE.d.ts +263 -0
- package/dist/solid.d.ts +39 -0
- package/dist/solid.js +229 -0
- package/dist/solid.js.map +1 -0
- package/dist/svelte-server.d.ts +23 -0
- package/dist/svelte-server.js +33 -0
- package/dist/svelte-server.js.map +1 -0
- package/dist/svelte.d.ts +53 -0
- package/dist/svelte.js +244 -0
- package/dist/svelte.js.map +1 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.js +131 -0
- package/dist/vite.js.map +1 -0
- package/dist/vue-server.d.ts +20 -0
- package/dist/vue-server.js +26 -0
- package/dist/vue-server.js.map +1 -0
- package/dist/vue.d.ts +64 -0
- package/dist/vue.js +250 -0
- package/dist/vue.js.map +1 -0
- package/dist/webmcp.d.ts +19 -0
- package/dist/webmcp.js +36 -0
- package/dist/webmcp.js.map +1 -0
- package/package.json +172 -4
- package/skills/agent-native-actions/SKILL.md +76 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
+
import { A as ActionMapEntry, a as ActionCaller, b as ActionApprovalVerifier, c as ActionMiddleware, d as ActionAfterMutateInfo, e as ActionErrorInfo, f as ActionDefinition, D as DefinedAction, g as DefaultActionContext, h as ActionHttpMethod, J as JsonSchemaObject, i as ActionMap, j as ActionsRegistry, k as ActionHttpHandlerOptions, M as McpHandlerOptions } from './registry-CIe_aYoE.js';
|
|
3
|
+
export { l as ActionApprovalRequest, m as ActionContextInput, n as ActionHttpConfig, o as ActionMetadataSummary, p as ActionMiddlewareParams, q as AnyDefinedAction, C as CombinedHandlerOptions, r as CreateActionsOptions, I as InferActionInput, s as InferActionInputFromDef, t as InferActionOutput, u as InferActionReturn, v as createActions } from './registry-CIe_aYoE.js';
|
|
4
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
|
+
|
|
6
|
+
declare function defineAction<TSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TReturn = unknown, TCtx = DefaultActionContext>(definition: ActionDefinition<TSchema, TOutputSchema, TReturn, TCtx>): DefinedAction<TSchema, TOutputSchema, TReturn, TCtx>;
|
|
7
|
+
/**
|
|
8
|
+
* Create an app-local `defineAction` helper pre-bound to your app's context type
|
|
9
|
+
* (e.g. `{ user: SessionUser | null; orgId: string | null }`), so `ctx` is
|
|
10
|
+
* strongly typed inside every `actions/*.ts` file.
|
|
11
|
+
*/
|
|
12
|
+
declare function createActionBuilder<TCtx>(): <TSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TReturn = unknown>(definition: ActionDefinition<TSchema, TOutputSchema, TReturn, TCtx>) => DefinedAction<TSchema, TOutputSchema, TReturn, TCtx>;
|
|
13
|
+
declare function isDefinedAction(value: unknown): value is DefinedAction;
|
|
14
|
+
declare function resolveActionHttpMethod(action: Pick<ActionMapEntry<never>, "http">): ActionHttpMethod | null;
|
|
15
|
+
declare function resolveActionHttpPath(name: string, action: Pick<ActionMapEntry<never>, "http">): string | null;
|
|
16
|
+
declare function isActionReadOnly(action: Pick<ActionMapEntry<never>, "readOnly" | "http">): boolean;
|
|
17
|
+
interface ExecuteActionOptions<TCtx> {
|
|
18
|
+
name: string;
|
|
19
|
+
action: ActionMapEntry<TCtx>;
|
|
20
|
+
rawInput: unknown;
|
|
21
|
+
ctx: TCtx;
|
|
22
|
+
caller: ActionCaller;
|
|
23
|
+
approvalToken?: string;
|
|
24
|
+
approved?: boolean;
|
|
25
|
+
verifyApproval?: ActionApprovalVerifier<TCtx>;
|
|
26
|
+
middleware?: readonly ActionMiddleware<TCtx>[];
|
|
27
|
+
onAfterMutate?: (info: ActionAfterMutateInfo<TCtx>) => void | Promise<void>;
|
|
28
|
+
onError?: (error: unknown, info: ActionErrorInfo<TCtx>) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Single checked execution pipeline shared by HTTP, direct `.call()`, CLI,
|
|
32
|
+
* MCP, and AI SDK tools:
|
|
33
|
+
*
|
|
34
|
+
* 1. Normalize LLM input quirks (for `mcp` and `agent` callers only)
|
|
35
|
+
* 2. Validate input once through Standard Schema
|
|
36
|
+
* 3. Run `authorize(input, ctx)` -> 403 `forbidden` before approval or `run`
|
|
37
|
+
* 4. Evaluate `needsApproval(input, ctx)` -> 403 `approval_required` unless verified
|
|
38
|
+
* 5. Run middleware chain + `run(input, ctx)`
|
|
39
|
+
* 6. Validate `outputSchema` and fire `onAfterMutate` (failures raise `ActionPostCommitError`)
|
|
40
|
+
*/
|
|
41
|
+
declare function executeAction<TCtx>(options: ExecuteActionOptions<TCtx>): Promise<unknown>;
|
|
42
|
+
|
|
43
|
+
interface ToolExportOptions<TCtx, TNames extends string = string> {
|
|
44
|
+
/** Pre-resolved context for tool execution (e.g. `{ user: currentUser }`). */
|
|
45
|
+
context: TCtx;
|
|
46
|
+
/** Restrict exported tools to an explicit allowlist of action names. */
|
|
47
|
+
only?: readonly TNames[];
|
|
48
|
+
/** Exclude specific action names from exported tools. */
|
|
49
|
+
exclude?: readonly TNames[];
|
|
50
|
+
/** Optional approval token or verifier override when running inside an agent loop. */
|
|
51
|
+
approvalToken?: string;
|
|
52
|
+
}
|
|
53
|
+
interface AiSdkToolDefinition {
|
|
54
|
+
description: string;
|
|
55
|
+
inputSchema: StandardSchemaV1 | JsonSchemaObject;
|
|
56
|
+
parameters: StandardSchemaV1 | JsonSchemaObject;
|
|
57
|
+
execute: (args: unknown) => Promise<unknown>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Export registered actions as tools compatible with Vercel AI SDK (`ai`).
|
|
61
|
+
*/
|
|
62
|
+
declare function toAiSdkTools<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options: ToolExportOptions<TCtx, Extract<keyof TActions, string>>): Record<string, AiSdkToolDefinition>;
|
|
63
|
+
interface AnthropicToolDefinition {
|
|
64
|
+
name: string;
|
|
65
|
+
description: string;
|
|
66
|
+
input_schema: JsonSchemaObject;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Export registered actions as Anthropic SDK tool definitions + executor.
|
|
70
|
+
*/
|
|
71
|
+
declare function toAnthropicTools<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options: ToolExportOptions<TCtx, Extract<keyof TActions, string>>): {
|
|
72
|
+
tools: AnthropicToolDefinition[];
|
|
73
|
+
executeToolUse: (toolUse: {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
input: unknown;
|
|
77
|
+
}) => Promise<{
|
|
78
|
+
type: "tool_result";
|
|
79
|
+
tool_use_id: string;
|
|
80
|
+
content: string;
|
|
81
|
+
is_error?: true;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
84
|
+
interface OpenAiToolDefinition {
|
|
85
|
+
type: "function";
|
|
86
|
+
function: {
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
parameters: JsonSchemaObject;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Export registered actions as OpenAI SDK tool definitions + executor.
|
|
94
|
+
*/
|
|
95
|
+
declare function toOpenAiTools<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options: ToolExportOptions<TCtx, Extract<keyof TActions, string>>): {
|
|
96
|
+
tools: OpenAiToolDefinition[];
|
|
97
|
+
executeToolCall: (toolCall: {
|
|
98
|
+
id: string;
|
|
99
|
+
function: {
|
|
100
|
+
name: string;
|
|
101
|
+
arguments: string;
|
|
102
|
+
};
|
|
103
|
+
}) => Promise<{
|
|
104
|
+
role: "tool";
|
|
105
|
+
tool_call_id: string;
|
|
106
|
+
content: string;
|
|
107
|
+
}>;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
interface ScannedActionFile {
|
|
111
|
+
name: string;
|
|
112
|
+
filePath: string;
|
|
113
|
+
relativeImport: string;
|
|
114
|
+
identifier: string;
|
|
115
|
+
}
|
|
116
|
+
interface ScanActionsResult {
|
|
117
|
+
actions: ScannedActionFile[];
|
|
118
|
+
contextFile: string | null;
|
|
119
|
+
}
|
|
120
|
+
declare function scanActionsDirectory(projectRoot: string, options?: {
|
|
121
|
+
actionsDir?: string;
|
|
122
|
+
generatedDir?: string;
|
|
123
|
+
}): ScanActionsResult;
|
|
124
|
+
interface GenerateArtifactsOptions {
|
|
125
|
+
projectRoot: string;
|
|
126
|
+
actionsDir?: string;
|
|
127
|
+
generatedDir?: string;
|
|
128
|
+
}
|
|
129
|
+
interface GenerateArtifactsResult {
|
|
130
|
+
manifestPath: string;
|
|
131
|
+
typesPath: string;
|
|
132
|
+
actionCount: number;
|
|
133
|
+
hasContextFile: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Deterministically generate:
|
|
137
|
+
* - `.generated/actions.ts`: static ES-import registry (`export const actions`, `export type AppActions`)
|
|
138
|
+
* - `.generated/action-types.d.ts`: module augmentation for `ActionTypeRegistry`
|
|
139
|
+
*/
|
|
140
|
+
declare function generateActionArtifacts(options: GenerateArtifactsOptions): GenerateArtifactsResult;
|
|
141
|
+
|
|
142
|
+
interface ActionFailOptions {
|
|
143
|
+
/** HTTP status code (preferred, matches `@agent-native/core`). Defaults to 400. */
|
|
144
|
+
statusCode?: number;
|
|
145
|
+
/** Alias for `statusCode`. */
|
|
146
|
+
status?: number;
|
|
147
|
+
/** Machine-readable error code surfaced to UI callers, MCP clients, and agents. */
|
|
148
|
+
errorCode?: string;
|
|
149
|
+
/** Bounded structured context for callers/agents (ids, field names, limits). */
|
|
150
|
+
details?: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
declare const ACTION_ERROR_BRAND: unique symbol;
|
|
153
|
+
declare const POST_COMMIT_ERROR_BRAND: unique symbol;
|
|
154
|
+
declare class ActionError extends Error {
|
|
155
|
+
readonly [ACTION_ERROR_BRAND] = true;
|
|
156
|
+
readonly actionContractError = true;
|
|
157
|
+
readonly statusCode: number;
|
|
158
|
+
readonly errorCode: string;
|
|
159
|
+
readonly details: Record<string, unknown> | undefined;
|
|
160
|
+
readonly committed: boolean;
|
|
161
|
+
constructor(message: string, options?: ActionFailOptions & {
|
|
162
|
+
committed?: boolean;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Raised when an action's `run()` already completed (so side effects may have
|
|
167
|
+
* committed), but a post-run step such as `outputSchema` validation or
|
|
168
|
+
* `onAfterMutate` failed. Callers must not blindly retry writes on this error.
|
|
169
|
+
*/
|
|
170
|
+
declare class ActionPostCommitError extends ActionError {
|
|
171
|
+
readonly [POST_COMMIT_ERROR_BRAND] = true;
|
|
172
|
+
readonly cause: unknown;
|
|
173
|
+
constructor(message: string, cause?: unknown, details?: Record<string, unknown>);
|
|
174
|
+
}
|
|
175
|
+
declare function isActionError(value: unknown): value is ActionError;
|
|
176
|
+
declare function isActionPostCommitError(value: unknown): value is ActionPostCommitError;
|
|
177
|
+
/**
|
|
178
|
+
* Throw a structured, caller-readable error from an action.
|
|
179
|
+
* Compatible with `@agent-native/core`'s `fail()`.
|
|
180
|
+
*/
|
|
181
|
+
declare function fail(message: string, options?: ActionFailOptions): never;
|
|
182
|
+
interface ActionErrorSet<TCode extends string> {
|
|
183
|
+
readonly codes: readonly TCode[];
|
|
184
|
+
fail: (message: string, code: TCode, options?: Omit<ActionFailOptions, "errorCode">) => never;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Declare a closed set of error codes for an action, matching `@agent-native/core`'s
|
|
188
|
+
* `defineActionErrors("not_found", "already_paid")`.
|
|
189
|
+
*/
|
|
190
|
+
declare function defineActionErrors<const TCodes extends readonly [string, ...string[]]>(...codes: TCodes): ActionErrorSet<TCodes[number]>;
|
|
191
|
+
declare function serializeActionErrorBody(error: unknown): {
|
|
192
|
+
statusCode: number;
|
|
193
|
+
body: {
|
|
194
|
+
error: string;
|
|
195
|
+
errorCode: string;
|
|
196
|
+
committed?: true;
|
|
197
|
+
details?: Record<string, unknown>;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare function stripBasePath(pathname: string, basePath: string): string;
|
|
202
|
+
declare function createActionFetchHandler<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options?: ActionHttpHandlerOptions): (request: Request, override?: {
|
|
203
|
+
actionPath?: string;
|
|
204
|
+
platform?: unknown;
|
|
205
|
+
}) => Promise<Response>;
|
|
206
|
+
type FetchHandler = (request: Request, override?: {
|
|
207
|
+
actionPath?: string;
|
|
208
|
+
platform?: unknown;
|
|
209
|
+
}) => Promise<Response>;
|
|
210
|
+
type NodeRequestWithBody = IncomingMessage & {
|
|
211
|
+
body?: unknown;
|
|
212
|
+
originalUrl?: string | undefined;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Adapt any Web Standard Fetch handler (`actions.handler`, `actions.fetchHandler`,
|
|
216
|
+
* or `actions.mcpHandler`) to Node's `(req, res)` signature for Express, Fastify,
|
|
217
|
+
* Connect, or `node:http`.
|
|
218
|
+
*/
|
|
219
|
+
declare function toNodeHandler(handler: FetchHandler): (req: NodeRequestWithBody, res: ServerResponse) => Promise<void>;
|
|
220
|
+
|
|
221
|
+
declare function createMcpFetchHandler<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options?: McpHandlerOptions): (request: Request, override?: {
|
|
222
|
+
platform?: unknown;
|
|
223
|
+
}) => Promise<Response>;
|
|
224
|
+
declare function runStdioMcpServer<TCtx, TActions extends ActionMap<TCtx>>(registry: ActionsRegistry<TCtx, TActions>, options?: McpHandlerOptions): Promise<void>;
|
|
225
|
+
|
|
226
|
+
declare function validateInputSchema<TSchema extends StandardSchemaV1>(schema: TSchema, rawInput: unknown, actionName: string): Promise<StandardSchemaV1.InferOutput<TSchema>>;
|
|
227
|
+
declare function validateOutputSchema<TSchema extends StandardSchemaV1>(schema: TSchema, rawOutput: unknown, actionName: string): Promise<StandardSchemaV1.InferOutput<TSchema>>;
|
|
228
|
+
declare function schemaToJsonSchema(schema: StandardSchemaV1 | undefined, mode: "input" | "output", explicitOverride?: JsonSchemaObject): JsonSchemaObject | null;
|
|
229
|
+
/**
|
|
230
|
+
* Normalize common LLM strict-mode quirks where optional fields are sent as
|
|
231
|
+
* `null` or stringified JSON objects/arrays when the JSON Schema does not
|
|
232
|
+
* expect those types.
|
|
233
|
+
*/
|
|
234
|
+
declare function normalizeLlmToolInput(rawInput: unknown, jsonSchema: JsonSchemaObject | null): unknown;
|
|
235
|
+
|
|
236
|
+
declare const AGENT_NATIVE_ACTIONS_SKILL_NAME = "agent-native-actions";
|
|
237
|
+
declare const AGENT_NATIVE_ACTIONS_SKILL_RELATIVE_PATH: string;
|
|
238
|
+
declare const AGENT_NATIVE_ACTIONS_SKILL_MD = "---\nname: agent-native-actions\ndescription: Build and maintain backend operations with @agent-native/actions. Use whenever adding a new feature, endpoint, mutation, data fetch, CLI command, or AI tool in this app so UI, HTTP, CLI, MCP, and AI SDKs always share one typed action.\n---\n\n# Agent-Native Actions\n\nThis repository uses `@agent-native/actions` as the single source of truth for application operations.\n\n## Core Rule: Always Build New Capabilities as Actions\n\nWhen adding any new backend feature, query, mutation, or integration:\n\n1. **Create one file per operation in `actions/<verb-noun>.ts`** (for example `actions/list-deals.ts`, `actions/create-invoice.ts`, `actions/refund-charge.ts`).\n2. **Do not create parallel ad-hoc `/api/*` REST routes, Next.js Server Actions, tRPC procedures, or standalone database scripts** for normal app operations. Put the operation in `actions/` so your UI hooks, HTTP API, CLI, MCP server, and AI SDK tools automatically stay in parity.\n3. Reserve custom routes only for streaming responses, binary/file uploads, inbound third-party webhooks, OAuth callbacks, or non-JSON endpoints.\n\n## Defining an Action\n\nUse the app's typed `defineAction` helper from `actions/context.ts` if present (otherwise import `defineAction` from `@agent-native/actions`):\n\n```ts\n// actions/list-todos.ts\nimport { z } from \"zod\";\nimport { defineAction } from \"./context\"; // or \"@agent-native/actions\"\n\nexport default defineAction({\n description: \"List todos for the current user\",\n schema: z.object({\n done: z.boolean().optional().describe(\"Filter by completion status\"),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n authorize: (_input, ctx) => Boolean(ctx.user),\n run: async ({ done }, ctx) => {\n return db.todos.findMany({ where: { userId: ctx.user.id, done } });\n },\n});\n```\n\n### Action Authoring Checklist\n\n- **Filename = action name:** `actions/create-todo.ts` becomes `create-todo`. Subfolders join with hyphens (`actions/billing/refund.ts` -> `billing-refund`). Prefix shared helpers with `_` (`actions/_shared/db.ts`) so they are not registered as actions.\n- **Describe every field:** Always provide a concise one-line `description` and `.describe(...)` on schema fields so the CLI `--help`, MCP clients, and AI agents know how to call the action.\n- **Mark reads explicitly:** Set `http: { method: \"GET\" }` and `readOnly: true` on read-only queries. Leave mutations on default `POST` (or `PUT` / `DELETE`).\n- **Enforce auth in `authorize(input, ctx)`:** Never trust UI hiding. Check `ctx` (resolved once in `actions/context.ts`) inside `authorize(input, ctx)` so HTTP, CLI, MCP, and AI callers all go through the same check.\n- **Gate sensitive writes with `needsApproval`:** For destructive, irreversible, or high-value mutations (deleting data, issuing refunds, sending external emails), set `needsApproval: true` or `needsApproval: (input, ctx) => ...` and `destructive: true`.\n- **Throw structured errors with `fail()` or `defineActionErrors()`:** Never throw bare strings or swallow errors into fake empty results. Use `fail(\"Invoice not found\", { statusCode: 404, errorCode: \"not_found\" })`.\n- **Hide internal-only actions from external agents when needed:** Set `mcpTool: false` (or `agentTool: false`) on UI-only or internal admin operations.\n\n## Calling Actions from UI Code\n\nUse the typed client hooks for this repo's framework \u2014 never hand-write `fetch(\"/api/...\")` calls for actions:\n\n- **React / Next.js:** `useActionQuery(\"list-todos\", { done: false })` and `useActionMutation(\"create-todo\")` from `@agent-native/actions/react` (or `@agent-native/actions/next`)\n- **SolidJS:** `createActionQuery` / `createActionMutation` from `@agent-native/actions/solid`\n- **Vue / Nuxt:** `useActionQuery` / `useActionMutation` from `@agent-native/actions/vue`\n- **Svelte 5 / SvelteKit:** `createActionQuery` / `createActionMutation` from `@agent-native/actions/svelte`\n- **Plain TypeScript:** `createActionClient()` from `@agent-native/actions/client`\n\nMutations automatically invalidate related queries so views stay fresh without manual query-key plumbing.\n\n## Regenerating Types & Verifying via CLI\n\nAfter adding or changing actions:\n\n1. Regenerate `.generated/actions.ts` and `.generated/action-types.d.ts` if the dev server is not running:\n ```bash\n npx @agent-native/actions generate\n ```\n2. Verify discovery and execution through the CLI:\n ```bash\n pnpm action --list\n pnpm action <action-name> --help\n pnpm action <action-name> '{\"key\":\"value\"}'\n ```\n";
|
|
239
|
+
interface InstallActionsSkillOptions {
|
|
240
|
+
projectRoot: string;
|
|
241
|
+
dryRun?: boolean;
|
|
242
|
+
overwrite?: boolean;
|
|
243
|
+
}
|
|
244
|
+
interface InstallActionsSkillResult {
|
|
245
|
+
filePath: string;
|
|
246
|
+
relativePath: string;
|
|
247
|
+
status: "created" | "updated" | "skipped" | "would-create" | "would-update";
|
|
248
|
+
}
|
|
249
|
+
declare function installActionsSkill(options: InstallActionsSkillOptions): InstallActionsSkillResult;
|
|
250
|
+
|
|
251
|
+
export { AGENT_NATIVE_ACTIONS_SKILL_MD, AGENT_NATIVE_ACTIONS_SKILL_NAME, AGENT_NATIVE_ACTIONS_SKILL_RELATIVE_PATH, ActionAfterMutateInfo, ActionApprovalVerifier, ActionCaller, ActionDefinition, ActionError, ActionErrorInfo, type ActionErrorSet, type ActionFailOptions, ActionHttpHandlerOptions, ActionHttpMethod, ActionMap, ActionMiddleware, ActionPostCommitError, ActionsRegistry, type AiSdkToolDefinition, type AnthropicToolDefinition, DefaultActionContext, DefinedAction, type ExecuteActionOptions, type FetchHandler, type GenerateArtifactsOptions, type GenerateArtifactsResult, type InstallActionsSkillOptions, type InstallActionsSkillResult, JsonSchemaObject, McpHandlerOptions, type OpenAiToolDefinition, type ScanActionsResult, type ScannedActionFile, type ToolExportOptions, createActionBuilder, createActionFetchHandler, createMcpFetchHandler, defineAction, defineActionErrors, executeAction, fail, generateActionArtifacts, installActionsSkill, isActionError, isActionPostCommitError, isActionReadOnly, isDefinedAction, normalizeLlmToolInput, resolveActionHttpMethod, resolveActionHttpPath, runStdioMcpServer, scanActionsDirectory, schemaToJsonSchema, serializeActionErrorBody, stripBasePath, toAiSdkTools, toAnthropicTools, toNodeHandler, toOpenAiTools, validateInputSchema, validateOutputSchema };
|