agentrinse 0.4.0 → 0.6.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 +71 -48
- package/dist/adapters/claude-cache.d.ts +3 -0
- package/dist/adapters/claude-cache.d.ts.map +1 -0
- package/dist/adapters/claude-cache.js +67 -0
- package/dist/adapters/claude-cache.js.map +1 -0
- package/dist/adapters/claude-debug.d.ts +3 -0
- package/dist/adapters/claude-debug.d.ts.map +1 -0
- package/dist/adapters/claude-debug.js +100 -0
- package/dist/adapters/claude-debug.js.map +1 -0
- package/dist/adapters/claude-retention.d.ts +36 -0
- package/dist/adapters/claude-retention.d.ts.map +1 -0
- package/dist/adapters/claude-retention.js +176 -0
- package/dist/adapters/claude-retention.js.map +1 -0
- package/dist/adapters/copilot-maintenance.d.ts +23 -0
- package/dist/adapters/copilot-maintenance.d.ts.map +1 -0
- package/dist/adapters/copilot-maintenance.js +53 -0
- package/dist/adapters/copilot-maintenance.js.map +1 -0
- package/dist/adapters/cursor-maintenance.d.ts +54 -0
- package/dist/adapters/cursor-maintenance.d.ts.map +1 -0
- package/dist/adapters/cursor-maintenance.js +138 -0
- package/dist/adapters/cursor-maintenance.js.map +1 -0
- package/dist/adapters/docker/adapter.d.ts +13 -4
- package/dist/adapters/docker/adapter.d.ts.map +1 -1
- package/dist/adapters/docker/adapter.js +254 -45
- package/dist/adapters/docker/adapter.js.map +1 -1
- package/dist/adapters/docker/owner.d.ts +70 -0
- package/dist/adapters/docker/owner.d.ts.map +1 -0
- package/dist/adapters/docker/owner.js +359 -0
- package/dist/adapters/docker/owner.js.map +1 -0
- package/dist/adapters/grok-maintenance.d.ts +67 -0
- package/dist/adapters/grok-maintenance.d.ts.map +1 -0
- package/dist/adapters/grok-maintenance.js +193 -0
- package/dist/adapters/grok-maintenance.js.map +1 -0
- package/dist/adapters/opencode-maintenance.d.ts +23 -0
- package/dist/adapters/opencode-maintenance.d.ts.map +1 -0
- package/dist/adapters/opencode-maintenance.js +53 -0
- package/dist/adapters/opencode-maintenance.js.map +1 -0
- package/dist/adapters/provider-adapter.d.ts +3 -0
- package/dist/adapters/provider-adapter.d.ts.map +1 -1
- package/dist/adapters/provider-adapter.js +395 -7
- package/dist/adapters/provider-adapter.js.map +1 -1
- package/dist/adapters/provider-root.d.ts +8 -0
- package/dist/adapters/provider-root.d.ts.map +1 -0
- package/dist/adapters/provider-root.js +50 -0
- package/dist/adapters/provider-root.js.map +1 -0
- package/dist/adapters/provider-specs.d.ts.map +1 -1
- package/dist/adapters/provider-specs.js +39 -4
- package/dist/adapters/provider-specs.js.map +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/registry.js +7 -1
- package/dist/adapters/registry.js.map +1 -1
- package/dist/adapters/zed-logs.d.ts +8 -0
- package/dist/adapters/zed-logs.d.ts.map +1 -0
- package/dist/adapters/zed-logs.js +103 -0
- package/dist/adapters/zed-logs.js.map +1 -0
- package/dist/commands/adapters.js +1 -1
- package/dist/commands/adapters.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/purge.d.ts +7 -1
- package/dist/commands/purge.d.ts.map +1 -1
- package/dist/commands/purge.js +23 -0
- package/dist/commands/purge.js.map +1 -1
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +3 -0
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/undo.d.ts +4 -1
- package/dist/commands/undo.d.ts.map +1 -1
- package/dist/commands/undo.js +18 -1
- package/dist/commands/undo.js.map +1 -1
- package/dist/contracts/action.d.ts +335 -2
- package/dist/contracts/action.d.ts.map +1 -1
- package/dist/contracts/action.js +52 -1
- package/dist/contracts/action.js.map +1 -1
- package/dist/contracts/finding.d.ts +153 -2
- package/dist/contracts/finding.d.ts.map +1 -1
- package/dist/contracts/plan.d.ts +152 -2
- package/dist/contracts/plan.d.ts.map +1 -1
- package/dist/contracts/plan.js +1 -1
- package/dist/contracts/plan.js.map +1 -1
- package/dist/contracts/provider-file-quarantine.d.ts +221 -0
- package/dist/contracts/provider-file-quarantine.d.ts.map +1 -0
- package/dist/contracts/provider-file-quarantine.js +61 -0
- package/dist/contracts/provider-file-quarantine.js.map +1 -0
- package/dist/contracts/report.d.ts +153 -2
- package/dist/contracts/report.d.ts.map +1 -1
- package/dist/contracts/resource.d.ts +3 -0
- package/dist/contracts/resource.d.ts.map +1 -1
- package/dist/contracts/resource.js +1 -0
- package/dist/contracts/resource.js.map +1 -1
- package/dist/contracts/run.d.ts +94 -0
- package/dist/contracts/run.d.ts.map +1 -1
- package/dist/contracts/run.js +7 -0
- package/dist/contracts/run.js.map +1 -1
- package/dist/core/apply.d.ts +5 -1
- package/dist/core/apply.d.ts.map +1 -1
- package/dist/core/apply.js +74 -3
- package/dist/core/apply.js.map +1 -1
- package/dist/core/no-clobber-rename.d.ts +1 -0
- package/dist/core/no-clobber-rename.d.ts.map +1 -1
- package/dist/core/no-clobber-rename.js +44 -0
- package/dist/core/no-clobber-rename.js.map +1 -1
- package/dist/core/pinned-file.d.ts +37 -0
- package/dist/core/pinned-file.d.ts.map +1 -0
- package/dist/core/pinned-file.js +228 -0
- package/dist/core/pinned-file.js.map +1 -0
- package/dist/core/plan.d.ts.map +1 -1
- package/dist/core/plan.js +4 -1
- package/dist/core/plan.js.map +1 -1
- package/dist/core/process-ownership.d.ts +1 -0
- package/dist/core/process-ownership.d.ts.map +1 -1
- package/dist/core/process-ownership.js +17 -3
- package/dist/core/process-ownership.js.map +1 -1
- package/dist/core/provider-file-executor.d.ts +40 -0
- package/dist/core/provider-file-executor.d.ts.map +1 -0
- package/dist/core/provider-file-executor.js +259 -0
- package/dist/core/provider-file-executor.js.map +1 -0
- package/dist/core/provider-file-identity.d.ts +8 -0
- package/dist/core/provider-file-identity.d.ts.map +1 -0
- package/dist/core/provider-file-identity.js +113 -0
- package/dist/core/provider-file-identity.js.map +1 -0
- package/dist/core/provider-file-policy.d.ts +39 -0
- package/dist/core/provider-file-policy.d.ts.map +1 -0
- package/dist/core/provider-file-policy.js +131 -0
- package/dist/core/provider-file-policy.js.map +1 -0
- package/dist/core/provider-file-recovery.d.ts +25 -0
- package/dist/core/provider-file-recovery.d.ts.map +1 -0
- package/dist/core/provider-file-recovery.js +393 -0
- package/dist/core/provider-file-recovery.js.map +1 -0
- package/dist/core/provider-file-revalidation.d.ts +20 -0
- package/dist/core/provider-file-revalidation.d.ts.map +1 -0
- package/dist/core/provider-file-revalidation.js +60 -0
- package/dist/core/provider-file-revalidation.js.map +1 -0
- package/dist/core/provider-processes.d.ts +18 -0
- package/dist/core/provider-processes.d.ts.map +1 -0
- package/dist/core/provider-processes.js +90 -0
- package/dist/core/provider-processes.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/state/json-file.d.ts +2 -1
- package/dist/state/json-file.d.ts.map +1 -1
- package/dist/state/json-file.js +59 -2
- package/dist/state/json-file.js.map +1 -1
- package/dist/state/layout.d.ts +1 -0
- package/dist/state/layout.d.ts.map +1 -1
- package/dist/state/layout.js +1 -0
- package/dist/state/layout.js.map +1 -1
- package/dist/state/run-journal.d.ts.map +1 -1
- package/dist/state/run-journal.js +8 -2
- package/dist/state/run-journal.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schemas/audit.schema.json +786 -1
- package/schemas/plan.schema.json +785 -1
- package/schemas/provider-file-quarantine.schema.json +741 -0
- package/schemas/run.schema.json +85 -0
package/README.md
CHANGED
|
@@ -15,11 +15,15 @@ protected or eligible, creates a content-addressed plan, and revalidates the
|
|
|
15
15
|
same facts immediately before mutation.
|
|
16
16
|
|
|
17
17
|
agentrinse is not audit-only. audit establishes the evidence; apply performs
|
|
18
|
-
the approved filesystem, Git metadata, and offline database changes. `0.
|
|
19
|
-
removes exact configured rebuildable artifacts, quarantines proven inactive
|
|
20
|
-
worktrees, repairs and locks their Git registrations, restores
|
|
21
|
-
worktrees, permanently purges explicitly selected quarantine
|
|
22
|
-
compacts supported Codex SQLite state with a retained rollback
|
|
18
|
+
the approved filesystem, Git metadata, and offline database changes. `0.6.0`
|
|
19
|
+
removes exact configured rebuildable artifacts, quarantines proven inactive
|
|
20
|
+
linked worktrees, repairs and locks their Git registrations, restores
|
|
21
|
+
quarantined worktrees, permanently purges explicitly selected quarantine
|
|
22
|
+
entries, and compacts supported Codex SQLite state with a retained rollback
|
|
23
|
+
copy. It also quarantines exact stale Claude debug logs and changelog cache
|
|
24
|
+
files plus Zed's exact stale `Zed.log.old` rotated application log with a
|
|
25
|
+
seven-day undo window. OpenCode, Cursor, version-gated Docker Buildx, and
|
|
26
|
+
version-gated Grok owner maintenance remain report-only.
|
|
23
27
|
|
|
24
28
|
the point is confidence: make real cleanup changes without deleting the
|
|
25
29
|
session, branch, worktree, database content, or cache that another agent still
|
|
@@ -33,20 +37,29 @@ optional external handoff for broader macOS and project debris.
|
|
|
33
37
|
|
|
34
38
|
## cleanup actions
|
|
35
39
|
|
|
36
|
-
| Action | Risk | What changes
|
|
37
|
-
| ---------------------- | ------------ |
|
|
38
|
-
| 🧹 artifact removal | safe | atomically isolates and removes an exact configured rebuildable directory
|
|
39
|
-
| 🌿 worktree quarantine | recoverable | moves a linked worktree, creates a recovery ref, and repairs Git registration
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
| Action | Risk | What changes | Recovery |
|
|
41
|
+
| ---------------------- | ------------ | ------------------------------------------------------------------------------ | --------------------------------------- |
|
|
42
|
+
| 🧹 artifact removal | safe | atomically isolates and removes an exact configured rebuildable directory | rebuild from the project |
|
|
43
|
+
| 🌿 worktree quarantine | recoverable | moves a linked worktree, creates a recovery ref, and repairs Git registration | `agentrinse undo <run-id>` |
|
|
44
|
+
| 🧾 provider quarantine | recoverable | moves an exact provider-owned disposable file into private recovery storage | `agentrinse undo <run-id>` |
|
|
45
|
+
| 🗜️ Codex DB vacuum | experimental | builds and verifies a compacted SQLite copy, then retains the original file | `agentrinse undo <run-id>` before reuse |
|
|
46
|
+
| ↩️ recovery undo | recoverable | restores a quarantined worktree, provider file, or database original | recovery remains journaled |
|
|
47
|
+
| 🗑️ recovery purge | destructive | permanently removes an explicitly selected worktree, provider file, or DB copy | none |
|
|
48
|
+
| ⚙️ config init | operational | creates the default config without overwriting an existing file | edit or remove the generated config |
|
|
49
|
+
| 🔒 lock recovery | operational | removes only a stale AgentRinse lock after proving its process is gone | rerun the interrupted command |
|
|
50
|
+
|
|
51
|
+
provider sessions, transcripts, credentials, configuration, and logical
|
|
52
|
+
database records remain report-only. `0.6.0` supports explicit offline
|
|
53
|
+
compaction for the exact current Codex `state_5`, `logs_2`, `goals_1`, and
|
|
54
|
+
`memories_1` SQLite contracts. Claude cleanup is limited to exact old debug
|
|
55
|
+
text files and its rebuildable changelog cache. AgentRinse also reports
|
|
56
|
+
Claude's native retention policy and Copilot's native session and process-log
|
|
57
|
+
maintenance. It also reports OpenCode's owner-run snapshot compaction and its
|
|
58
|
+
separate append-only server log, plus Cursor's owner-run state database
|
|
59
|
+
maintenance. Docker inventories images, containers, and supported Buildx cache
|
|
60
|
+
records but remains audit-only. Grok inventory is pinned to the inspected
|
|
61
|
+
`0.2.112` version and build revision from the audited root's canonical
|
|
62
|
+
executable, and reports its session-start memory GC without invoking it.
|
|
50
63
|
|
|
51
64
|
## agent integrations
|
|
52
65
|
|
|
@@ -54,26 +67,33 @@ provider state is report-only unless the table below says otherwise.
|
|
|
54
67
|
agentrinse never erases transcripts, sessions, credentials, configuration, or
|
|
55
68
|
logical memory records.
|
|
56
69
|
|
|
57
|
-
| Logo | Client
|
|
58
|
-
| --------------------------------------------------------------------------- |
|
|
59
|
-
| <img width="48px" src="docs/client-openai.jpg" alt="OpenAI Codex" /> | [OpenAI Codex](https://github.com/openai/codex)
|
|
60
|
-
| <img width="48px" src="docs/client-claude.jpg" alt="Claude Code" /> | [Claude Code](https://
|
|
61
|
-
| <img width="48px" src="docs/client-cursor.jpg" alt="Cursor" /> | [Cursor](https://cursor.com/docs)
|
|
62
|
-
| <img width="48px" src="docs/client-copilot.png" alt="GitHub Copilot CLI" /> | [GitHub Copilot CLI](https://github.com/github/copilot-cli)
|
|
63
|
-
| <img width="48px" src="docs/client-zed.svg" alt="Zed" /> | [Zed](https://zed.dev/docs/ai/overview)
|
|
64
|
-
| <img width="48px" src="docs/client-opencode.png" alt="OpenCode" /> | [OpenCode](https://opencode.ai/)
|
|
65
|
-
| <img width="48px" src="docs/client-grok-build.svg" alt="Grok Build" /> | [Grok Build](https://docs.x.ai/build/overview)
|
|
70
|
+
| Logo | Client | Mode | What it protects |
|
|
71
|
+
| --------------------------------------------------------------------------- | ----------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------- |
|
|
72
|
+
| <img width="48px" src="docs/client-openai.jpg" alt="OpenAI Codex" /> | [OpenAI Codex](https://github.com/openai/codex) | audit + offline vacuum | sessions, workspace roots, reachability, and supported SQLite state |
|
|
73
|
+
| <img width="48px" src="docs/client-claude.jpg" alt="Claude Code" /> | [Claude Code](https://code.claude.com/docs/en/overview) | retention + quarantine | sessions, caches, roots, native retention, and exact old files |
|
|
74
|
+
| <img width="48px" src="docs/client-cursor.jpg" alt="Cursor" /> | [Cursor](https://cursor.com/docs) | audit + native guidance | workspace state, DB companions, and owner maintenance |
|
|
75
|
+
| <img width="48px" src="docs/client-copilot.png" alt="GitHub Copilot CLI" /> | [GitHub Copilot CLI](https://github.com/github/copilot-cli) | audit + native guidance | local sessions, process logs, and provider-owned maintenance |
|
|
76
|
+
| <img width="48px" src="docs/client-zed.svg" alt="Zed" /> | [Zed](https://zed.dev/docs/ai/overview) | audit + quarantine | local agent state and the exact stale rotated application log |
|
|
77
|
+
| <img width="48px" src="docs/client-opencode.png" alt="OpenCode" /> | [OpenCode](https://opencode.ai/) | audit + native guidance | local state, snapshot GC, and server-log retention |
|
|
78
|
+
| <img width="48px" src="docs/client-grok-build.svg" alt="Grok Build" /> | [Grok Build](https://docs.x.ai/build/overview) | audit + native guidance | sessions, memory, logs, worktrees, caches, and owner maintenance |
|
|
66
79
|
|
|
67
80
|
## cleanup surfaces
|
|
68
81
|
|
|
69
|
-
| Icon
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
| <img width="48px" src="docs/client-
|
|
76
|
-
|
|
|
82
|
+
| Icon | Surface | Mode | What it understands |
|
|
83
|
+
| --------------------------------------------------------------------------- | ------------------------------------ | ------------------ | ----------------------------------------------------------------------- |
|
|
84
|
+
| <img width="48px" src="docs/icon-git-branch.svg" alt="Git branch" /> | Git worktrees | audit + quarantine | linked worktrees, refs, dirtiness, locks, processes, and provider roots |
|
|
85
|
+
| <img width="48px" src="docs/icon-file.svg" alt="Build artifact file" /> | Build artifacts | safe-clean | exact configured rebuildable directories |
|
|
86
|
+
| <img width="48px" src="docs/client-openai.jpg" alt="OpenAI Codex" /> | Codex SQLite state | experimental | schema versions, free pages, sidecars, owner processes, and rollback |
|
|
87
|
+
| <img width="48px" src="docs/client-claude.jpg" alt="Claude Code" /> | Claude native retention | report-only | default or user retention, settings validity, and provider ownership |
|
|
88
|
+
| <img width="48px" src="docs/client-claude.jpg" alt="Claude Code" /> | Claude logs and changelog cache | recoverable | exact old files, provider liveness, seven-day undo, and explicit purge |
|
|
89
|
+
| <img width="48px" src="docs/client-copilot.png" alt="GitHub Copilot CLI" /> | Copilot native maintenance | report-only | local session pruning and versioned process-log retention |
|
|
90
|
+
| <img width="48px" src="docs/client-zed.svg" alt="Zed" /> | Zed rotated application log | recoverable | exact `Zed.log.old`, provider liveness, seven-day undo, and purge |
|
|
91
|
+
| <img width="48px" src="docs/client-opencode.png" alt="OpenCode" /> | OpenCode native maintenance | report-only | hourly snapshot GC and the append-only server-log contract |
|
|
92
|
+
| <img width="48px" src="docs/client-cursor.jpg" alt="Cursor" /> | Cursor database maintenance | report-only | exact DB companions, orphan KV GC, and destructive chat cleanup |
|
|
93
|
+
| <img width="48px" src="docs/client-grok-build.svg" alt="Grok Build" /> | Grok native memory GC | report-only | session-start orphan cleanup, source version, and explicit refusal |
|
|
94
|
+
| <img width="48px" src="docs/icon-terminal.svg" alt="Terminal runtime" /> | Agent runtimes | audit-only, opt-in | installed agent executables and versions |
|
|
95
|
+
| <img width="48px" src="docs/client-docker-agent.svg" alt="Docker" /> | [Docker](https://docs.docker.com/) | audit-only, opt-in | images, containers, and versioned Buildx cache |
|
|
96
|
+
| <img width="48px" src="docs/icon-search.svg" alt="Cleanup search" /> | [Mole](https://github.com/tw93/Mole) | suggestions only | external dry-run cleanup opportunities on macOS |
|
|
77
97
|
|
|
78
98
|
## install
|
|
79
99
|
|
|
@@ -92,7 +112,7 @@ brew install vincentkoc/tap/agentrinse
|
|
|
92
112
|
one-off use:
|
|
93
113
|
|
|
94
114
|
```bash
|
|
95
|
-
npx agentrinse@0.
|
|
115
|
+
npx agentrinse@0.6.0 doctor
|
|
96
116
|
```
|
|
97
117
|
|
|
98
118
|
then:
|
|
@@ -212,7 +232,7 @@ agentrinse is built around refusal:
|
|
|
212
232
|
|
|
213
233
|
there is no generic `--force` escape hatch.
|
|
214
234
|
|
|
215
|
-
agentrinse `0.
|
|
235
|
+
agentrinse `0.6.0` never removes:
|
|
216
236
|
|
|
217
237
|
- provider sessions, transcripts, logical database rows, credentials, or configuration
|
|
218
238
|
- unsupported provider databases or Codex databases with unknown migrations
|
|
@@ -322,12 +342,12 @@ it can be verified before apply.
|
|
|
322
342
|
|
|
323
343
|
## platform support
|
|
324
344
|
|
|
325
|
-
| Platform | `0.
|
|
326
|
-
| -------------- |
|
|
327
|
-
| macOS | audit, artifact/worktree cleanup,
|
|
328
|
-
| Linux | audit, artifact/worktree cleanup,
|
|
329
|
-
| WSL | Linux contract inside the WSL filesystem
|
|
330
|
-
| native Windows | audit-only; mutation remains blocked before `1.0.0`
|
|
345
|
+
| Platform | `0.6.0` support |
|
|
346
|
+
| -------------- | ------------------------------------------------------------------- |
|
|
347
|
+
| macOS | audit, artifact/worktree/Claude/Zed cleanup, DB vacuum, undo, purge |
|
|
348
|
+
| Linux | audit, artifact/worktree/Claude/Zed cleanup, DB vacuum, undo, purge |
|
|
349
|
+
| WSL | Linux contract inside the WSL filesystem |
|
|
350
|
+
| native Windows | audit-only; mutation remains blocked before `1.0.0` |
|
|
331
351
|
|
|
332
352
|
Git and `lsof` are required for the complete diagnostic and process-ownership
|
|
333
353
|
contract. Codex DB maintenance additionally requires `sqlite3`. Docker is
|
|
@@ -362,9 +382,12 @@ unreleased build at real developer state.
|
|
|
362
382
|
|
|
363
383
|
## status
|
|
364
384
|
|
|
365
|
-
`0.
|
|
366
|
-
configured artifact cleanup, recoverable Git worktree
|
|
367
|
-
|
|
368
|
-
|
|
385
|
+
`0.6.0` ships the complete audit → plan → revalidate → apply loop, safe
|
|
386
|
+
configured artifact cleanup, recoverable Git worktree, Claude file, and exact
|
|
387
|
+
Zed rotated-log quarantine, plus recoverable offline Codex database
|
|
388
|
+
compaction. It reports OpenCode's native maintenance contract, Cursor's owner
|
|
389
|
+
database commands, Docker Buildx cache facts, and Grok's version-gated
|
|
390
|
+
session-start memory GC. Grok Build, Docker, and all other Cursor, Zed, and
|
|
391
|
+
OpenCode state remain non-mutating.
|
|
369
392
|
|
|
370
393
|
MIT licensed. built by [Vincent Koc](https://github.com/vincentkoc).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-cache.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAc9E,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC,CA2D3B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { lstat } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { sha256 } from "../core/digest.js";
|
|
4
|
+
import { inspectProviderFile } from "../core/provider-file-identity.js";
|
|
5
|
+
import { CLAUDE_CHANGELOG_CACHE_MIN_AGE_MINUTES, CLAUDE_CHANGELOG_CACHE_POLICY_ID, } from "../core/provider-file-policy.js";
|
|
6
|
+
function isMissing(error) {
|
|
7
|
+
return (error instanceof Error && "code" in error && error.code === "ENOENT");
|
|
8
|
+
}
|
|
9
|
+
export async function collectClaudeChangelogCache(context, ownerRoot) {
|
|
10
|
+
const cacheRoot = join(ownerRoot, "cache");
|
|
11
|
+
const path = join(cacheRoot, "changelog.md");
|
|
12
|
+
try {
|
|
13
|
+
const cacheStats = await lstat(cacheRoot);
|
|
14
|
+
if (cacheStats.isSymbolicLink() || !cacheStats.isDirectory()) {
|
|
15
|
+
return { resources: [], diagnostics: [] };
|
|
16
|
+
}
|
|
17
|
+
const stats = await lstat(path);
|
|
18
|
+
const cutoffMs = context.now.getTime() - CLAUDE_CHANGELOG_CACHE_MIN_AGE_MINUTES * 60_000;
|
|
19
|
+
if (!stats.isFile() || stats.isSymbolicLink() || stats.mtimeMs > cutoffMs) {
|
|
20
|
+
return { resources: [], diagnostics: [] };
|
|
21
|
+
}
|
|
22
|
+
const identity = await inspectProviderFile(path, ownerRoot, "claude");
|
|
23
|
+
const canonicalKey = `claude:changelog-cache:${identity.path}`;
|
|
24
|
+
return {
|
|
25
|
+
resources: [
|
|
26
|
+
{
|
|
27
|
+
resource: {
|
|
28
|
+
id: `claude:agent-cache:${sha256(canonicalKey)}`,
|
|
29
|
+
adapter: "claude",
|
|
30
|
+
kind: "agent-cache",
|
|
31
|
+
canonicalKey,
|
|
32
|
+
displayName: "Claude changelog cache",
|
|
33
|
+
path: identity.path,
|
|
34
|
+
},
|
|
35
|
+
observedAt: context.now.toISOString(),
|
|
36
|
+
exists: true,
|
|
37
|
+
measuredBytes: identity.measuredBytes,
|
|
38
|
+
facts: {
|
|
39
|
+
reportOnly: false,
|
|
40
|
+
maintenanceAction: "provider.file-quarantine",
|
|
41
|
+
policyId: CLAUDE_CHANGELOG_CACHE_POLICY_ID,
|
|
42
|
+
minAgeMinutes: CLAUDE_CHANGELOG_CACHE_MIN_AGE_MINUTES,
|
|
43
|
+
providerFileIdentity: identity,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
diagnostics: [],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (isMissing(error)) {
|
|
52
|
+
return { resources: [], diagnostics: [] };
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
resources: [],
|
|
56
|
+
diagnostics: [
|
|
57
|
+
{
|
|
58
|
+
severity: "warning",
|
|
59
|
+
code: "CLAUDE_CHANGELOG_CACHE_INSPECTION_FAILED",
|
|
60
|
+
message: error instanceof Error ? error.message : String(error),
|
|
61
|
+
adapter: "claude",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=claude-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-cache.js","sourceRoot":"","sources":["../../src/adapters/claude-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,sCAAsC,EACtC,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AAEzC,SAAS,SAAS,CAA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C,CA6F3B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { lstat, readdir } from "node:fs/promises";
|
|
2
|
+
import { basename, join } from "node:path";
|
|
3
|
+
import { sha256 } from "../core/digest.js";
|
|
4
|
+
import { inspectProviderFile } from "../core/provider-file-identity.js";
|
|
5
|
+
import { CLAUDE_DEBUG_LOG_MIN_AGE_MINUTES, CLAUDE_DEBUG_LOG_POLICY_ID, isClaudeDebugLogRelativePath, } from "../core/provider-file-policy.js";
|
|
6
|
+
function isMissing(error) {
|
|
7
|
+
return (error instanceof Error && "code" in error && error.code === "ENOENT");
|
|
8
|
+
}
|
|
9
|
+
export async function collectClaudeDebugLogs(context, ownerRoot, maxEntries) {
|
|
10
|
+
const debugRoot = join(ownerRoot, "debug");
|
|
11
|
+
const diagnostics = [];
|
|
12
|
+
let entries;
|
|
13
|
+
try {
|
|
14
|
+
const rootStats = await lstat(debugRoot);
|
|
15
|
+
if (rootStats.isSymbolicLink() || !rootStats.isDirectory()) {
|
|
16
|
+
return { resources: [], diagnostics };
|
|
17
|
+
}
|
|
18
|
+
entries = await readdir(debugRoot, { withFileTypes: true });
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (isMissing(error)) {
|
|
22
|
+
return { resources: [], diagnostics };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
resources: [],
|
|
26
|
+
diagnostics: [
|
|
27
|
+
{
|
|
28
|
+
severity: "warning",
|
|
29
|
+
code: "CLAUDE_DEBUG_ENUMERATION_FAILED",
|
|
30
|
+
message: error instanceof Error ? error.message : String(error),
|
|
31
|
+
adapter: "claude",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (entries.length > maxEntries) {
|
|
37
|
+
return {
|
|
38
|
+
resources: [],
|
|
39
|
+
diagnostics: [
|
|
40
|
+
{
|
|
41
|
+
severity: "warning",
|
|
42
|
+
code: "CLAUDE_DEBUG_ENUMERATION_TRUNCATED",
|
|
43
|
+
message: `Claude debug cleanup requires at most ${maxEntries} direct entries`,
|
|
44
|
+
adapter: "claude",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const cutoffMs = context.now.getTime() - CLAUDE_DEBUG_LOG_MIN_AGE_MINUTES * 60_000;
|
|
50
|
+
const resources = [];
|
|
51
|
+
for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
52
|
+
context.signal?.throwIfAborted();
|
|
53
|
+
const path = join(debugRoot, entry.name);
|
|
54
|
+
const relativePath = join("debug", entry.name);
|
|
55
|
+
if (!isClaudeDebugLogRelativePath(relativePath)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const stats = await lstat(path);
|
|
60
|
+
if (!stats.isFile() || stats.isSymbolicLink() || stats.mtimeMs > cutoffMs) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const identity = await inspectProviderFile(path, ownerRoot, "claude");
|
|
64
|
+
const canonicalKey = `claude:debug-log:${identity.path}`;
|
|
65
|
+
resources.push({
|
|
66
|
+
resource: {
|
|
67
|
+
id: `claude:agent-log-store:${sha256(canonicalKey)}`,
|
|
68
|
+
adapter: "claude",
|
|
69
|
+
kind: "agent-log-store",
|
|
70
|
+
canonicalKey,
|
|
71
|
+
displayName: `Claude debug log ${basename(identity.path)}`,
|
|
72
|
+
path: identity.path,
|
|
73
|
+
},
|
|
74
|
+
observedAt: context.now.toISOString(),
|
|
75
|
+
exists: true,
|
|
76
|
+
measuredBytes: identity.measuredBytes,
|
|
77
|
+
facts: {
|
|
78
|
+
reportOnly: false,
|
|
79
|
+
maintenanceAction: "provider.file-quarantine",
|
|
80
|
+
policyId: CLAUDE_DEBUG_LOG_POLICY_ID,
|
|
81
|
+
minAgeMinutes: CLAUDE_DEBUG_LOG_MIN_AGE_MINUTES,
|
|
82
|
+
providerFileIdentity: identity,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (isMissing(error)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
diagnostics.push({
|
|
91
|
+
severity: "warning",
|
|
92
|
+
code: "CLAUDE_DEBUG_FILE_INSPECTION_FAILED",
|
|
93
|
+
message: error instanceof Error ? error.message : String(error),
|
|
94
|
+
adapter: "claude",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { resources, diagnostics };
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=claude-debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-debug.js","sourceRoot":"","sources":["../../src/adapters/claude-debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,CACL,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,CAChG,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAqB,EACrB,SAAiB,EACjB,UAAkB;IAElB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAoC,EAAE,CAAC;IACxD,IAAI,OAAyB,CAAC;IAE9B,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,SAA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,aAAa,EAAE,gCAAgC;oBAC/C,oBAAoB,EAAE,QAAQ;iBAC/B;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,WAAW,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,qCAAqC;gBAC3C,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC/D,OAAO,EAAE,QAAQ;aAClB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
2
|
+
import { type FileHandle } from "node:fs/promises";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import type { Diagnostic } from "../contracts/diagnostic.js";
|
|
5
|
+
export declare const CLAUDE_NATIVE_RETENTION_DEFAULT_DAYS = 30;
|
|
6
|
+
export declare const claudeNativeRetentionFactsSchema: z.ZodObject<{
|
|
7
|
+
mechanism: z.ZodLiteral<"cleanupPeriodDays">;
|
|
8
|
+
documentedDefaultDays: z.ZodLiteral<30>;
|
|
9
|
+
startupSweep: z.ZodLiteral<true>;
|
|
10
|
+
effectiveDaysKnown: z.ZodLiteral<false>;
|
|
11
|
+
userSettingsStatus: z.ZodEnum<{
|
|
12
|
+
changed: "changed";
|
|
13
|
+
invalid: "invalid";
|
|
14
|
+
missing: "missing";
|
|
15
|
+
"too-large": "too-large";
|
|
16
|
+
unreadable: "unreadable";
|
|
17
|
+
unsupported: "unsupported";
|
|
18
|
+
unverified: "unverified";
|
|
19
|
+
valid: "valid";
|
|
20
|
+
}>;
|
|
21
|
+
userConfiguredDays: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type ClaudeNativeRetentionFacts = z.infer<typeof claudeNativeRetentionFactsSchema>;
|
|
24
|
+
type SettingsFileHandle = Pick<FileHandle, "close" | "read" | "stat">;
|
|
25
|
+
export type ClaudeRetentionDependencies = {
|
|
26
|
+
lstat(path: string): Promise<Stats>;
|
|
27
|
+
open(path: string, flags: number): Promise<SettingsFileHandle>;
|
|
28
|
+
};
|
|
29
|
+
export type ClaudeRetentionInspection = {
|
|
30
|
+
facts: ClaudeNativeRetentionFacts;
|
|
31
|
+
diagnostics: Diagnostic[];
|
|
32
|
+
};
|
|
33
|
+
export declare function usesClaudeNativeRetention(relativePath: string): boolean;
|
|
34
|
+
export declare function inspectClaudeNativeRetention(ownerRoot: string, platform?: NodeJS.Platform, dependencies?: ClaudeRetentionDependencies): Promise<ClaudeRetentionInspection>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=claude-retention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-retention.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAEvD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;iBAgB3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,KAAK,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,0BAA0B,CAAC;IAClC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AA0EF,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED,wBAAsB,4BAA4B,CAChD,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,YAAY,GAAE,2BAAkD,GAC/D,OAAO,CAAC,yBAAyB,CAAC,CAyIpC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { lstat, open } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const MAX_SETTINGS_BYTES = 1024 * 1024;
|
|
6
|
+
export const CLAUDE_NATIVE_RETENTION_DEFAULT_DAYS = 30;
|
|
7
|
+
export const claudeNativeRetentionFactsSchema = z.object({
|
|
8
|
+
mechanism: z.literal("cleanupPeriodDays"),
|
|
9
|
+
documentedDefaultDays: z.literal(CLAUDE_NATIVE_RETENTION_DEFAULT_DAYS),
|
|
10
|
+
startupSweep: z.literal(true),
|
|
11
|
+
effectiveDaysKnown: z.literal(false),
|
|
12
|
+
userSettingsStatus: z.enum([
|
|
13
|
+
"missing",
|
|
14
|
+
"valid",
|
|
15
|
+
"invalid",
|
|
16
|
+
"changed",
|
|
17
|
+
"unreadable",
|
|
18
|
+
"unsupported",
|
|
19
|
+
"too-large",
|
|
20
|
+
"unverified",
|
|
21
|
+
]),
|
|
22
|
+
userConfiguredDays: z.number().int().min(1).optional(),
|
|
23
|
+
});
|
|
24
|
+
const DEFAULT_DEPENDENCIES = {
|
|
25
|
+
lstat,
|
|
26
|
+
open,
|
|
27
|
+
};
|
|
28
|
+
const NATIVE_RETENTION_PATHS = new Set(["projects", "debug", "paste-cache", "image-cache"]);
|
|
29
|
+
function isMissing(error) {
|
|
30
|
+
return (error instanceof Error && "code" in error && error.code === "ENOENT");
|
|
31
|
+
}
|
|
32
|
+
function stableStats(before, after) {
|
|
33
|
+
return (before.dev === after.dev &&
|
|
34
|
+
before.ino === after.ino &&
|
|
35
|
+
before.mode === after.mode &&
|
|
36
|
+
before.mtimeMs === after.mtimeMs &&
|
|
37
|
+
before.ctimeMs === after.ctimeMs &&
|
|
38
|
+
before.size === after.size);
|
|
39
|
+
}
|
|
40
|
+
async function readBoundedSettings(handle) {
|
|
41
|
+
const buffer = Buffer.allocUnsafe(MAX_SETTINGS_BYTES + 1);
|
|
42
|
+
let offset = 0;
|
|
43
|
+
while (offset < buffer.length) {
|
|
44
|
+
const result = await handle.read(buffer, offset, buffer.length - offset, offset);
|
|
45
|
+
if (result.bytesRead === 0) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
offset += result.bytesRead;
|
|
49
|
+
}
|
|
50
|
+
if (offset > MAX_SETTINGS_BYTES) {
|
|
51
|
+
return { overflow: true };
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
contents: buffer.subarray(0, offset).toString("utf8"),
|
|
55
|
+
overflow: false,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function inspection(userSettingsStatus, diagnostics = [], userConfiguredDays) {
|
|
59
|
+
return {
|
|
60
|
+
facts: {
|
|
61
|
+
mechanism: "cleanupPeriodDays",
|
|
62
|
+
documentedDefaultDays: CLAUDE_NATIVE_RETENTION_DEFAULT_DAYS,
|
|
63
|
+
startupSweep: true,
|
|
64
|
+
effectiveDaysKnown: false,
|
|
65
|
+
userSettingsStatus,
|
|
66
|
+
...(userConfiguredDays === undefined ? {} : { userConfiguredDays }),
|
|
67
|
+
},
|
|
68
|
+
diagnostics,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function warning(code, message) {
|
|
72
|
+
return {
|
|
73
|
+
severity: "warning",
|
|
74
|
+
code,
|
|
75
|
+
message,
|
|
76
|
+
adapter: "claude",
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export function usesClaudeNativeRetention(relativePath) {
|
|
80
|
+
return NATIVE_RETENTION_PATHS.has(relativePath);
|
|
81
|
+
}
|
|
82
|
+
export async function inspectClaudeNativeRetention(ownerRoot, platform = process.platform, dependencies = DEFAULT_DEPENDENCIES) {
|
|
83
|
+
const settingsPath = join(ownerRoot, "settings.json");
|
|
84
|
+
let entryStats;
|
|
85
|
+
try {
|
|
86
|
+
entryStats = await dependencies.lstat(settingsPath);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (isMissing(error)) {
|
|
90
|
+
return inspection("missing");
|
|
91
|
+
}
|
|
92
|
+
return inspection("unreadable", [
|
|
93
|
+
warning("CLAUDE_RETENTION_SETTINGS_UNREADABLE", "Claude user settings could not be inspected; native retention is uncertain."),
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
if (entryStats.isSymbolicLink() || !entryStats.isFile()) {
|
|
97
|
+
return inspection("unsupported", [
|
|
98
|
+
warning("CLAUDE_RETENTION_SETTINGS_UNSUPPORTED", "Claude user settings are not a direct regular file; native retention is uncertain."),
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
if (entryStats.size > MAX_SETTINGS_BYTES) {
|
|
102
|
+
return inspection("too-large", [
|
|
103
|
+
warning("CLAUDE_RETENTION_SETTINGS_TOO_LARGE", "Claude user settings exceed the inspection limit; native retention is uncertain."),
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
let handle;
|
|
107
|
+
try {
|
|
108
|
+
const flags = platform === "win32" ? constants.O_RDONLY : constants.O_RDONLY | constants.O_NOFOLLOW;
|
|
109
|
+
handle = await dependencies.open(settingsPath, flags);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return inspection("unreadable", [
|
|
113
|
+
warning("CLAUDE_RETENTION_SETTINGS_UNREADABLE", "Claude user settings could not be opened safely; native retention is uncertain."),
|
|
114
|
+
]);
|
|
115
|
+
}
|
|
116
|
+
let contents;
|
|
117
|
+
try {
|
|
118
|
+
const before = await handle.stat();
|
|
119
|
+
if (!before.isFile() || !stableStats(entryStats, before) || before.size > MAX_SETTINGS_BYTES) {
|
|
120
|
+
return inspection("changed", [
|
|
121
|
+
warning("CLAUDE_RETENTION_SETTINGS_CHANGED", "Claude user settings changed during inspection; native retention is uncertain."),
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
const boundedRead = await readBoundedSettings(handle);
|
|
125
|
+
const after = await handle.stat();
|
|
126
|
+
if (!stableStats(before, after)) {
|
|
127
|
+
return inspection("changed", [
|
|
128
|
+
warning("CLAUDE_RETENTION_SETTINGS_CHANGED", "Claude user settings changed during inspection; native retention is uncertain."),
|
|
129
|
+
]);
|
|
130
|
+
}
|
|
131
|
+
if (boundedRead.overflow || boundedRead.contents === undefined) {
|
|
132
|
+
return inspection("too-large", [
|
|
133
|
+
warning("CLAUDE_RETENTION_SETTINGS_TOO_LARGE", "Claude user settings exceed the inspection limit; native retention is uncertain."),
|
|
134
|
+
]);
|
|
135
|
+
}
|
|
136
|
+
contents = boundedRead.contents;
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return inspection("unreadable", [
|
|
140
|
+
warning("CLAUDE_RETENTION_SETTINGS_UNREADABLE", "Claude user settings could not be read safely; native retention is uncertain."),
|
|
141
|
+
]);
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
await handle.close().catch(() => undefined);
|
|
145
|
+
}
|
|
146
|
+
let value;
|
|
147
|
+
try {
|
|
148
|
+
value = JSON.parse(contents.replace(/^\uFEFF/u, ""));
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return inspection("invalid", [
|
|
152
|
+
warning("CLAUDE_RETENTION_SETTINGS_INVALID", "Claude user settings are not valid JSON; Claude may pause its native retention sweep."),
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
156
|
+
return inspection("invalid", [
|
|
157
|
+
warning("CLAUDE_RETENTION_SETTINGS_INVALID", "Claude user settings must be a JSON object; Claude may pause its native retention sweep."),
|
|
158
|
+
]);
|
|
159
|
+
}
|
|
160
|
+
const settings = value;
|
|
161
|
+
const cleanupPeriodDays = settings.cleanupPeriodDays;
|
|
162
|
+
if (cleanupPeriodDays !== undefined &&
|
|
163
|
+
(!Number.isInteger(cleanupPeriodDays) || cleanupPeriodDays < 1)) {
|
|
164
|
+
return inspection("invalid", [
|
|
165
|
+
warning("CLAUDE_RETENTION_SETTINGS_INVALID", "Claude cleanupPeriodDays must be an integer of at least 1; native retention is uncertain."),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
const userConfiguredDays = cleanupPeriodDays === undefined ? undefined : cleanupPeriodDays;
|
|
169
|
+
if (Object.keys(settings).some((key) => key !== "cleanupPeriodDays")) {
|
|
170
|
+
return inspection("unverified", [
|
|
171
|
+
warning("CLAUDE_RETENTION_SETTINGS_UNVERIFIED", "Claude user settings contain fields AgentRinse does not validate; native retention is uncertain."),
|
|
172
|
+
], userConfiguredDays);
|
|
173
|
+
}
|
|
174
|
+
return inspection("valid", [], userConfiguredDays);
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=claude-retention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-retention.js","sourceRoot":"","sources":["../../src/adapters/claude-retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAmB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,IAAI,EAA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