@procrastivity/clast 0.0.2 → 0.0.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/README.md CHANGED
@@ -90,8 +90,10 @@ for the current set of flags.
90
90
  ./install.sh ~/.local
91
91
  ```
92
92
 
93
- `make install` wraps the same script. Use `./uninstall.sh ~/.local` (or
94
- `make uninstall` for the default prefix) to remove the installed files. See
93
+ `make install` wraps the same script; `make install-local` installs the working
94
+ tree to `~/.local` with no sudo (and `make uninstall-local` removes it). Use
95
+ `./uninstall.sh ~/.local` (or `make uninstall` for the default prefix) to remove
96
+ the installed files. See
95
97
  [`docs/reference/repo-bootstrap.md#installsh--uninstallsh`](./docs/reference/repo-bootstrap.md#installsh--uninstallsh)
96
98
  for the rationale.
97
99
 
package/bin/clast-brief CHANGED
@@ -15,7 +15,7 @@
15
15
  # CLAST_LLM_MODEL — e.g. gpt-4o, llama3
16
16
  set -euo pipefail
17
17
 
18
- CLAST_BRIEF_DIR="$(cd "$(dirname "$0")/.." && pwd)"
18
+ CLAST_BRIEF_DIR="$(cd "$(dirname "$(realpath "$0")")/.." && pwd)"
19
19
 
20
20
  # ── Helpers ──────────────────────────────────────────────────────────
21
21
 
package/bin/clast-wake CHANGED
@@ -11,7 +11,7 @@
11
11
  # CLAST_LLM_MODEL — e.g. gpt-4o, llama3
12
12
  set -euo pipefail
13
13
 
14
- CLAST_WAKE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
14
+ CLAST_WAKE_DIR="$(cd "$(dirname "$(realpath "$0")")/.." && pwd)"
15
15
 
16
16
  # ── Helpers ──────────────────────────────────────────────────────────
17
17
 
@@ -262,24 +262,20 @@ _clast_entries_list() {
262
262
  return 0
263
263
  fi
264
264
 
265
- printf '%-11s %-6s %-17s %-29s %s\n' \
266
- "date" "time" "project" "slug" "tags"
265
+ printf '%-50s %s\n' "entry" "tags"
267
266
 
268
- local n i row r_date r_time r_project r_slug r_tags tags_disp
267
+ local n i row r_path r_basename r_tags tags_disp
269
268
  n="$(jq 'length' <<<"$rows_json")"
270
269
  for (( i = 0; i < n; i++ )); do
271
270
  row="$(jq -c ".[$i]" <<<"$rows_json")"
272
- r_date="$(jq -r '.date // ""' <<<"$row")"
273
- r_time="$(jq -r '.time // ""' <<<"$row")"
274
- r_project="$(jq -r '.project // ""' <<<"$row")"
275
- r_slug="$(jq -r '.session_slug // ""' <<<"$row")"
271
+ r_path="$(jq -r '.path // ""' <<<"$row")"
272
+ r_basename="$(basename "$r_path")"
276
273
  r_tags="$(jq -r '.tags // [] | join(",")' <<<"$row")"
277
274
  tags_disp="$r_tags"
278
275
  if (( ${#tags_disp} > 30 )); then
279
276
  tags_disp="${tags_disp:0:29}…"
280
277
  fi
281
- printf '%-11s %-6s %-17s %-29s %s\n' \
282
- "$r_date" "$r_time" "$r_project" "$r_slug" "$tags_disp"
278
+ printf '%-50s %s\n' "$r_basename" "$tags_disp"
283
279
  done
284
280
  }
285
281
 
@@ -515,6 +511,7 @@ _clast_entries_write() {
515
511
  trimmed="${rt#"${rt%%[![:space:]]*}"}"
516
512
  trimmed="${trimmed%"${trimmed##*[![:space:]]}"}"
517
513
  [[ -z "$trimmed" ]] && continue
514
+ trimmed="${trimmed,,}"
518
515
  if ! [[ "$trimmed" =~ ^[a-z0-9][a-z0-9-]{0,31}$ ]]; then
519
516
  _clast_entries_err "write: invalid tag '$trimmed'"; return 2
520
517
  fi
@@ -566,16 +563,13 @@ _clast_entries_write() {
566
563
  fi
567
564
 
568
565
  # Best-effort branch from snapshot.
566
+ # Claude Code stores gitBranch (camelCase) on type:"user" lines, not on line 1.
569
567
  local journal_dir snapshot_abs branch=""
570
568
  journal_dir="$(clast_journal_dir)"
571
569
  snapshot_abs="$journal_dir/$snapshot_rel"
572
570
  if [[ -r "$snapshot_abs" ]]; then
573
- branch="$(head -n1 "$snapshot_abs" 2>/dev/null | jq -r '.cwd // .git_branch // empty' 2>/dev/null || true)"
574
- # `.cwd` isn't a branch, but we keep parity with step 07's TODO: leave best-effort placeholder.
575
- # If the value looks like a path, drop it.
576
- case "$branch" in
577
- /*|"") branch="" ;;
578
- esac
571
+ branch="$(grep -m1 '"gitBranch"' "$snapshot_abs" 2>/dev/null \
572
+ | jq -r '.gitBranch // empty' 2>/dev/null || true)"
579
573
  fi
580
574
 
581
575
  local author machine
@@ -224,7 +224,7 @@ clast_cmd_show() {
224
224
  _clast_show_user_messages() {
225
225
  local path="$1"
226
226
  jq -r '
227
- select((.role // .message.role) == "user")
227
+ select((.role // .message.role // .type) == "user")
228
228
  | (.message.content // .content // empty)
229
229
  | if type == "array" then map(.text? // "") | join(" ") else . end
230
230
  | select(. != null and . != "")
@@ -237,9 +237,9 @@ _clast_show_collect_turns() {
237
237
  local path="$1"
238
238
  jq -sc '
239
239
  map(
240
- select((.role // .message.role) as $r | $r == "user" or $r == "assistant")
240
+ select((.role // .message.role // .type) as $r | $r == "user" or $r == "assistant")
241
241
  | {
242
- role: (.role // .message.role),
242
+ role: (.role // .message.role // .type),
243
243
  text: ((.message.content // .content // "") | if type == "array" then map(.text? // "") | join(" ") else . end)
244
244
  }
245
245
  | select(.text != null and .text != "")
@@ -26,3 +26,4 @@ One sentence describing what this session was trying to accomplish.
26
26
  Be concise. Prefer bullets over paragraphs. Use the user's terminology (project-specific names, file paths). Do not invent details. If you are uncertain about something, omit it rather than guess.
27
27
 
28
28
  After the entry, add a blank line and then: "Suggested tags: tag1, tag2, tag3"
29
+ Tags must be lowercase kebab-case (regex: `^[a-z0-9][a-z0-9-]{0,31}$`). Examples: `adrs`, `symfony-bot`, `mr-umbrella`, `phase-0`. Never use uppercase letters.
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@procrastivity/clast",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Capture, curate, and surface Claude Code session history across all your projects.",
5
5
  "homepage": "https://github.com/procrastivity/clast#readme",
6
6
  "bin": {
7
- "clast": "bin/clast"
7
+ "clast": "bin/clast",
8
+ "clast-wake": "bin/clast-wake",
9
+ "clast-brief": "bin/clast-brief"
8
10
  },
9
11
  "files": [
10
12
  "bin/",