context-mode 1.0.105 → 1.0.107
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/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/adapters/copilot-base.d.ts +3 -3
- package/build/adapters/cursor/hooks.js +8 -0
- package/build/adapters/cursor/index.js +4 -1
- package/build/adapters/gemini-cli/hooks.d.ts +6 -1
- package/build/adapters/gemini-cli/hooks.js +7 -1
- package/build/adapters/gemini-cli/index.js +12 -0
- package/build/adapters/kiro/hooks.js +4 -0
- package/build/adapters/kiro/index.d.ts +9 -2
- package/build/adapters/kiro/index.js +49 -27
- package/build/adapters/opencode/index.js +6 -0
- package/build/adapters/qwen-code/index.js +18 -0
- package/build/adapters/vscode-copilot/hooks.d.ts +0 -4
- package/build/adapters/vscode-copilot/hooks.js +6 -6
- package/build/cli.js +1 -0
- package/build/openclaw/mcp-tools.d.ts +54 -0
- package/build/openclaw/mcp-tools.js +198 -0
- package/build/openclaw-plugin.d.ts +9 -0
- package/build/openclaw-plugin.js +132 -16
- package/build/opencode-plugin.d.ts +29 -4
- package/build/opencode-plugin.js +185 -11
- package/build/pi-extension.js +123 -29
- package/build/server.d.ts +1 -0
- package/build/server.js +28 -2
- package/build/session/db.d.ts +12 -3
- package/build/session/db.js +19 -4
- package/build/session/extract.d.ts +1 -1
- package/build/session/extract.js +46 -1
- package/cli.bundle.mjs +128 -127
- package/hooks/core/platform-detect.mjs +49 -0
- package/hooks/core/routing.mjs +13 -1
- package/hooks/cursor/afteragentresponse.mjs +74 -0
- package/hooks/gemini-cli/beforeagent.mjs +99 -0
- package/hooks/kiro/agentspawn.mjs +97 -0
- package/hooks/kiro/userpromptsubmit.mjs +88 -0
- package/hooks/session-db.bundle.mjs +4 -3
- package/hooks/session-extract.bundle.mjs +2 -2
- package/hooks/sessionstart.mjs +3 -1
- package/hooks/vscode-copilot/sessionstart.mjs +13 -14
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +72 -71
package/build/session/extract.js
CHANGED
|
@@ -850,14 +850,59 @@ export function resetIterationLoopState() {
|
|
|
850
850
|
callHistory.length = 0;
|
|
851
851
|
}
|
|
852
852
|
// ── Public API ─────────────────────────────────────────────────────────────
|
|
853
|
+
/**
|
|
854
|
+
* Map platform-native tool names (Qwen Code, Gemini CLI, OpenCode, etc.) to the
|
|
855
|
+
* canonical Claude Code names this extractor branches on. Without this, Qwen's
|
|
856
|
+
* `run_shell_command` events would silently produce zero git/cwd/env extractions.
|
|
857
|
+
*
|
|
858
|
+
* Evidence: refs/platforms/qwen-code/packages/core/src/tools/tool-names.ts
|
|
859
|
+
*/
|
|
860
|
+
const TOOL_NAME_NORMALIZE = {
|
|
861
|
+
// Qwen Code / Gemini CLI native names
|
|
862
|
+
run_shell_command: "Bash",
|
|
863
|
+
read_file: "Read",
|
|
864
|
+
read_many_files: "Read",
|
|
865
|
+
grep_search: "Grep",
|
|
866
|
+
search_file_content: "Grep",
|
|
867
|
+
web_fetch: "WebFetch",
|
|
868
|
+
write_file: "Write",
|
|
869
|
+
edit: "Edit",
|
|
870
|
+
glob: "Glob",
|
|
871
|
+
todo_write: "TodoWrite",
|
|
872
|
+
ask_user_question: "AskUserQuestion",
|
|
873
|
+
list_directory: "LS",
|
|
874
|
+
save_memory: "Memory",
|
|
875
|
+
skill: "Skill",
|
|
876
|
+
exit_plan_mode: "ExitPlanMode",
|
|
877
|
+
agent: "Agent",
|
|
878
|
+
// OpenCode native names
|
|
879
|
+
bash: "Bash",
|
|
880
|
+
view: "Read",
|
|
881
|
+
grep: "Grep",
|
|
882
|
+
fetch: "WebFetch",
|
|
883
|
+
// Codex CLI
|
|
884
|
+
shell: "Bash",
|
|
885
|
+
shell_command: "Bash",
|
|
886
|
+
exec_command: "Bash",
|
|
887
|
+
"container.exec": "Bash",
|
|
888
|
+
local_shell: "Bash",
|
|
889
|
+
grep_files: "Grep",
|
|
890
|
+
};
|
|
891
|
+
function normalizeHookInput(input) {
|
|
892
|
+
const normalized = TOOL_NAME_NORMALIZE[input.tool_name];
|
|
893
|
+
if (!normalized || normalized === input.tool_name)
|
|
894
|
+
return input;
|
|
895
|
+
return { ...input, tool_name: normalized };
|
|
896
|
+
}
|
|
853
897
|
/**
|
|
854
898
|
* Extract session events from a PostToolUse hook input.
|
|
855
899
|
*
|
|
856
900
|
* Accepts the raw hook JSON shape (snake_case keys) as received from stdin.
|
|
857
901
|
* Returns an array of zero or more SessionEvents. Never throws.
|
|
858
902
|
*/
|
|
859
|
-
export function extractEvents(
|
|
903
|
+
export function extractEvents(rawInput) {
|
|
860
904
|
try {
|
|
905
|
+
const input = normalizeHookInput(rawInput);
|
|
861
906
|
const events = [];
|
|
862
907
|
// File + Rule (handles Read/Edit/Write)
|
|
863
908
|
events.push(...extractFileAndRule(input));
|