@agenticmail/enterprise 0.5.47 → 0.5.48
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/dist/chunk-2CVPFHJD.js +898 -0
- package/dist/chunk-4SAHG5E7.js +593 -0
- package/dist/chunk-MINPSFLF.js +3563 -0
- package/dist/chunk-NU56PI3D.js +2115 -0
- package/dist/chunk-QRFUGV66.js +9085 -0
- package/dist/chunk-WG3RK3S2.js +12676 -0
- package/dist/cli-validate-QVUQDNGI.js +148 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +6 -6
- package/dist/routes-RVD5BOHP.js +5783 -0
- package/dist/runtime-JH4SPNAH.js +47 -0
- package/dist/server-KJ2IHVRS.js +12 -0
- package/dist/setup-DRJP24W7.js +20 -0
- package/dist/skills-PGWWON4J.js +14 -0
- package/package.json +1 -1
- package/src/engine/skills/agenticmail.ts +115 -0
- package/src/engine/skills/index.ts +9 -0
- package/src/engine/skills.ts +4 -2
- package/src/engine/tool-catalog.ts +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALL_TOOLS,
|
|
3
|
+
init_tool_catalog
|
|
4
|
+
} from "./chunk-MINPSFLF.js";
|
|
5
|
+
import {
|
|
6
|
+
collectCommunityToolIds,
|
|
7
|
+
validateSkillManifest
|
|
8
|
+
} from "./chunk-TY7NVD4U.js";
|
|
9
|
+
import "./chunk-KFQGP6VL.js";
|
|
10
|
+
|
|
11
|
+
// src/engine/cli-validate.ts
|
|
12
|
+
init_tool_catalog();
|
|
13
|
+
async function runValidate(args) {
|
|
14
|
+
const chalk = (await import("chalk")).default;
|
|
15
|
+
const fs = await import("fs/promises");
|
|
16
|
+
const path = await import("path");
|
|
17
|
+
const jsonMode = args.includes("--json");
|
|
18
|
+
const allMode = args.includes("--all");
|
|
19
|
+
const pathArgs = args.filter((a) => !a.startsWith("--"));
|
|
20
|
+
const builtinIds = new Set(ALL_TOOLS.map((t) => t.id));
|
|
21
|
+
const communityDir = path.resolve(process.cwd(), "community-skills");
|
|
22
|
+
const reports = [];
|
|
23
|
+
if (allMode) {
|
|
24
|
+
let entries;
|
|
25
|
+
try {
|
|
26
|
+
entries = await fs.readdir(communityDir, { withFileTypes: true });
|
|
27
|
+
} catch {
|
|
28
|
+
if (jsonMode) {
|
|
29
|
+
console.log(JSON.stringify({ error: "community-skills/ directory not found" }));
|
|
30
|
+
} else {
|
|
31
|
+
console.error(chalk.red("Error: community-skills/ directory not found"));
|
|
32
|
+
}
|
|
33
|
+
process.exit(1);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (!entry.isDirectory() || entry.name.startsWith("_") || entry.name.startsWith(".")) continue;
|
|
38
|
+
const skillDir = path.join(communityDir, entry.name);
|
|
39
|
+
const report = await validatePath(skillDir, builtinIds, communityDir);
|
|
40
|
+
reports.push(report);
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
const target = pathArgs[0];
|
|
44
|
+
if (!target) {
|
|
45
|
+
if (jsonMode) {
|
|
46
|
+
console.log(JSON.stringify({ error: "No path specified. Usage: npx @agenticmail/enterprise validate <path> [--all] [--json]" }));
|
|
47
|
+
} else {
|
|
48
|
+
console.log(`${chalk.bold("Usage:")} npx @agenticmail/enterprise validate <path>`);
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log(" <path> Path to a skill directory or agenticmail-skill.json file");
|
|
51
|
+
console.log(" --all Validate all skills in community-skills/");
|
|
52
|
+
console.log(" --json Machine-readable JSON output");
|
|
53
|
+
}
|
|
54
|
+
process.exit(1);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const report = await validatePath(path.resolve(target), builtinIds, communityDir);
|
|
58
|
+
reports.push(report);
|
|
59
|
+
}
|
|
60
|
+
if (jsonMode) {
|
|
61
|
+
console.log(JSON.stringify({ results: reports, totalErrors: reports.reduce((s, r) => s + r.errors.length, 0) }, null, 2));
|
|
62
|
+
} else {
|
|
63
|
+
console.log("");
|
|
64
|
+
for (const report of reports) {
|
|
65
|
+
if (report.valid) {
|
|
66
|
+
console.log(chalk.green(" \u2714") + " " + chalk.bold(report.skillId) + chalk.dim(` (${report.path})`));
|
|
67
|
+
} else {
|
|
68
|
+
console.log(chalk.red(" \u2718") + " " + chalk.bold(report.skillId) + chalk.dim(` (${report.path})`));
|
|
69
|
+
for (const err of report.errors) {
|
|
70
|
+
console.log(chalk.red(" \u2502 ") + err);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (const warn of report.warnings) {
|
|
74
|
+
console.log(chalk.yellow(" \u26A0 ") + warn);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
console.log("");
|
|
78
|
+
const passed = reports.filter((r) => r.valid).length;
|
|
79
|
+
const failed = reports.filter((r) => !r.valid).length;
|
|
80
|
+
if (failed > 0) {
|
|
81
|
+
console.log(chalk.red(` ${failed} failed`) + chalk.dim(`, ${passed} passed, ${reports.length} total`));
|
|
82
|
+
} else {
|
|
83
|
+
console.log(chalk.green(` ${passed} passed`) + chalk.dim(`, ${reports.length} total`));
|
|
84
|
+
}
|
|
85
|
+
console.log("");
|
|
86
|
+
}
|
|
87
|
+
if (reports.some((r) => !r.valid)) {
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function validatePath(targetPath, builtinIds, communityDir) {
|
|
92
|
+
const fs = await import("fs/promises");
|
|
93
|
+
const path = await import("path");
|
|
94
|
+
let manifestPath;
|
|
95
|
+
try {
|
|
96
|
+
const stat = await fs.stat(targetPath);
|
|
97
|
+
if (stat.isDirectory()) {
|
|
98
|
+
manifestPath = path.join(targetPath, "agenticmail-skill.json");
|
|
99
|
+
} else {
|
|
100
|
+
manifestPath = targetPath;
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
return {
|
|
104
|
+
path: targetPath,
|
|
105
|
+
skillId: path.basename(targetPath),
|
|
106
|
+
valid: false,
|
|
107
|
+
errors: [`Path not found: ${targetPath}`],
|
|
108
|
+
warnings: []
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
let raw;
|
|
112
|
+
try {
|
|
113
|
+
raw = await fs.readFile(manifestPath, "utf-8");
|
|
114
|
+
} catch {
|
|
115
|
+
return {
|
|
116
|
+
path: manifestPath,
|
|
117
|
+
skillId: path.basename(path.dirname(manifestPath)),
|
|
118
|
+
valid: false,
|
|
119
|
+
errors: [`Cannot read: ${manifestPath}`],
|
|
120
|
+
warnings: []
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
let manifest;
|
|
124
|
+
try {
|
|
125
|
+
manifest = JSON.parse(raw);
|
|
126
|
+
} catch (err) {
|
|
127
|
+
return {
|
|
128
|
+
path: manifestPath,
|
|
129
|
+
skillId: path.basename(path.dirname(manifestPath)),
|
|
130
|
+
valid: false,
|
|
131
|
+
errors: [`Invalid JSON: ${err.message}`],
|
|
132
|
+
warnings: []
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const communityIds = await collectCommunityToolIds(communityDir, manifest.id);
|
|
136
|
+
const allExistingIds = /* @__PURE__ */ new Set([...builtinIds, ...communityIds]);
|
|
137
|
+
const result = validateSkillManifest(manifest, { existingToolIds: allExistingIds });
|
|
138
|
+
return {
|
|
139
|
+
path: manifestPath,
|
|
140
|
+
skillId: manifest.id || path.basename(path.dirname(manifestPath)),
|
|
141
|
+
valid: result.valid,
|
|
142
|
+
errors: result.errors,
|
|
143
|
+
warnings: result.warnings
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
runValidate
|
|
148
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ var args = process.argv.slice(2);
|
|
|
5
5
|
var command = args[0];
|
|
6
6
|
switch (command) {
|
|
7
7
|
case "validate":
|
|
8
|
-
import("./cli-validate-
|
|
8
|
+
import("./cli-validate-QVUQDNGI.js").then((m) => m.runValidate(args.slice(1))).catch(fatal);
|
|
9
9
|
break;
|
|
10
10
|
case "build-skill":
|
|
11
11
|
import("./cli-build-skill-AE7QC5C5.js").then((m) => m.runBuildSkill(args.slice(1))).catch(fatal);
|
|
@@ -48,7 +48,7 @@ Skill Development:
|
|
|
48
48
|
break;
|
|
49
49
|
case "setup":
|
|
50
50
|
default:
|
|
51
|
-
import("./setup-
|
|
51
|
+
import("./setup-DRJP24W7.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
function fatal(err) {
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
TenantManager,
|
|
21
21
|
WorkforceManager,
|
|
22
22
|
init_guardrails
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QRFUGV66.js";
|
|
24
24
|
import {
|
|
25
25
|
AgentRuntime,
|
|
26
26
|
EmailChannel,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
executeTool,
|
|
36
36
|
runAgentLoop,
|
|
37
37
|
toolsToDefinitions
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WG3RK3S2.js";
|
|
39
39
|
import "./chunk-TYW5XTOW.js";
|
|
40
40
|
import {
|
|
41
41
|
ValidationError,
|
|
@@ -50,11 +50,11 @@ import {
|
|
|
50
50
|
requireRole,
|
|
51
51
|
securityHeaders,
|
|
52
52
|
validate
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-NU56PI3D.js";
|
|
54
54
|
import {
|
|
55
55
|
provision,
|
|
56
56
|
runSetupWizard
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-2CVPFHJD.js";
|
|
58
58
|
import {
|
|
59
59
|
ENGINE_TABLES,
|
|
60
60
|
ENGINE_TABLES_POSTGRES,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
BUILTIN_SKILLS,
|
|
93
93
|
PRESET_PROFILES,
|
|
94
94
|
PermissionEngine
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-4SAHG5E7.js";
|
|
96
96
|
import {
|
|
97
97
|
DatabaseAdapter
|
|
98
98
|
} from "./chunk-FLRYMSKY.js";
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
generateToolPolicy,
|
|
109
109
|
getToolsBySkill,
|
|
110
110
|
init_tool_catalog
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-MINPSFLF.js";
|
|
112
112
|
import {
|
|
113
113
|
VALID_CATEGORIES,
|
|
114
114
|
VALID_RISK_LEVELS,
|