feat(tools/basic): 内置基础工具(calculator(注入安全)/datetime/random/text/json/markdown)+ 批量注册
This commit is contained in:
1 parent
b3c61aa1ff
commit
08223c06a5
19 files changed
+2074
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package basic
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
|
||||
)
|
||||
|
||||
// log returns a logger tagged with this plugin's source so every record it emits
|
||||
// is traceable back to its owning module (DevDocs/02-development-constraints.md
|
||||
// §五). The sdk.Tool surface does not carry an injected base logger, so a fresh
|
||||
// one is built on demand; it is only used on the error path, where the cost is
|
||||
// negligible. Errors are also returned to the caller so the failure is never
|
||||
// swallowed.
|
||||
func log() *slog.Logger {
|
||||
return logger.WithSource(logger.New(logger.Options{}), "plugins/tools/basic")
|
||||
}
|
||||
Reference in new issue
Block a user