@kraftapps-ai/kai 1.5.4 → 1.5.5
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 +21 -3
- package/package.json +1 -1
package/kai
CHANGED
|
@@ -392,11 +392,11 @@ else
|
|
|
392
392
|
mkdir -p .kai
|
|
393
393
|
echo "$KAI_SESSION" > "$SESSION_FILE"
|
|
394
394
|
fi
|
|
395
|
-
CLAUDE_ARGS="$CLAUDE_ARGS --
|
|
395
|
+
CLAUDE_ARGS="$CLAUDE_ARGS --name kai"
|
|
396
396
|
|
|
397
397
|
# ── Launch the PM ─────────────────────────────────────
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
SYSTEM_PROMPT="You are Kai — an AI product manager, tech lead, and **Shopify expert**. You work directly with the developer to plan and ship Shopify apps, themes, and integrations.
|
|
400
400
|
|
|
401
401
|
## Session persistence
|
|
402
402
|
|
|
@@ -536,4 +536,22 @@ Shopify apps are **embedded inside Shopify Admin**. Pages are NOT directly acces
|
|
|
536
536
|
- When unsure about an API, introspect the schema instead of guessing
|
|
537
537
|
- **On startup with existing memory (returning session):** All context is already loaded below. DO NOT read files. Greet the developer by name immediately with awareness of where you left off. Be instant — no tool calls before your first response. Keep it to 2-3 lines.
|
|
538
538
|
- **On startup without memory (fresh start):** Explore the repo first to understand the project. Read \`package.json\`, \`shopify.app.toml\` (or \`shopify.app.*.toml\`), scan the directory structure, check the README, and any other key files. Then greet the developer with a summary of what you found: the app name, what it does, tech stack, Shopify APIs used, etc. Save this to \`.kai/memory.md\` so you remember next time. Then ask what they want to plan or build. This first greeting should feel like a knowledgeable colleague who just reviewed the codebase.
|
|
539
|
-
${status}${project_context}${progress}${memory}${dev_greeting}"
|
|
539
|
+
${status}${project_context}${progress}${memory}${dev_greeting}"
|
|
540
|
+
|
|
541
|
+
err_file=$(mktemp)
|
|
542
|
+
set +e
|
|
543
|
+
claude --session-id "$KAI_SESSION" $CLAUDE_ARGS --system-prompt "$SYSTEM_PROMPT" "${@:-Hey Kai}" 2>"$err_file"
|
|
544
|
+
exit_code=$?
|
|
545
|
+
set -e
|
|
546
|
+
|
|
547
|
+
if [ $exit_code -ne 0 ] && grep -qi "already in use" "$err_file" 2>/dev/null; then
|
|
548
|
+
rm -f "$err_file"
|
|
549
|
+
echo ""
|
|
550
|
+
echo "Kai is already running in another terminal."
|
|
551
|
+
echo ""
|
|
552
|
+
echo " 1) Start a new session here: kai --new"
|
|
553
|
+
echo " 2) Continue in the other terminal where Kai is running"
|
|
554
|
+
echo ""
|
|
555
|
+
exit 1
|
|
556
|
+
fi
|
|
557
|
+
rm -f "$err_file"
|