@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 +3 -0
- package/README.md +27 -0
- package/dist/builders.d.ts +16 -0
- package/dist/builders.d.ts.map +1 -0
- package/dist/builders.js +22 -0
- package/dist/builders.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +837 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +447 -0
- package/dist/schema.js.map +1 -0
- package/dist/types.d.ts +157 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validators.d.ts +19 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +33 -0
- package/dist/validators.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ActionCardSchema } from "./schema.js";
|
|
2
|
+
export class ActionCardValidationError extends Error {
|
|
3
|
+
issues;
|
|
4
|
+
constructor(message, issues) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "ActionCardValidationError";
|
|
7
|
+
this.issues = issues;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function parseActionCard(value) {
|
|
11
|
+
const result = ActionCardSchema.safeParse(value);
|
|
12
|
+
if (!result.success) {
|
|
13
|
+
throw new ActionCardValidationError("Invalid AgentClutch Action Card", result.error.issues);
|
|
14
|
+
}
|
|
15
|
+
return result.data;
|
|
16
|
+
}
|
|
17
|
+
export function validateActionCard(value) {
|
|
18
|
+
const result = ActionCardSchema.safeParse(value);
|
|
19
|
+
if (!result.success) {
|
|
20
|
+
return {
|
|
21
|
+
success: false,
|
|
22
|
+
issues: result.error.issues
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
data: result.data
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function isActionCard(value) {
|
|
31
|
+
return ActionCardSchema.safeParse(value).success;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClC,MAAM,CAAa;IAEnC,YAAY,OAAe,EAAE,MAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAgBD,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,yBAAyB,CACjC,iCAAiC,EACjC,MAAM,CAAC,KAAK,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAkB,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,MAAM,CAAC,IAAkB;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentclutch/action-card",
|
|
3
|
+
"version": "0.7.3-alpha.0",
|
|
4
|
+
"description": "TypeScript types, schemas, builders, and validation for AgentClutch Action Cards.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"agentclutch",
|
|
9
|
+
"action-card",
|
|
10
|
+
"ai-agents",
|
|
11
|
+
"human-in-the-loop",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/MelaBuilt-AI/agentclutch.git",
|
|
17
|
+
"directory": "packages/action-card"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/MelaBuilt-AI/agentclutch#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/MelaBuilt-AI/agentclutch/issues"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=22"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"tag": "alpha"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"zod": "latest"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
|
+
}
|
|
49
|
+
}
|