@agenticmail/enterprise 0.5.368 → 0.5.370

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