@agentproto/action 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/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/chunk-VJCWGENG.mjs +51 -0
- package/dist/chunk-VJCWGENG.mjs.map +1 -0
- package/dist/index-CETj5oaU.d.ts +174 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.mjs +37 -0
- package/dist/index.mjs.map +1 -0
- package/dist/manifest/index.d.ts +2 -0
- package/dist/manifest/index.mjs +3 -0
- package/dist/manifest/index.mjs.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agentproto 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,23 @@
|
|
|
1
|
+
# @agentproto/action
|
|
2
|
+
|
|
3
|
+
AIP-39 `ACTION.md` reference implementation. A markdown + frontmatter format for declaring an abstract verb / operation that can be performed on a resource — its identity, semantics, side-effect profile, approval class, and lifecycle events. The pivot primitive that TOOL implements (with LLM schema), POLICY references (for grants), INTENT routes to (from user verbs), and WORKFLOW steps invoke. Bottom-up — implementations declare which actions they implement.
|
|
4
|
+
|
|
5
|
+
> **Status: 0.1.0-alpha.** Generated by `scripts/scaffold-aip.mjs` — `build()` and `validate()` bodies are TODOs.
|
|
6
|
+
|
|
7
|
+
Spec: <https://agentproto.sh/docs/aip-39>
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { defineAction } from "@agentproto/action"
|
|
13
|
+
|
|
14
|
+
const x = defineAction({
|
|
15
|
+
id: "my-action",
|
|
16
|
+
description: "Short purpose.",
|
|
17
|
+
// ...
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import matter from 'gray-matter';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createDoctype } from '@agentproto/define-doctype';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @agentproto/action v0.1.0-alpha
|
|
7
|
+
* AIP-39 ACTION.md `defineAction` reference implementation.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var actionFrontmatterSchema = z.object({ "schema": z.literal("action/v1"), "id": z.string().regex(new RegExp("^[a-z0-9][a-z0-9.-]*(:[a-z0-9][a-z0-9.-]*)?$")).min(2).max(80).describe("Machine identifier. Standard format `<target-kind>:<verb>` (e.g. `storage:commit`). Single colon only; multiple colons reserved for future namespacing."), "description": z.string().min(1).max(2e3).describe("One-paragraph purpose, written for the LLM caller."), "version": z.string().regex(new RegExp("^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$")).describe("Spec version of THIS file. Bump on breaking change to mutates / risk_level.").default("1.0.0"), "category": z.string().describe("Discovery category for catalog UIs. Common: filesystem, compute, messaging, vcs, payment, auth, lifecycle.").default(""), "verb": z.string().describe("The bare verb (e.g. `commit`, `execute`). Derived from `id` after the `:` if absent.").optional(), "target_kind": z.string().describe("The resource kind this action operates on (e.g. `storage`, `sandbox`, `secrets`). Derived from `id` before the `:` if absent.").optional(), "mutates": z.array(z.string().regex(new RegExp("^[a-z]+:[^\\s]+$")).describe("Format: <class>:<scope>. Examples: storage:*, network:api.foo.com, database:invoices. Implementors MUST honour every entry; widening rejected at parse time.")).describe("Resources the action may modify. Inherited by implementors (TOOL, DRIVER); they MAY add more, never drop.").default([]), "requires": z.object({ "network": z.array(z.string()).optional(), "secrets": z.array(z.string()).optional(), "tools": z.array(z.string()).optional() }).strict().describe("Capability requirements gated by AIP-7 governance. Implementors MAY add to this set; MUST NOT remove.").optional(), "approval": z.union([z.enum(["auto", "always", "on-mutate"]), z.string().regex(new RegExp("^policy:[A-Za-z0-9_./-]+$"))]).describe("Approval class. Implementors MAY narrow (`auto` \u2192 `always` \u2192 `on-mutate`); MUST NOT widen.").default("auto"), "risk_level": z.number().int().gte(0).lte(3).describe("0=read-only, 1=scoped writes, 2=external side effects, 3=irreversible. Implementors MAY raise; MUST NOT lower.").default(0), "fires_events": z.array(z.string().min(1)).describe("AIP-37 LIFECYCLE event names this action fires when invoked. Subscribers (sync layers, audit) attach to these. Implementors MAY fire more events; MUST NOT drop any declared here.").default([]), "implementations": z.array(z.object({ "kind": z.enum(["tool", "driver", "ui", "lifecycle"]).describe("Kind of implementation."), "ref": z.string().min(1).describe("Reference to the implementor (TOOL.md id, DRIVER.md id, UI surface name, etc.).") }).strict()).describe("OPTIONAL discovery hint \u2014 known implementations of this action. NOT authoritative \u2014 source of truth lives on implementors via their `implements:` field. Hosts populate from scanning.").default([]), "tags": z.array(z.string()).describe("Free-form discovery tags.").default([]), "examples": z.array(z.object({ "name": z.string().min(1), "scenario": z.string().min(1), "note": z.string().optional() }).strict()).describe("Semantic examples (NOT input/output, since action has no schema). Each `{ name, scenario, note? }`.").default([]), "metadata": z.record(z.string(), z.any()).describe("Free-form, namespaced. Authors MAY stash adapter-specific hints under namespaced keys.").optional() }).strict().describe("Validates the YAML frontmatter portion of an AIP-39 ACTION.md manifest. The pivot primitive: TOOL implements it, POLICY grants on it, INTENT routes to it, WORKFLOW steps invoke it.");
|
|
11
|
+
var defineAction = createDoctype({
|
|
12
|
+
aip: 39,
|
|
13
|
+
name: "action",
|
|
14
|
+
// Action ids are namespaced `<target_kind>:<verb>` (`secrets:reveal`,
|
|
15
|
+
// `storage:commit`). Override createDoctype's default kebab-only
|
|
16
|
+
// pattern; the schema's own id regex (stricter) runs inside zod.
|
|
17
|
+
idPattern: /^[a-z0-9][a-z0-9.-]*(?::[a-z0-9][a-z0-9.-]*)?$/,
|
|
18
|
+
validate(def) {
|
|
19
|
+
const result = actionFrontmatterSchema.safeParse(def);
|
|
20
|
+
if (!result.success) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`defineAction (AIP-39): ${result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ")}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
build(def) {
|
|
27
|
+
return { ...def };
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// src/manifest/index.ts
|
|
32
|
+
function parseActionManifest(source) {
|
|
33
|
+
const parsed = matter(source);
|
|
34
|
+
if (Object.keys(parsed.data).length === 0) {
|
|
35
|
+
throw new Error("parseActionManifest: missing or empty frontmatter");
|
|
36
|
+
}
|
|
37
|
+
const result = actionFrontmatterSchema.safeParse(parsed.data);
|
|
38
|
+
if (!result.success) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`parseActionManifest: invalid frontmatter \u2014 ${result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ")}`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return { frontmatter: result.data, body: parsed.content };
|
|
44
|
+
}
|
|
45
|
+
function actionFromManifest(manifest) {
|
|
46
|
+
return defineAction(manifest.frontmatter);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { actionFromManifest, actionFrontmatterSchema, defineAction, parseActionManifest };
|
|
50
|
+
//# sourceMappingURL=chunk-VJCWGENG.mjs.map
|
|
51
|
+
//# sourceMappingURL=chunk-VJCWGENG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts","../src/define-action.ts","../src/manifest/index.ts"],"names":[],"mappings":";;;;;;;;;AAeO,IAAM,0BAA0B,CAAA,CAAE,MAAA,CAAO,EAAE,QAAA,EAAU,EAAE,OAAA,CAAQ,WAAW,CAAA,EAAG,IAAA,EAAM,EAAE,MAAA,EAAO,CAAE,KAAA,CAAM,IAAI,OAAO,8CAA8C,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,SAAS,yJAAyJ,CAAA,EAAG,aAAA,EAAe,CAAA,CAAE,QAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAI,CAAA,CAAE,QAAA,CAAS,oDAAoD,CAAA,EAAG,WAAW,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,IAAI,MAAA,CAAO,yCAAyC,CAAC,CAAA,CAAE,SAAS,6EAA6E,CAAA,CAAE,OAAA,CAAQ,OAAO,GAAG,UAAA,EAAY,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,4GAA4G,CAAA,CAAE,OAAA,CAAQ,EAAE,GAAG,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,sFAA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WGENG.mjs","sourcesContent":["/**\n * AIP-39 ACTION.md frontmatter zod schema.\n *\n * Generated from `resources/aip-39/draft/ACTION.schema.json` via\n * json-schema-to-zod. Imported by both `define-action.ts` (TS path\n * validation) and `manifest/index.ts` (.md path validation) so every\n * field-level constraint runs in both authoring paths from a single\n * source of truth — re-run scaffold-aip to refresh after spec changes.\n *\n * Cross-field rules (if/then/allOf in JSON Schema) don't translate\n * cleanly and live in `define-action.ts`'s `validate(def)` instead.\n */\n\nimport { z } from \"zod\"\n\nexport const actionFrontmatterSchema = z.object({ \"schema\": z.literal(\"action/v1\"), \"id\": z.string().regex(new RegExp(\"^[a-z0-9][a-z0-9.-]*(:[a-z0-9][a-z0-9.-]*)?$\")).min(2).max(80).describe(\"Machine identifier. Standard format `<target-kind>:<verb>` (e.g. `storage:commit`). Single colon only; multiple colons reserved for future namespacing.\"), \"description\": z.string().min(1).max(2000).describe(\"One-paragraph purpose, written for the LLM caller.\"), \"version\": z.string().regex(new RegExp(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:[-+][\\\\w.\\\\-]+)?$\")).describe(\"Spec version of THIS file. Bump on breaking change to mutates / risk_level.\").default(\"1.0.0\"), \"category\": z.string().describe(\"Discovery category for catalog UIs. Common: filesystem, compute, messaging, vcs, payment, auth, lifecycle.\").default(\"\"), \"verb\": z.string().describe(\"The bare verb (e.g. `commit`, `execute`). Derived from `id` after the `:` if absent.\").optional(), \"target_kind\": z.string().describe(\"The resource kind this action operates on (e.g. `storage`, `sandbox`, `secrets`). Derived from `id` before the `:` if absent.\").optional(), \"mutates\": z.array(z.string().regex(new RegExp(\"^[a-z]+:[^\\\\s]+$\")).describe(\"Format: <class>:<scope>. Examples: storage:*, network:api.foo.com, database:invoices. Implementors MUST honour every entry; widening rejected at parse time.\")).describe(\"Resources the action may modify. Inherited by implementors (TOOL, DRIVER); they MAY add more, never drop.\").default([] as never), \"requires\": z.object({ \"network\": z.array(z.string()).optional(), \"secrets\": z.array(z.string()).optional(), \"tools\": z.array(z.string()).optional() }).strict().describe(\"Capability requirements gated by AIP-7 governance. Implementors MAY add to this set; MUST NOT remove.\").optional(), \"approval\": z.union([z.enum([\"auto\",\"always\",\"on-mutate\"]), z.string().regex(new RegExp(\"^policy:[A-Za-z0-9_./-]+$\"))]).describe(\"Approval class. Implementors MAY narrow (`auto` → `always` → `on-mutate`); MUST NOT widen.\").default(\"auto\"), \"risk_level\": z.number().int().gte(0).lte(3).describe(\"0=read-only, 1=scoped writes, 2=external side effects, 3=irreversible. Implementors MAY raise; MUST NOT lower.\").default(0), \"fires_events\": z.array(z.string().min(1)).describe(\"AIP-37 LIFECYCLE event names this action fires when invoked. Subscribers (sync layers, audit) attach to these. Implementors MAY fire more events; MUST NOT drop any declared here.\").default([] as never), \"implementations\": z.array(z.object({ \"kind\": z.enum([\"tool\",\"driver\",\"ui\",\"lifecycle\"]).describe(\"Kind of implementation.\"), \"ref\": z.string().min(1).describe(\"Reference to the implementor (TOOL.md id, DRIVER.md id, UI surface name, etc.).\") }).strict()).describe(\"OPTIONAL discovery hint — known implementations of this action. NOT authoritative — source of truth lives on implementors via their `implements:` field. Hosts populate from scanning.\").default([] as never), \"tags\": z.array(z.string()).describe(\"Free-form discovery tags.\").default([] as never), \"examples\": z.array(z.object({ \"name\": z.string().min(1), \"scenario\": z.string().min(1), \"note\": z.string().optional() }).strict()).describe(\"Semantic examples (NOT input/output, since action has no schema). Each `{ name, scenario, note? }`.\").default([] as never), \"metadata\": z.record(z.string(), z.any()).describe(\"Free-form, namespaced. Authors MAY stash adapter-specific hints under namespaced keys.\").optional() }).strict().describe(\"Validates the YAML frontmatter portion of an AIP-39 ACTION.md manifest. The pivot primitive: TOOL implements it, POLICY grants on it, INTENT routes to it, WORKFLOW steps invoke it.\")\n\nexport type ActionFrontmatter = z.infer<typeof actionFrontmatterSchema>\n","import { createDoctype } from \"@agentproto/define-doctype\"\nimport { actionFrontmatterSchema } from \"./schema.js\"\nimport type { ActionDefinition, ActionHandle } from \"./types.js\"\n\n/**\n * AIP-39 reference implementation of `defineAction`.\n *\n * Built on `createDoctype` so the cross-AIP invariants (id pattern,\n * description length, top-level freeze, \"defineAction (AIP-39): …\"\n * error prefix) run uniformly with every other AIP defineX.\n *\n * Field-level validation runs the schema-derived zod from\n * `./schema.ts` against the input. Same source of truth as the .md\n * path uses (`parseActionManifest`), so a malformed TS-authored\n * definition fails with the same diagnostic as a malformed manifest.\n * Cross-field rules go in `validate(def)` after the zod check.\n */\nexport const defineAction = createDoctype<ActionDefinition, ActionHandle>({\n aip: 39,\n name: \"action\",\n // Action ids are namespaced `<target_kind>:<verb>` (`secrets:reveal`,\n // `storage:commit`). Override createDoctype's default kebab-only\n // pattern; the schema's own id regex (stricter) runs inside zod.\n idPattern: /^[a-z0-9][a-z0-9.-]*(?::[a-z0-9][a-z0-9.-]*)?$/,\n validate(def) {\n const result = actionFrontmatterSchema.safeParse(def)\n if (!result.success) {\n throw new Error(\n `defineAction (AIP-39): ${result.error.issues\n .map((i) => `${i.path.join(\".\")}: ${i.message}`)\n .join(\"; \")}`,\n )\n }\n // TODO: spec-39-specific cross-field rules (if/then/allOf in\n // the JSON Schema) — those don't translate to zod cleanly and\n // belong here. See @agentproto/operator's autonomy=gated rule.\n },\n build(def) {\n // Default build: spread the validated definition into a fresh object.\n // Hand-tune for nested freezing (Object.freeze on arrays/objects) and\n // for fields that need defaults applied — see @agentproto/operator\n // for a reference shape.\n return { ...def } as ActionHandle\n },\n})\n","/**\n * AIP-39 ACTION.md sidecar parser + manifest-to-handle constructor.\n *\n * Mirror of `@agentproto/tool/manifest` and `@agentproto/driver/manifest`:\n * the .md provides metadata; the TS module supplies any spec-specific\n * runtime bits (schemas, execute bodies, …) that can't live in\n * frontmatter. Both inputs end up in `defineAction` so the cross-AIP\n * invariants run uniformly.\n *\n *\n * The frontmatter zod schema below was generated from\n * `resources/aip-39/draft/ACTION.schema.json` via json-schema-to-zod.\n * Re-run scaffold-aip to refresh after spec changes (or hand-tune\n * any constraint the converter doesn't capture cleanly).\n */\n\nimport matter from \"gray-matter\"\nimport { actionFrontmatterSchema, type ActionFrontmatter } from \"../schema.js\"\nimport { defineAction } from \"../define-action.js\"\nimport type { ActionDefinition, ActionHandle } from \"../types.js\"\n\n// Re-export so consumers can import the schema + inferred type either\n// from \"@@agentproto/action/manifest\" or directly from \"@@agentproto/action/schema\".\nexport { actionFrontmatterSchema, type ActionFrontmatter }\n\nexport interface ActionManifest {\n frontmatter: ActionFrontmatter\n body: string\n}\n\nexport function parseActionManifest(source: string): ActionManifest {\n const parsed = matter(source)\n if (Object.keys(parsed.data).length === 0) {\n throw new Error(\"parseActionManifest: missing or empty frontmatter\")\n }\n const result = actionFrontmatterSchema.safeParse(parsed.data)\n if (!result.success) {\n throw new Error(\n `parseActionManifest: invalid frontmatter — ${result.error.issues\n .map((i) => `${i.path.join(\".\")}: ${i.message}`)\n .join(\"; \")}`,\n )\n }\n return { frontmatter: result.data, body: parsed.content }\n}\n\nexport function actionFromManifest(manifest: ActionManifest): ActionHandle {\n // The zod-validated frontmatter is structurally compatible with\n // ActionDefinition; the cast pins the typing once the manifest\n // schema and the TS interface diverge (e.g. handle has frozen fields\n // a literal config doesn't carry yet).\n return defineAction(manifest.frontmatter as unknown as ActionDefinition)\n}\n"]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AIP-39 ActionDefinition + ActionHandle.
|
|
5
|
+
*
|
|
6
|
+
* `ActionDefinition` was generated from
|
|
7
|
+
* `resources/aip-39/draft/ACTION.schema.json` via json-schema-to-typescript.
|
|
8
|
+
* `ActionHandle` is the readonly view of the same shape; tighten it
|
|
9
|
+
* by hand for fields that get defaults applied in build().
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Validates the YAML frontmatter portion of an AIP-39 ACTION.md manifest. The pivot primitive: TOOL implements it, POLICY grants on it, INTENT routes to it, WORKFLOW steps invoke it.
|
|
13
|
+
*/
|
|
14
|
+
interface ActionDefinition {
|
|
15
|
+
schema: "action/v1";
|
|
16
|
+
/**
|
|
17
|
+
* Machine identifier. Standard format `<target-kind>:<verb>` (e.g. `storage:commit`). Single colon only; multiple colons reserved for future namespacing.
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* One-paragraph purpose, written for the LLM caller.
|
|
22
|
+
*/
|
|
23
|
+
description: string;
|
|
24
|
+
/**
|
|
25
|
+
* Spec version of THIS file. Bump on breaking change to mutates / risk_level.
|
|
26
|
+
*/
|
|
27
|
+
version?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Discovery category for catalog UIs. Common: filesystem, compute, messaging, vcs, payment, auth, lifecycle.
|
|
30
|
+
*/
|
|
31
|
+
category?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The bare verb (e.g. `commit`, `execute`). Derived from `id` after the `:` if absent.
|
|
34
|
+
*/
|
|
35
|
+
verb?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The resource kind this action operates on (e.g. `storage`, `sandbox`, `secrets`). Derived from `id` before the `:` if absent.
|
|
38
|
+
*/
|
|
39
|
+
target_kind?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Resources the action may modify. Inherited by implementors (TOOL, DRIVER); they MAY add more, never drop.
|
|
42
|
+
*/
|
|
43
|
+
mutates?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Capability requirements gated by AIP-7 governance. Implementors MAY add to this set; MUST NOT remove.
|
|
46
|
+
*/
|
|
47
|
+
requires?: {
|
|
48
|
+
network?: string[];
|
|
49
|
+
secrets?: string[];
|
|
50
|
+
tools?: string[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Approval class. Implementors MAY narrow (`auto` → `always` → `on-mutate`); MUST NOT widen.
|
|
54
|
+
*/
|
|
55
|
+
approval?: ("auto" | "always" | "on-mutate") | string;
|
|
56
|
+
/**
|
|
57
|
+
* 0=read-only, 1=scoped writes, 2=external side effects, 3=irreversible. Implementors MAY raise; MUST NOT lower.
|
|
58
|
+
*/
|
|
59
|
+
risk_level?: number;
|
|
60
|
+
/**
|
|
61
|
+
* AIP-37 LIFECYCLE event names this action fires when invoked. Subscribers (sync layers, audit) attach to these. Implementors MAY fire more events; MUST NOT drop any declared here.
|
|
62
|
+
*/
|
|
63
|
+
fires_events?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* OPTIONAL discovery hint — known implementations of this action. NOT authoritative — source of truth lives on implementors via their `implements:` field. Hosts populate from scanning.
|
|
66
|
+
*/
|
|
67
|
+
implementations?: {
|
|
68
|
+
/**
|
|
69
|
+
* Kind of implementation.
|
|
70
|
+
*/
|
|
71
|
+
kind: "tool" | "driver" | "ui" | "lifecycle";
|
|
72
|
+
/**
|
|
73
|
+
* Reference to the implementor (TOOL.md id, DRIVER.md id, UI surface name, etc.).
|
|
74
|
+
*/
|
|
75
|
+
ref: string;
|
|
76
|
+
}[];
|
|
77
|
+
/**
|
|
78
|
+
* Free-form discovery tags.
|
|
79
|
+
*/
|
|
80
|
+
tags?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* Semantic examples (NOT input/output, since action has no schema). Each `{ name, scenario, note? }`.
|
|
83
|
+
*/
|
|
84
|
+
examples?: {
|
|
85
|
+
name: string;
|
|
86
|
+
scenario: string;
|
|
87
|
+
note?: string;
|
|
88
|
+
}[];
|
|
89
|
+
/**
|
|
90
|
+
* Free-form, namespaced. Authors MAY stash adapter-specific hints under namespaced keys.
|
|
91
|
+
*/
|
|
92
|
+
metadata?: {
|
|
93
|
+
[k: string]: unknown;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
type ActionHandle = Readonly<ActionDefinition>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* AIP-39 ACTION.md frontmatter zod schema.
|
|
100
|
+
*
|
|
101
|
+
* Generated from `resources/aip-39/draft/ACTION.schema.json` via
|
|
102
|
+
* json-schema-to-zod. Imported by both `define-action.ts` (TS path
|
|
103
|
+
* validation) and `manifest/index.ts` (.md path validation) so every
|
|
104
|
+
* field-level constraint runs in both authoring paths from a single
|
|
105
|
+
* source of truth — re-run scaffold-aip to refresh after spec changes.
|
|
106
|
+
*
|
|
107
|
+
* Cross-field rules (if/then/allOf in JSON Schema) don't translate
|
|
108
|
+
* cleanly and live in `define-action.ts`'s `validate(def)` instead.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
declare const actionFrontmatterSchema: z.ZodObject<{
|
|
112
|
+
schema: z.ZodLiteral<"action/v1">;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
description: z.ZodString;
|
|
115
|
+
version: z.ZodDefault<z.ZodString>;
|
|
116
|
+
category: z.ZodDefault<z.ZodString>;
|
|
117
|
+
verb: z.ZodOptional<z.ZodString>;
|
|
118
|
+
target_kind: z.ZodOptional<z.ZodString>;
|
|
119
|
+
mutates: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
120
|
+
requires: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
network: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
+
}, z.core.$strict>>;
|
|
125
|
+
approval: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
126
|
+
auto: "auto";
|
|
127
|
+
always: "always";
|
|
128
|
+
"on-mutate": "on-mutate";
|
|
129
|
+
}>, z.ZodString]>>;
|
|
130
|
+
risk_level: z.ZodDefault<z.ZodNumber>;
|
|
131
|
+
fires_events: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
132
|
+
implementations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
133
|
+
kind: z.ZodEnum<{
|
|
134
|
+
tool: "tool";
|
|
135
|
+
driver: "driver";
|
|
136
|
+
ui: "ui";
|
|
137
|
+
lifecycle: "lifecycle";
|
|
138
|
+
}>;
|
|
139
|
+
ref: z.ZodString;
|
|
140
|
+
}, z.core.$strict>>>;
|
|
141
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
142
|
+
examples: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
143
|
+
name: z.ZodString;
|
|
144
|
+
scenario: z.ZodString;
|
|
145
|
+
note: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>>>;
|
|
147
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
type ActionFrontmatter = z.infer<typeof actionFrontmatterSchema>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* AIP-39 ACTION.md sidecar parser + manifest-to-handle constructor.
|
|
153
|
+
*
|
|
154
|
+
* Mirror of `@agentproto/tool/manifest` and `@agentproto/driver/manifest`:
|
|
155
|
+
* the .md provides metadata; the TS module supplies any spec-specific
|
|
156
|
+
* runtime bits (schemas, execute bodies, …) that can't live in
|
|
157
|
+
* frontmatter. Both inputs end up in `defineAction` so the cross-AIP
|
|
158
|
+
* invariants run uniformly.
|
|
159
|
+
*
|
|
160
|
+
*
|
|
161
|
+
* The frontmatter zod schema below was generated from
|
|
162
|
+
* `resources/aip-39/draft/ACTION.schema.json` via json-schema-to-zod.
|
|
163
|
+
* Re-run scaffold-aip to refresh after spec changes (or hand-tune
|
|
164
|
+
* any constraint the converter doesn't capture cleanly).
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
interface ActionManifest {
|
|
168
|
+
frontmatter: ActionFrontmatter;
|
|
169
|
+
body: string;
|
|
170
|
+
}
|
|
171
|
+
declare function parseActionManifest(source: string): ActionManifest;
|
|
172
|
+
declare function actionFromManifest(manifest: ActionManifest): ActionHandle;
|
|
173
|
+
|
|
174
|
+
export { type ActionDefinition as A, type ActionHandle as a, type ActionManifest as b, actionFromManifest as c, actionFrontmatterSchema as d, type ActionFrontmatter as e, parseActionManifest as p };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { A as ActionDefinition, a as ActionHandle } from './index-CETj5oaU.js';
|
|
2
|
+
export { b as ActionManifest, c as actionFromManifest, d as actionFrontmatterSchema, p as parseActionManifest } from './index-CETj5oaU.js';
|
|
3
|
+
import * as _agentproto_manifest from '@agentproto/manifest';
|
|
4
|
+
import { DoctypeSpec } from '@agentproto/manifest';
|
|
5
|
+
import 'zod';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* AIP-39 reference implementation of `defineAction`.
|
|
9
|
+
*
|
|
10
|
+
* Built on `createDoctype` so the cross-AIP invariants (id pattern,
|
|
11
|
+
* description length, top-level freeze, "defineAction (AIP-39): …"
|
|
12
|
+
* error prefix) run uniformly with every other AIP defineX.
|
|
13
|
+
*
|
|
14
|
+
* Field-level validation runs the schema-derived zod from
|
|
15
|
+
* `./schema.ts` against the input. Same source of truth as the .md
|
|
16
|
+
* path uses (`parseActionManifest`), so a malformed TS-authored
|
|
17
|
+
* definition fails with the same diagnostic as a malformed manifest.
|
|
18
|
+
* Cross-field rules go in `validate(def)` after the zod check.
|
|
19
|
+
*/
|
|
20
|
+
declare const defineAction: (def: ActionDefinition) => Readonly<ActionDefinition>;
|
|
21
|
+
|
|
22
|
+
declare const actionSpec: DoctypeSpec<ActionDefinition, ActionHandle>;
|
|
23
|
+
declare const actionVerbs: _agentproto_manifest.Verbs<ActionDefinition, Readonly<ActionDefinition>>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @agentproto/action — AIP-39 ACTION.md `defineAction` reference impl.
|
|
27
|
+
*
|
|
28
|
+
* A markdown + frontmatter format for declaring an abstract verb / operation that can be performed on a resource — its identity, semantics, side-effect profile, approval class, and lifecycle events. The pivot primitive that TOOL implements (with LLM schema), POLICY references (for grants), INTENT routes to (from user verbs), and WORKFLOW steps invoke. Bottom-up — implementations declare which actions they implement.
|
|
29
|
+
*
|
|
30
|
+
* Spec: https://agentproto.sh/docs/aip-39
|
|
31
|
+
*
|
|
32
|
+
* Authoring paths:
|
|
33
|
+
* - TS: `defineAction({...})` → `ActionHandle`
|
|
34
|
+
* - MD: `parseActionManifest(src) → actionFromManifest({...})` → `ActionHandle`
|
|
35
|
+
*/
|
|
36
|
+
declare const SPEC_NAME: "agentaction/v1";
|
|
37
|
+
declare const SPEC_VERSION: "1.0.0-alpha";
|
|
38
|
+
|
|
39
|
+
export { ActionDefinition, ActionHandle, SPEC_NAME, SPEC_VERSION, actionSpec, actionVerbs, defineAction };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineAction, parseActionManifest } from './chunk-VJCWGENG.mjs';
|
|
2
|
+
export { actionFromManifest, actionFrontmatterSchema, defineAction, parseActionManifest } from './chunk-VJCWGENG.mjs';
|
|
3
|
+
import { createVerbs } from '@agentproto/manifest';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @agentproto/action v0.1.0-alpha
|
|
7
|
+
* AIP-39 ACTION.md `defineAction` reference implementation.
|
|
8
|
+
*/
|
|
9
|
+
var actionSpec = {
|
|
10
|
+
name: "action",
|
|
11
|
+
aip: 39,
|
|
12
|
+
schemaLiteral: "action/v1",
|
|
13
|
+
// Path convention: actions live under a `.actions/` dir keyed by
|
|
14
|
+
// their kebab-cased id. AIP-39's standard library follows the same
|
|
15
|
+
// shape (`.actions/secrets-reveal/ACTION.md` for id `secrets:reveal`).
|
|
16
|
+
pathOf: (h) => {
|
|
17
|
+
const slug = h.id.replace(/:/g, "-");
|
|
18
|
+
return `.actions/${slug}/ACTION.md`;
|
|
19
|
+
},
|
|
20
|
+
define: defineAction,
|
|
21
|
+
parse: (source) => {
|
|
22
|
+
const m = parseActionManifest(source);
|
|
23
|
+
return {
|
|
24
|
+
frontmatter: m.frontmatter,
|
|
25
|
+
body: m.body
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var actionVerbs = createVerbs(actionSpec);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var SPEC_NAME = "agentaction/v1";
|
|
33
|
+
var SPEC_VERSION = "1.0.0-alpha";
|
|
34
|
+
|
|
35
|
+
export { SPEC_NAME, SPEC_VERSION, actionSpec, actionVerbs };
|
|
36
|
+
//# sourceMappingURL=index.mjs.map
|
|
37
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/spec.ts","../src/index.ts"],"names":[],"mappings":";;;;;;;;AAaO,IAAM,UAAA,GAA0D;AAAA,EACrE,IAAA,EAAM,QAAA;AAAA,EACN,GAAA,EAAK,EAAA;AAAA,EACL,aAAA,EAAe,WAAA;AAAA;AAAA;AAAA;AAAA,EAIf,MAAA,EAAQ,CAAC,CAAA,KAAM;AACb,IAAA,MAAM,IAAA,GAAO,CAAA,CAAE,EAAA,CAAG,OAAA,CAAQ,MAAM,GAAG,CAAA;AACnC,IAAA,OAAO,YAAY,IAAI,CAAA,UAAA,CAAA;AAAA,EACzB,CAAA;AAAA,EACA,MAAA,EAAQ,YAAA;AAAA,EACR,KAAA,EAAO,CAAC,MAAA,KAAW;AACjB,IAAA,MAAM,CAAA,GAAI,oBAAoB,MAAM,CAAA;AACpC,IAAA,OAAO;AAAA,MACL,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,MAAM,CAAA,CAAE;AAAA,KACV;AAAA,EACF;AACF;AAEO,IAAM,WAAA,GAAc,YAAY,UAAU;;;ACtB1C,IAAM,SAAA,GAAY;AAClB,IAAM,YAAA,GAAe","file":"index.mjs","sourcesContent":["/**\n * AIP-39 doctype spec — fed to `@agentproto/manifest.createVerbs`\n * to derive create / load / list / update / resolve / delete in one\n * place. Plugs into `@agentproto/mcp-server` so an action library\n * lives at `<workspace>/.actions/<id>/ACTION.md` (the convention\n * AIP-39's standard library uses) and is callable over MCP.\n */\n\nimport { createVerbs, type DoctypeSpec } from \"@agentproto/manifest\"\nimport { defineAction } from \"./define-action.js\"\nimport { parseActionManifest } from \"./manifest/index.js\"\nimport type { ActionDefinition, ActionHandle } from \"./types.js\"\n\nexport const actionSpec: DoctypeSpec<ActionDefinition, ActionHandle> = {\n name: \"action\",\n aip: 39,\n schemaLiteral: \"action/v1\",\n // Path convention: actions live under a `.actions/` dir keyed by\n // their kebab-cased id. AIP-39's standard library follows the same\n // shape (`.actions/secrets-reveal/ACTION.md` for id `secrets:reveal`).\n pathOf: (h) => {\n const slug = h.id.replace(/:/g, \"-\")\n return `.actions/${slug}/ACTION.md`\n },\n define: defineAction,\n parse: (source) => {\n const m = parseActionManifest(source)\n return {\n frontmatter: m.frontmatter as unknown as Record<string, unknown>,\n body: m.body,\n }\n },\n}\n\nexport const actionVerbs = createVerbs(actionSpec)\n","/**\n * @agentproto/action — AIP-39 ACTION.md `defineAction` reference impl.\n *\n * A markdown + frontmatter format for declaring an abstract verb / operation that can be performed on a resource — its identity, semantics, side-effect profile, approval class, and lifecycle events. The pivot primitive that TOOL implements (with LLM schema), POLICY references (for grants), INTENT routes to (from user verbs), and WORKFLOW steps invoke. Bottom-up — implementations declare which actions they implement.\n *\n * Spec: https://agentproto.sh/docs/aip-39\n *\n * Authoring paths:\n * - TS: `defineAction({...})` → `ActionHandle`\n * - MD: `parseActionManifest(src) → actionFromManifest({...})` → `ActionHandle`\n */\n\nexport const SPEC_NAME = \"agentaction/v1\" as const\nexport const SPEC_VERSION = \"1.0.0-alpha\" as const\n\nexport { defineAction } from \"./define-action.js\"\nexport type { ActionDefinition, ActionHandle } from \"./types.js\"\nexport { actionSpec, actionVerbs } from \"./spec.js\"\nexport {\n parseActionManifest,\n actionFromManifest,\n actionFrontmatterSchema,\n type ActionManifest,\n} from \"./manifest/index.js\"\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentproto/action",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "@agentproto/action — AIP-39 ACTION.md reference implementation. A markdown + frontmatter format for declaring an abstract verb / operation that can be performed on a resource — its identity, semantics, side-effect profile, approval class, and lifecycle events. The pivot primitive that TOOL implements (with LLM schema), POLICY references (for grants), INTENT routes to (from user verbs), and WORKFLOW steps invoke. Bottom-up — implementations declare which actions they implement.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agentproto",
|
|
7
|
+
"aip-39",
|
|
8
|
+
"action",
|
|
9
|
+
"defineAction",
|
|
10
|
+
"open-standard",
|
|
11
|
+
"agentic"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://agentproto.sh/docs/aip-39",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/agentproto/ts",
|
|
17
|
+
"directory": "packages/action"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/agentproto/ts/issues"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "dist/index.mjs",
|
|
25
|
+
"module": "dist/index.mjs",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.mjs",
|
|
31
|
+
"default": "./dist/index.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./manifest": {
|
|
34
|
+
"types": "./dist/manifest/index.d.ts",
|
|
35
|
+
"import": "./dist/manifest/index.mjs",
|
|
36
|
+
"default": "./dist/manifest/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"gray-matter": "^4.0.3",
|
|
50
|
+
"zod": "^4.4.3",
|
|
51
|
+
"@agentproto/define-doctype": "0.1.0",
|
|
52
|
+
"@agentproto/manifest": "0.1.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/node": "^25.6.2",
|
|
56
|
+
"tsup": "^8.5.1",
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"vitest": "^3.2.4",
|
|
59
|
+
"@agentproto/tooling": "0.1.0-alpha.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "tsup --watch",
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"clean": "rm -rf dist",
|
|
65
|
+
"check-types": "tsc --noEmit",
|
|
66
|
+
"test": "vitest run --passWithNoTests",
|
|
67
|
+
"test:watch": "vitest"
|
|
68
|
+
}
|
|
69
|
+
}
|