coder-config 0.42.40 → 0.43.1
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/hooks/session-start.sh +23 -1
- package/lib/constants.js +1 -1
- package/lib/workstreams.js +8 -2
- package/package.json +1 -1
package/hooks/session-start.sh
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Session Start Hook - Restore context
|
|
2
|
+
# Session Start Hook - Restore context and inject workstream
|
|
3
3
|
# Context is stored in .claude/session-context.md (project-local)
|
|
4
4
|
|
|
5
|
+
# Inject workstream context (auto-detects from current directory)
|
|
6
|
+
# Use script's directory to find coder-config
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
CODER_CONFIG="$SCRIPT_DIR/../cli.js"
|
|
9
|
+
|
|
10
|
+
if [ -f "$CODER_CONFIG" ]; then
|
|
11
|
+
WORKSTREAM_CONTEXT=$(node "$CODER_CONFIG" workstream inject --silent 2>/dev/null)
|
|
12
|
+
if [ -n "$WORKSTREAM_CONTEXT" ]; then
|
|
13
|
+
echo "<workstream-context>"
|
|
14
|
+
echo "$WORKSTREAM_CONTEXT"
|
|
15
|
+
echo "</workstream-context>"
|
|
16
|
+
fi
|
|
17
|
+
elif command -v coder-config &> /dev/null; then
|
|
18
|
+
WORKSTREAM_CONTEXT=$(coder-config workstream inject --silent 2>/dev/null)
|
|
19
|
+
if [ -n "$WORKSTREAM_CONTEXT" ]; then
|
|
20
|
+
echo "<workstream-context>"
|
|
21
|
+
echo "$WORKSTREAM_CONTEXT"
|
|
22
|
+
echo "</workstream-context>"
|
|
23
|
+
fi
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Restore session context from previous session
|
|
5
27
|
PROJECT_CONTEXT=".claude/session-context.md"
|
|
6
28
|
|
|
7
29
|
if [ -f "$PROJECT_CONTEXT" ]; then
|
package/lib/constants.js
CHANGED
package/lib/workstreams.js
CHANGED
|
@@ -254,7 +254,7 @@ function workstreamRemoveProject(installDir, idOrName, projectPath) {
|
|
|
254
254
|
/**
|
|
255
255
|
* Get active workstream - checks env var first, then falls back to file
|
|
256
256
|
*/
|
|
257
|
-
function getActiveWorkstream(installDir) {
|
|
257
|
+
function getActiveWorkstream(installDir, autoDetect = true) {
|
|
258
258
|
const data = loadWorkstreams(installDir);
|
|
259
259
|
|
|
260
260
|
// Check env var first (per-session activation)
|
|
@@ -267,7 +267,13 @@ function getActiveWorkstream(installDir) {
|
|
|
267
267
|
if (ws) return ws;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
//
|
|
270
|
+
// Auto-detect from current directory (takes precedence over global active)
|
|
271
|
+
if (autoDetect) {
|
|
272
|
+
const detected = workstreamDetect(installDir, process.cwd());
|
|
273
|
+
if (detected) return detected;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Fall back to file-based activeId (global active workstream)
|
|
271
277
|
return data.workstreams.find(w => w.id === data.activeId) || null;
|
|
272
278
|
}
|
|
273
279
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.1",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|