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

@chicowall/capacitor-appfunctions

v0.1.2

Published

Plugin Capacitor que expoe acoes do agendaAI como Android AppFunctions para o Gemini

Readme

@agendaai/capacitor-appfunctions

Plugin Capacitor que expoe acoes do agendaAI como Android AppFunctions chamáveis pelo Gemini.

Status: alpha. Depende de androidx.appfunctions 1.0.0-alphaXX, que esta em rollout.

O que esta dentro do plugin

  • TokenStore — persiste o JWT em SharedPreferences pro background access.
  • AgendaAIClient — wrapper HTTP sobre OkHttp + kotlinx.serialization que cobre todos os endpoints do back.
  • DTOs@AppFunctionSerializable + @kotlinx.serialization.Serializable (compartilhaveis entre Gemini e backend).
  • Plugin Capacitor — bridge JS para chamar as mesmas operacoes em foreground.

O que esta no app consumidor

As anotacoes @AppFunction ficam no app consumidor (frontend-capacitor) porque o KSP roda em build-time sobre o codigo do app, nao do plugin. Esse plugin entrega tudo pronto para o app criar uma classe simples com 10 metodos @AppFunction que delegam pro AgendaAIClient.

// no app consumidor (agendaAI):
class AgendaAIFunctions(context: Context) {
    private val client = AgendaAIClient(context)

    @AppFunction
    suspend fun listarPacientes(): List<PacienteDto> = client.listarPacientes()

    @AppFunction
    suspend fun criarAgendamento(
        pacienteId: String,
        profissionalId: String,
        servicoId: String,
        dataHoraInicio: String,
    ): AgendamentoDto = client.criarAgendamento(
        CriarAgendamentoBody(pacienteId, profissionalId, servicoId, dataHoraInicio)
    )

    // ... outras 8 funcoes
}

Funcoes expostas

  1. listarPacientes
  2. criarPaciente
  3. removerPaciente (soft-delete)
  4. listarProfissionais
  5. listarServicos
  6. verHorariosDisponiveis
  7. criarAgendamento
  8. listarProximosAgendamentos
  9. cancelarAgendamento
  10. agendaDoDia

Setup

1. Instalar no app

npm install ../plugins/capacitor-appfunctions
npx cap sync android

2. Empurrar o token apos login

import { AgendaAIAppFunctions } from '@agendaai/capacitor-appfunctions';

// em algum momento apos login bem-sucedido:
await AgendaAIAppFunctions.setAuthToken({
  token: jwt,
  apiBaseUrl: 'https://agendaai-backend-qw6w.onrender.com',
});

// no logout:
await AgendaAIAppFunctions.clearAuthToken();

3. Adicionar KSP no android/app/build.gradle do app consumidor

plugins {
    id 'com.google.devtools.ksp' version '2.0.21-1.0.28' apply false
}

apply plugin: 'com.google.devtools.ksp'

dependencies {
    implementation 'androidx.appfunctions:appfunctions:1.0.0-alpha07'
    implementation 'androidx.appfunctions:appfunctions-service:1.0.0-alpha07'
    ksp 'androidx.appfunctions:appfunctions-compiler:1.0.0-alpha07'
}

4. Declarar o servico no AndroidManifest

<application>
    <meta-data
        android:name="android.app.appfunctions"
        android:resource="@xml/app_functions" />
</application>

(O KSP gera o app_functions.xml.)

Como testar

Foreground (JS calls)

const { pacientes } = await AgendaAIAppFunctions.listarPacientes();

Background (Gemini)

  1. Build APK e instalar.
  2. adb shell dumpsys appfunctions → verifica catalogo.
  3. Em device com Gemini ativo, falar: "marca uma consulta amanha as 10h pro Joao com a Dra. Marina".

Limitacoes

  • iOS: o equivalente sao App Intents em Swift; este plugin nao cobre iOS ainda.
  • Web: stub que so persiste token em localStorage; chamadas de dominio nao funcionam.
  • Devices sem Gemini/AICore: funcoes ficam registradas mas ninguem invoca. #� �c�a�p�a�c�i�t�o�r�-�a�p�p�f�u�n�c�t�i�o�n�s� � �