agent-dir 0.5.0 → 1.1.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.
@@ -0,0 +1,204 @@
1
+ # Releasing agent-dir
2
+
3
+ This document is the authoritative maintainer/agent procedure for publishing `agent-dir`.
4
+
5
+ ## Architecture
6
+
7
+ feature/*
8
+ │
9
+ └── PR → main
10
+ └── CI
11
+ │
12
+ ▼
13
+ .github/workflows/publish.yml
14
+ │
15
+ ├── npm run check
16
+ ├── npm test
17
+ ├── npm pack --dry-run
18
+ └── npm run release
19
+ │
20
+ └── semantic-release
21
+ ├── determine SemVer
22
+ ├── update package.json/package-lock.json
23
+ ├── commit release
24
+ ├── create vX.Y.Z tag
25
+ ├── create GitHub Release
26
+ └── publish npm package
27
+
28
+ `main` is the single protected release branch. Normal human and agent changes reach it through pull requests. There is no permanent `staging` branch.
29
+
30
+ ## Release source of truth
31
+
32
+ - `.releaserc.json` — semantic-release configuration
33
+ - `.github/workflows/publish.yml` — production release workflow
34
+ - `package.json` — package metadata and release script
35
+ - npm Trusted Publishing/OIDC — npm authentication for GitHub Actions
36
+
37
+ The workflow filename `publish.yml` is intentional. Do not rename it. npm Trusted Publishing is configured against the workflow identity.
38
+
39
+ The semantic-release repository URL uses SSH: `git@github.com:SarfDime/agent-dir.git`.
40
+
41
+ The release workflow uses the repository's release SSH key to allow semantic-release to update protected `main` with its release commit/tag.
42
+
43
+ ## Normal release procedure
44
+
45
+ ### 1. Make the change
46
+
47
+ Work on a feature branch. Keep the change focused. Use a Conventional Commit message whose type reflects the intended release impact.
48
+
49
+ Examples: `fix: handle tunnel reconnect`, `feat: add project snapshots`, `feat!: change authentication protocol`.
50
+
51
+ Do not manually edit the package version.
52
+
53
+ ### 2. Validate locally
54
+
55
+ npm run check
56
+ npm test
57
+ npm pack --dry-run
58
+
59
+ `npm pack --dry-run` is important: inspect the file list and make sure the package does not contain credentials, local configuration, development-only files, or other unintended content.
60
+
61
+ ### 3. Open and merge a pull request
62
+
63
+ Push the branch and open a PR targeting `main`.
64
+
65
+ The required CI check is `Check`. It runs `npm ci`, `npm run check`, `npm test`, and `npm pack --dry-run`.
66
+
67
+ Do not bypass a failing check. Merge only after the required `Check` status is green and the required review is approved.
68
+
69
+ ### 4. Let GitHub Actions publish
70
+
71
+ The merge to `main` creates a push to `main`, which starts `.github/workflows/publish.yml`.
72
+
73
+ The workflow validates the package again and invokes `npm run release`.
74
+
75
+ Do not run `npm publish` locally and do not manually create a release tag.
76
+
77
+ semantic-release reads the Conventional Commit history since the previous release and decides whether a release is required.
78
+
79
+ ## Version rules
80
+
81
+ | Change | Version impact |
82
+ |---|---|
83
+ | `fix:` | patch |
84
+ | `feat:` | minor |
85
+ | `feat!:` | major |
86
+ | `BREAKING CHANGE:` footer | major |
87
+ | `docs:` | none |
88
+ | `test:` | none |
89
+ | `chore:` | none |
90
+ | `refactor:` | none |
91
+ | `ci:` | none |
92
+
93
+ There is an explicit semantic-release rule: `fix(ci)` has `release: false`.
94
+
95
+ A CI-only repair can be promoted to `main` without creating a package release. Do not change its commit type merely to force publication.
96
+
97
+ ## What semantic-release changes
98
+
99
+ When a release is required, semantic-release is responsible for:
100
+
101
+ - calculating the next SemVer version;
102
+ - updating `package.json`;
103
+ - updating `package-lock.json`;
104
+ - creating the release commit with `[skip ci]`;
105
+ - creating the `vX.Y.Z` Git tag;
106
+ - creating the GitHub Release;
107
+ - publishing the package to npm.
108
+
109
+ The release commit is `chore(release): <version> [skip ci]`. The release commit itself must not start another release cycle.
110
+
111
+ ## npm authentication
112
+
113
+ npm publishing is performed by GitHub Actions using npm Trusted Publishing/OIDC.
114
+
115
+ The workflow requests `id-token: write`. Do not add an npm token to the workflow unless the publishing architecture is deliberately changed and reconfigured.
116
+
117
+ Do not expose or print npm credentials.
118
+
119
+ `GITHUB_TOKEN` is separate from npm authentication and is used by semantic-release for GitHub release operations. The repository currently supplies the release workflow's GitHub credential through the `RELEASE_TOKEN` Actions secret.
120
+
121
+ ## Protected-branch automation
122
+
123
+ The release workflow needs to write the semantic-release commit/tag back to `main`, even though normal pushes to `main` are blocked.
124
+
125
+ That automation is authorized separately through the release SSH deploy key stored in the `RELEASE_DEPLOY_KEY_B64` Actions secret.
126
+
127
+ Do not remove or replace this mechanism casually. If it must change, verify the complete release flow and npm Trusted Publishing configuration before merging the change.
128
+
129
+ The intended security boundary is:
130
+
131
+ - humans/agents: PR-only changes;
132
+ - release automation: narrowly authorized to perform the semantic-release update on `main`.
133
+
134
+ ## How to verify a release
135
+
136
+ After a release-worthy change reaches `main`, verify:
137
+
138
+ 1. The `Release` workflow completed successfully.
139
+ 2. semantic-release reported the expected next version.
140
+ 3. The repository has a matching `vX.Y.Z` tag.
141
+ 4. The GitHub Release exists for that tag.
142
+ 5. npm reports the expected package version.
143
+ 6. `package.json` and `package-lock.json` on `main` contain the released version after the release commit.
144
+
145
+ The package version and release tag must agree: `package.json version = X.Y.Z` and `Git tag = vX.Y.Z`.
146
+
147
+ ## When a release does not happen
148
+
149
+ A successful `Release` workflow can legitimately produce no release when commits since the previous release contain no release-worthy Conventional Commit.
150
+
151
+ Examples: `docs: update README`, `test: add regression coverage`, `chore: update development tooling`, `fix(ci): correct workflow configuration`.
152
+
153
+ Do not interpret a successful workflow with no release as a publishing failure.
154
+
155
+ ## Release failure recovery
156
+
157
+ When a release fails:
158
+
159
+ 1. Inspect the exact failing workflow step.
160
+ 2. Determine whether semantic-release calculated a release.
161
+ 3. Check the latest Git tag.
162
+ 4. Check the current npm published version.
163
+ 5. Check whether a GitHub Release was created.
164
+ 6. Check whether the release commit was created.
165
+ 7. Only then decide whether another change or rerun is appropriate.
166
+
167
+ Do not manually bump the version, move/delete/recreate an existing release tag, run `npm publish` from a workstation, create a second tag for the same version, or rewrite commit history just to make semantic-release produce a version.
168
+
169
+ If a release was partially created, reconcile the actual Git/npm/GitHub state before making another release attempt.
170
+
171
+ ## CI workflow constraints
172
+
173
+ `.github/workflows/ci.yml` runs on pushes to `main` and pull requests targeting `main`.
174
+
175
+ Its concurrency key must remain safe for both PR events and any diagnostic/manual event that may temporarily be introduced:
176
+
177
+ group: ci-${{ github.event.pull_request.number || github.ref }}
178
+
179
+ Do not replace this with a direct `pull_request.number` reference.
180
+
181
+ The production release workflow intentionally runs only on pushes to `main`:
182
+
183
+ on:
184
+ push:
185
+ branches:
186
+ - main
187
+
188
+ Keep release execution serialized:
189
+
190
+ concurrency:
191
+ group: release
192
+ cancel-in-progress: false
193
+
194
+ ## Files an agent should inspect first
195
+
196
+ AGENTS.md
197
+ docs/RELEASING.md
198
+ .releaserc.json
199
+ package.json
200
+ .github/workflows/ci.yml
201
+ .github/workflows/publish.yml
202
+ .github/CONTRIBUTING.md
203
+
204
+ Do not assume the release process from generic npm conventions. This repository's protected-branch and Trusted Publishing configuration is intentional.
@@ -0,0 +1,109 @@
1
+ # Telemetry interpretation
2
+
3
+ Agent Dir telemetry is a local operational record of MCP activity. It describes what the server handled, how long it took, and where failures occurred without recording project contents, command arguments, tokens, environment variables, or project paths at standard levels. The opt-in diagnostic level additionally records local troubleshooting metadata, including project paths, hostname, username, process identifiers, full Node version, Linux distribution ID/name/version, kernel version, memory usage, process uptime, and bounded raw tool inputs/outputs or error details. Diagnostic records can contain source code, command arguments, project data, and other sensitive material; they are stored locally and should be enabled only when intended.
4
+
5
+ ## Data hierarchy
6
+
7
+ Telemetry is organized as:
8
+
9
+ - `none`: disabled.
10
+ - `anonymous`: operational events without runtime/project context.
11
+ - `basic`: anonymous events plus coarse runtime context.
12
+ - `detailed`: basic context plus coarse project classification.
13
+ - `diagnostic`: detailed context plus identifying/troubleshooting metadata and bounded raw tool input/output or error details. This can contain source code, command arguments, and sensitive project information; it is stored locally. Use only when intended.
14
+
15
+ configuration → session → event
16
+
17
+ - **Configuration** identifies the Agent Dir configuration that produced the event. Named profiles use the profile name; direct CLI configurations use a stable hash of the effective share configuration.
18
+ - **Session** identifies one MCP handler lifetime. A session starts with its first MCP request and is finalized when the server closes the handler.
19
+ - **Event** is one recorded operation or one session-finalization record.
20
+
21
+ ## Event types
22
+
23
+ ### mcp_request
24
+
25
+ One MCP/JSON-RPC request handled by Agent Dir. Its duration covers the request from entry through response/error handling.
26
+
27
+ ### tool_call
28
+
29
+ One Agent Dir tool execution inside an MCP request. Tool metrics are the best measure of individual Agent Dir capability reliability. Tool events include UTF-8 input/output byte counts, a rough token-size estimate (`ceil(bytes / 4)`), hashed request/input/output fingerprints, output repetition within the current process session, and bounded per-file metadata. File metadata contains hashes of paths and returned file text plus byte counts; it does not contain the paths or text themselves. A matching output fingerprint means the serialized tool result was identical, not that Claude necessarily re-read or billed those bytes again.
30
+
31
+ Token estimates are **not tokenizer measurements** and do not represent Claude's actual input/output tokens or billing. Agent Dir cannot observe Claude's hidden prompt, cached tokens, reasoning tokens, or context carried between turns. Search results can be compared by result count, output bytes, truncation, and pagination, but Agent Dir does not currently judge semantic search relevance. Repeated input fingerprints and event ordering can help identify retry patterns, while validation-after-change counts must be inferred from the raw event sequence rather than treated as a definitive causal metric.
32
+
33
+ ### command_call
34
+
35
+ One command operation performed by an Agent Dir command tool. Command metrics describe command execution separately from MCP transport success.
36
+
37
+ ### session
38
+
39
+ A final summary emitted when the MCP handler closes. It contains:
40
+
41
+ - wallClockDurationMs: elapsed time from the first request to the last request.
42
+ - activeRequestDurationMs: sum of MCP request processing durations.
43
+ - idleGapDurationMs: wall-clock time minus active request time.
44
+ - requestCount: number of MCP requests in the session.
45
+ - toolCallCount: number of tool calls in the session.
46
+ - commandCallCount: number of command operations in the session.
47
+
48
+ Idle gaps are **not agent thinking time**. They can contain agent reasoning, network latency, client delays, scheduling, or other time outside Agent Dir request processing.
49
+
50
+ ## Success rates
51
+
52
+ There is intentionally **no single overall success rate**.
53
+
54
+ An MCP tool invocation normally produces both a tool_call event and an enclosing mcp_request event. Counting both as independent successes or failures would double-count the same operation and make the metric misleading.
55
+
56
+ Instead, interpret these independently:
57
+
58
+ - **MCP success** = successful MCP requests / MCP requests.
59
+ - **Tool success** = successful tool calls / tool calls.
60
+ - **Command success** = successful command calls / command calls.
61
+ - **Per-tool success** = successful calls for that tool / calls for that tool.
62
+ - **Per-command success** = successful calls for that command operation / calls for that command operation.
63
+
64
+ A rate of — means there were no events of that type, not that the type failed.
65
+
66
+ ## Failures
67
+
68
+ Failure categories are separated by event type:
69
+
70
+ - mcp failures belong to MCP request handling.
71
+ - tool failures belong to Agent Dir tool execution.
72
+ - command failures belong to command execution.
73
+
74
+ This separation prevents a failed tool call and its failed enclosing MCP request from being presented as one combined failure metric.
75
+
76
+ ## Duration metrics
77
+
78
+ - **Avg** is the arithmetic mean of recorded durations for that operation.
79
+ - **P95** is the 95th-percentile recorded duration using the nearest observed sample at or above the percentile rank.
80
+ - Session wall-clock time is not equivalent to active server processing time.
81
+
82
+ Do not infer agent reasoning time, user wait time, or network latency from tool duration alone.
83
+
84
+ ## Privacy levels
85
+
86
+ - **anonymous** records operational event data only.
87
+ - **basic** adds bounded Agent Dir/runtime and MCP client information.
88
+ - **detailed** additionally adds coarse project classification such as language, package manager, Git/CodeGraph availability, and project size.
89
+ - **diagnostic** additionally adds local troubleshooting metadata such as project paths, hostname, username, process identifiers, Node version, memory usage, and process uptime. This level is opt-in and should only be enabled when needed for local diagnosis.
90
+
91
+ Telemetry is persisted locally only when enabled. Persistence failures must never affect MCP request handling.
92
+
93
+ ## Reading telemetry show
94
+
95
+ telemetry show is the raw event stream grouped by configuration and session. Use it when exact event order, timestamps, event fields, or individual failures matter.
96
+
97
+ ## Reading telemetry summary
98
+
99
+ telemetry summary is an aggregation for humans and agents. Prefer its separate MCP/tool/command success rates and per-tool/per-command metrics for reliability analysis. Use the raw stream when investigating a specific request or reconstructing event order. Raw tool events currently provide the token-size, fingerprint, duplicate-output, and file-metadata signals described above; aggregated summary fields for those measurements have not yet been added.
100
+
101
+ ## Data quality rules
102
+
103
+ Telemetry should be treated as measurement data, not as a complete audit log:
104
+
105
+ 1. Session records are only emitted when a handler closes normally through Agent Dir shutdown.
106
+ 2. An active session may therefore have no session event yet.
107
+ 3. Legacy persisted session records without the current timing fields are identified separately and are not used as current session timing data.
108
+ 4. Event counts include session records, because they are recorded telemetry events; success rates exclude session records because sessions are summaries, not operations.
109
+ 5. MCP request and tool events are deliberately not combined into one reliability denominator.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-dir",
3
- "version": "0.5.0",
3
+ "version": "1.1.0",
4
4
  "description": "Expose a local project to an AI agent through authenticated MCP, filesystem tools, and allowlisted development commands",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,9 @@
14
14
  "dist/bin",
15
15
  "dist/src",
16
16
  "README.md",
17
+ "docs",
18
+ "assets/agent-dir-banner.svg",
19
+ "SECURITY.md",
17
20
  "LICENSE"
18
21
  ],
19
22
  "engines": {