chore(go): audit providers kirocli kiroide opencode
Move Kiro IDE onto managed_runtime.go and shell_command.go, share cloneJSONObject across providers, make OpenCode status verify the managed runtime contract instead of any hook.js, propagate script removal errors, and build the legacy runtime config through buildManagedRuntimeConfig. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
34ff4c1ea8
commit
96489cd051
20 files changed
+185
-650
No files matched your search
@@ -39,14 +39,6 @@ type codexRenderedDocument struct {
|
||||
|
||||
type codexRuntimeContract = managedRuntimeContract
|
||||
|
||||
func cloneCodexObject(value map[string]any) map[string]any {
|
||||
clone := make(map[string]any, len(value))
|
||||
for key, item := range value {
|
||||
clone[key] = item
|
||||
}
|
||||
return clone
|
||||
}
|
||||
|
||||
func cloneCodexHooks(source codexHooks) codexHooks {
|
||||
clone := make(codexHooks, len(source))
|
||||
for event, groups := range source {
|
||||
@@ -147,7 +139,7 @@ func removeCodexGroups(
|
||||
kept = append(kept, handler)
|
||||
}
|
||||
if len(kept) > 0 || !exactCodexMatcherGroup(group) {
|
||||
next := cloneCodexObject(group)
|
||||
next := cloneJSONObject(group)
|
||||
next["hooks"] = kept
|
||||
result = append(result, next)
|
||||
}
|
||||
@@ -223,7 +215,7 @@ func renderCodexDocument(
|
||||
if len(hooks) == 0 && entirelyManagedCodexDocument(document) {
|
||||
return &codexRenderedDocument{document: document, changed: true, remove: true}, nil
|
||||
}
|
||||
root := cloneCodexObject(document.root)
|
||||
root := cloneJSONObject(document.root)
|
||||
if len(hooks) == 0 {
|
||||
delete(root, "hooks")
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user