diff options
| author | Drew Ritter <drew@primeradiant.com> | 2026-06-01 14:53:46 -0700 |
|---|---|---|
| committer | Drew Ritter <drew@primeradiant.com> | 2026-06-16 10:09:44 -0700 |
| commit | f61300eac8d85d055eb9afed870051ccdfb62f31 (patch) | |
| tree | 6e3bf6465d215f4bc27e903cc9aa8b19957ec257 /tests | |
| parent | e15d4ecd88f4e9dae5c12488189438ab95c1d770 (diff) | |
fix: wire Kimi plugin into release metadata
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/codex-plugin-sync/test-sync-to-codex-plugin.sh | 10 | ||||
| -rwxr-xr-x | tests/kimi/run-tests.sh | 6 | ||||
| -rwxr-xr-x | tests/kimi/test-plugin-manifest.sh | 67 |
3 files changed, 83 insertions, 0 deletions
diff --git a/tests/codex-plugin-sync/test-sync-to-codex-plugin.sh b/tests/codex-plugin-sync/test-sync-to-codex-plugin.sh index a94cdec..60af21a 100755 --- a/tests/codex-plugin-sync/test-sync-to-codex-plugin.sh +++ b/tests/codex-plugin-sync/test-sync-to-codex-plugin.sh @@ -175,6 +175,7 @@ write_upstream_fixture() { mkdir -p \ "$repo/.codex-plugin" \ + "$repo/.kimi-plugin" \ "$repo/.private-journal" \ "$repo/assets" \ "$repo/evals/drill" \ @@ -212,6 +213,13 @@ EOF } EOF + cat > "$repo/.kimi-plugin/plugin.json" <<EOF +{ + "name": "superpowers", + "version": "$MANIFEST_VERSION" +} +EOF + cat > "$repo/assets/superpowers-small.svg" <<'EOF' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"></svg> EOF @@ -267,6 +275,7 @@ EOF git -C "$repo" add \ .codex-plugin/plugin.json \ + .kimi-plugin/plugin.json \ .gitignore \ assets/app-icon.png \ assets/superpowers-small.svg \ @@ -618,6 +627,7 @@ main() { assert_contains "$preview_output" "Version: $MANIFEST_VERSION" "Preview uses manifest version" assert_not_contains "$preview_output" "Version: $PACKAGE_VERSION" "Preview does not use package.json version" assert_contains "$preview_section" ".codex-plugin/plugin.json" "Preview includes manifest path" + assert_not_contains "$preview_section" ".kimi-plugin/plugin.json" "Preview excludes Kimi manifest from Codex sync" assert_contains "$preview_section" "assets/superpowers-small.svg" "Preview includes SVG asset" assert_contains "$preview_section" "assets/app-icon.png" "Preview includes PNG asset" assert_contains "$preview_section" "hooks/hooks-codex.json" "Preview includes Codex hook manifest" diff --git a/tests/kimi/run-tests.sh b/tests/kimi/run-tests.sh new file mode 100755 index 0000000..f7bb21f --- /dev/null +++ b/tests/kimi/run-tests.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +bash "$SCRIPT_DIR/test-plugin-manifest.sh" diff --git a/tests/kimi/test-plugin-manifest.sh b/tests/kimi/test-plugin-manifest.sh new file mode 100755 index 0000000..0040697 --- /dev/null +++ b/tests/kimi/test-plugin-manifest.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" +MANIFEST="$REPO_ROOT/.kimi-plugin/plugin.json" + +python3 - "$MANIFEST" <<'PY' +import json +import sys +from pathlib import Path + +manifest_path = Path(sys.argv[1]) +manifest = json.loads(manifest_path.read_text(encoding="utf-8")) + +def assert_equal(actual, expected, label): + if actual != expected: + raise AssertionError(f"{label}: expected {expected!r}, got {actual!r}") + +def assert_present(text, needle, label): + if needle not in text: + raise AssertionError(f"{label}: missing {needle!r}") + +assert_equal(manifest.get("name"), "superpowers", "plugin name") +assert_equal(manifest.get("skills"), "./skills/", "skills path") +assert_equal( + manifest.get("sessionStart", {}).get("skill"), + "using-superpowers", + "sessionStart.skill", +) + +instructions = manifest.get("skillInstructions") +if not isinstance(instructions, str) or not instructions.strip(): + raise AssertionError("skillInstructions must be a non-empty string") + +for token in [ + "AskUserQuestion", + "TodoList", + "Agent", + "Skill", + "Read", + "Write", + "Edit", + "Bash", + "WebSearch", +]: + assert_present(instructions, token, "skillInstructions") + +unsupported_fields = [ + "tools", + "commands", + "hooks", + "apps", + "inject", + "configFile", + "config_file", + "bootstrap", +] +present_unsupported = sorted(field for field in unsupported_fields if field in manifest) +if present_unsupported: + raise AssertionError( + "unsupported Kimi runtime fields present: " + + ", ".join(present_unsupported) + ) + +print("Kimi plugin manifest looks good") +PY |
