fix: align Kimi hooks with official contracts

This commit is contained in:
ZacharyZhang-NY committed 2026-07-20 04:56:41 -04:00
1 parent f0e4694da2
commit c60b46b994
17 files changed
+1991 -635

No files matched your search

+5 -1
View File
@@ -24,6 +24,7 @@ type kimiTomlLayout struct {
type kimiDocument struct {
contract kimiContract
exists bool
raw []byte
hooks []kimiHook
layout kimiTomlLayout
@@ -31,7 +32,9 @@ type kimiDocument struct {
func parseKimiDocument(contract kimiContract, raw []byte, exists bool) (kimiDocument, error) {
if !exists {
return kimiDocument{contract: contract, raw: []byte{}, hooks: []kimiHook{}}, nil
return kimiDocument{
contract: contract, exists: false, raw: []byte{}, hooks: []kimiHook{},
}, nil
}
root := map[string]any{}
if err := toml.Unmarshal(raw, &root); err != nil {
@@ -76,6 +79,7 @@ func parseKimiDocument(contract kimiContract, raw []byte, exists bool) (kimiDocu
}
return kimiDocument{
contract: contract,
exists: true,
raw: append([]byte(nil), raw...),
hooks: hooks,
layout: layout,