Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ version and its date. Versions follow semantic versioning: a major version
when people have to change their setup, a minor one for new skills or
abilities, a patch for fixes.

## 1.1.23 - 2026-11-28

- Apps and boards can read the project's alarms: every project has the built-in app `alarms`, with the tables `alarms` (the current state of each alarm with the latest filter) and `alarm_events` (one row per status change, with its cause, the device and the row that caused it). `ironflock-templates` shows how an app consumes it (`consumes`, `provider_app: alarms` on a board, the SDK's cross-app connection) and its columns; the board validator checks bindings to both tables like the app's own, and reports a write to them, since only the platform writes alarms. The template schemas describe `alarms` and say that `*` includes it. `ironflock-data` and `ironflock-fleet` answer questions about past alarms from `alarm_events` with SQL.

## 1.1.22 - 2026-11-27

- Boards can take photos with a form: widget-form's media field (widget-form 2.3.0 and later) stores several photos per save, each resized to a JPEG, as rows of a photo table linked to the record, optionally with where and when each was taken. `board-forms.md` shows the photo table, the files namespace and the two forms (a report with photos, more photos for an existing record), and the board validator checks the namespace (it must take `image/jpeg`), the accepted image types, the photo table's columns and their types, the link to the record and the photo ID's entity key. The widget skill documents the `media-data-submit` event Studio handles for it.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.22
1.1.23
2 changes: 1 addition & 1 deletion plugins/ironflock-appliance/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ironflock-appliance",
"displayName": "IronFlock Appliance",
"version": "1.1.22",
"version": "1.1.23",
"description": "Add a direct connection from Claude Code to your IronFlock appliance. Configure the appliance’s HTTPS MCP address and sign in to that installation.",
"author": {
"name": "IronFlock",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ironflock-dev/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ironflock-dev",
"displayName": "IronFlock Dev",
"version": "1.1.22",
"version": "1.1.23",
"description": "Build on IronFlock: design and scaffold edge apps that keep their state in the app's tables and embed their devices' web UIs in the board, write and validate their .ironflock templates (boards and widgets, data tables, app parameters, remote-access ports, AI agents), and create, change and check the board widgets themselves (@ironflock/widget-* Lit components). Needs the ironflock plugin, which Claude Code installs with it.",
"author": {
"name": "IronFlock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ starter app in `assets/app-template/` follows all of them; scaffold it with
7. [Reading and writing state with the SDK](#reading-and-writing-state-with-the-sdk)
8. [Entity tables: current state, updates and deletes](#entity-tables-current-state-updates-and-deletes)
9. [Following what the board writes](#following-what-the-board-writes)
10. [Commands, device functions and topics](#commands-device-functions-and-topics)
11. [The container on the device](#the-container-on-the-device)
12. [Docker Compose](#docker-compose)
13. [Web UIs on the device](#web-uis-on-the-device)
14. [Several devices](#several-devices)
15. [Devices that register themselves](#devices-that-register-themselves)
16. [Checklist](#checklist)
10. [Reading another app's data](#reading-another-apps-data)
11. [Commands, device functions and topics](#commands-device-functions-and-topics)
12. [The container on the device](#the-container-on-the-device)
13. [Docker Compose](#docker-compose)
14. [Web UIs on the device](#web-uis-on-the-device)
15. [Several devices](#several-devices)
16. [Devices that register themselves](#devices-that-register-themselves)
17. [Checklist](#checklist)

## The parts of an app

Expand Down Expand Up @@ -461,6 +462,43 @@ A table without an entity key holds one setting for all devices: the newest row
is in force. For settings per device or per machine, key the table by the target
(see [Several devices](#several-devices)).

## Reading another app's data

An app reads the shared tables of another app in the same project once it lists
that app under `consumes` in data-template.yml and the project's user has
granted the access. The code opens a read-only handle with `connect_to_app`
(`connectToApp` in JavaScript, `ConnectToApp` in Go) and reads and follows the
provider's tables through it with `get_history` and `subscribe_to_table`, as it
does its own. It cannot write them.

**The project's alarms** are such an app: every project has the built-in app
`alarms`, and a `*` under `consumes` includes it. The SDK names it with the
constant `ALARMS_APP` (`AlarmsApp` in Go).

```python
from ironflock import ALARMS_APP

alarms = await flock.connect_to_app(ALARMS_APP)
current = await alarms.get_history("alarms", {"limit": 100, "filterAnd": [{"latest": True}]})
await alarms.subscribe_to_table("alarm_events", lambda row, *a, **kw: on_alarm_event(row))
```

| Table | Rows | Columns |
|---|---|---|
| `alarms` | One per version of an alarm; `{"latest": True}` gives the current state of each (entity key `alarm_key`) | `tsp`, `alarm_key`, `alarm_name`, `display_name`, `status` (`OK`, `MINOR`, `MAJOR`, `CRITICAL`, empty while unknown), `status_tsp`, `status_row` (the values of the row that set the status), `observing`, `watched_app`, `watched_app_key`, `watched_backend_key`, `watched_table`, `auto_resolve`, `conditions`, `assessment`, `assigned_to`, `changed_by` |
| `alarm_events` | One per status change, oldest first like every read | `tsp`, `event_id` (a UUID, to keep as a reference), `alarm_key`, `alarm_name`, `display_name`, `from_status`, `to_status`, `cause` (`data`, `reset`, `started`, `stopped`, `trigger_changed`, `deleted`), `watched_app`, `watched_app_key`, `watched_table`, `device_name`, `row_tsp`, `row` (the values of the row that caused the change), `condition` (the condition that matched; empty when the status fell to OK), `changed_by` |

- Both tables also have `device_key` and `authid`. In `alarm_events`,
`device_key` is the device that wrote the row.
- **Production only.** The alarms exist in production; a development run of the
app reads the project's production alarms, and so does the board. This needs
an SDK release that exports `ALARMS_APP`.
- **Read-only.** Only the platform writes these tables; an app that acts on an
alarm writes to its own tables. The recipients of notifications are not
readable.
- An event carries the row that caused it, so an app with access to `alarms`
sees those values even without access to the watched app.

## Commands, device functions and topics

**Prefer state.** Most things users "command" are desired state: a setpoint, on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ read them.
- To read another app's tables, list it under `consumes:`. Board widgets that bind
to those tables then need `provider_app` on their data reference (see
board-bindings.md).
- **Alarms are an app too.** Every project has the built-in app `alarms`, with
the project's alarms as two tables: `alarms` (one row per version of an
alarm, current state with the latest filter) and `alarm_events` (one row per
status change). An app that shows or reacts to alarms consumes it like any
other app, and `*` includes it:

```yaml
consumes:
- app: alarms
reason: Shows the alarms of each machine on the board
```

The tables are read-only and exist in production only. app-architecture.md
("Reading another app's data") has the columns and how the code reads them.
- **An app that needs host access declares `privileged:`** next to `data:`, with a
`reason` the user reads when granting it:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,26 @@ You can read:
- **Another app's table:** add `provider_app: <app name in lowercase>` to the ref,
and list that app under `consumes` in data-template.yml. Only that app's shared
tables and transforms can be read. Its private ones are not shared.
- **The project's alarms:** `provider_app: alarms`, with `alarms` or `*` under
`consumes`. `alarms` holds one row per version of an alarm; bind it with
`{latest: true}` (entity key `alarm_key`) for the current state of each alarm.
`alarm_events` holds one row per status change, oldest first like every
table. The validator knows both tables' columns (app-architecture.md,
"Reading another app's data"). Neither can be a form's or a toolbar's target:
only the platform writes them. A board reads production alarms, also while
the app runs in development.

```yaml
tableRef:
tablename: alarm_events
provider_app: alarms
format: {time: tsp, alarm: display_name, status: to_status, device: device_name}
queryParams:
limit: 100
windowPeriod: day
windowLength: 1
nowMinusPeriods: 0
```

There's no arithmetic, ratio, join or derived column in a binding, and no widget
computes those either. When a widget needs one, add a transform to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ Some values only exist inside a running platform, and a template cannot know the
## Checklist

1. Every `tablename` and column exists in data-template.yml (or under
`provider_app` in a consumed app), and the app's code actually publishes it.
`provider_app` in a consumed app, such as the built-in `alarms` with its
tables `alarms` and `alarm_events`), and the app's code actually publishes it.
2. Every chartconfig key comes from the pinned widget version's schema, and every
constant is prefixed.
3. Bindings (board-bindings.md) sit at the right kind of property (valueRef on single values, tableRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ $defs:
description: >-
Lowercase name of another app whose table this binding reads. That app
must be listed under consumes in this app's data-template.yml, and the
project must have granted the data access.
project must have granted the data access. A consumes entry "*" covers
every app. The name alarms is the built-in alarms app that every project
has: its tables alarms and alarm_events are readable like any app's,
read-only, and exist in production only.
anyOf:
- type: string
pattern: "^[a-z0-9._-]+$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $defs:
app:
type: string
pattern: "^(\\*|[A-Za-z0-9._-]+)$"
description: Name of the provider app whose data backend this app reads, or "*" to consume all non-platform apps' data in the project. Case-insensitive — legacy apps predating the lowercase-name invariant may be named in their original case; the parser normalizes to lowercase.
description: Name of the provider app whose data backend this app reads, or "*" to consume the data of all apps in the project, including alarms. The name alarms is the built-in alarms app that every project has; its tables alarms and alarm_events are readable like any app's, read-only, and exist in production only, so a development run reads the project's production alarms. Case-insensitive — legacy apps predating the lowercase-name invariant may be named in their original case; the parser normalizes to lowercase.
reason:
type: string
description: Human-readable reason for the access, shown to the user when granting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,58 @@
"user_message": "string",
}
}
#: The built-in alarms app that every project has. Boards read its tables
#: through provider_app: alarms (with alarms or * under consumes), read-only and
#: from production. Its third table, the notification recipients, is not
#: readable. Both tables carry the system columns device_key and authid.
ALARMS_APP = "alarms"
ALARMS_TABLES = {
"alarms": {
"tsp": "timestamp",
"alarm_key": "bigint",
"alarm_name": "string",
"display_name": "string",
"status": "string",
"status_tsp": "timestamp",
"status_row": "json",
"observing": "boolean",
"watched_app": "string",
"watched_app_key": "bigint",
"watched_backend_key": "bigint",
"watched_table": "string",
"auto_resolve": "boolean",
"conditions": "json",
"assessment": "json",
"assigned_to": "bigint",
"changed_by": "string",
"device_key": "bigint",
"authid": "string",
},
"alarm_events": {
"tsp": "timestamp",
"event_id": "string",
"alarm_key": "bigint",
"alarm_name": "string",
"display_name": "string",
"from_status": "string",
"to_status": "string",
"cause": "string",
"watched_app": "string",
"watched_app_key": "bigint",
"watched_table": "string",
"device_name": "string",
"row_tsp": "timestamp",
"row": "json",
"condition": "json",
"changed_by": "string",
"device_key": "bigint",
"authid": "string",
},
}
#: Entity keys of the alarms app's tables: {latest: true} on alarms gives the
#: current state of each alarm; alarm_events has none.
ALARMS_ENTITY_KEYS = {"alarms": ["alarm_key"]}
ALARMS_UNREADABLE = {"alarm_notifications"}
DEFAULT_COLUMNS, DEFAULT_ROWS = 96, 64
#: DEFAULT_DASHBOARD_STYLE in Studio's src/types/dashboard.ts.
DEFAULT_CELL_SIZE, DEFAULT_GRID_GAP = 12, 8
Expand Down Expand Up @@ -189,14 +241,20 @@ def warn(self, path: list, message: str) -> None:

def columns_of(self, table: str, provider: str | None) -> dict[str, str] | None:
"""Column -> dataType for a table this board may read, or None when the
columns cannot be known here (another app's table)."""
columns cannot be known here (another app's table, except the built-in
alarms app's)."""
if provider:
return None
return ALARMS_TABLES.get(table) if is_alarms(provider) else None
if table in SYSTEM_TABLES:
return SYSTEM_TABLES[table]
return self.data.tables.get(table)


def is_alarms(provider: Any) -> bool:
"""Whether a provider_app names the built-in alarms app."""
return isinstance(provider, str) and provider.lower() == ALARMS_APP


# --------------------------------------------------------------------------
# Entry point
# --------------------------------------------------------------------------
Expand Down Expand Up @@ -633,6 +691,14 @@ def check_ref_common(self, ref: dict, path: list, kind: str) -> dict[str, str] |
if board.data.present and provider.lower() not in consumes and "*" not in consumes:
board.error(path + ["provider_app"], f"reads app '{provider}', which data-template.yml does not list under consumes")
columns = None
if isinstance(table, str) and is_alarms(provider):
columns = board.columns_of(table, provider)
if table in ALARMS_UNREADABLE:
board.error(path + ["tablename"], f"'{table}' of the alarms app holds the notification recipients and is not readable; bind alarms or alarm_events")
elif columns is None:
hint = difflib.get_close_matches(table, list(ALARMS_TABLES), n=1)
more = f" (did you mean '{hint[0]}'?)" if hint else ""
board.error(path + ["tablename"], f"the alarms app has no table '{table}'{more}; it offers alarms and alarm_events")
if isinstance(table, str) and not provider:
columns = board.columns_of(table, None)
if columns is None and board.data.present:
Expand Down Expand Up @@ -871,6 +937,9 @@ def check_write_targets(board: Board, targets: list, writer: str) -> None:
if not isinstance(target, dict) or not target.get("tablename"):
continue
table, column = target.get("tablename"), target.get("column")
if is_alarms(target.get("provider_app")):
board.error(tpath + ["provider_app"], f"the {writer} writes to the alarms app, whose tables are read-only")
continue
columns = board.columns_of(table, None)
if columns is None:
if board.data.present:
Expand Down Expand Up @@ -1005,12 +1074,16 @@ def one_row_reason(board: Board, ref: dict) -> str | None:
if not isinstance(limit, bool) and isinstance(limit, (int, float)) and limit == 1:
return "limit 1"
table = ref.get("tablename")
if ref.get("provider_app") or not isinstance(table, str) or table not in board.data.tables:
alarms = is_alarms(ref.get("provider_app"))
if alarms:
if table not in ALARMS_TABLES:
return None
elif ref.get("provider_app") or not isinstance(table, str) or table not in board.data.tables:
return None # another app's table or a transform: its entity key is unknown here
filters = qp.get("filterAnd") if isinstance(qp.get("filterAnd"), list) else []
if not any(isinstance(f, dict) and f.get("latest") for f in filters):
return None
keys = board.data.entity_keys.get(table)
keys = ALARMS_ENTITY_KEYS.get(table) if alarms else board.data.entity_keys.get(table)
if not keys:
return f"the latest filter on '{table}', which has no entity key, keeps its single newest row"
pinned = {
Expand Down
2 changes: 1 addition & 1 deletion plugins/ironflock/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ironflock",
"displayName": "IronFlock",
"version": "1.1.22",
"version": "1.1.23",
"description": "Connect Claude to IronFlock in the cloud with browser sign-in. Work with devices, apps, alarms, logs and project data. Add the optional IronFlock Appliance plugin for a direct connection to a local installation.",
"author": {
"name": "IronFlock",
Expand Down
10 changes: 10 additions & 0 deletions plugins/ironflock/skills/ironflock-data/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ Patterns:
anyone; never select, filter, join or group on them. Only whether a value
is set can be counted (`count(*) FILTER (WHERE col IS NOT NULL)`). If the
person wants the value, explain that only the app itself can read it.
- **Alarms are tables too.** The project's alarms are the data of the
built-in app Alarms, listed by `get_schema` like any app: `alarms` holds
one row per version of an alarm (its entity key is `alarm_key`, so its
current state is the newest row per `alarm_key`), and `alarm_events` one
row per status change, with `from_status`, `to_status`, the `cause`, the
device (`device_key`, `device_name`), the row that caused the change
(`row_tsp`, `row`) and the `condition` that matched. Queries, transforms
and boards read them like any table ("how often did the press alarm go
critical last week?"); nobody writes them but the platform. They hold
production alarms only.
- **Private tables.** An app may keep tables private. A query on one is
refused by design: tell the person the app keeps that data to itself, and do
not try other ways to read it.
Expand Down
Loading