instar 0.23.18 → 0.24.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/.claude/hooks/auto-approve-claude-edits.py +72 -0
- package/.claude/settings.json +65 -1
- package/dist/cli.js +0 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +769 -310
- package/dist/commands/init.js.map +1 -1
- package/dist/core/Config.d.ts.map +1 -1
- package/dist/core/Config.js +5 -3
- package/dist/core/Config.js.map +1 -1
- package/dist/core/ResponseReviewGate.d.ts +182 -0
- package/dist/core/ResponseReviewGate.d.ts.map +1 -0
- package/dist/core/ResponseReviewGate.js +956 -0
- package/dist/core/ResponseReviewGate.js.map +1 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +6 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/types.d.ts +5 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/monitoring/HomeostasisMonitor.d.ts +102 -0
- package/dist/monitoring/HomeostasisMonitor.d.ts.map +1 -0
- package/dist/monitoring/HomeostasisMonitor.js +185 -0
- package/dist/monitoring/HomeostasisMonitor.js.map +1 -0
- package/dist/monitoring/QuotaManager.d.ts +5 -0
- package/dist/monitoring/QuotaManager.d.ts.map +1 -1
- package/dist/monitoring/QuotaManager.js +23 -4
- package/dist/monitoring/QuotaManager.js.map +1 -1
- package/dist/monitoring/QuotaNotifier.js +4 -4
- package/dist/monitoring/QuotaNotifier.js.map +1 -1
- package/dist/monitoring/QuotaTracker.d.ts +3 -3
- package/dist/monitoring/QuotaTracker.js +3 -3
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +22 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/scheduler/JobScheduler.d.ts.map +1 -1
- package/dist/scheduler/JobScheduler.js +2 -1
- package/dist/scheduler/JobScheduler.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +42 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +2 -2
- package/src/data/builtin-manifest.json +142 -102
- package/src/templates/hooks/session-start.sh +5 -0
- package/upgrades/0.23.18.md +31 -3
- package/upgrades/0.24.0.md +41 -0
- package/upgrades/NEXT.md +35 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
PermissionRequest hook: Auto-approve operations that autonomous sessions need.
|
|
4
|
+
|
|
5
|
+
Claude Code v2.1.81+ prompts for confirmation on more operations than before,
|
|
6
|
+
blocking autonomous sessions. This hook auto-approves:
|
|
7
|
+
|
|
8
|
+
1. Edit/Write to .claude/ files (except settings.json/settings.local.json)
|
|
9
|
+
2. Read from known-safe directories outside the project (e.g. ~/.dawn-server/)
|
|
10
|
+
|
|
11
|
+
Safety:
|
|
12
|
+
- Does NOT approve settings.json or settings.local.json edits
|
|
13
|
+
- Read approvals are limited to an explicit allowlist of safe directories
|
|
14
|
+
"""
|
|
15
|
+
import json
|
|
16
|
+
import sys
|
|
17
|
+
import os
|
|
18
|
+
|
|
19
|
+
# Directories outside the project that are safe to read from
|
|
20
|
+
SAFE_READ_DIRS = [
|
|
21
|
+
os.path.expanduser("~/.dawn-server"),
|
|
22
|
+
os.path.expanduser("~/.claude"),
|
|
23
|
+
"/tmp/dawn-telegram",
|
|
24
|
+
"/tmp/dawn-",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
def allow():
|
|
28
|
+
"""Print the allow decision and exit."""
|
|
29
|
+
result = {
|
|
30
|
+
"hookSpecificOutput": {
|
|
31
|
+
"hookEventName": "PermissionRequest",
|
|
32
|
+
"decision": {
|
|
33
|
+
"behavior": "allow"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
print(json.dumps(result))
|
|
38
|
+
|
|
39
|
+
def main():
|
|
40
|
+
try:
|
|
41
|
+
input_data = json.loads(sys.stdin.read())
|
|
42
|
+
except (json.JSONDecodeError, EOFError):
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
tool_name = input_data.get("tool_name", "")
|
|
46
|
+
tool_input = input_data.get("tool_input", {})
|
|
47
|
+
|
|
48
|
+
file_path = tool_input.get("file_path", "") if isinstance(tool_input, dict) else str(tool_input)
|
|
49
|
+
|
|
50
|
+
# Handle Edit/Write to .claude/ files
|
|
51
|
+
if tool_name in ("Edit", "Write"):
|
|
52
|
+
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", "")
|
|
53
|
+
if project_dir and file_path.startswith(project_dir):
|
|
54
|
+
rel_path = file_path[len(project_dir):].lstrip("/")
|
|
55
|
+
else:
|
|
56
|
+
rel_path = file_path
|
|
57
|
+
|
|
58
|
+
if rel_path.startswith(".claude/"):
|
|
59
|
+
if rel_path in (".claude/settings.json", ".claude/settings.local.json"):
|
|
60
|
+
return
|
|
61
|
+
allow()
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
# Handle Read from known-safe directories
|
|
65
|
+
if tool_name == "Read":
|
|
66
|
+
for safe_dir in SAFE_READ_DIRS:
|
|
67
|
+
if file_path.startswith(safe_dir):
|
|
68
|
+
allow()
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
main()
|
package/.claude/settings.json
CHANGED
|
@@ -11,7 +11,71 @@
|
|
|
11
11
|
"timeout": 5000
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"matcher": "mcp__.*",
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "node .instar/hooks/instar/external-operation-gate.js",
|
|
21
|
+
"blocking": true,
|
|
22
|
+
"timeout": 5000
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"SessionStart": [
|
|
28
|
+
{
|
|
29
|
+
"matcher": "startup",
|
|
30
|
+
"hooks": [
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "bash .instar/hooks/instar/session-start.sh",
|
|
34
|
+
"timeout": 5
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"matcher": "resume",
|
|
40
|
+
"hooks": [
|
|
41
|
+
{
|
|
42
|
+
"type": "command",
|
|
43
|
+
"command": "bash .instar/hooks/instar/session-start.sh",
|
|
44
|
+
"timeout": 5
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"matcher": "compact",
|
|
50
|
+
"hooks": [
|
|
51
|
+
{
|
|
52
|
+
"type": "command",
|
|
53
|
+
"command": "bash .instar/hooks/instar/session-start.sh",
|
|
54
|
+
"timeout": 5
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"UserPromptSubmit": [
|
|
60
|
+
{
|
|
61
|
+
"matcher": "",
|
|
62
|
+
"hooks": [
|
|
63
|
+
{
|
|
64
|
+
"type": "command",
|
|
65
|
+
"command": "bash .instar/hooks/instar/telegram-topic-context.sh",
|
|
66
|
+
"timeout": 5000
|
|
67
|
+
}
|
|
68
|
+
]
|
|
14
69
|
}
|
|
15
70
|
]
|
|
71
|
+
},
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"playwright": {
|
|
74
|
+
"command": "npx",
|
|
75
|
+
"args": [
|
|
76
|
+
"-y",
|
|
77
|
+
"@playwright/mcp@latest"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
16
80
|
}
|
|
17
|
-
}
|
|
81
|
+
}
|
package/dist/cli.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AA4BH,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBrE;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AA4BH,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBrE;AAgzFD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAMlF"}
|