Przejdź do treści
Biblioteka skilli
Programowanie · Integracja z narzędziem

new-device

/new-device

Łączy urządzenie fizyczne, np. drukarkę etykiet, czytnik kart lub kamerę, z centrum przez mały program, który wywołuje centrum.

Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Łączy urządzenie fizyczne, np. drukarkę etykiet, czytnik kart lub kamerę, z centrum przez mały program, który wywołuje centrum.

Oryginalny opis (EN)

Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.

Jak działa

  1. Steps
  2. How a job travels
  3. Events
  4. Security
  5. Check
Sekcje z nagłówków SKILL.md, w oryginale · 47 linii, 720 słów
Podgląd SKILL.md
---
name: new-device
description: Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.
---

# New device

Devices call the hub every 15 seconds, and the hub never calls a device. So there is no port to open on the premises router and nothing needs a fixed address.

Each device has a program behind it, the agent, which runs on a computer or a Raspberry Pi next to it. `devices/agent.mjs` is the example agent: a single file, with nothing to install except Node 18 or later.

## Steps

1. Ask what the device is, where it is, which computer it is plugged into and what it has to do: receive jobs (print, open, display), send events (a card read, an alarm) or both.
2. Find out how that device is driven from that computer. A printer, with the system print command (`lp` on Mac and Linux). A USB reader usually types like a keyboard. A camera or a sensor usually has an address on the local network. Try it by hand on that computer before touching the hub.
3. Register the device in the hub: Devices → Add a device. The hub shows the key only once. The person copies it to the device's computer. Do not paste it in the chat or in the repository.
4. Copy `devices/agent.mjs` to that computer and change two functions:
   - `doJob(job)`: what the device does with each `kind` of job. It returns a short text, or throws an error if it fails.
   - `status()`: what is worth seeing on the Devices screen (paper, temperature, version).
   To send events, call `sendEvent(kind, data)` when something happens.
5. Start it: `HUB_URL=https://... HUB_DEVICE_KEY=dev_... node agent.mjs`. On the Devices screen it must show "Online".
6. Press "Send a test job" and check that the device does it and that the job moves to "Done".
7. Set it up as a service, so it starts by itself when the computer is turned on and comes back up if it crashes: `launchd` on Mac, `systemd` on Linux or a scheduled task on Windows. The key goes in the service configuration, readable only by the service's user.
8. Grant the permission `device:<slug>:use` to the roles that should send it jobs, add the new device to the log and update `docs/STATUS.md`.

## How a job travels

A person, their AI or a company tool calls `enqueueJob(slug, kind, payload, requestedBy)`. The job is "Queued". On its next heartbeat the agent receives it and the job moves to "Delivered". The agent does it and confirms: "Done" or "Error". If the agent does not confirm within 5 minutes, the hub delivers the job again, up to 5 times. That is why the agent remembers for 48 hours the jobs it has already done and does not print the same label twice.

You define the `kind` and the `payload`: they are the contract between whoever enqueues the job and the agent. Write that contract in a comment at the top of the agent and in the description of the tool that enqueues.

## Events

An event is something that happens on the premises and that the hub should know about: `sendEvent("read", { card: "04A1B2" })`. It is stored in `device_events`. To make it do something (clock a person in, warn about an alarm), write a company tool that reads that table, with the `new-tool` skill.

If the agent loses its connection, have it save the events to a file and send them when the connection is back, with the time they happened inside `data`.

## Security

- One key per device. The key only allows sending heartbeats, confirming the device's own jobs and sending events.
- If the device's computer is lost or replaced: Devices → New key. The old key stops working at once.
- An agent does not execute commands that arrive in the payload of a job. `doJob` recognizes fixed kinds and treats the payload as data.
- Cameras and readers collect data about people. Before connecting them, the company tells its team what is stored and why.

## Check

1. "Online" on the Devices screen, with "Last signal" less than 15 seconds ago.
2. The test job comes out of the device and ends as "Done".
3. Stop the agent, send a job and start the agent again: it does the job on startup, only once.
4. Restart the device's computer: the agent starts by itself.

Wersje

W bazie nie ma innych skilli o nazwie new-device.

Migawka bazy z 13.11.2026 · wersja paczki 35f52fd10005 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100xcode-device-hub-workflow
    Zarządza i waliduje symulowane i fizyczne urządzenia Apple przez Xcode Device Hub: cele uruchomienia, interakcja z aplikacją, ustawienia symulatora, zrzuty ekranu i wideo, parowanie i diagnostyka.
  • 90giligili-device
    Obsługuje urządzenie giligili: konfiguruje Wi-Fi i klucze API, wysyła polecenia oraz diagnozuje rozmowy głosowe i kamerę.
  • 90dev-hub
    Zakłada strukturę projektu dla przepływu RayStack: AGENTS.md, DECISIONS.md i foldery dokumentów, w jednym repo lub w centrum bez kodu.
  • 100collaboration-hub
    Rozwija interfejs AILANG Collaboration Hub w React: panel monitoringu, kolejkę zatwierdzeń i centrum wiadomości.
  • 100new-connector
    Łączy zewnętrzną usługę, np. księgowość, CRM lub bank, z centrum, szyfrując jej sekret i nadając uprawnienia według roli.
  • 100collaboration-hub
    Zmienia i rozbudowuje interfejs AILANG Collaboration Hub w React: dashboard monitoringu, kolejkę zatwierdzeń i centrum wiadomości.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.