@agenttrail/cli 0.0.0-stage → 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/LICENSE +202 -0
- package/README.md +292 -2
- package/dist/chunk-WMGYTOQC.js +163 -0
- package/dist/cli/index.cjs +159 -0
- package/dist/cli/index.js +2 -0
- package/dist/cursor/capture-hook.mjs +2 -0
- package/dist/cursor/flush.mjs +6 -0
- package/dist/cursor/pep-hook.mjs +4877 -0
- package/dist/index.cjs +163 -0
- package/dist/index.d.cts +662 -0
- package/dist/index.d.ts +662 -0
- package/dist/index.js +1 -0
- package/package.json +48 -3
- package/plugin/.claude-plugin/marketplace.json +22 -0
- package/plugin/.claude-plugin/plugin.json +11 -0
- package/plugin/README.md +32 -0
- package/plugin/hooks/hooks.json +16 -0
- package/plugin/scripts/pep-hook.mjs +4877 -0
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenttrail/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The AgentTrail command-line tool: connects an AI coding agent's sessions to AgentTrail, with setup, sign-in, status and history import for the agent named by --agent.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/agenttrailhq/agenttrail.sh.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://agenttrail.sh",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/agenttrailhq/agenttrail.sh/issues"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"agenttrail": "./dist/cli/index.js"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.cjs",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"require": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"!dist/**/*.map",
|
|
38
|
+
"plugin",
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"uuid": "^9.0.1",
|
|
44
|
+
"zod": "^3.25.17"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"test": "vitest run"
|
|
50
|
+
}
|
|
6
51
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agenttrail",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "AgentTrail",
|
|
5
|
+
"url": "https://agenttrail.sh"
|
|
6
|
+
},
|
|
7
|
+
"metadata": {
|
|
8
|
+
"description": "AgentTrail's plugin marketplace — the enforcement plugin for agent governance.",
|
|
9
|
+
"version": "0.2.0"
|
|
10
|
+
},
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"name": "agenttrail",
|
|
14
|
+
"source": "./",
|
|
15
|
+
"description": "AgentTrail enforcement plugin — PreToolUse governance hook (a fail-closed command shim).",
|
|
16
|
+
"version": "0.2.0",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "AgentTrail"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agenttrail",
|
|
3
|
+
"description": "AgentTrail enforcement plugin for Claude Code — carries the PreToolUse governance hook, a fail-closed command shim.",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "AgentTrail",
|
|
7
|
+
"url": "https://agenttrail.sh"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://agenttrail.sh",
|
|
10
|
+
"license": "Apache-2.0"
|
|
11
|
+
}
|
package/plugin/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# AgentTrail enforcement plugin
|
|
2
|
+
|
|
3
|
+
This directory is a **Claude Code plugin and single-plugin marketplace** shipped inside
|
|
4
|
+
`@agenttrail/cli`. `agenttrail setup --agent claude` installs it through the sanctioned plugin path
|
|
5
|
+
(`claude plugin install agenttrail@agenttrail --scope user`), so Claude Code, not AgentTrail, owns the
|
|
6
|
+
write into `~/.claude` and keeps the hook apart from the user's own `settings.json` `hooks` block.
|
|
7
|
+
|
|
8
|
+
## Layout
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
plugin/
|
|
12
|
+
.claude-plugin/
|
|
13
|
+
plugin.json # plugin manifest (a plugin cannot carry an `env` field)
|
|
14
|
+
marketplace.json # single-plugin marketplace listing `agenttrail` (source "./")
|
|
15
|
+
hooks/
|
|
16
|
+
hooks.json # PreToolUse: runs the fail-closed command shim below
|
|
17
|
+
scripts/
|
|
18
|
+
pep-hook.mjs # the shim: self-contained, no node_modules, decides allow, ask or block
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Why a command shim
|
|
22
|
+
|
|
23
|
+
A raw HTTP hook cannot fail closed: an overrunning hook is abandoned and the tool runs. The shim is a
|
|
24
|
+
command that denies when it cannot decide. It is invoked as
|
|
25
|
+
`node "${CLAUDE_PLUGIN_ROOT}/scripts/pep-hook.mjs"`.
|
|
26
|
+
|
|
27
|
+
## Setup order
|
|
28
|
+
|
|
29
|
+
A plugin cannot carry `env`, so the hook's per-customer routing and token configuration rides the `env`
|
|
30
|
+
block the CLI writes into `settings.json`, read when the hook runs. Setup writes that block **before**
|
|
31
|
+
it installs the plugin: a plugin installed while the block is absent authenticates with an empty bearer
|
|
32
|
+
token, and every call would be rejected.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PreToolUse": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "Bash|PowerShell|Edit|Write|Read|NotebookEdit|Grep|Glob|WebSearch|mcp__.*",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/pep-hook.mjs\" --agent claude",
|
|
10
|
+
"timeout": 600
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|