refocus 0.7.0__tar.gz

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.
refocus-0.7.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrew Park
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
refocus-0.7.0/PKG-INFO ADDED
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: refocus
3
+ Version: 0.7.0
4
+ Summary: Universal agent activity ledger. Records what AI agents do.
5
+ Author: Andrew Park
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/aardpark/inscript
8
+ Keywords: ai,agent,context,mcp,claude,session,tracking
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # inscript
22
+
23
+ Universal agent activity ledger.
24
+
25
+ When an AI agent works on code, **inscript** records everything: which project, which files, what changed. Any tool can read `~/.inscript/` for context.
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ pip install inscript
31
+ ```
32
+
33
+ ## What it records
34
+
35
+ ```
36
+ ~/.inscript/
37
+ active_project ← which codebase right now
38
+ active_session ← current session ID
39
+ config.toml ← retention policy
40
+ sessions/
41
+ <session-id>/
42
+ meta.json ← start time, project, status
43
+ touches.jsonl ← every file read/edit/write
44
+ diffs.jsonl ← raw changes (Edit old→new, Write content hash)
45
+ summary.json ← stats written on session end
46
+ overlap/
47
+ <project-hash>.jsonl ← when 2+ sessions touch the same files
48
+ ```
49
+
50
+ ## Setup
51
+
52
+ ```bash
53
+ inscript init # configure retention, storage, diffs
54
+ ```
55
+
56
+ Then add hooks to `~/.claude/settings.json`:
57
+
58
+ ```json
59
+ {
60
+ "hooks": {
61
+ "SessionStart": [
62
+ {
63
+ "hooks": [{ "type": "command", "command": "inscript-hook" }]
64
+ }
65
+ ],
66
+ "PostToolUse": [
67
+ {
68
+ "matcher": "Read|Edit|Write|Glob|Grep",
69
+ "hooks": [{ "type": "command", "command": "inscript-hook", "async": true }]
70
+ }
71
+ ],
72
+ "Stop": [
73
+ {
74
+ "hooks": [{ "type": "command", "command": "inscript-hook" }]
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## CLI
82
+
83
+ ```bash
84
+ inscript # status: active project + session
85
+ inscript log # activity log for current session
86
+ inscript log <id> # activity log for a specific session
87
+ inscript overlap # show file collisions across sessions
88
+ inscript export <id> # export session as markdown
89
+ inscript cleanup # enforce retention policy
90
+ inscript init # setup wizard
91
+ ```
92
+
93
+ ## Python API
94
+
95
+ ```python
96
+ from inscript_pkg import active_project, active_session, list_sessions
97
+
98
+ project = active_project() # Path or None
99
+ session = active_session() # session ID or None
100
+ all_sessions = list_sessions() # [{session_id, start_time, project, status}, ...]
101
+ ```
102
+
103
+ ## How it works
104
+
105
+ Three Claude Code hooks write to `~/.inscript/`:
106
+
107
+ - **SessionStart** → creates `sessions/<id>/meta.json`
108
+ - **PostToolUse** → appends to `touches.jsonl` and `diffs.jsonl`
109
+ - **Stop** → writes `summary.json` with session stats
110
+
111
+ Any MCP server, script, or tool can read these files. No coordination needed. The agent doesn't know inscript exists.
112
+
113
+ ## Overlap detection
114
+
115
+ When two Claude Code sessions work on the same project simultaneously, inscript records which files both sessions touch. Run `inscript overlap` to see collisions.
@@ -0,0 +1,95 @@
1
+ # inscript
2
+
3
+ Universal agent activity ledger.
4
+
5
+ When an AI agent works on code, **inscript** records everything: which project, which files, what changed. Any tool can read `~/.inscript/` for context.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install inscript
11
+ ```
12
+
13
+ ## What it records
14
+
15
+ ```
16
+ ~/.inscript/
17
+ active_project ← which codebase right now
18
+ active_session ← current session ID
19
+ config.toml ← retention policy
20
+ sessions/
21
+ <session-id>/
22
+ meta.json ← start time, project, status
23
+ touches.jsonl ← every file read/edit/write
24
+ diffs.jsonl ← raw changes (Edit old→new, Write content hash)
25
+ summary.json ← stats written on session end
26
+ overlap/
27
+ <project-hash>.jsonl ← when 2+ sessions touch the same files
28
+ ```
29
+
30
+ ## Setup
31
+
32
+ ```bash
33
+ inscript init # configure retention, storage, diffs
34
+ ```
35
+
36
+ Then add hooks to `~/.claude/settings.json`:
37
+
38
+ ```json
39
+ {
40
+ "hooks": {
41
+ "SessionStart": [
42
+ {
43
+ "hooks": [{ "type": "command", "command": "inscript-hook" }]
44
+ }
45
+ ],
46
+ "PostToolUse": [
47
+ {
48
+ "matcher": "Read|Edit|Write|Glob|Grep",
49
+ "hooks": [{ "type": "command", "command": "inscript-hook", "async": true }]
50
+ }
51
+ ],
52
+ "Stop": [
53
+ {
54
+ "hooks": [{ "type": "command", "command": "inscript-hook" }]
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## CLI
62
+
63
+ ```bash
64
+ inscript # status: active project + session
65
+ inscript log # activity log for current session
66
+ inscript log <id> # activity log for a specific session
67
+ inscript overlap # show file collisions across sessions
68
+ inscript export <id> # export session as markdown
69
+ inscript cleanup # enforce retention policy
70
+ inscript init # setup wizard
71
+ ```
72
+
73
+ ## Python API
74
+
75
+ ```python
76
+ from inscript_pkg import active_project, active_session, list_sessions
77
+
78
+ project = active_project() # Path or None
79
+ session = active_session() # session ID or None
80
+ all_sessions = list_sessions() # [{session_id, start_time, project, status}, ...]
81
+ ```
82
+
83
+ ## How it works
84
+
85
+ Three Claude Code hooks write to `~/.inscript/`:
86
+
87
+ - **SessionStart** → creates `sessions/<id>/meta.json`
88
+ - **PostToolUse** → appends to `touches.jsonl` and `diffs.jsonl`
89
+ - **Stop** → writes `summary.json` with session stats
90
+
91
+ Any MCP server, script, or tool can read these files. No coordination needed. The agent doesn't know inscript exists.
92
+
93
+ ## Overlap detection
94
+
95
+ When two Claude Code sessions work on the same project simultaneously, inscript records which files both sessions touch. Run `inscript overlap` to see collisions.