agentxchain 2.79.0 → 2.81.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/README.md +2 -0
- package/bin/agentxchain.js +19 -0
- package/builtin-plugins/plugin-github-issues/README.md +31 -0
- package/builtin-plugins/plugin-github-issues/agentxchain-plugin.json +53 -0
- package/builtin-plugins/plugin-github-issues/hooks/_shared.js +305 -0
- package/builtin-plugins/plugin-github-issues/hooks/after-acceptance.js +3 -0
- package/builtin-plugins/plugin-github-issues/hooks/on-escalation.js +3 -0
- package/builtin-plugins/plugin-github-issues/package.json +8 -0
- package/builtin-plugins/plugin-json-report/README.md +30 -0
- package/builtin-plugins/plugin-json-report/agentxchain-plugin.json +44 -0
- package/builtin-plugins/plugin-json-report/hooks/_shared.js +92 -0
- package/builtin-plugins/plugin-json-report/hooks/after-acceptance.js +4 -0
- package/builtin-plugins/plugin-json-report/hooks/before-gate.js +4 -0
- package/builtin-plugins/plugin-json-report/hooks/on-escalation.js +4 -0
- package/builtin-plugins/plugin-json-report/package.json +8 -0
- package/builtin-plugins/plugin-slack-notify/README.md +34 -0
- package/builtin-plugins/plugin-slack-notify/agentxchain-plugin.json +47 -0
- package/builtin-plugins/plugin-slack-notify/hooks/_shared.js +115 -0
- package/builtin-plugins/plugin-slack-notify/hooks/after-acceptance.js +16 -0
- package/builtin-plugins/plugin-slack-notify/hooks/before-gate.js +18 -0
- package/builtin-plugins/plugin-slack-notify/hooks/on-escalation.js +15 -0
- package/builtin-plugins/plugin-slack-notify/package.json +8 -0
- package/package.json +2 -1
- package/src/commands/doctor.js +121 -0
- package/src/commands/plugin.js +31 -1
- package/src/commands/replay.js +120 -0
- package/src/lib/accepted-turn-history.js +84 -0
- package/src/lib/plugins.js +54 -1
package/src/lib/plugins.js
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
statSync,
|
|
10
10
|
} from 'fs';
|
|
11
11
|
import { createHash } from 'crypto';
|
|
12
|
-
import { join, resolve, relative } from 'path';
|
|
12
|
+
import { dirname, join, resolve, relative } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
13
14
|
import { tmpdir } from 'os';
|
|
14
15
|
import { spawnSync } from 'child_process';
|
|
15
16
|
|
|
@@ -23,6 +24,55 @@ export const PLUGINS_DIR = '.agentxchain/plugins';
|
|
|
23
24
|
const PLUGIN_SCHEMA_VERSION = '0.1';
|
|
24
25
|
const PLUGIN_NAME_RE = /^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/;
|
|
25
26
|
|
|
27
|
+
const __filename_local = fileURLToPath(import.meta.url);
|
|
28
|
+
const __dirname_local = dirname(__filename_local);
|
|
29
|
+
const BUILTIN_PLUGINS_DIR = join(__dirname_local, '../../builtin-plugins');
|
|
30
|
+
|
|
31
|
+
const BUILTIN_PLUGIN_SHORT_NAMES = {
|
|
32
|
+
'slack-notify': 'plugin-slack-notify',
|
|
33
|
+
'json-report': 'plugin-json-report',
|
|
34
|
+
'github-issues': 'plugin-github-issues',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function resolveBuiltinPlugin(spec) {
|
|
38
|
+
const dirName = BUILTIN_PLUGIN_SHORT_NAMES[spec];
|
|
39
|
+
if (!dirName) return null;
|
|
40
|
+
const pluginDir = join(BUILTIN_PLUGINS_DIR, dirName);
|
|
41
|
+
if (!existsSync(pluginDir)) return null;
|
|
42
|
+
const root = findManifestRoot(pluginDir);
|
|
43
|
+
if (!root) return null;
|
|
44
|
+
return {
|
|
45
|
+
ok: true,
|
|
46
|
+
type: 'builtin',
|
|
47
|
+
root,
|
|
48
|
+
sourceSpec: spec,
|
|
49
|
+
cleanup: null,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function listAvailablePlugins() {
|
|
54
|
+
const available = [];
|
|
55
|
+
for (const [shortName, dirName] of Object.entries(BUILTIN_PLUGIN_SHORT_NAMES)) {
|
|
56
|
+
const pluginDir = join(BUILTIN_PLUGINS_DIR, dirName);
|
|
57
|
+
if (!existsSync(pluginDir)) continue;
|
|
58
|
+
const manifestPath = join(pluginDir, PLUGIN_MANIFEST_FILE);
|
|
59
|
+
if (!existsSync(manifestPath)) continue;
|
|
60
|
+
try {
|
|
61
|
+
const manifest = readJson(manifestPath);
|
|
62
|
+
available.push({
|
|
63
|
+
short_name: shortName,
|
|
64
|
+
name: manifest.name,
|
|
65
|
+
version: manifest.version,
|
|
66
|
+
description: manifest.description,
|
|
67
|
+
install_command: `agentxchain plugin install ${shortName}`,
|
|
68
|
+
});
|
|
69
|
+
} catch {
|
|
70
|
+
// skip broken manifests
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { ok: true, plugins: available };
|
|
74
|
+
}
|
|
75
|
+
|
|
26
76
|
function clone(value) {
|
|
27
77
|
return JSON.parse(JSON.stringify(value));
|
|
28
78
|
}
|
|
@@ -199,6 +249,9 @@ function resolvePluginSource(spec, startDir) {
|
|
|
199
249
|
}
|
|
200
250
|
}
|
|
201
251
|
|
|
252
|
+
const builtin = resolveBuiltinPlugin(spec);
|
|
253
|
+
if (builtin) return builtin;
|
|
254
|
+
|
|
202
255
|
const packed = packNpmPlugin(spec);
|
|
203
256
|
if (!packed.ok) {
|
|
204
257
|
return packed;
|