npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kairos.ai/studio-sdk

v1.0.0-mvp.1

Published

SDK cliente para emitir telemetria de execuções de IA da KairOS-Platform — roda em Node, Deno e Supabase Edge Functions

Readme

@kairos/studio-sdk

Validação End-to-End (Inclua + Platform local)

Pré-requisitos

  • Platform local rodando:
    cd ../KairOS-Platform
    supabase start
    supabase db reset
    supabase functions serve ingerir --no-verify-jwt
  • API key criada:
    cd ../kairos-studio-sdk
    pnpm run integration:seed
    # anote idInquilino e apiKey do stdout
  • Inclua com SDK vendored (já feito via Task 17) + .env.local preenchido:
    # Em incluavt/supabase/.env.local, substituir:
    STUDIO_API_KEY=kp_live_<<apikey-da-seed>>

Execução

  1. Subir Inclua local:

    cd ../incluavt
    supabase start
    supabase functions serve nee-chat --no-verify-jwt --env-file supabase/.env.local
  2. Disparar uma chamada (nee-chat é chat; payload tem messages + student_context):

    curl -N http://127.0.0.1:54321/functions/v1/nee-chat \
      -H "Content-Type: application/json" \
      -d '{
        "messages": [{"role": "user", "content": "Sugira 3 estratégias para um aluno com TDAH."}],
        "nee_types": ["TDAH"],
        "student_context": {
          "name": "Teste",
          "grade": "5º ano",
          "nee_types": ["TDAH"]
        },
        "tenant": { "redeId": "<<ID_INQUILINO_DA_SEED>>" }
      }'

    Esperado: stream de chunks SSE do Claude chegando progressivamente no terminal.

  3. Após o stream fechar (2-5 segundos), inspecionar o Platform:

    psql postgresql://postgres:[email protected]:54322/postgres \
      -c "SELECT id_agente, modelo_llm, custo_tokens, duracao_ms, severidade
          FROM evento_execucao
          ORDER BY criado_em DESC LIMIT 1;"

    Esperado:

        id_agente  |       modelo_llm       | custo_tokens | duracao_ms | severidade
    ---------------+------------------------+---------------+------------+------------
     nee-chat      | anthropic/claude-sonnet-4 |          ~500 |      ~3000 | info

Critério de sucesso

  • Stream SSE visível no terminal do curl (UX preservada).
  • Um registro em evento_execucao com id_agente='nee-chat', custo_tokens > 0, duracao_ms > 0, severidade='info'.
  • Diff de latência vs. Inclua sem SDK: < 20ms medido em 5 execuções.

Troubleshooting

  • Stream chega mas 0 rows no Platform: provavelmente o Platform não está rodando ou STUDIO_ENDPOINT aponta pra URL errada. Verifique supabase status em ambos os repos e confirme o endpoint em .env.local.
  • 401 do Platform: API key em .env.local não bate com o que foi gerado pela seed. Re-rode pnpm run integration:seed e copie o valor novo pro .env.local.
  • evento_execucao tem registro mas custo_tokens = 0: OpenRouter não emitiu o chunk de usage. Verifique que stream_options: { include_usage: true } está na request (olhe o dados JSON do registro — deve ter errorCode: 'NO_USAGE_IN_STREAM' se ausente).
  • Latência > 100ms adicional: pode significar que EdgeRuntime.waitUntil não está sendo usado (o emit ficou síncrono). Olhe logs do supabase functions serve nee-chat pra ver se há erro/warning do SDK.