@loksly/agent-sessions 0.2.7 → 0.2.9
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 +9 -1
- package/dist/hook.js +7 -0
- package/package.json +2 -2
- package/src/hook.ts +7 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @loksly/agent-sessions
|
|
2
2
|
|
|
3
3
|
A tiny file protocol for the state of your AI coding sessions (Claude Code,
|
|
4
|
-
Gemini CLI, …), so that anything can show which session needs you: an LCD
|
|
4
|
+
Gemini CLI, Codex CLI, Qwen Code, Kimi CLI, …), so that anything can show which session needs you: an LCD
|
|
5
5
|
panel, a status bar, a tmux segment, a microcontroller on your desk.
|
|
6
6
|
|
|
7
7
|
- **A hook** (`agent-sessions-hook`) that your CLI calls on every event. It
|
|
@@ -65,6 +65,7 @@ npm install -g @loksly/agent-sessions
|
|
|
65
65
|
"PostToolUse": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
66
66
|
"PostToolUseFailure": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
67
67
|
"Notification": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
68
|
+
"PermissionRequest": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
68
69
|
"Stop": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
69
70
|
"SubagentStop": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
70
71
|
"PreCompact": [{ "hooks": [{ "type": "command", "command": "agent-sessions-hook", "timeout": 5 }] }],
|
|
@@ -75,6 +76,13 @@ npm install -g @loksly/agent-sessions
|
|
|
75
76
|
|
|
76
77
|
**Gemini CLI**: the same command with `--provider gemini`.
|
|
77
78
|
|
|
79
|
+
**Codex CLI**, **Qwen Code** and **Kimi CLI**: the same command with
|
|
80
|
+
`--provider codex`, `--provider qwen` or `--provider kimi`, on the events each
|
|
81
|
+
one has (see their hooks documentation; kiosko-plugin-agents' README has
|
|
82
|
+
ready-to-paste snippets). `PermissionRequest` marks the session as waiting for
|
|
83
|
+
your permission, with the tool it wants to run; Codex has no Notification
|
|
84
|
+
event, so it is the one to hook there.
|
|
85
|
+
|
|
78
86
|
## Reading it
|
|
79
87
|
|
|
80
88
|
```ts
|
package/dist/hook.js
CHANGED
|
@@ -80,6 +80,13 @@ export function handleEvent(provider, data, prev, now, cwd = process.cwd()) {
|
|
|
80
80
|
detail = arg ? `${e.tool}: ${arg}` : e.tool;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
|
+
case 'PermissionRequest': {
|
|
84
|
+
// Claude Code, Codex CLI and Qwen Code ask before running a tool: blocked on you, with what it wants to run.
|
|
85
|
+
state = 'permission';
|
|
86
|
+
const arg = summarizeToolInput(e.toolInput);
|
|
87
|
+
detail = arg ? `${e.tool}: ${arg}` : e.tool || e.fallback;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
83
90
|
case 'Notification': {
|
|
84
91
|
// Documented matchers: permission_prompt | idle_prompt | auth_success |
|
|
85
92
|
// elicitation_* | agent_*.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loksly/agent-sessions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "A tiny file protocol for the state of AI coding sessions (Claude Code, Gemini CLI…): a zero-dependency hook that writes it and helpers to read it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"author": "Loksly",
|
|
7
|
+
"author": "Loksly <info@kioskolcd.dev> (https://kioskolcd.dev)",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/Loksly/aimonitor.git",
|
package/src/hook.ts
CHANGED
|
@@ -85,6 +85,13 @@ export function handleEvent(provider: string, data: Record<string, any>, prev: S
|
|
|
85
85
|
detail = arg ? `${e.tool}: ${arg}` : e.tool;
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
+
case 'PermissionRequest': {
|
|
89
|
+
// Claude Code, Codex CLI and Qwen Code ask before running a tool: blocked on you, with what it wants to run.
|
|
90
|
+
state = 'permission';
|
|
91
|
+
const arg = summarizeToolInput(e.toolInput);
|
|
92
|
+
detail = arg ? `${e.tool}: ${arg}` : e.tool || e.fallback;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
88
95
|
case 'Notification': {
|
|
89
96
|
// Documented matchers: permission_prompt | idle_prompt | auth_success |
|
|
90
97
|
// elicitation_* | agent_*.
|