@agentclutch/action-card 0.7.3-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,3 @@
1
+ Apache-2.0 license placeholder.
2
+
3
+ The full Apache License 2.0 text will be added before the first release.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @agentclutch/action-card
2
+
3
+ TypeScript types, schemas, builders, and validation for AgentClutch Action Cards.
4
+
5
+ This package is part of [AgentClutch](https://github.com/MelaBuilt-AI/agentclutch): the local-first Action Card and takeover UX layer for consequential AI agent actions.
6
+
7
+ ## Status
8
+
9
+ `0.7.3-alpha.0` is prepared as the first npm alpha version. Publish with the `alpha` dist-tag only until AgentClutch is stable.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pnpm add @agentclutch/action-card@alpha
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import { buildActionCard } from "@agentclutch/action-card";
21
+ ```
22
+
23
+ ## Package role
24
+
25
+ Action Card types, schema, builders, and validation.
26
+
27
+ See the root AgentClutch README and `docs/quickstart.md` for full setup, demos, and caveats.
@@ -0,0 +1,16 @@
1
+ import type { ActionCard, AgentDescriptor, ConsequenceDescriptor, EvidenceItem, ISODateTime, JsonObject, ProposedAction, RiskDescriptor, UserOption } from "./types.js";
2
+ export interface BuildActionCardInput {
3
+ id: string;
4
+ run_id: string;
5
+ agent: AgentDescriptor;
6
+ proposed_action: ProposedAction;
7
+ consequence: ConsequenceDescriptor;
8
+ risk: RiskDescriptor;
9
+ evidence?: EvidenceItem[];
10
+ user_options?: UserOption[];
11
+ created_at?: ISODateTime;
12
+ expires_at?: ISODateTime;
13
+ metadata?: JsonObject;
14
+ }
15
+ export declare function buildActionCard(input: BuildActionCardInput): ActionCard;
16
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,eAAe,EAAE,cAAc,CAAC;IAChC,WAAW,EAAE,qBAAqB,CAAC;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,UAAU,CAoBvE"}
@@ -0,0 +1,22 @@
1
+ export function buildActionCard(input) {
2
+ return {
3
+ type: "agentclutch.action_card.v0",
4
+ id: input.id,
5
+ run_id: input.run_id,
6
+ created_at: input.created_at ?? new Date().toISOString(),
7
+ agent: input.agent,
8
+ proposed_action: input.proposed_action,
9
+ consequence: input.consequence,
10
+ risk: input.risk,
11
+ evidence: input.evidence ?? [],
12
+ user_options: input.user_options ?? [
13
+ "approve_once",
14
+ "edit_fields",
15
+ "take_wheel",
16
+ "block"
17
+ ],
18
+ ...(input.expires_at === undefined ? {} : { expires_at: input.expires_at }),
19
+ ...(input.metadata === undefined ? {} : { metadata: input.metadata })
20
+ };
21
+ }
22
+ //# sourceMappingURL=builders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.js","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACxD,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;QAC9B,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI;YAClC,cAAc;YACd,aAAa;YACb,YAAY;YACZ,OAAO;SACR;QACD,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC3E,GAAG,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;KACtE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./types.js";
2
+ export * from "./schema.js";
3
+ export * from "./builders.js";
4
+ export * from "./validators.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./types.js";
2
+ export * from "./schema.js";
3
+ export * from "./builders.js";
4
+ export * from "./validators.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}