haiku-method 3.12.0 → 3.13.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haiku",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "H·AI·K·U methodology — universal lifecycle orchestration with hat-based workflows, completion criteria, and automatic context preservation.",
5
5
  "author": {
6
6
  "name": "GigSmart",
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.13.0] - 2026-05-05
9
+
10
+ ### Added
11
+ - Run hat iterations faster with `/haiku:zap`, which executes a streamlined hat-loop without the usual ceremony.
12
+
13
+ ## [3.12.1] - 2026-05-05
14
+
15
+ ### Fixed
16
+ - File paths now resolve correctly when the plugin runs in worktree contexts.
17
+ - Plugin initialization now reliably uses the bundled version when available.
18
+
8
19
  ## [3.12.0] - 2026-05-05
9
20
 
10
21
  ### Added
package/bin/haiku CHANGED
@@ -1,38 +1,73 @@
1
1
  #!/usr/bin/env bash
2
- # H·AI·K·U MCP server entry — auto-detects dev checkout vs production install.
2
+ # H·AI·K·U MCP server entry.
3
3
  #
4
- # Behavior:
5
- # - In a dev checkout (packages/haiku/src/main.ts present): exec the source
6
- # via bun (preferred) or npx tsx, so edits hot-reload on next MCP restart
7
- # without rebuilding.
8
- # - In a production install (npm tarball or github clone of just the plugin):
9
- # exec the bundled JS sibling at plugin/bin/haiku.mjs via node.
4
+ # Production (marketplace install under ~/.claude/plugins/marketplaces/...):
5
+ # exec the bundled, self-contained `bin/haiku.mjs` under plain `node`.
6
+ # The bundle has every runtime dep (including @sentry/node) tree-rolled
7
+ # in via esbuild — it does NOT depend on the consumer's node_modules.
8
+ # Built by CI, committed to git, shipped to users.
10
9
  #
11
- # This file is ALWAYS the bin entry. It is never overwritten by the build —
12
- # the build emits plugin/bin/haiku.mjs as a separate artifact, which is
13
- # committed to git so github-sourced installs work without a build step.
10
+ # Dev (everywhere else):
11
+ # exec source `packages/haiku/src/main.ts` via `bun` (preferred) or
12
+ # `npx tsx`, so edits hot-reload on the next MCP restart without
13
+ # rebuilding. Devs never run the bundle locally.
14
+ #
15
+ # The marketplace path is the discriminator because marketplace installs
16
+ # are full git clones — `packages/haiku/src/main.ts` exists there too —
17
+ # so `[ -f source ]` alone misroutes production into the dev branch and
18
+ # crashes on missing project-local @sentry/node when `npx tsx` resolves
19
+ # against the consumer's node_modules.
20
+ #
21
+ # HAIKU_PROD=1 forces bundle mode anywhere (CI smoke tests, debugging
22
+ # bundle behavior in a dev checkout). HAIKU_DEV=1 forces source mode
23
+ # (custom plugin install paths that should still hot-reload).
14
24
  set -euo pipefail
15
25
  HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16
- SOURCE_ENTRY="$HERE/../../packages/haiku/src/main.ts"
17
26
  BUNDLE="$HERE/haiku.mjs"
27
+ SOURCE_ENTRY="$HERE/../../packages/haiku/src/main.ts"
18
28
 
19
- if [ -f "$SOURCE_ENTRY" ]; then
29
+ # Detect production install location. `*/.claude/plugins/*` covers the
30
+ # marketplaces dir too — `*` in bash `case` patterns matches `/`.
31
+ IS_PROD=""
32
+ case "$HERE" in
33
+ */.claude/plugins/*|*/.claude/mcpb/*)
34
+ IS_PROD=1
35
+ ;;
36
+ esac
37
+ [ "${HAIKU_PROD:-}" = "1" ] && IS_PROD=1
38
+ [ "${HAIKU_DEV:-}" = "1" ] && IS_PROD=""
39
+
40
+ # Dev path: source via bun/tsx.
41
+ if [ -z "$IS_PROD" ] && [ -f "$SOURCE_ENTRY" ]; then
20
42
  if command -v bun >/dev/null 2>&1; then
21
43
  exec bun "$SOURCE_ENTRY" "$@"
22
44
  fi
23
45
  if command -v npx >/dev/null 2>&1; then
24
46
  exec npx tsx "$SOURCE_ENTRY" "$@"
25
47
  fi
26
- echo "haiku: dev checkout detected at $SOURCE_ENTRY but neither 'bun' nor 'npx' is on PATH." >&2
27
- echo "Install bun (https://bun.sh) or node (which provides npx)." >&2
48
+ echo "haiku: dev checkout at $SOURCE_ENTRY but neither 'bun' nor 'npx' is on PATH." >&2
49
+ echo "Install bun (https://bun.sh) or node, or set HAIKU_PROD=1 to use the bundle." >&2
28
50
  exit 1
29
51
  fi
30
52
 
53
+ # Production path: bundle under node.
31
54
  if [ -f "$BUNDLE" ]; then
32
55
  exec node "$BUNDLE" "$@"
33
56
  fi
34
57
 
35
- echo "haiku: cannot locate source ($SOURCE_ENTRY) or bundle ($BUNDLE)." >&2
36
- echo "If you installed via npm or cloned from github, the bundle should sit next to this script." >&2
37
- echo "If you are developing in a checkout, run from the repo root and confirm packages/haiku exists." >&2
58
+ # Last-resort fallback for an unbuilt dev checkout that ended up flagged
59
+ # as production (e.g. someone symlinked it into ~/.claude/plugins/).
60
+ if [ -f "$SOURCE_ENTRY" ]; then
61
+ echo "haiku: bundle missing at $BUNDLE — falling back to source. Run 'npm run build -w @haiku/haiku' or unset HAIKU_PROD." >&2
62
+ if command -v bun >/dev/null 2>&1; then
63
+ exec bun "$SOURCE_ENTRY" "$@"
64
+ fi
65
+ if command -v npx >/dev/null 2>&1; then
66
+ exec npx tsx "$SOURCE_ENTRY" "$@"
67
+ fi
68
+ echo "haiku: bundle missing and neither 'bun' nor 'npx' is available for source fallback." >&2
69
+ exit 1
70
+ fi
71
+
72
+ echo "haiku: cannot locate bundle ($BUNDLE) or source ($SOURCE_ENTRY)." >&2
38
73
  exit 1