haiku-method 3.12.0 → 3.12.1
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +6 -0
- package/bin/haiku +52 -17
- package/bin/haiku.mjs +160 -160
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ 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.12.1] - 2026-05-05
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- File paths now resolve correctly when the plugin runs in worktree contexts.
|
|
12
|
+
- Plugin initialization now reliably uses the bundled version when available.
|
|
13
|
+
|
|
8
14
|
## [3.12.0] - 2026-05-05
|
|
9
15
|
|
|
10
16
|
### Added
|
package/bin/haiku
CHANGED
|
@@ -1,38 +1,73 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# H·AI·K·U MCP server entry
|
|
2
|
+
# H·AI·K·U MCP server entry.
|
|
3
3
|
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
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
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
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
|
-
|
|
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
|
|
27
|
-
echo "Install bun (https://bun.sh) or node
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|