@jxtools/promptline 1.3.4 → 1.3.6

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.
@@ -70,6 +70,20 @@ if (!allHooksInstalled) {
70
70
  }
71
71
 
72
72
  installHooks()
73
+ } else {
74
+ const hooksOutdated = hookFiles.some(f => {
75
+ try {
76
+ const src = readFileSync(join(pkgDir, f), 'utf-8')
77
+ const dest = readFileSync(join(hooksDir, f), 'utf-8')
78
+ return src !== dest
79
+ } catch {
80
+ return true
81
+ }
82
+ })
83
+
84
+ if (hooksOutdated) {
85
+ installHooks()
86
+ }
73
87
  }
74
88
 
75
89
  // Start Vite dev server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxtools/promptline",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -39,8 +39,10 @@ if [ -n "$EXISTING" ]; then
39
39
  PROJECT=$(basename "$(dirname "$EXISTING")")
40
40
  QUEUE_DIR="$(dirname "$EXISTING")"
41
41
  else
42
- # No session file -> nothing to do
43
- exit 0
42
+ PROJECT=$(basename "$CWD")
43
+ QUEUE_DIR="$QUEUES_BASE/$PROJECT"
44
+ QUEUE_FILE="$QUEUE_DIR/$SESSION_ID.json"
45
+ mkdir -p "$QUEUE_DIR"
44
46
  fi
45
47
 
46
48
  export QUEUE_FILE SESSION_ID CWD PROJECT TRANSCRIPT_PATH STOP_HOOK_ACTIVE
@@ -99,7 +101,27 @@ queue_file = os.environ.get("QUEUE_FILE", "")
99
101
  session_id = os.environ.get("SESSION_ID", "")
100
102
  transcript_path = os.environ.get("TRANSCRIPT_PATH", "")
101
103
 
102
- if not queue_file or not os.path.isfile(queue_file):
104
+ if not queue_file:
105
+ print("STOP")
106
+ sys.exit(0)
107
+
108
+ if not os.path.isfile(queue_file):
109
+ cwd = os.environ.get("CWD", "")
110
+ project = os.environ.get("PROJECT", "")
111
+ now = datetime.now(timezone.utc).isoformat()
112
+ data = {
113
+ "sessionId": session_id,
114
+ "project": project,
115
+ "directory": cwd,
116
+ "sessionName": extract_session_name(transcript_path),
117
+ "prompts": [],
118
+ "startedAt": now,
119
+ "lastActivity": now,
120
+ "currentPromptId": None,
121
+ "completedAt": None,
122
+ "closedAt": None,
123
+ }
124
+ atomic_write(queue_file, data)
103
125
  print("STOP")
104
126
  sys.exit(0)
105
127