agent build

This commit is contained in:
2026-08-28 12:21:44 +05:30
parent b6f8655909
commit f7df96c973
138 changed files with 24164 additions and 207 deletions

View File

@@ -0,0 +1,36 @@
package tools_test
import (
"context"
"encoding/json"
"testing"
"github.com/krow/krow-backend/go-api/internal/authctx"
"github.com/krow/krow-backend/go-api/internal/testutil"
"github.com/krow/krow-backend/go-api/internal/tools"
)
// TestDumpToolOutput prints what each tool actually returns against the seeded
// demo tenant. Run with -v when checking that a port produces real figures
// rather than a silent zero.
func TestDumpToolOutput(t *testing.T) {
h := testutil.New(t)
admin := authctx.Identity{
UserID: "00000000-0000-0000-0000-000000000001",
OrgID: h.OrgID, Role: "admin", Email: "admin@example.test",
}
reg := tools.NewRegistry()
for _, tool := range everyTool(h.Pool) {
reg.MustRegister(tool)
}
for _, name := range reg.Names() {
res := reg.Dispatch(context.Background(),
tools.Context{Principal: admin}, name, json.RawMessage(`{"limit":3}`))
encoded, _ := json.Marshal(res.Data)
out := string(encoded)
if len(out) > 400 {
out = out[:400] + "…"
}
t.Logf("%-24s %s", name, out)
}
}