@wei840222/qmd 2026.8.23

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +1373 -0
  2. package/LICENSE +45 -0
  3. package/README.md +1439 -0
  4. package/THIRD_PARTY_NOTICES.md +31 -0
  5. package/bin/qmd +192 -0
  6. package/dist/ast.d.ts +65 -0
  7. package/dist/ast.js +334 -0
  8. package/dist/bench/bench.d.ts +35 -0
  9. package/dist/bench/bench.js +338 -0
  10. package/dist/bench/cjk-baseline.d.ts +36 -0
  11. package/dist/bench/cjk-baseline.js +111 -0
  12. package/dist/bench/fixture.d.ts +2 -0
  13. package/dist/bench/fixture.js +84 -0
  14. package/dist/bench/score.d.ts +38 -0
  15. package/dist/bench/score.js +107 -0
  16. package/dist/bench/types.d.ts +110 -0
  17. package/dist/bench/types.js +8 -0
  18. package/dist/cli/build-info.json +4 -0
  19. package/dist/cli/embed-lock.d.ts +24 -0
  20. package/dist/cli/embed-lock.js +94 -0
  21. package/dist/cli/embedding-owner.d.ts +10 -0
  22. package/dist/cli/embedding-owner.js +20 -0
  23. package/dist/cli/formatter.d.ts +120 -0
  24. package/dist/cli/formatter.js +355 -0
  25. package/dist/cli/mcp-pid.d.ts +25 -0
  26. package/dist/cli/mcp-pid.js +86 -0
  27. package/dist/cli/qmd.d.ts +72 -0
  28. package/dist/cli/qmd.js +4806 -0
  29. package/dist/cli/version.d.ts +42 -0
  30. package/dist/cli/version.js +80 -0
  31. package/dist/collections.d.ts +200 -0
  32. package/dist/collections.js +433 -0
  33. package/dist/db.d.ts +65 -0
  34. package/dist/db.js +143 -0
  35. package/dist/diagnostics.d.ts +62 -0
  36. package/dist/diagnostics.js +260 -0
  37. package/dist/embedding/config.d.ts +52 -0
  38. package/dist/embedding/config.js +229 -0
  39. package/dist/embedding/identity.d.ts +58 -0
  40. package/dist/embedding/identity.js +321 -0
  41. package/dist/embedding/local-identity.d.ts +1 -0
  42. package/dist/embedding/local-identity.js +15 -0
  43. package/dist/embedding/local.d.ts +34 -0
  44. package/dist/embedding/local.js +290 -0
  45. package/dist/embedding/openai.d.ts +79 -0
  46. package/dist/embedding/openai.js +477 -0
  47. package/dist/embedding/owner.d.ts +13 -0
  48. package/dist/embedding/owner.js +36 -0
  49. package/dist/embedding/provider.d.ts +68 -0
  50. package/dist/embedding/provider.js +16 -0
  51. package/dist/embedding/remote-chunking.d.ts +22 -0
  52. package/dist/embedding/remote-chunking.js +83 -0
  53. package/dist/embedding/remote-embedding.d.ts +15 -0
  54. package/dist/embedding/remote-embedding.js +77 -0
  55. package/dist/hybrid-llm.d.ts +18 -0
  56. package/dist/hybrid-llm.js +53 -0
  57. package/dist/index.d.ts +244 -0
  58. package/dist/index.js +418 -0
  59. package/dist/llm.d.ts +566 -0
  60. package/dist/llm.js +1847 -0
  61. package/dist/maintenance.d.ts +33 -0
  62. package/dist/maintenance.js +52 -0
  63. package/dist/mcp/origin-guard.d.ts +67 -0
  64. package/dist/mcp/origin-guard.js +137 -0
  65. package/dist/mcp/server.d.ts +116 -0
  66. package/dist/mcp/server.js +919 -0
  67. package/dist/paths.d.ts +1 -0
  68. package/dist/paths.js +4 -0
  69. package/dist/remote-llm.d.ts +52 -0
  70. package/dist/remote-llm.js +464 -0
  71. package/dist/search/cjk-analyzer.d.ts +33 -0
  72. package/dist/search/cjk-analyzer.js +158 -0
  73. package/dist/search/cjk-index.d.ts +104 -0
  74. package/dist/search/cjk-index.js +1031 -0
  75. package/dist/search/jieba-loader.d.ts +23 -0
  76. package/dist/search/jieba-loader.js +79 -0
  77. package/dist/search/query-expansion.d.ts +23 -0
  78. package/dist/search/query-expansion.js +43 -0
  79. package/dist/search/zh-dict.txt +624013 -0
  80. package/dist/store.d.ts +1218 -0
  81. package/dist/store.js +6076 -0
  82. package/dist/trust.d.ts +152 -0
  83. package/dist/trust.js +249 -0
  84. package/package.json +139 -0
  85. package/scripts/build.mjs +83 -0
  86. package/scripts/check-package-grammars.mjs +29 -0
  87. package/scripts/package-smoke.mjs +205 -0
  88. package/scripts/sync-zh-dict.mjs +187 -0
  89. package/scripts/test-all.mjs +45 -0
  90. package/skills/qmd/SKILL.md +324 -0
  91. package/skills/qmd/references/mcp-setup.md +119 -0
  92. package/skills/release/SKILL.md +141 -0
  93. package/skills/release/scripts/install-hooks.sh +38 -0
  94. package/skills/release/scripts/release-context.sh +129 -0
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Gather release context for the /release skill (skills/release/SKILL.md step 1).
5
+ # Silently installs git hooks, then prints version info, working-tree status,
6
+ # commits and files since the last release tag, the current [Unreleased]
7
+ # changelog block, and the previous release entry for style reference.
8
+ #
9
+ # Usage: skills/release/scripts/release-context.sh [patch|minor|major|<version>]
10
+
11
+ VERSION_ARG="${1:?Usage: release-context.sh [patch|minor|major|<version>]}"
12
+
13
+ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
14
+
15
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
16
+ if [[ -z "$REPO_ROOT" ]]; then
17
+ echo "Error: not in a git repository" >&2
18
+ exit 1
19
+ fi
20
+ cd "$REPO_ROOT"
21
+
22
+ # Hooks are installed silently — the skill documents this as the auto-install path.
23
+ if [[ -x "$SCRIPT_DIR/install-hooks.sh" ]]; then
24
+ "$SCRIPT_DIR/install-hooks.sh" >/dev/null
25
+ fi
26
+
27
+ bump_version() {
28
+ local current="$1" type="$2"
29
+ IFS='.' read -r major minor patch <<< "$current"
30
+ case "$type" in
31
+ major) echo "$((major + 1)).0.0" ;;
32
+ minor) echo "$major.$((minor + 1)).0" ;;
33
+ patch) echo "$major.$minor.$((patch + 1))" ;;
34
+ *) echo "$type" ;;
35
+ esac
36
+ }
37
+
38
+ if [[ ! -f package.json ]]; then
39
+ echo "Error: package.json not found in $REPO_ROOT" >&2
40
+ exit 1
41
+ fi
42
+
43
+ CURRENT=$(jq -r .version package.json)
44
+ NEXT=$(bump_version "$CURRENT" "$VERSION_ARG")
45
+ BRANCH=$(git branch --show-current)
46
+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
47
+
48
+ echo "=== Version ==="
49
+ echo "Current: $CURRENT"
50
+ echo "Requested: $VERSION_ARG"
51
+ echo "Next: $NEXT"
52
+ echo "Branch: ${BRANCH:-"(detached)"}"
53
+ if [[ -n "$LAST_TAG" ]]; then
54
+ echo "Last tag: $LAST_TAG"
55
+ else
56
+ echo "Last tag: (none)"
57
+ fi
58
+ echo
59
+
60
+ echo "=== Working tree ==="
61
+ STATUS=$(git status --short)
62
+ if [[ -z "$STATUS" ]]; then
63
+ echo "(clean)"
64
+ else
65
+ printf '%s\n' "$STATUS"
66
+ fi
67
+ echo
68
+
69
+ echo "=== Commits since last release ==="
70
+ if [[ -n "$LAST_TAG" ]]; then
71
+ COMMITS=$(git log --oneline "${LAST_TAG}..HEAD")
72
+ if [[ -z "$COMMITS" ]]; then
73
+ echo "(none since $LAST_TAG)"
74
+ else
75
+ printf '%s\n' "$COMMITS"
76
+ fi
77
+ else
78
+ echo "(no tags)"
79
+ git log --oneline
80
+ fi
81
+ echo
82
+
83
+ echo "=== Files changed since last release ==="
84
+ if [[ -n "$LAST_TAG" ]]; then
85
+ FILES=$(git diff --name-only "${LAST_TAG}..HEAD")
86
+ if [[ -z "$FILES" ]]; then
87
+ echo "(none since $LAST_TAG)"
88
+ else
89
+ printf '%s\n' "$FILES"
90
+ fi
91
+ else
92
+ echo "(no tags)"
93
+ fi
94
+ echo
95
+
96
+ echo "=== CHANGELOG [Unreleased] ==="
97
+ if [[ -f CHANGELOG.md ]]; then
98
+ UNRELEASED=$(awk '
99
+ /^## \[Unreleased\]/ { p=1; next }
100
+ /^## \[/ { if (p) exit }
101
+ p { print }
102
+ ' CHANGELOG.md)
103
+ TRIMMED=$(printf '%s' "$UNRELEASED" | sed '/^[[:space:]]*$/d')
104
+ if [[ -z "$TRIMMED" ]]; then
105
+ echo "(empty)"
106
+ else
107
+ printf '%s\n' "$UNRELEASED"
108
+ fi
109
+ else
110
+ echo "(CHANGELOG.md not found)"
111
+ fi
112
+ echo
113
+
114
+ echo "=== Previous release entry ==="
115
+ if [[ -f CHANGELOG.md ]]; then
116
+ PREVIOUS=$(awk '
117
+ /^## \[Unreleased\]/ { next }
118
+ /^## \[/ { if (p) exit; p=1 }
119
+ p { print }
120
+ ' CHANGELOG.md)
121
+ TRIMMED=$(printf '%s' "$PREVIOUS" | sed '/^[[:space:]]*$/d')
122
+ if [[ -z "$TRIMMED" ]]; then
123
+ echo "(none)"
124
+ else
125
+ printf '%s\n' "$PREVIOUS"
126
+ fi
127
+ else
128
+ echo "(CHANGELOG.md not found)"
129
+ fi