Build a same-page interface with an optional local Node backend. The plugin API is experimental and may change.
First manifest
Save this as manifest.json and add ui.mjs. Import the folder in Settings → Plugins, review the code and initial locations, then choose Trust, install and enable. Install only keeps it disabled; the global switch and safe mode still apply.
Optional defaultSurfaces suggests initial locations. Confirm or change them at installation; install-only defers them until first enable. Updates preserve your choices. Full locations are skipped, and surface master switches stay unchanged.
Author modules use DOM/CSS/JS inside the host renderer. Bundle your CSS and use native content nodes or helpers where available. The UI has no Node integration.
Data and settings
Use ctx.data.query inside an async mount or handler to read captured App data; no backend is needed. The host supplies query version 1. Handle unavailable/stale results and unknown cost rather than turning them into zero.
A single query returns a snapshot and has no reset callback. Do not retain its data across source or privacy changes. For a persistent display, use the complete subscription example, which handles resets and cleanup.
Use the complete live UI example for subscriptions and cleanup, and the copyable settings schema and save example for the native form or a custom editor. Release subscriptions on disposal, discard old cursors on source/privacy resets, and reload deliberately after save conflicts.
For files, network or computation, declare an optional Node backend. It has the OS user’s authority and is shared across windows and locations. Honor hidden/visible state; background execution requires a separate explicit choice.
Test and distribute
Build dependencies first; installation never runs npm scripts. Follow the author self-check for the features you ship and test the exact package in a disposable profile. The host platform acceptance matrix is for maintainers, not a prerequisite for your first plugin.
Follow the publishing guide and README template for compatibility, access disclosures, screenshots and release steps. Use file/folder import or a direct HTTPS catalog; in-app GitHub discovery is not yet available. Rollback restores code, not arbitrary data migrations.
Trust before enabling
Plugins can read local files and credentials, use the network, change data or freeze the interface. Enable only code you trust. A hash is not a security audit.
Copy this prompt, add your idea, and give it to your coding assistant.
Prompt
Help me build a Token Monitor plugin. Read the official guide: https://github.com/Javis603/token-monitor/blob/main/docs/plugins/author-quickstart.md (and the reference it links to).
If any requirements are unclear, please ask me first. When finished, test the plugin and provide a folder or .tmplugin file I can import, along with installation and activation steps.
My idea:
호스트 렌더러에서 DOM/CSS/JS로 UI를 디자인합니다. CSS를 번들에 포함하고 제공되는 네이티브 콘텐츠 노드나 helpers를 활용하세요. UI에는 Node 통합이 없습니다.
데이터와 설정
비동기 mount나 이벤트 핸들러에서 ctx.data.query로 앱이 수집한 데이터를 읽으세요. 백엔드는 필요 없으며 호스트가 query version 1을 채웁니다. 사용할 수 없거나 오래된 데이터와 알 수 없는 비용을 0으로 처리하지 마세요.
단일 query는 스냅샷을 반환하며 reset 콜백이 없습니다. 소스나 개인정보 설정이 바뀐 뒤에는 이전 데이터를 유지하지 마세요. 계속 표시하려면 reset과 정리를 처리하는 전체 구독 예제를 사용하세요.
실시간 UI 전체 예제에서 구독과 정리를, 설정 schema와 저장 예제에서 기본 폼과 사용자 편집기를 확인하세요. 해제 시 구독을 취소하고 소스/개인정보 재설정 시 이전 cursor를 버리세요. 저장 충돌은 덮어쓰지 말고 다시 불러올지 사용자에게 알리세요.
파일, 네트워크, 계산이 필요할 때만 Node 백엔드를 선언하세요. OS 사용자 권한으로 실행되며 창과 표시 위치 간에 공유됩니다. 표시/숨김 상태를 따르세요. 백그라운드 실행은 별도로 명시적 활성화가 필요합니다.
테스트와 배포
의존성을 먼저 번들하세요. 설치는 npm scripts를 실행하지 않습니다. 제공하는 기능에 맞게 작성자 자체 점검을 하고 임시 프로필에서 실제 배포 패키지를 테스트하세요. 호스트 플랫폼 인수 검증은 유지관리자용이며 첫 플러그인의 전제 조건이 아닙니다.
게시 가이드와 README 템플릿에 따라 호환성, 접근 권한, 이미지와 출시 절차를 설명하세요. 현재 파일/폴더 가져오기나 직접 HTTPS 카탈로그를 사용합니다. 앱 내 GitHub 검색 기능은 아직 제공되지 않습니다. 롤백은 코드를 복원하며 임의의 데이터 마이그레이션을 되돌리지 않습니다.
신뢰 후 활성화
플러그인은 파일과 자격 증명, 네트워크에 접근하고 데이터를 변경하거나 UI를 멈출 수 있습니다. 신뢰하는 코드만 활성화하세요. 해시는 보안 검토가 아닙니다.
Token Monitor 플러그인 만들기를 도와주세요. 공식 가이드를 읽어 주세요: https://github.com/Javis603/token-monitor/blob/main/docs/plugins/author-quickstart.md (및 거기서 링크된 레퍼런스).
요구사항이 불분명하면 먼저 저에게 확인해 주세요. 완성되면 플러그인을 테스트하고, 가져올 수 있는 폴더나 .tmplugin 파일과 설치 및 활성화 방법을 제공해 주세요.
원하는 기능:
プラグイン開発ガイド
同一ページの UI と任意のローカル Node バックエンドを作成できます。プラグイン API は実験的で、今後変更される可能性があります。
defaultSurfaces sugere locais iniciais. Confirme ou altere na instalação; instalar sem ativar adia a aplicação até a primeira ativação. Atualizações preservam suas escolhas. Locais cheios são ignorados e os controles gerais não mudam.
Crie a UI com DOM/CSS/JS no renderizador do app. Inclua o CSS no pacote e use os elementos nativos ou helpers disponíveis. A UI não tem integração com Node.
Dados e configurações
Use ctx.data.query em um mount assíncrono ou manipulador de eventos para ler dados já coletados pelo app. Não é necessário backend; o host fornece query version 1. Não transforme dados indisponíveis, antigos ou custos desconhecidos em zero.
Uma query isolada retorna um snapshot e não oferece callback de reset. Não retenha seus dados após mudanças de origem ou privacidade. Para uma exibição persistente, use o exemplo completo de assinatura, que trata resets e limpeza.
Consulte o exemplo completo de UI ao vivo para assinaturas e limpeza e o schema de configurações e exemplo de gravação para o formulário nativo ou editor próprio. Cancele assinaturas ao descartar a UI e descarte cursors antigos quando a origem/privacidade mudar. Informe conflitos antes de recarregar; não sobrescreva outra edição silenciosamente.
Declare um backend Node opcional apenas para arquivos, rede ou cálculo. Ele tem a autoridade do usuário do sistema e é compartilhado entre janelas e locais. Respeite o estado visível/oculto; execução em segundo plano exige ativação explícita separada.
Teste e distribua
Empacote dependências antes; instalar não executa npm scripts. Siga a verificação do autor conforme os recursos oferecidos e teste o pacote exato em um perfil descartável. A matriz de aceitação da plataforma é para mantenedores, não um requisito para o primeiro plugin.
Siga o guia de publicação e modelo de README para compatibilidade, acesso, imagens e lançamentos. Use importação de arquivo/pasta ou catálogo HTTPS direto; a descoberta do GitHub dentro do app ainda não está disponível. Rollback restaura código, não migrações arbitrárias de dados.
Confie antes de ativar
Plugins podem acessar arquivos, credenciais e rede, modificar dados ou travar a interface. Ative apenas código confiável. Um hash não é uma auditoria de segurança.
Copie o prompt abaixo, acrescente sua ideia e envie ao seu assistente de programação.
Prompt
Me ajude a criar um plugin para o Token Monitor. Leia o guia oficial: https://github.com/Javis603/token-monitor/blob/main/docs/plugins/author-quickstart.md (e a referência que ele indica).
Se algum requisito não estiver claro, confirme comigo primeiro. Ao terminar, teste o plugin e forneça uma pasta ou um arquivo .tmplugin que eu possa importar, junto com as instruções de instalação e ativação.
Minha ideia: