@jaxonshaw/multi-model-kit 0.0.0-stage → 0.1.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.
- package/.agents/plugins/marketplace.json +11 -0
- package/.claude-plugin/marketplace.json +8 -0
- package/.claude-plugin/plugin.json +5 -0
- package/.codex-plugin/plugin.json +6 -0
- package/INSTALL-AGENT.md +95 -0
- package/LICENSE +21 -0
- package/README.md +152 -2
- package/bin/byok-review +258 -0
- package/bin/claude-org +415 -0
- package/bin/model-route +303 -0
- package/bin/multi-model-kit +22 -0
- package/bin/quota-status +259 -0
- package/config/defaults.json +45 -0
- package/hooks/hooks.json +14 -0
- package/hooks/session-start.sh +77 -0
- package/install.sh +1606 -0
- package/mods/org-switch/.claude-plugin/plugin.json +5 -0
- package/mods/org-switch/hooks/hooks.json +1 -0
- package/mods/org-switch/hooks/register.ts +571 -0
- package/mods/org-switch/tsconfig.json +3 -0
- package/orgs.example.json +18 -0
- package/package.json +32 -4
- package/plugins/paseo-usage/bridge/capture-quota.cjs +59 -0
- package/plugins/paseo-usage/index.server.ts +47 -0
- package/plugins/paseo-usage/paseo-plugin.json +8 -0
- package/plugins/paseo-usage/server/usage.mjs +140 -0
- package/rules/multi-model.md +15 -0
- package/skills/dispatch/SKILL.md +148 -0
- package/skills/dispatch/references/brief-template.md +52 -0
- package/skills/dispatch/references/ce-config.example.yaml +19 -0
- package/skills/dispatch/references/paseo.md +87 -0
- package/skills/dispatch/references/roundtable.md +32 -0
- package/skills/dispatch/references/routing.md +83 -0
- package/skills/dispatch/references/watch-paseo.md +217 -0
- package/skills/dispatch/references/watch.md +42 -0
- package/skills/prompt-library/SKILL.md +60 -0
- package/skills/prompt-library/prompts/c01-first-principles.md +1 -0
- package/skills/prompt-library/prompts/c02-clarify-then-options.md +1 -0
- package/skills/prompt-library/prompts/c03-reframe-problem.md +1 -0
- package/skills/prompt-library/prompts/c04-second-order-effects.md +1 -0
- package/skills/prompt-library/prompts/c05-cross-domain.md +1 -0
- package/skills/prompt-library/prompts/c06-argue-against.md +1 -0
- package/skills/prompt-library/prompts/c07-git-history-legacy.md +1 -0
- package/skills/prompt-library/prompts/c08-onboarding-cost.md +1 -0
- package/skills/prompt-library/prompts/c09-slow-prs.md +1 -0
- package/skills/prompt-library/prompts/c10-rework-retro.md +1 -0
- package/skills/prompt-library/prompts/d01-complexity-to-system.md +11 -0
- package/skills/prompt-library/prompts/d02-motion.md +11 -0
- package/skills/task-handoff/SKILL.md +319 -0
- package/skills/task-handoff/references/handoff-template.md +134 -0
- package/skills/task-handoff/references/takeover-prompt.md +81 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Keep the host's JSON input on fd 3 while Python reads the script on stdin.
|
|
3
|
+
command -v python3 > /dev/null 2>&1 || {
|
|
4
|
+
printf '%s\n' '{"systemMessage":"multi-model-kit: python3 not found"}'
|
|
5
|
+
exit 0
|
|
6
|
+
}
|
|
7
|
+
exec python3 -I -B - "$0" 3<&0 <<'PY'
|
|
8
|
+
import json
|
|
9
|
+
import os
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
import subprocess
|
|
12
|
+
import sys
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def global_instructions(root):
|
|
16
|
+
home = Path.home()
|
|
17
|
+
# Codex supplies PLUGIN_ROOT and also exports CLAUDE_PLUGIN_ROOT for compatibility.
|
|
18
|
+
# Compare it with this package so a value inherited from another shell is ignored.
|
|
19
|
+
plugin_root = os.environ.get("PLUGIN_ROOT")
|
|
20
|
+
if plugin_root and Path(plugin_root).resolve() == root:
|
|
21
|
+
config = Path(os.environ.get("CODEX_HOME") or home / ".codex")
|
|
22
|
+
names = ("AGENTS.override.md", "AGENTS.md")
|
|
23
|
+
else:
|
|
24
|
+
config = Path(os.environ.get("CLAUDE_CONFIG_DIR") or home / ".claude")
|
|
25
|
+
names = ("CLAUDE.md",)
|
|
26
|
+
|
|
27
|
+
for name in names:
|
|
28
|
+
try:
|
|
29
|
+
text = (config / name).read_text(encoding="utf-8")
|
|
30
|
+
except FileNotFoundError:
|
|
31
|
+
continue
|
|
32
|
+
if text.strip():
|
|
33
|
+
return text
|
|
34
|
+
return ""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def context(event, root):
|
|
38
|
+
route = root / "bin/model-route"
|
|
39
|
+
settings = subprocess.run(
|
|
40
|
+
[str(route), "--settings"], capture_output=True, text=True, check=True
|
|
41
|
+
)
|
|
42
|
+
if not json.loads(settings.stdout)["autoload"]:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
if event.get("source") == "compact":
|
|
46
|
+
if (Path(event.get("cwd") or Path.cwd()) / ".handoff.md").is_file():
|
|
47
|
+
return "先读 `.handoff.md` 的压缩前检查点再继续。"
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
begin = "<!-- BEGIN multi-model-kit -->"
|
|
51
|
+
end = "<!-- END multi-model-kit -->"
|
|
52
|
+
lines = global_instructions(root).splitlines()
|
|
53
|
+
if begin in lines and end in lines[lines.index(begin) + 1:]:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
rules = (root / "rules/multi-model.md").read_text(encoding="utf-8")
|
|
57
|
+
quoted_route = "'" + str(route).replace("'", "'\"'\"'") + "'"
|
|
58
|
+
return f"{rules}\n调用 model-route 时优先使用此插件内的命令:{quoted_route}\n"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
try:
|
|
62
|
+
with os.fdopen(3, encoding="utf-8") as stream:
|
|
63
|
+
event = json.load(stream)
|
|
64
|
+
extra_context = context(event, Path(sys.argv[1]).resolve().parent.parent)
|
|
65
|
+
except subprocess.CalledProcessError as error:
|
|
66
|
+
detail = " ".join(error.stderr.splitlines()).strip() or "model-route --settings failed"
|
|
67
|
+
print(json.dumps({"systemMessage": f"multi-model-kit: {detail}"}))
|
|
68
|
+
except (OSError, ValueError, KeyError, AttributeError) as error:
|
|
69
|
+
detail = " ".join(str(error).splitlines())
|
|
70
|
+
print(json.dumps({"systemMessage": f"multi-model-kit: {detail}"}))
|
|
71
|
+
else:
|
|
72
|
+
if extra_context:
|
|
73
|
+
print(json.dumps({"hookSpecificOutput": {
|
|
74
|
+
"hookEventName": "SessionStart",
|
|
75
|
+
"additionalContext": extra_context,
|
|
76
|
+
}}))
|
|
77
|
+
PY
|