@kraftapps-ai/kai 1.5.0 → 1.5.3
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/kai +23 -9
- package/package.json +1 -1
package/kai
CHANGED
|
@@ -15,19 +15,26 @@ if [ "${1:-}" = "--version" ] || [ "${1:-}" = "-v" ]; then
|
|
|
15
15
|
exit 0
|
|
16
16
|
fi
|
|
17
17
|
|
|
18
|
+
PRD_FILE=".kai/stories.json"
|
|
19
|
+
PROGRESS_FILE=".kai/progress.txt"
|
|
20
|
+
PROMPT_FILE=".kai/PROMPT.md"
|
|
21
|
+
MEMORY_FILE=".kai/memory.md"
|
|
22
|
+
SESSION_FILE=".kai/session_id"
|
|
23
|
+
LOOP_SCRIPT=".kai/loop.sh"
|
|
24
|
+
|
|
18
25
|
# ── Handle --new flag ─────────────────────────────────
|
|
19
26
|
|
|
20
|
-
USE_CONTINUE=true
|
|
21
27
|
if [ "${1:-}" = "--new" ]; then
|
|
22
|
-
|
|
28
|
+
rm -f "$SESSION_FILE"
|
|
23
29
|
shift
|
|
24
30
|
fi
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
# ── Ensure .kai/ is git-ignored ───────────────────────
|
|
33
|
+
|
|
34
|
+
mkdir -p .kai
|
|
35
|
+
if [ ! -f ".kai/.gitignore" ]; then
|
|
36
|
+
echo "*" > .kai/.gitignore
|
|
37
|
+
fi
|
|
31
38
|
|
|
32
39
|
# ── Auto-init if needed ───────────────────────────────
|
|
33
40
|
|
|
@@ -376,9 +383,16 @@ The developer's name is: ${dev_name}"
|
|
|
376
383
|
# ── Build Claude args ─────────────────────────────────
|
|
377
384
|
|
|
378
385
|
CLAUDE_ARGS="--dangerously-skip-permissions"
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
|
|
387
|
+
# Session persistence: reuse the same session ID per repo
|
|
388
|
+
if [ -f "$SESSION_FILE" ]; then
|
|
389
|
+
KAI_SESSION=$(cat "$SESSION_FILE")
|
|
390
|
+
else
|
|
391
|
+
KAI_SESSION=$(uuidgen 2>/dev/null || python3 -c "import uuid; print(uuid.uuid4())" 2>/dev/null || cat /proc/sys/kernel/random/uuid 2>/dev/null)
|
|
392
|
+
mkdir -p .kai
|
|
393
|
+
echo "$KAI_SESSION" > "$SESSION_FILE"
|
|
381
394
|
fi
|
|
395
|
+
CLAUDE_ARGS="$CLAUDE_ARGS --session-id $KAI_SESSION --name kai"
|
|
382
396
|
|
|
383
397
|
# ── Launch the PM ─────────────────────────────────────
|
|
384
398
|
|