@agentplugins/adapter-claude 0.1.0 → 0.2.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/dist/index.cjs +4 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
var import_core = require("@agentplugins/core");
|
|
29
|
+
var import_adapter = require("@agentplugins/core/adapter");
|
|
29
30
|
var CLAUDE_SUPPORTED_HOOKS = [
|
|
30
31
|
"sessionStart",
|
|
31
32
|
"sessionEnd",
|
|
@@ -91,7 +92,7 @@ var ClaudePlatformAdapter = class {
|
|
|
91
92
|
inlineWrappers = /* @__PURE__ */ new Map();
|
|
92
93
|
// ─── Validation ────────────────────────────────────────────────────────────
|
|
93
94
|
validate(plugin) {
|
|
94
|
-
const issues = [...(0,
|
|
95
|
+
const issues = [...(0, import_adapter.validateForPlatform)(plugin, "claude")];
|
|
95
96
|
if (plugin.hooks) {
|
|
96
97
|
for (const [name, def] of Object.entries(plugin.hooks)) {
|
|
97
98
|
const hookName = name;
|
|
@@ -187,13 +188,13 @@ var ClaudePlatformAdapter = class {
|
|
|
187
188
|
}
|
|
188
189
|
const inlineHandlers = this.extractInlineHandlers(plugin);
|
|
189
190
|
if (inlineHandlers.size > 0) {
|
|
190
|
-
const handlersModule = (0,
|
|
191
|
+
const handlersModule = (0, import_adapter.generateHandlersModule)(inlineHandlers);
|
|
191
192
|
files.push({
|
|
192
193
|
path: "hooks/__agentplugins_handlers__.js",
|
|
193
194
|
content: handlersModule
|
|
194
195
|
});
|
|
195
196
|
for (const [wrapperId, { hookName }] of this.inlineWrappers.entries()) {
|
|
196
|
-
const wrapperScript = (0,
|
|
197
|
+
const wrapperScript = (0, import_adapter.generateHookWrapper)("./__agentplugins_handlers__.js", {
|
|
197
198
|
platform: "claude",
|
|
198
199
|
hookName,
|
|
199
200
|
wrapperId
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
-
generateHookWrapper,
|
|
4
|
-
generateHandlersModule,
|
|
5
|
-
validateForPlatform,
|
|
6
3
|
Severity
|
|
7
4
|
} from "@agentplugins/core";
|
|
5
|
+
import {
|
|
6
|
+
generateHookWrapper,
|
|
7
|
+
generateHandlersModule,
|
|
8
|
+
validateForPlatform
|
|
9
|
+
} from "@agentplugins/core/adapter";
|
|
8
10
|
var CLAUDE_SUPPORTED_HOOKS = [
|
|
9
11
|
"sessionStart",
|
|
10
12
|
"sessionEnd",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentplugins/adapter-claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "AgentPlugins platform adapter for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,13 +12,8 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
17
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
18
|
-
"typecheck": "tsc --noEmit"
|
|
19
|
-
},
|
|
20
15
|
"dependencies": {
|
|
21
|
-
"@agentplugins/core": "
|
|
16
|
+
"@agentplugins/core": "0.2.0"
|
|
22
17
|
},
|
|
23
18
|
"devDependencies": {
|
|
24
19
|
"@types/node": "^20.0.0",
|
|
@@ -32,5 +27,10 @@
|
|
|
32
27
|
"publishConfig": {
|
|
33
28
|
"access": "public"
|
|
34
29
|
},
|
|
35
|
-
"license": "MIT"
|
|
36
|
-
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
33
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
}
|
|
36
|
+
}
|