@dexto/agent-management 1.5.6 → 1.5.8

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.
Files changed (140) hide show
  1. package/dist/config/config-enrichment.cjs +72 -21
  2. package/dist/config/config-enrichment.d.ts +10 -2
  3. package/dist/config/config-enrichment.d.ts.map +1 -1
  4. package/dist/config/config-enrichment.js +76 -21
  5. package/dist/config/discover-prompts.cjs +1 -1
  6. package/dist/config/discover-prompts.d.ts +11 -11
  7. package/dist/config/discover-prompts.d.ts.map +1 -1
  8. package/dist/config/discover-prompts.js +1 -1
  9. package/dist/config/loader.cjs +31 -13
  10. package/dist/config/loader.d.ts.map +1 -1
  11. package/dist/config/loader.js +31 -13
  12. package/dist/index.cjs +76 -0
  13. package/dist/index.d.ts +5 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +78 -0
  16. package/dist/models/custom-models.cjs +2 -1
  17. package/dist/models/custom-models.d.ts +7 -6
  18. package/dist/models/custom-models.d.ts.map +1 -1
  19. package/dist/models/custom-models.js +2 -1
  20. package/dist/plugins/discover-plugins.cjs +176 -0
  21. package/dist/plugins/discover-plugins.d.ts +39 -0
  22. package/dist/plugins/discover-plugins.d.ts.map +1 -0
  23. package/dist/plugins/discover-plugins.js +140 -0
  24. package/dist/plugins/discover-skills.cjs +93 -0
  25. package/dist/plugins/discover-skills.d.ts +49 -0
  26. package/dist/plugins/discover-skills.d.ts.map +1 -0
  27. package/dist/plugins/discover-skills.js +58 -0
  28. package/dist/plugins/error-codes.cjs +47 -0
  29. package/dist/plugins/error-codes.d.ts +24 -0
  30. package/dist/plugins/error-codes.d.ts.map +1 -0
  31. package/dist/plugins/error-codes.js +23 -0
  32. package/dist/plugins/errors.cjs +197 -0
  33. package/dist/plugins/errors.d.ts +68 -0
  34. package/dist/plugins/errors.d.ts.map +1 -0
  35. package/dist/plugins/errors.js +173 -0
  36. package/dist/plugins/index.cjs +144 -0
  37. package/dist/plugins/index.d.ts +23 -0
  38. package/dist/plugins/index.d.ts.map +1 -0
  39. package/dist/plugins/index.js +115 -0
  40. package/dist/plugins/install-plugin.cjs +211 -0
  41. package/dist/plugins/install-plugin.d.ts +47 -0
  42. package/dist/plugins/install-plugin.d.ts.map +1 -0
  43. package/dist/plugins/install-plugin.js +173 -0
  44. package/dist/plugins/list-plugins.cjs +134 -0
  45. package/dist/plugins/list-plugins.d.ts +26 -0
  46. package/dist/plugins/list-plugins.d.ts.map +1 -0
  47. package/dist/plugins/list-plugins.js +99 -0
  48. package/dist/plugins/load-plugin.cjs +197 -0
  49. package/dist/plugins/load-plugin.d.ts +20 -0
  50. package/dist/plugins/load-plugin.d.ts.map +1 -0
  51. package/dist/plugins/load-plugin.js +163 -0
  52. package/dist/plugins/marketplace/error-codes.cjs +45 -0
  53. package/dist/plugins/marketplace/error-codes.d.ts +21 -0
  54. package/dist/plugins/marketplace/error-codes.d.ts.map +1 -0
  55. package/dist/plugins/marketplace/error-codes.js +21 -0
  56. package/dist/plugins/marketplace/errors.cjs +188 -0
  57. package/dist/plugins/marketplace/errors.d.ts +64 -0
  58. package/dist/plugins/marketplace/errors.d.ts.map +1 -0
  59. package/dist/plugins/marketplace/errors.js +164 -0
  60. package/dist/plugins/marketplace/index.cjs +95 -0
  61. package/dist/plugins/marketplace/index.d.ts +14 -0
  62. package/dist/plugins/marketplace/index.d.ts.map +1 -0
  63. package/dist/plugins/marketplace/index.js +74 -0
  64. package/dist/plugins/marketplace/install-from-marketplace.cjs +152 -0
  65. package/dist/plugins/marketplace/install-from-marketplace.d.ts +25 -0
  66. package/dist/plugins/marketplace/install-from-marketplace.d.ts.map +1 -0
  67. package/dist/plugins/marketplace/install-from-marketplace.js +120 -0
  68. package/dist/plugins/marketplace/operations.cjs +374 -0
  69. package/dist/plugins/marketplace/operations.d.ts +43 -0
  70. package/dist/plugins/marketplace/operations.d.ts.map +1 -0
  71. package/dist/plugins/marketplace/operations.js +339 -0
  72. package/dist/plugins/marketplace/registry.cjs +166 -0
  73. package/dist/plugins/marketplace/registry.d.ts +72 -0
  74. package/dist/plugins/marketplace/registry.d.ts.map +1 -0
  75. package/dist/plugins/marketplace/registry.js +119 -0
  76. package/dist/plugins/marketplace/schemas.cjs +79 -0
  77. package/dist/plugins/marketplace/schemas.d.ts +260 -0
  78. package/dist/plugins/marketplace/schemas.d.ts.map +1 -0
  79. package/dist/plugins/marketplace/schemas.js +49 -0
  80. package/dist/plugins/marketplace/types.cjs +16 -0
  81. package/dist/plugins/marketplace/types.d.ts +156 -0
  82. package/dist/plugins/marketplace/types.d.ts.map +1 -0
  83. package/dist/plugins/marketplace/types.js +0 -0
  84. package/dist/plugins/schemas.cjs +74 -0
  85. package/dist/plugins/schemas.d.ts +262 -0
  86. package/dist/plugins/schemas.d.ts.map +1 -0
  87. package/dist/plugins/schemas.js +46 -0
  88. package/dist/plugins/types.cjs +16 -0
  89. package/dist/plugins/types.d.ts +186 -0
  90. package/dist/plugins/types.d.ts.map +1 -0
  91. package/dist/plugins/types.js +0 -0
  92. package/dist/plugins/uninstall-plugin.cjs +133 -0
  93. package/dist/plugins/uninstall-plugin.d.ts +24 -0
  94. package/dist/plugins/uninstall-plugin.d.ts.map +1 -0
  95. package/dist/plugins/uninstall-plugin.js +99 -0
  96. package/dist/plugins/validate-plugin.cjs +180 -0
  97. package/dist/plugins/validate-plugin.d.ts +53 -0
  98. package/dist/plugins/validate-plugin.d.ts.map +1 -0
  99. package/dist/plugins/validate-plugin.js +145 -0
  100. package/dist/preferences/errors.cjs +11 -0
  101. package/dist/preferences/errors.d.ts +1 -0
  102. package/dist/preferences/errors.d.ts.map +1 -1
  103. package/dist/preferences/errors.js +11 -0
  104. package/dist/preferences/loader.cjs +119 -6
  105. package/dist/preferences/loader.d.ts +21 -1
  106. package/dist/preferences/loader.d.ts.map +1 -1
  107. package/dist/preferences/loader.js +102 -1
  108. package/dist/preferences/schemas.cjs +12 -0
  109. package/dist/preferences/schemas.d.ts +38 -12
  110. package/dist/preferences/schemas.d.ts.map +1 -1
  111. package/dist/preferences/schemas.js +10 -0
  112. package/dist/runtime/AgentRuntime.cjs +1 -2
  113. package/dist/runtime/AgentRuntime.d.ts.map +1 -1
  114. package/dist/runtime/AgentRuntime.js +1 -2
  115. package/dist/tool-provider/llm-resolution.cjs +74 -0
  116. package/dist/tool-provider/llm-resolution.d.ts +51 -0
  117. package/dist/tool-provider/llm-resolution.d.ts.map +1 -0
  118. package/dist/tool-provider/llm-resolution.js +50 -0
  119. package/dist/tool-provider/runtime-service.cjs +246 -34
  120. package/dist/tool-provider/runtime-service.d.ts +34 -2
  121. package/dist/tool-provider/runtime-service.d.ts.map +1 -1
  122. package/dist/tool-provider/runtime-service.js +236 -34
  123. package/dist/tool-provider/tool-provider.cjs +154 -1
  124. package/dist/tool-provider/tool-provider.d.ts +7 -1
  125. package/dist/tool-provider/tool-provider.d.ts.map +1 -1
  126. package/dist/tool-provider/tool-provider.js +161 -1
  127. package/dist/tool-provider/types.d.ts +2 -0
  128. package/dist/tool-provider/types.d.ts.map +1 -1
  129. package/dist/utils/api-key-resolver.cjs +5 -2
  130. package/dist/utils/api-key-resolver.d.ts.map +1 -1
  131. package/dist/utils/api-key-resolver.js +5 -2
  132. package/dist/utils/dexto-auth.cjs +83 -0
  133. package/dist/utils/dexto-auth.d.ts +23 -0
  134. package/dist/utils/dexto-auth.d.ts.map +1 -0
  135. package/dist/utils/dexto-auth.js +57 -0
  136. package/dist/utils/feature-flags.cjs +32 -0
  137. package/dist/utils/feature-flags.d.ts +21 -0
  138. package/dist/utils/feature-flags.d.ts.map +1 -0
  139. package/dist/utils/feature-flags.js +8 -0
  140. package/package.json +3 -2
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var discover_plugins_exports = {};
30
+ __export(discover_plugins_exports, {
31
+ discoverClaudeCodePlugins: () => discoverClaudeCodePlugins,
32
+ getInstalledPluginsPath: () => getInstalledPluginsPath,
33
+ getPluginSearchPaths: () => getPluginSearchPaths
34
+ });
35
+ module.exports = __toCommonJS(discover_plugins_exports);
36
+ var path = __toESM(require("path"), 1);
37
+ var import_fs = require("fs");
38
+ var import_path = require("../utils/path.js");
39
+ var import_schemas = require("./schemas.js");
40
+ var import_validate_plugin = require("./validate-plugin.js");
41
+ function discoverClaudeCodePlugins(projectPath, bundledPluginPaths) {
42
+ const plugins = [];
43
+ const seenNames = /* @__PURE__ */ new Set();
44
+ const cwd = projectPath || process.cwd();
45
+ const addPlugin = (plugin) => {
46
+ const normalizedName = plugin.manifest.name.toLowerCase();
47
+ if (seenNames.has(normalizedName)) {
48
+ return false;
49
+ }
50
+ seenNames.add(normalizedName);
51
+ plugins.push(plugin);
52
+ return true;
53
+ };
54
+ const dextoInstalledPluginsPath = (0, import_path.getDextoGlobalPath)("plugins", "installed_plugins.json");
55
+ const dextoInstalledPlugins = readInstalledPluginsFile(dextoInstalledPluginsPath, cwd);
56
+ for (const plugin of dextoInstalledPlugins) {
57
+ addPlugin(plugin);
58
+ }
59
+ const scanPluginsDir = (dir, source) => {
60
+ if (!(0, import_fs.existsSync)(dir)) return;
61
+ try {
62
+ const entries = (0, import_fs.readdirSync)(dir, { withFileTypes: true });
63
+ for (const entry of entries) {
64
+ if (!entry.isDirectory()) continue;
65
+ if (entry.name === "cache" || entry.name === "marketplaces") continue;
66
+ const pluginPath = path.join(dir, entry.name);
67
+ let loadResult;
68
+ try {
69
+ loadResult = (0, import_validate_plugin.tryLoadManifest)(pluginPath, true);
70
+ } catch {
71
+ continue;
72
+ }
73
+ if (loadResult) {
74
+ addPlugin({
75
+ path: pluginPath,
76
+ manifest: loadResult.manifest,
77
+ source,
78
+ format: loadResult.format
79
+ });
80
+ }
81
+ }
82
+ } catch {
83
+ }
84
+ };
85
+ scanPluginsDir(path.join(cwd, ".dexto", "plugins"), "project");
86
+ scanPluginsDir((0, import_path.getDextoGlobalPath)("plugins"), "user");
87
+ if (bundledPluginPaths && bundledPluginPaths.length > 0) {
88
+ for (const pluginPath of bundledPluginPaths) {
89
+ if (!(0, import_fs.existsSync)(pluginPath)) {
90
+ continue;
91
+ }
92
+ let loadResult;
93
+ try {
94
+ loadResult = (0, import_validate_plugin.tryLoadManifest)(pluginPath, true);
95
+ } catch {
96
+ continue;
97
+ }
98
+ if (loadResult) {
99
+ addPlugin({
100
+ path: pluginPath,
101
+ manifest: loadResult.manifest,
102
+ source: "user",
103
+ // Treat as user-level since they come from image
104
+ format: loadResult.format
105
+ });
106
+ }
107
+ }
108
+ }
109
+ return plugins;
110
+ }
111
+ function readInstalledPluginsFile(filePath, currentProjectPath) {
112
+ const plugins = [];
113
+ if (!(0, import_fs.existsSync)(filePath)) {
114
+ return plugins;
115
+ }
116
+ try {
117
+ const content = (0, import_fs.readFileSync)(filePath, "utf-8");
118
+ const parsed = JSON.parse(content);
119
+ const result = import_schemas.InstalledPluginsFileSchema.safeParse(parsed);
120
+ if (!result.success) {
121
+ return plugins;
122
+ }
123
+ const installedPlugins = result.data;
124
+ for (const installations of Object.values(installedPlugins.plugins)) {
125
+ for (const installation of installations) {
126
+ const { scope, installPath, projectPath } = installation;
127
+ if (!(0, import_fs.existsSync)(installPath)) {
128
+ continue;
129
+ }
130
+ if ((scope === "project" || scope === "local") && projectPath) {
131
+ const normalizedProjectPath = path.resolve(projectPath).toLowerCase();
132
+ const normalizedCurrentPath = path.resolve(currentProjectPath).toLowerCase();
133
+ if (normalizedProjectPath !== normalizedCurrentPath) {
134
+ continue;
135
+ }
136
+ }
137
+ let loadResult;
138
+ try {
139
+ loadResult = (0, import_validate_plugin.tryLoadManifest)(installPath, true);
140
+ } catch {
141
+ continue;
142
+ }
143
+ if (loadResult) {
144
+ const source = scope === "project" || scope === "local" ? "project" : "user";
145
+ plugins.push({
146
+ path: installPath,
147
+ manifest: loadResult.manifest,
148
+ source,
149
+ format: loadResult.format
150
+ });
151
+ }
152
+ }
153
+ }
154
+ } catch {
155
+ }
156
+ return plugins;
157
+ }
158
+ function getPluginSearchPaths() {
159
+ const cwd = process.cwd();
160
+ return [
161
+ // Dexto's installed_plugins.json (highest priority)
162
+ (0, import_path.getDextoGlobalPath)("plugins", "installed_plugins.json"),
163
+ // Directory scan locations
164
+ path.join(cwd, ".dexto", "plugins"),
165
+ (0, import_path.getDextoGlobalPath)("plugins")
166
+ ];
167
+ }
168
+ function getInstalledPluginsPath() {
169
+ return (0, import_path.getDextoGlobalPath)("plugins", "installed_plugins.json");
170
+ }
171
+ // Annotate the CommonJS export names for ESM import in node:
172
+ 0 && (module.exports = {
173
+ discoverClaudeCodePlugins,
174
+ getInstalledPluginsPath,
175
+ getPluginSearchPaths
176
+ });
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Plugin Discovery
3
+ *
4
+ * Discovers plugins from Dexto locations following the plugin format.
5
+ * Plugins must have a .claude-plugin/plugin.json manifest file.
6
+ *
7
+ * Discovery Methods (Priority Order):
8
+ * 1. Read ~/.dexto/plugins/installed_plugins.json for Dexto installed plugins
9
+ * 2. Scan directories for plugins with .claude-plugin/plugin.json manifests
10
+ *
11
+ * Search Locations for Directory Scanning:
12
+ * 1. <cwd>/.dexto/plugins/* (project)
13
+ * 2. ~/.dexto/plugins/* (user)
14
+ *
15
+ * First found wins on name collision (by plugin name).
16
+ */
17
+ import type { DiscoveredPlugin } from './types.js';
18
+ /**
19
+ * Discovers plugins from Dexto locations.
20
+ *
21
+ * @param projectPath Optional project path for filtering project-scoped plugins
22
+ * @param bundledPluginPaths Optional array of absolute paths to bundled plugins from image definition
23
+ * @returns Array of discovered plugins, deduplicated by name (first found wins)
24
+ */
25
+ export declare function discoverClaudeCodePlugins(projectPath?: string, bundledPluginPaths?: string[]): DiscoveredPlugin[];
26
+ /**
27
+ * Gets the search locations for plugins in priority order.
28
+ * Useful for debugging and testing.
29
+ *
30
+ * @returns Array of plugin search paths
31
+ */
32
+ export declare function getPluginSearchPaths(): string[];
33
+ /**
34
+ * Gets the path to Dexto's installed_plugins.json file.
35
+ *
36
+ * @returns Absolute path to installed_plugins.json
37
+ */
38
+ export declare function getInstalledPluginsPath(): string;
39
+ //# sourceMappingURL=discover-plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-plugins.d.ts","sourceRoot":"","sources":["../../src/plugins/discover-plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EACR,gBAAgB,EAInB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACrC,WAAW,CAAC,EAAE,MAAM,EACpB,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAC9B,gBAAgB,EAAE,CAyGpB;AA0FD;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAU/C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
@@ -0,0 +1,140 @@
1
+ import * as path from "path";
2
+ import { existsSync, readdirSync, readFileSync } from "fs";
3
+ import { getDextoGlobalPath } from "../utils/path.js";
4
+ import { InstalledPluginsFileSchema } from "./schemas.js";
5
+ import { tryLoadManifest } from "./validate-plugin.js";
6
+ function discoverClaudeCodePlugins(projectPath, bundledPluginPaths) {
7
+ const plugins = [];
8
+ const seenNames = /* @__PURE__ */ new Set();
9
+ const cwd = projectPath || process.cwd();
10
+ const addPlugin = (plugin) => {
11
+ const normalizedName = plugin.manifest.name.toLowerCase();
12
+ if (seenNames.has(normalizedName)) {
13
+ return false;
14
+ }
15
+ seenNames.add(normalizedName);
16
+ plugins.push(plugin);
17
+ return true;
18
+ };
19
+ const dextoInstalledPluginsPath = getDextoGlobalPath("plugins", "installed_plugins.json");
20
+ const dextoInstalledPlugins = readInstalledPluginsFile(dextoInstalledPluginsPath, cwd);
21
+ for (const plugin of dextoInstalledPlugins) {
22
+ addPlugin(plugin);
23
+ }
24
+ const scanPluginsDir = (dir, source) => {
25
+ if (!existsSync(dir)) return;
26
+ try {
27
+ const entries = readdirSync(dir, { withFileTypes: true });
28
+ for (const entry of entries) {
29
+ if (!entry.isDirectory()) continue;
30
+ if (entry.name === "cache" || entry.name === "marketplaces") continue;
31
+ const pluginPath = path.join(dir, entry.name);
32
+ let loadResult;
33
+ try {
34
+ loadResult = tryLoadManifest(pluginPath, true);
35
+ } catch {
36
+ continue;
37
+ }
38
+ if (loadResult) {
39
+ addPlugin({
40
+ path: pluginPath,
41
+ manifest: loadResult.manifest,
42
+ source,
43
+ format: loadResult.format
44
+ });
45
+ }
46
+ }
47
+ } catch {
48
+ }
49
+ };
50
+ scanPluginsDir(path.join(cwd, ".dexto", "plugins"), "project");
51
+ scanPluginsDir(getDextoGlobalPath("plugins"), "user");
52
+ if (bundledPluginPaths && bundledPluginPaths.length > 0) {
53
+ for (const pluginPath of bundledPluginPaths) {
54
+ if (!existsSync(pluginPath)) {
55
+ continue;
56
+ }
57
+ let loadResult;
58
+ try {
59
+ loadResult = tryLoadManifest(pluginPath, true);
60
+ } catch {
61
+ continue;
62
+ }
63
+ if (loadResult) {
64
+ addPlugin({
65
+ path: pluginPath,
66
+ manifest: loadResult.manifest,
67
+ source: "user",
68
+ // Treat as user-level since they come from image
69
+ format: loadResult.format
70
+ });
71
+ }
72
+ }
73
+ }
74
+ return plugins;
75
+ }
76
+ function readInstalledPluginsFile(filePath, currentProjectPath) {
77
+ const plugins = [];
78
+ if (!existsSync(filePath)) {
79
+ return plugins;
80
+ }
81
+ try {
82
+ const content = readFileSync(filePath, "utf-8");
83
+ const parsed = JSON.parse(content);
84
+ const result = InstalledPluginsFileSchema.safeParse(parsed);
85
+ if (!result.success) {
86
+ return plugins;
87
+ }
88
+ const installedPlugins = result.data;
89
+ for (const installations of Object.values(installedPlugins.plugins)) {
90
+ for (const installation of installations) {
91
+ const { scope, installPath, projectPath } = installation;
92
+ if (!existsSync(installPath)) {
93
+ continue;
94
+ }
95
+ if ((scope === "project" || scope === "local") && projectPath) {
96
+ const normalizedProjectPath = path.resolve(projectPath).toLowerCase();
97
+ const normalizedCurrentPath = path.resolve(currentProjectPath).toLowerCase();
98
+ if (normalizedProjectPath !== normalizedCurrentPath) {
99
+ continue;
100
+ }
101
+ }
102
+ let loadResult;
103
+ try {
104
+ loadResult = tryLoadManifest(installPath, true);
105
+ } catch {
106
+ continue;
107
+ }
108
+ if (loadResult) {
109
+ const source = scope === "project" || scope === "local" ? "project" : "user";
110
+ plugins.push({
111
+ path: installPath,
112
+ manifest: loadResult.manifest,
113
+ source,
114
+ format: loadResult.format
115
+ });
116
+ }
117
+ }
118
+ }
119
+ } catch {
120
+ }
121
+ return plugins;
122
+ }
123
+ function getPluginSearchPaths() {
124
+ const cwd = process.cwd();
125
+ return [
126
+ // Dexto's installed_plugins.json (highest priority)
127
+ getDextoGlobalPath("plugins", "installed_plugins.json"),
128
+ // Directory scan locations
129
+ path.join(cwd, ".dexto", "plugins"),
130
+ getDextoGlobalPath("plugins")
131
+ ];
132
+ }
133
+ function getInstalledPluginsPath() {
134
+ return getDextoGlobalPath("plugins", "installed_plugins.json");
135
+ }
136
+ export {
137
+ discoverClaudeCodePlugins,
138
+ getInstalledPluginsPath,
139
+ getPluginSearchPaths
140
+ };
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var discover_skills_exports = {};
30
+ __export(discover_skills_exports, {
31
+ discoverStandaloneSkills: () => discoverStandaloneSkills,
32
+ getSkillSearchPaths: () => getSkillSearchPaths
33
+ });
34
+ module.exports = __toCommonJS(discover_skills_exports);
35
+ var path = __toESM(require("path"), 1);
36
+ var import_fs = require("fs");
37
+ function discoverStandaloneSkills(projectPath) {
38
+ const skills = [];
39
+ const seenNames = /* @__PURE__ */ new Set();
40
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
41
+ const cwd = projectPath || process.cwd();
42
+ const addSkill = (skill) => {
43
+ const normalizedName = skill.name.toLowerCase();
44
+ if (seenNames.has(normalizedName)) {
45
+ return false;
46
+ }
47
+ seenNames.add(normalizedName);
48
+ skills.push(skill);
49
+ return true;
50
+ };
51
+ const scanSkillsDir = (dir, source) => {
52
+ if (!(0, import_fs.existsSync)(dir)) return;
53
+ try {
54
+ const entries = (0, import_fs.readdirSync)(dir, { withFileTypes: true });
55
+ for (const entry of entries) {
56
+ if (!entry.isDirectory()) continue;
57
+ const skillPath = path.join(dir, entry.name);
58
+ const skillFile = path.join(skillPath, "SKILL.md");
59
+ if ((0, import_fs.existsSync)(skillFile)) {
60
+ addSkill({
61
+ name: entry.name,
62
+ path: skillPath,
63
+ skillFile,
64
+ source
65
+ });
66
+ }
67
+ }
68
+ } catch {
69
+ }
70
+ };
71
+ scanSkillsDir(path.join(cwd, ".agents", "skills"), "project");
72
+ scanSkillsDir(path.join(cwd, ".dexto", "skills"), "project");
73
+ if (homeDir) {
74
+ scanSkillsDir(path.join(homeDir, ".agents", "skills"), "user");
75
+ scanSkillsDir(path.join(homeDir, ".dexto", "skills"), "user");
76
+ }
77
+ return skills;
78
+ }
79
+ function getSkillSearchPaths() {
80
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
81
+ const cwd = process.cwd();
82
+ return [
83
+ path.join(cwd, ".agents", "skills"),
84
+ path.join(cwd, ".dexto", "skills"),
85
+ homeDir ? path.join(homeDir, ".agents", "skills") : "",
86
+ homeDir ? path.join(homeDir, ".dexto", "skills") : ""
87
+ ].filter(Boolean);
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ discoverStandaloneSkills,
92
+ getSkillSearchPaths
93
+ });
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Standalone Skill Discovery
3
+ *
4
+ * Discovers standalone skills from ~/.agents/skills/ and ~/.dexto/skills/ directories.
5
+ * These are different from plugin skills - they're just directories containing a SKILL.md file.
6
+ *
7
+ * Structure:
8
+ * ~/.agents/skills/
9
+ * ~/.dexto/skills/
10
+ * └── skill-name/
11
+ * ├── SKILL.md (required - the skill prompt)
12
+ * └── references/ (optional - reference files)
13
+ *
14
+ * These skills are loaded as prompts directly, not as part of a plugin package.
15
+ */
16
+ /**
17
+ * Represents a discovered standalone skill
18
+ */
19
+ export interface DiscoveredSkill {
20
+ /** Unique skill name (directory name) */
21
+ name: string;
22
+ /** Absolute path to the skill directory */
23
+ path: string;
24
+ /** Absolute path to the SKILL.md file */
25
+ skillFile: string;
26
+ /** Source location */
27
+ source: 'user' | 'project';
28
+ }
29
+ /**
30
+ * Discovers standalone skills from standard locations.
31
+ *
32
+ * Search Locations:
33
+ * 1. <cwd>/.agents/skills/* (project)
34
+ * 2. <cwd>/.dexto/skills/* (project)
35
+ * 3. ~/.agents/skills/* (user)
36
+ * 4. ~/.dexto/skills/* (user)
37
+ *
38
+ * @param projectPath Optional project path (defaults to cwd)
39
+ * @returns Array of discovered skills
40
+ */
41
+ export declare function discoverStandaloneSkills(projectPath?: string): DiscoveredSkill[];
42
+ /**
43
+ * Gets the search locations for standalone skills.
44
+ * Useful for debugging and testing.
45
+ *
46
+ * @returns Array of skill search paths
47
+ */
48
+ export declare function getSkillSearchPaths(): string[];
49
+ //# sourceMappingURL=discover-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-skills.d.ts","sourceRoot":"","sources":["../../src/plugins/discover-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAgEhF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAU9C"}
@@ -0,0 +1,58 @@
1
+ import * as path from "path";
2
+ import { existsSync, readdirSync } from "fs";
3
+ function discoverStandaloneSkills(projectPath) {
4
+ const skills = [];
5
+ const seenNames = /* @__PURE__ */ new Set();
6
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
7
+ const cwd = projectPath || process.cwd();
8
+ const addSkill = (skill) => {
9
+ const normalizedName = skill.name.toLowerCase();
10
+ if (seenNames.has(normalizedName)) {
11
+ return false;
12
+ }
13
+ seenNames.add(normalizedName);
14
+ skills.push(skill);
15
+ return true;
16
+ };
17
+ const scanSkillsDir = (dir, source) => {
18
+ if (!existsSync(dir)) return;
19
+ try {
20
+ const entries = readdirSync(dir, { withFileTypes: true });
21
+ for (const entry of entries) {
22
+ if (!entry.isDirectory()) continue;
23
+ const skillPath = path.join(dir, entry.name);
24
+ const skillFile = path.join(skillPath, "SKILL.md");
25
+ if (existsSync(skillFile)) {
26
+ addSkill({
27
+ name: entry.name,
28
+ path: skillPath,
29
+ skillFile,
30
+ source
31
+ });
32
+ }
33
+ }
34
+ } catch {
35
+ }
36
+ };
37
+ scanSkillsDir(path.join(cwd, ".agents", "skills"), "project");
38
+ scanSkillsDir(path.join(cwd, ".dexto", "skills"), "project");
39
+ if (homeDir) {
40
+ scanSkillsDir(path.join(homeDir, ".agents", "skills"), "user");
41
+ scanSkillsDir(path.join(homeDir, ".dexto", "skills"), "user");
42
+ }
43
+ return skills;
44
+ }
45
+ function getSkillSearchPaths() {
46
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
47
+ const cwd = process.cwd();
48
+ return [
49
+ path.join(cwd, ".agents", "skills"),
50
+ path.join(cwd, ".dexto", "skills"),
51
+ homeDir ? path.join(homeDir, ".agents", "skills") : "",
52
+ homeDir ? path.join(homeDir, ".dexto", "skills") : ""
53
+ ].filter(Boolean);
54
+ }
55
+ export {
56
+ discoverStandaloneSkills,
57
+ getSkillSearchPaths
58
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var error_codes_exports = {};
20
+ __export(error_codes_exports, {
21
+ PluginErrorCode: () => PluginErrorCode
22
+ });
23
+ module.exports = __toCommonJS(error_codes_exports);
24
+ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
25
+ PluginErrorCode2["MANIFEST_NOT_FOUND"] = "plugin_manifest_not_found";
26
+ PluginErrorCode2["MANIFEST_INVALID"] = "plugin_manifest_invalid";
27
+ PluginErrorCode2["MANIFEST_PARSE_ERROR"] = "plugin_manifest_parse_error";
28
+ PluginErrorCode2["DIRECTORY_READ_ERROR"] = "plugin_directory_read_error";
29
+ PluginErrorCode2["MCP_CONFIG_INVALID"] = "plugin_mcp_config_invalid";
30
+ PluginErrorCode2["DUPLICATE_PLUGIN"] = "plugin_duplicate";
31
+ PluginErrorCode2["INSTALL_SOURCE_NOT_FOUND"] = "plugin_install_source_not_found";
32
+ PluginErrorCode2["INSTALL_ALREADY_EXISTS"] = "plugin_install_already_exists";
33
+ PluginErrorCode2["INSTALL_COPY_FAILED"] = "plugin_install_copy_failed";
34
+ PluginErrorCode2["INSTALL_MANIFEST_WRITE_FAILED"] = "plugin_install_manifest_write_failed";
35
+ PluginErrorCode2["INSTALL_INVALID_SCOPE"] = "plugin_install_invalid_scope";
36
+ PluginErrorCode2["IMPORT_NOT_FOUND"] = "plugin_import_not_found";
37
+ PluginErrorCode2["UNINSTALL_NOT_FOUND"] = "plugin_uninstall_not_found";
38
+ PluginErrorCode2["UNINSTALL_DELETE_FAILED"] = "plugin_uninstall_delete_failed";
39
+ PluginErrorCode2["UNINSTALL_MANIFEST_UPDATE_FAILED"] = "plugin_uninstall_manifest_update_failed";
40
+ PluginErrorCode2["VALIDATION_INVALID_STRUCTURE"] = "plugin_validation_invalid_structure";
41
+ PluginErrorCode2["VALIDATION_MISSING_REQUIRED"] = "plugin_validation_missing_required";
42
+ return PluginErrorCode2;
43
+ })(PluginErrorCode || {});
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ PluginErrorCode
47
+ });
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Plugin-specific error codes
3
+ * Includes discovery, validation, installation, and loading errors
4
+ */
5
+ export declare enum PluginErrorCode {
6
+ MANIFEST_NOT_FOUND = "plugin_manifest_not_found",
7
+ MANIFEST_INVALID = "plugin_manifest_invalid",
8
+ MANIFEST_PARSE_ERROR = "plugin_manifest_parse_error",
9
+ DIRECTORY_READ_ERROR = "plugin_directory_read_error",
10
+ MCP_CONFIG_INVALID = "plugin_mcp_config_invalid",
11
+ DUPLICATE_PLUGIN = "plugin_duplicate",
12
+ INSTALL_SOURCE_NOT_FOUND = "plugin_install_source_not_found",
13
+ INSTALL_ALREADY_EXISTS = "plugin_install_already_exists",
14
+ INSTALL_COPY_FAILED = "plugin_install_copy_failed",
15
+ INSTALL_MANIFEST_WRITE_FAILED = "plugin_install_manifest_write_failed",
16
+ INSTALL_INVALID_SCOPE = "plugin_install_invalid_scope",
17
+ IMPORT_NOT_FOUND = "plugin_import_not_found",
18
+ UNINSTALL_NOT_FOUND = "plugin_uninstall_not_found",
19
+ UNINSTALL_DELETE_FAILED = "plugin_uninstall_delete_failed",
20
+ UNINSTALL_MANIFEST_UPDATE_FAILED = "plugin_uninstall_manifest_update_failed",
21
+ VALIDATION_INVALID_STRUCTURE = "plugin_validation_invalid_structure",
22
+ VALIDATION_MISSING_REQUIRED = "plugin_validation_missing_required"
23
+ }
24
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/plugins/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IAEvB,kBAAkB,8BAA8B;IAChD,gBAAgB,4BAA4B;IAC5C,oBAAoB,gCAAgC;IAGpD,oBAAoB,gCAAgC;IACpD,kBAAkB,8BAA8B;IAGhD,gBAAgB,qBAAqB;IAGrC,wBAAwB,oCAAoC;IAC5D,sBAAsB,kCAAkC;IACxD,mBAAmB,+BAA+B;IAClD,6BAA6B,yCAAyC;IACtE,qBAAqB,iCAAiC;IAGtD,gBAAgB,4BAA4B;IAG5C,mBAAmB,+BAA+B;IAClD,uBAAuB,mCAAmC;IAC1D,gCAAgC,4CAA4C;IAG5E,4BAA4B,wCAAwC;IACpE,2BAA2B,uCAAuC;CACrE"}
@@ -0,0 +1,23 @@
1
+ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
2
+ PluginErrorCode2["MANIFEST_NOT_FOUND"] = "plugin_manifest_not_found";
3
+ PluginErrorCode2["MANIFEST_INVALID"] = "plugin_manifest_invalid";
4
+ PluginErrorCode2["MANIFEST_PARSE_ERROR"] = "plugin_manifest_parse_error";
5
+ PluginErrorCode2["DIRECTORY_READ_ERROR"] = "plugin_directory_read_error";
6
+ PluginErrorCode2["MCP_CONFIG_INVALID"] = "plugin_mcp_config_invalid";
7
+ PluginErrorCode2["DUPLICATE_PLUGIN"] = "plugin_duplicate";
8
+ PluginErrorCode2["INSTALL_SOURCE_NOT_FOUND"] = "plugin_install_source_not_found";
9
+ PluginErrorCode2["INSTALL_ALREADY_EXISTS"] = "plugin_install_already_exists";
10
+ PluginErrorCode2["INSTALL_COPY_FAILED"] = "plugin_install_copy_failed";
11
+ PluginErrorCode2["INSTALL_MANIFEST_WRITE_FAILED"] = "plugin_install_manifest_write_failed";
12
+ PluginErrorCode2["INSTALL_INVALID_SCOPE"] = "plugin_install_invalid_scope";
13
+ PluginErrorCode2["IMPORT_NOT_FOUND"] = "plugin_import_not_found";
14
+ PluginErrorCode2["UNINSTALL_NOT_FOUND"] = "plugin_uninstall_not_found";
15
+ PluginErrorCode2["UNINSTALL_DELETE_FAILED"] = "plugin_uninstall_delete_failed";
16
+ PluginErrorCode2["UNINSTALL_MANIFEST_UPDATE_FAILED"] = "plugin_uninstall_manifest_update_failed";
17
+ PluginErrorCode2["VALIDATION_INVALID_STRUCTURE"] = "plugin_validation_invalid_structure";
18
+ PluginErrorCode2["VALIDATION_MISSING_REQUIRED"] = "plugin_validation_missing_required";
19
+ return PluginErrorCode2;
20
+ })(PluginErrorCode || {});
21
+ export {
22
+ PluginErrorCode
23
+ };