14/Documentation
Tricks reference
Every place, part, manifest key, limit and command of a trick, complete and generated from the code
<!-- This page is generated by bun scripts/tricks-reference.ts --write from web/src/lib/tricks/catalogue.ts. Do not edit it by hand. -->
This page lists every place, part, manifest key, limit and command of a ColliePWA trick, and it is complete. It is generated from the code, so it cannot drift. It is the one list: other pages link here and do not repeat its tables.
Tricks are experimental. They may change, lose settings, or be withdrawn in a patch release. They are off until you switch them on at the top of Settings → Tricks and the Hill, or with collie tricks on.
Places
A place is a spot on the phone where a trick can show (a surface). A program trick, a program on your machine that prints parts, draws in the first seven. An agent view, one screen that the session's own agent draws, is the eighth.

In the picture: 1 Dashboard tile, 2 Page, 3 Bottom bar item, 4 Status chip, 5 Belt, 6 Agent view, 7 Session settings rows, 8 Floating picture. Each place below has its own picture.
| Place | Name | Where it shows | Drawn by |
|---|---|---|---|
belt | Belt | A mark at the end of the Belt, the scrolling strip of controls. It never takes fixed room. It sits at the end of the scrolling strip, off screen until the person scrolls; the fixed block at the right is Collie's own. | A program |
session | Page | A page of the trick's own: a row on the Dashboard under Tricks, and a screen of its own. The code word is session. | A program |
dashboard | Dashboard tile | A round tile in the strip at the top of the Dashboard. The strip is hidden while no trick has a tile. | A program |
status | Status chip | One chip in the status line above the Belt, at the left end of the row; the model and the usage stay at the right end. | A program |
tabbar | Bottom bar item | An item in the Dashboard's bottom bar, after the Hill. On a large screen there is no bar: the item stands after the views, in the control of the Dashboard's header. | A program |
menu | Session settings rows | Rows in a session's settings (the sheet of the session's ⋮ button), in a group of the trick's own after Collie's rows and Close, under the heading "From the trick", then the trick's name. Agent sessions only. Adds rows to a session's settings. | A program |
float | Floating picture | A small moving picture over the app, on the Dashboard and in a session's Chat and Terminal, in the free area clear of the header, the strips, the Belt and the composer. It can draw a small moving picture over the app. It never covers a question and never blocks a tap. | A program |
agent-view | Agent view | A view of one agent session, beside Terminal and Chat. The session's own agent draws it, and the person switches it on per session. | A session's agent |
belt

Where. A mark at the end of the Belt, the scrolling strip of controls. It never takes fixed room. It sits at the end of the scrolling strip, off screen until the person scrolls; the fixed block at the right is Collie's own.
Shows. One mark: an icon, a face word (label), a badge and a tone. It takes no view.
A tap. With an intent, a tap runs the trick with that intent. Without one, the mark is the same button and takes no tap.
| Limit | Value |
|---|---|
| Parts of this place per trick | one unbound, and up to 8 bound ones with sessions. No session is named by two parts |
label, the face word | at most 12 characters |
badge | a count from 0 to 9999 as text, or "" for a dot |
| A mark needs | at least one of icon, label and badge |
sessions, contract 2 | 1 to 8 of the facts' session ids, agent sessions only. The part shows only in those sessions, in place of the trick's unbound part of this place there. Left out, the part is unbound |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "belt",
"id": "legs",
"mark": {
"icon": "check",
"label": "23/34",
"tone": "ok",
"intent": "open"
}
}
]
}A program prints:
{
"v": 2,
"parts": [
{
"at": "belt",
"id": "legs",
"mark": {
"icon": "check",
"label": "23/34",
"tone": "ok"
}
},
{
"at": "belt",
"id": "legs-here",
"sessions": [
"lodge:w1:2"
],
"mark": {
"icon": "flask",
"label": "2 red",
"tone": "danger",
"intent": "open"
}
}
]
}session

Where. A page of the trick's own: a row on the Dashboard under Tricks, and a screen of its own. The code word is session.
Shows. A name, an icon, a tone, a subtitle, a badge, a progress meter, up to four action buttons and a view: a list of nodes of any kind in the Parts table.
A tap. A button, or an action, sends its intent to the trick, which runs once with that tap. A row or a link with an href opens a web page or a session. A button with does set to draft puts its text into the empty reply box of the session the page was opened from, and opens that session. Opened from the Dashboard or the bottom bar, the page is for no session, and such a button says "Open a session first".
| Limit | Value |
|---|---|
name | at most 40 characters. Left out, the manifest's name |
subtitle | at most 120 characters |
badge | { "count": 0 to 9999 } or { "text": 1 to 12 characters }, one of the two |
progress | value of max, max a whole number from 1 to 12. No value means indeterminate |
actions | at most 4, each id, label (at most 16 characters), intent, and optionally value, icon and disabled. An action icon is one of play, pause, check, x, refresh, archive, flag, star, send, note, search, more |
view | 1 to 24 nodes at the top, 6 levels, 300 nodes in all |
| Parts of this place per trick | as many as it needs, each with its own id |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "session",
"id": "main",
"name": "Legs",
"icon": "check",
"subtitle": "3 of 5 done",
"badge": {
"count": 2
},
"progress": {
"value": 3,
"max": 5
},
"actions": [
{
"id": "refresh",
"label": "Refresh",
"intent": "refresh",
"icon": "refresh"
}
],
"view": [
{
"kind": "list",
"kids": [
{
"kind": "row",
"text": "api",
"attrs": {
"end": "ok",
"tone": "ok"
}
}
]
}
]
}
]
}dashboard

Where. A round tile in the strip at the top of the Dashboard. The strip is hidden while no trick has a tile.
Shows. One item: an icon over a short name, with a badge and a tone. It takes no view.
A tap. A tap opens the trick's Page when it has one. Without a Page the tile is drawn and takes no tap.
| Limit | Value |
|---|---|
| Parts of this place per trick | one |
label | 1 to 16 characters |
badge | a count from 0 to 9999 (0 draws none), or text of 1 to 12 characters |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "dashboard",
"id": "legs",
"item": {
"label": "Legs",
"icon": "check",
"badge": 3,
"tone": "ok"
}
}
]
}status

Where. One chip in the status line above the Belt, at the left end of the row; the model and the usage stay at the right end.
Shows. One chip: a short text, an icon, a tone, and a live time with at and clock. It takes no view. It draws in the type and the colour of the usage figures beside it, and the trick sets no size. Only the tones warn and danger change the colour; every other tone reads as the row.
A tap. A tap opens the trick's Page when it has one. The chip is not a control and takes no intent.
| Limit | Value |
|---|---|
| Parts of this place per trick | one |
text | 1 to 12 characters |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "status",
"id": "ci",
"chip": {
"text": "CI red",
"icon": "check",
"tone": "danger"
}
}
]
}tabbar

Where. An item in the Dashboard's bottom bar, after the Hill. On a large screen there is no bar: the item stands after the views, in the control of the Dashboard's header.
Shows. One item: an icon over a short name, with a badge and a tone. It takes no view.
A tap. A tap opens the trick's Page when it has one. Without a Page the item is drawn and takes no tap.
| Limit | Value |
|---|---|
| Parts of this place per trick | one |
label | 1 to 16 characters |
badge | a count from 0 to 9999 (0 draws none), or text of 1 to 12 characters |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "tabbar",
"id": "legs",
"item": {
"label": "Legs",
"icon": "check",
"badge": "new"
}
}
]
}menu

Where. Rows in a session's settings (the sheet of the session's ⋮ button), in a group of the trick's own after Collie's rows and Close, under the heading "From the trick", then the trick's name. Agent sessions only. Adds rows to a session's settings.
Shows. Rows: a button or a switch, each with a label, an icon and an intent. A switch shows the on of the last document and never flips before the program answers.
A tap. A tap runs it and tells it which session. Collie gives it no way to type there. A button sends its intent; a switch sends its intent with the state asked for as value, "on" or "off". With confirm a button arms on the first tap and shows its whole label.
| Limit | Value |
|---|---|
| Contract | 2 |
| Rows | 1 to 6 in a part. Each id and each intent once |
| A row | id, kind (button or switch), label, intent, and optionally icon, disabled, on (required on a switch) and confirm (a button only). Nothing else |
label | 1 to 24 characters, refused when longer, never cut. No hidden character. It may not read as one of the sheet's own rows in any language Collie speaks, hold the word Collie, WalkyTalky, Hill, view, or start with Allow, Approve, Deny, Grant, Trust, Yes, Always, or with a word of the permission card's buttons in any language Collie speaks. Look-alike letters count as the letters they pass for: C0llie is Collie |
| Parts of this place per trick | one unbound, for every agent session of this machine, and up to 8 bound ones with sessions, the only way rows show on a crew member's session. No session is named by two parts |
sessions, contract 2 | 1 to 8 of the facts' session ids, agent sessions only. The part shows only in those sessions, in place of the trick's unbound part of this place there. Left out, the part is unbound |
| Rows in one sheet | 12 of every trick together. A trick's group is shown whole or left out whole, in the order of the trick ids, and the sheet says how many tricks it left out |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 2,
"parts": [
{
"at": "menu",
"id": "ci",
"rows": [
{
"id": "rerun",
"kind": "button",
"label": "Rerun CI",
"icon": "refresh",
"intent": "rerun",
"confirm": true
},
{
"id": "watch",
"kind": "switch",
"label": "Watch branch",
"icon": "flag",
"intent": "watch",
"on": true
}
]
}
]
}In trick.toml:
id = "ci"
name = "CI"
run = "program.ts"
contract = 2
places = ["menu"]A program prints:
{
"v": 2,
"parts": [
{
"at": "menu",
"id": "ci-workshop",
"sessions": [
"m_workshop:w3:1"
],
"rows": [
{
"id": "deploy",
"kind": "button",
"label": "Deploy here",
"icon": "upload",
"intent": "deploy",
"confirm": true
}
]
}
]
}float

Where. A small moving picture over the app, on the Dashboard and in a session's Chat and Terminal, in the free area clear of the header, the strips, the Belt and the composer. It can draw a small moving picture over the app. It never covers a question and never blocks a tap.
Shows. One picture of the trick's media/ folder, and one motion of a fixed list. A part says once (the picture plays one motion and is gone) or stay (it stays and shows a mood). It takes no view, no coordinates, no style and no code: Collie places and times the picture. Without sessions it shows on the Dashboard; with them (contract 2) it shows only in those sessions. It is hidden while a sheet, a dialog or a card that asks a question is open, while a field has focus and while a yes is held, and it comes back after. "Moving pictures from tricks" in Settings, Look and feel, turns every picture off on a device, and each trick keeps its own switch. Pictures must be original art, never a known character.
A tap. A once picture never takes a tap: a tap goes to what is under it. A stay picture is tap-through too, unless its part says opens "page": a parked picture (perch or idle, never one that is moving) then takes a tap in a 44 px box and opens the trick's Page. Tapping its picture opens its page. Nothing else takes a tap.
| Limit | Value |
|---|---|
| Parts of this place per trick | one stay and one once for every session, and up to eight bound ones of each mode with sessions. No session is named by two parts of one mode |
| A part | id, mode (once or stay), motion, sprite, and optionally edge, along, from, mood, opens and sessions. Nothing else |
motion of once | fly-across, arc or pop. Each plays once, in at most 5 s, and the picture fades in. arc (3.7 s) and pop (2.1 s) stay inside the free area and fade out. fly-across crosses at one even speed, a phone-wide crossing in 3.2 s (2 to 5 s, by its path), and flies out past the far edge of the free area, where it is cut off, with no fade at the end |
motion of stay | perch, wander or idle. perch stands on an edge (edge: top, bottom, left or right, bottom when left out): its foot touches the Belt, the status line or the composer below it, with no gap, or the edge of the screen where nothing is there. idle sits in place and bobs a little, wander moves to a new spot at most every 10 s |
sprite | src, a file of the trick's media/ folder (a PNG, JPEG or WebP, 2 MiB at most, the same check as an image node), and optionally frames, rows, fps, size, loop and after. Nothing else |
sprite size | s, m or l: the height a frame is drawn at. s is 32 px, m is 48 px, l is 72 px. The width follows the frame's own shape. s when left out. A picture that would not fit the free area is not drawn. With opens the tap box is at least 44 px each way and never smaller than the picture |
sprite frames and fps | frames is the columns of a sprite sheet, 1 to 16: that many frames side by side. A frame is the sheet's width over frames wide and its height over rows high, so a frame need not be square: a sheet of four 74 by 120 frames is 296 by 120 pixels, and its figure stands at the full height of size. fps is 1 to 12 and needs frames of 2 or more |
sprite loop | true or false. true when left out: the frames play over and over. false: they play once, frame 1 to the last at fps, and the last frame stays, for a motion that happens once, such as a throw. Set a slower fps for a slower play. A stay picture plays again from the first frame when its part is printed with a changed value (another mood, say), and does not when the same part is printed again unchanged. With reduced motion, and where a device cannot animate, it shows the last frame as a still |
sprite after | One more sprite, { src, frames, fps, loop }, on a stay part whose own loop is false: a sprite that loops never reaches a last frame, so an after on a sprite with loop set to true or left out is refused. src, frames (1 to 16), fps (the same cap) and loop (true when left out) read as the first sprite's do. It is one level deep (an after inside an after is refused) and takes no rows and no size. Timing: when the first sprite reaches its last frame, the second starts from its first frame at once; with loop set to false it holds its last frame, otherwise it loops. Its frames are as high as the first sprite's (size) and as wide as its own sheet says, so it may be wider, for a pose with writing beside the figure. At the switch the picture takes the new width at once, with no glide, and keeps its anchor: with perch, along start keeps the left side fixed and grows to the right, end keeps the right side, middle keeps the centre. The second sheet is loaded while the first plays. A part printed with a changed value plays both again from the first frame of the first sprite, and the same part printed again unchanged does not restart anything. With reduced motion, and where a device cannot animate, the picture shows the last frame of the second sprite as a still. A once part with from waits for the end of the first sprite only, and starts from the picture's hand as the first sprite's box measures it |
sprite rows | The rows of a sprite sheet, 1 to 5. 1 when left out, and the sheet is then one row of frames as high as the picture. Name more only for a sheet with one row per mood |
mood | working, waiting, idle, done or gone. With rows of 2 or more it picks the row of the sprite sheet, counting from the top in that order; a sheet with fewer rows draws its first row. idle when left out |
along | start, middle or end, with perch only: where the picture stands along its edge. start is the left of a top or bottom edge and the top of a left or right one, end the other end. It keeps 8 px from the corner. end when left out |
from | With a once part only: the id of a stay part of the same trick. While that picture is on screen, the motion starts at its hand: the picture's front edge (the one toward the side it flies to) at 40% of its height from the top, with the shot's centre on that point. It flies away from the picture across the free area, toward the farther side edge, and a fly-across keeps that height. A picture printed in the same run is waited for, up to 1.5 s. When that picture's sprite has loop set to false, the motion also waits until the picture's frames have played to the last one (up to 2 s after the part arrived, then it starts anyway), so a ball leaves when the throw ends. A picture that loops never delays it. Without that picture on screen (hidden, no room, not drawn within that time) it starts as usual. Naming a part that is missing, is not a stay float part or belongs to another trick refuses the part |
opens | page, on a stay part with perch or idle. The trick needs a Page for the tap to open |
| On screen at once | at most 2 stay pictures across all tricks, and one once picture at a time: one waits and the rest are dropped. A trick's once pictures start at least 15 s apart |
When a once picture plays | when Collie first sees the part, or sees it change, after the phone has loaded the tricks. To play the same picture again, print the part with a new id or another mood. Parts that were there when the phone opened do not play |
| Contract | sessions needs contract 2, as on a belt mark. The place itself works at contract 1 |
| Motion | transform and opacity only. A hidden page pauses every picture. With reduced motion a once picture does nothing and a stay picture is a still image: the mood swaps the frame, and nothing glides or wanders |
How a stay picture appears | In place: it is drawn at the spot it rests at and fades in over a fraction of a second. It never travels in from an edge. Only a later change of the free area or of its size glides it, and a wander picture moves from spot to spot |
| Art | original art only, never a known character |
sessions, contract 2 | 1 to 8 of the facts' session ids, agent sessions only. The part shows only in those sessions, in place of the trick's unbound part of this place there. Left out, the part is unbound |
| One part, as compact JSON | at most 16 KiB |
A program prints:
{
"v": 1,
"parts": [
{
"at": "float",
"id": "pet",
"mode": "stay",
"motion": "perch",
"edge": "bottom",
"along": "end",
"sprite": {
"src": "media/pet.png",
"frames": 4,
"fps": 6,
"size": "l"
},
"mood": "working",
"opens": "page"
}
]
}A program prints:
{
"v": 1,
"parts": [
{
"at": "float",
"id": "pet",
"mode": "stay",
"motion": "perch",
"sprite": {
"src": "media/pet.png",
"size": "m"
}
},
{
"at": "float",
"id": "tada",
"mode": "once",
"motion": "fly-across",
"from": "pet",
"sprite": {
"src": "media/spark.png",
"size": "s"
}
}
]
}In trick.toml:
id = "pet"
name = "Pet"
run = "program.ts"
places = ["float", "session"]agent-view

Where. A view of one agent session, beside Terminal and Chat. The session's own agent draws it, and the person switches it on per session.
Shows. One screen: a list of nodes in the Parts table's kinds (held tighter, see Parts), up to four pictures, and one decision block with a question and up to five options.
A tap. A tap on a button, or a pick in the decision block, sends a message in the person's name to that one session. It carries the label only: a button holds no hidden value. Collie marks the pick on the screen afterwards. The agent cannot: a button's pressed and a choice's picked are refused.
| Limit | Value |
|---|---|
| Contract | 2, and the manifest needs rules |
| Screen title | at most 80 characters |
The note of start | at most 80 characters |
| A button's label | one line, at most 60 characters |
| A group's label | one line, at most 40 characters |
| The view, as compact JSON | at most 16 KiB, and the view limits of a part |
| Pictures | at most 4 on a screen, 2 MiB each, 8 MiB together, caption at most 80 characters |
| Decision block | a question of at most 120 characters, 1 to 5 options |
| A pending block's label | at most 40 characters |
| Writes by the agent | 120 a minute for one trick and session |
| Sends from the view | 20 a minute for one session, one in flight at a time |
| Marks of a pick | Collie's, never the agent's. A redraw keeps a mark while a block of the same id holds a button at the same steps, and the decision block's while it asks the same question with the same options |
| Links | a web address only. A session href is refused. The phone shows the host after each link, whole |
| Collie's own words | no text of the agent's may say "From Collie", "Drawn by this session's agent", "Drawn in an earlier conversation", "Sent to this session", "A question waits in this session", "Your typing answers the question", "The screen changed", "The buttons wait", "The agent is working", "Tap again to send", "Earlier screen", "The agent answered in text". A text is read as whole words, in any case, with look-alike letters and hidden characters folded. Collie's bare name passes |
| The rules file | see Limits: the rules file |
In trick.toml:
id = "triage"
name = "Triage"
contract = 2
places = ["agent-view"]
rules = "rules.md"The agent passes show this file:
[
{
"kind": "card",
"attrs": {
"tone": "accent"
},
"kids": [
{
"kind": "para",
"text": "Two tests fail."
},
{
"kind": "button",
"attrs": {
"label": "Show me the first one",
"intent": "show-first"
}
}
]
}
]The Hill
A page of Decisions: questions that a program or an agent asks the person, each answered with one tap. It ships with Collie as an experiment, off until the person switches it on in Settings → Tricks and the Hill. A trick does not list it in places.
From a program. A program lists Decisions in the decisions key of its output (the helper's t.decide). The list is declarative: after each run that succeeded, Collie makes the Hill agree with it, as The list is the truth says below. A document lists at most 20.
From an agent. An agent posts one with collie hill post and reads the answer with collie hill status <id>. The answer also reaches the agent as a WalkyTalky message.
A Decision a program lists has these keys:
| Key | Type | Needed | Limit | What it is |
|---|---|---|---|---|
key | text | yes | 1 to 64 of a-z, 0-9 and -, unique in the document | The trick's own name for the Decision. The answer comes back with it. |
title | text | yes | at most 120 characters | The question, as a sentence the options answer. |
summary | text | yes | at most 280 characters | What the recommended option does, and the one fact that decides it. |
body | text | no | at most 4000 characters | Longer text, shown behind More. |
options | list | no | at most 5; each intent, label (at most 40), and optionally detail (at most 120) and confirm (at most 24) | The choices. A tap on one sends its intent back. |
recommends | object or null | no | { intent, why }, why at most 200 characters | The trick's pick, one of the options. Shown as Recommended, never pre-selected. |
priority | word | no | one of now, today, later. Default today | A request, not a fact. Only now sends a notification, and one sender holds at most 3 open now Decisions. |
text | word | no | one of none, optional, required. Default optional | Whether the person may, must, or may not add words to the answer. none needs at least one option. |
about | session id | no | an id from the facts' sessions, memberId:paneId | The session the card is about. The card opens its Chat. |
replyTo | session id | no | an id from the facts' sessions. Only for a trick whose trick.toml says decides = "reply" | The session that gets the person's words, as the person's own WalkyTalky message. Without decides = "reply" the Decision is refused. |
media | list | no | at most 4; each file (a PNG, JPEG or WebP in the trick's folder, 2 MiB at most) and optionally caption (at most 80 characters) | Pictures on the card. |
links | list | no | at most 5; each label (at most 40) and href (an https or http address, at most 500 characters) | Web pages that give more. |
expiresAt | instant | no | epoch milliseconds. Left out, 14 days; never more than 30 days | When the Decision closes by itself, as expired. |
view | list of nodes | no | see Parts: a Decision's view | A small display-only view under the summary: facts to read, never a control. |
| Limit | Value |
|---|---|
| Open Decisions per sender | 20 |
Open now Decisions per sender | 3. A further one shows as today |
| Closed Decisions served | 20, newest first |
| The person's words in an answer | at most 4000 characters |
| Expiry | 14 days when left out, at most 30 |
| Answers waiting for one trick | 32. One more is refused as busy |
The answer. When the person answers, the program runs once with a tap trigger. Its node is hill/<key>. Its intent is the chosen option's, answer for words alone, or dismiss. Its value is { "text": ... }, the person's words or null. Its seen is the hash of the version the person saw, so the trick can tell an answer to old words from one to new.
A program lists this Decision:
{
"key": "case-24",
"title": "Rerun the failed check?",
"summary": "Check 24 failed twice, on a timeout. A rerun takes about a minute.",
"options": [
{
"intent": "rerun",
"label": "Rerun it"
},
{
"intent": "skip",
"label": "Skip it"
}
],
"recommends": {
"intent": "rerun",
"why": "It failed on a timeout, not on a test."
}
}The answer comes back as this trigger:
{
"kind": "tap",
"rid": "0b9e8d7c-3a41-4c52-9d5e-1f2a3b4c5d6e",
"node": "hill/case-24",
"intent": "rerun",
"value": {
"text": "Rerun it, then tell me."
},
"seen": "944a71314b332828"
}From a terminal:
collie hill post --title "Rerun the failed check?" --summary "Check 24 failed on a timeout." --option rerun="Rerun it" --option skip="Skip it" --recommend rerun --why "It was a timeout."The list is the truth
After each run that succeeded, Collie makes the Hill agree with the list of decisions, key by key.
| When | Collie does |
|---|---|
A new key | Posts once. A second run, or a restart, posts nothing twice. |
A listed key with changed content | Posts the new version, which replaces the open one. Content is the title, summary, body, options, recommendation, text mode, links, priority, about, replyTo, the view, and each picture's bytes and caption. When the old card is closed, the new version posts as a fresh card. |
A key the list no longer holds | The card is withdrawn, "by the trick". |
A key the person answered or dismissed | Stays closed while its content is unchanged. To ask again, change the content, or drop the key for one run and list it again. |
A key that closed without the person: undeliverable, expired or withdrawn, a withdrawal by anyone but the trick | Posts again on a later run that still lists it, at most once every 10 minutes for that key. A new post of this kind never sends a notification. |
A document with no decisions key | Changes nothing. |
decisions is [] | Withdraws every open card of the trick. |
| A Decision the parser or the Hill refuses, or that names a session that is not there | Changes nothing for its key: the version on the Hill stays. It shows as a refusal. |
A Decision with replyTo from a trick whose trick.toml does not say decides = "reply" | Refused with "This trick did not say that its Decisions reply to a session." An open card of its key is withdrawn, so no answer reaches a session. |
| A failed or timed-out run | Changes nothing. |
| The trick switched off or removed | Every open card of the trick is withdrawn at once, "the trick is off". |
| The Hill switched off | No post, replace or withdraw happens, and the trick still runs. Its row says its Decisions are not shown. |
So list every Decision you still want on every run, and keep the words stable. Words that change on each run, such as an age in minutes, post a new version every time and ask again.
Wording a card
A person opens the card cold, between other things, so the words carry the decision.
| Part | How to write it |
|---|---|
| Title | The decision as a short question that the options answer, at most 60 characters. "Ship 1.28.1 to Stable now?" is good. "Are the new kinds right?" is not. |
| Summary | At most 2 sentences and 200 characters. The first says what the recommended option does. The second gives the one fact that decides it. The evidence goes in the view or the body. |
| Option | Starts with a verb and says what happens, such as "Hold until CI". Never a bare Yes or No. |
collie trick dev and collie trick check --run warn about a title past 60 characters or with no question mark, a summary past 2 sentences or 200 characters, and an option that says only Yes, No or OK. A warning never refuses.
Parts
A part, in this page, is one node of a view: the building block a view is made of (the schema calls it a node kind). A node is { "kind": ..., "text"?: ..., "attrs"?: ..., "kids"?: ... }, and every attribute value is text.
- A program's view, on its Page (a
sessionpart): every kind. - A Decision's view, under its summary: display only. It takes
group,list,row,bar,chip,para,line,run,code,link,meter,spacer,number,image,compare,table,col,cell,difforspark. At most 8 KiB, 100 nodes and 4 levels. - An agent view: every kind, read strictly. A kind or an attribute that a program's part would only leave out is refused.
| Part | What it is | Sits | In a Decision's view |
|---|---|---|---|
card | A block that groups what belongs together. Its tone colours its edge. | the top of a view | no |
group | A titled set of rows and other nodes. The person can fold it. | the top of a view, in a card, in a group, in a list | yes |
list | A list of rows and groups. It keeps the height of its kids, so a change inside one row moves nothing. | the top of a view | yes |
row | One line: a title, an optional end word, and optionally a second line, chips and one trailing button. | in a group, in a list | yes |
bar | A strip of buttons, chips and links. With role strip it scrolls sideways as a band. | the top of a view, in a card, in a group | yes |
chip | A small label. state draws a dot, current marks the step, and at with clock makes it a live time. | in a card, in a row, in a bar | yes |
button | Sends one intent to the trick on a tap, copies a text with does set to copy, or puts a text into the reply box with does set to draft. | in a card, in a row, in a bar | no |
para | One paragraph of plain text, or of run and link kids. | the top of a view, in a card, in a group, in a row | yes |
line | One line of monospace screen text, such as a command or a log line. | the top of a view, in a card, in a group, in a code | yes |
run | A piece of text inside a para or a line, with its own style, link or live time. | in a para, in a line | yes |
code | A block of code. Its kids are line nodes. It scrolls on its own past max lines. | the top of a view | yes |
link | A link that opens a web page, or one agent session of the crew. | in a group, in a bar, in a para, in a line | yes |
image | A picture. In a program's part it is a file of the trick's media/ folder. In a Decision's view or an agent view it names one of the pictures that came with it, by ref. | the top of a view, in a card, in a group, in a compare | yes |
meter | An amount, or the progress of a task. With role progress and no value it is indeterminate. | the top of a view, in a card, in a group | yes |
spacer | Space between nodes. With a label it is a divider with words. | the top of a view, in a card, in a group | yes |
number | A big figure with a label under it. | the top of a view, in a card, in a group | yes |
compare | Two images side by side at one height, as before and after. | the top of a view, in a card, in a group | yes |
table | A small table: its column heads first, then its cells row by row. | the top of a view, in a card, in a group | yes |
col | A column head of a table. It sits only inside a table. | in a table | yes |
cell | One cell of a table. It sits only inside a table. An empty cell has no text. | in a table | yes |
diff | A hunk of a diff. Each line starts with + (added), - (removed) or @@ (a hunk head). | the top of a view, in a card, in a group | yes |
spark | A trend as a small line with no axes. The last point is marked. | the top of a view, in a card, in a group | yes |
card
A block that groups what belongs together. Its tone colours its edge.
Sits. the top of a view.
Holds. para, line, chip, button, meter, image, bar, group, number, spacer, compare, table, diff or spark (1 to 24).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The colour of the card's edge. |
{
"kind": "card",
"attrs": {
"tone": "ok"
},
"kids": [
{
"kind": "para",
"text": "All checks passed."
}
]
}group
A titled set of rows and other nodes. The person can fold it.
Sits. the top of a view, in a card, in a group, in a list.
Holds. row, group, bar, para, line, link, meter, number, spacer, image, compare, table, diff or spark (1 to 24).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
label | text | no | at most 60 characters | The group's title. |
fold | word | no | one of open, closed | Whether the group starts open or closed. The person owns the toggle after the first draw. |
badge | count or dot | no | a count from 0 to 9999 as text, or "" for a dot | A count, or a dot, beside the title. |
In an agent view. A label is one line of at most 40 characters, because a tap inside the group sends it.
{
"kind": "group",
"attrs": {
"label": "Services",
"fold": "open"
},
"kids": [
{
"kind": "row",
"text": "api",
"attrs": {
"end": "ok"
}
}
]
}list
A list of rows and groups. It keeps the height of its kids, so a change inside one row moves nothing.
Sits. the top of a view.
Holds. group or row (0 to 50).
{
"kind": "list",
"kids": [
{
"kind": "row",
"text": "api"
},
{
"kind": "row",
"text": "web"
}
]
}row
One line: a title, an optional end word, and optionally a second line, chips and one trailing button.
Sits. in a group, in a list.
Holds. para, chip or button (0 to 24).
Text. The row's title. (required, at most 120 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
href | address | no | with no rel, an https or http address (at most 2048 characters) or a session's id from the facts | Makes the row tappable: an https or http address, or a session's id from the facts. |
end | text | no | at most 24 characters | A short word at the end of the row. |
badge | count or dot | no | a count from 0 to 9999 as text, or "" for a dot | A count, or a dot, on the row. |
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the row. |
cut | word | no | one of end, mid | Where a long title is cut. |
icon | icon | no | one of the icon words in Shared values | An icon at the start of the row. |
disabled | text | no | at most 120 characters, may be empty | The reason the row cannot be used. An empty text means no reason is given. |
In an agent view. An href is a web address only: a session is refused.
In a Decision's view. A row opens a web page at most. It takes no button.
{
"kind": "list",
"kids": [
{
"kind": "row",
"text": "api",
"attrs": {
"end": "ok",
"tone": "ok",
"icon": "check"
},
"kids": [
{
"kind": "para",
"text": "Deployed 2 min ago"
}
]
}
]
}bar
A strip of buttons, chips and links. With role strip it scrolls sideways as a band.
Sits. the top of a view, in a card, in a group.
Holds. button, chip or link (1 to 12).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
role | word | no | one of strip | strip makes the bar one band that scrolls sideways. |
scroll | word | no | one of x | Sideways scroll for a bar of chips. |
label | text | no | at most 40 characters | A short name for the bar. |
{
"kind": "bar",
"kids": [
{
"kind": "button",
"attrs": {
"label": "Rerun",
"intent": "rerun"
}
},
{
"kind": "chip",
"text": "3 failed",
"attrs": {
"tone": "danger"
}
}
]
}chip
A small label. state draws a dot, current marks the step, and at with clock makes it a live time.
Sits. in a card, in a row, in a bar.
Text. The words of the chip. They may be left out when the chip is a live time (at and clock). (optional, at most 60 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the chip. |
icon | icon | no | one of the icon words in Shared values | An icon before the text. |
at | instant | no | epoch milliseconds as digits, such as "1794130692000" | An instant that the chip shows as a live time. It goes with clock. |
clock | word | no | one of ago, elapsed, left, time | How the instant is told. It goes with at. |
state | word | no | one of working, waiting, idle, done, gone | Draws a status dot. Chips with a state in a bar draw a strip of steps. |
current | flag | no | the empty text "" when on, left out when off | Marks this chip as the current step. |
short | text | no | at most 12 characters | The text shown when the box is narrow. |
{
"kind": "card",
"kids": [
{
"kind": "chip",
"text": "building",
"attrs": {
"state": "working",
"icon": "refresh"
}
}
]
}button
Sends one intent to the trick on a tap, copies a text with does set to copy, or puts a text into the reply box with does set to draft.
Sits. in a card, in a row, in a bar.
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
intent | intent | yes, unless does is copy or draft | 1 to 48 of a-z, 0-9, ., _ and -, starting with a letter or a digit | The intent a tap sends to the trick. |
label | text | yes | at most 24 characters | The words on the button. |
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the button. |
disabled | text | no | at most 120 characters, may be empty | The reason the button cannot be used. An empty text means no reason is given. |
pressed | word | no | one of true, false, mixed | Draws the button as a toggle: on, off or mixed. An agent view refuses it: Collie marks the pick. |
confirm | text | no | at most 24 characters | A second label. The first tap arms the button and the second sends the intent. |
badge | count or dot | no | a count from 0 to 9999 as text, or "" for a dot | A count, or a dot, on the button. |
icon | icon | no | one of the icon words in Shared values | An icon on the button. |
hint | text | no | at most 120 characters | A short line of help for the button. |
does | word | no | one of copy, draft | copy copies value to the phone's clipboard instead of sending an intent. draft puts value into the reply box of the session the page is open for, and opens that session. It never sends: the person reads it and taps Send. draft needs drafts = "session" in trick.toml, and it fills only an empty box. |
value | text | yes, when does is copy or draft | 1 to 1024 bytes, or with does draft 1 to 4000 characters; no control or invisible character but a line break and a tab | The one fixed text a tap sends with the intent, the text copy copies, or the text draft puts into the reply box. A draft value is at most 4000 characters, line breaks allowed. |
In an agent view. A tap sends the label (and the label of the group it sits in). value, does (draft too) and pressed are refused: Collie marks the pick, the agent does not. The label is one line of at most 60 characters, and says none of Collie's own words.
{
"kind": "card",
"kids": [
{
"kind": "button",
"attrs": {
"label": "Rerun",
"intent": "rerun",
"tone": "accent"
}
}
]
}para
One paragraph of plain text, or of run and link kids.
Sits. the top of a view, in a card, in a group, in a row.
Holds. run or link (1 to 64).
Text. The paragraph's words. Give text, or run and link kids, exactly one of the two. (optional, at most 2000 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
role | word | no | one of heading, quote | Draws the paragraph as a heading or a quote. |
bullet | text | no | at most 4 characters | A marker before the paragraph, such as - or 1.. |
term | text | no | at most 40 characters | A short term that the paragraph defines. |
{
"kind": "para",
"text": "Three checks failed on the last run."
}line
One line of monospace screen text, such as a command or a log line.
Sits. the top of a view, in a card, in a group, in a code.
Holds. run or link (1 to 64).
Text. The line's words, a tab allowed. Give text, or run and link kids, never both. (optional, at most 240 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
style | style words | no | words with single spaces between, each once, from Shared values | Style words for the whole line. |
role | word | no | one of text, status, note | Draws the line as plain text, a status line or a note. |
{
"kind": "line",
"text": "$ bun test",
"attrs": {
"style": "dim"
}
}run
A piece of text inside a para or a line, with its own style, link or live time.
Sits. in a para, in a line.
Text. The piece of text. Spaces alone are allowed. (required, at most 2000 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
style | style words | no | words with single spaces between, each once, from Shared values | Style words for this piece of text. |
code | flag | no | the empty text "" when on, left out when off | A flag: draws the text as inline code. |
href | web address | no | https or http, at most 2048 characters | Makes the text a link to a web address. |
at | instant | no | epoch milliseconds as digits, such as "1794130692000" | An instant that the text shows as a live time. It goes with clock. |
clock | word | no | one of ago, elapsed, left, time | How the instant is told. It goes with at. |
In an agent view. Text with an href that reads as a web address must be that address. The href is a web address only, and the phone shows its host after the run.
{
"kind": "para",
"kids": [
{
"kind": "run",
"text": "Build "
},
{
"kind": "run",
"text": "passed",
"attrs": {
"style": "bold"
}
}
]
}code
A block of code. Its kids are line nodes. It scrolls on its own past max lines.
Sits. the top of a view.
Holds. line (1 to 200).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
lang | word | no | 1 to 24 of a-z, 0-9, +, #, ., _ and - | The language word of the code. |
max | whole number | no | 1 to 40, as text | How many lines show before the block scrolls on its own. |
{
"kind": "code",
"attrs": {
"lang": "ts"
},
"kids": [
{
"kind": "line",
"text": "const total = 3;"
}
]
}link
A link that opens a web page, or one agent session of the crew.
Sits. in a group, in a bar, in a para, in a line.
Text. The words of the link. (required, at most 120 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
href | address | yes | with no rel, an https or http address (at most 2048 characters) or a session's id from the facts | Where the link goes: a web address, or a session's id from the facts with rel pane. |
rel | word | no | one of url, file, pane | What the href names: url or pane. file is refused: a trick opens no file. |
badge | count or dot | no | a count from 0 to 9999 as text, or "" for a dot | A count, or a dot, on the link. |
icon | icon | no | one of the icon words in Shared values | An icon before the link text. |
In an agent view. Text that reads as a web address must be that address, in any script. The href is a web address only: a session is refused. The phone shows the host after the link.
In a Decision's view. A link opens a web page only.
{
"kind": "group",
"attrs": {
"label": "More"
},
"kids": [
{
"kind": "link",
"text": "Open the run",
"attrs": {
"href": "https://example.com/run/1"
}
}
]
}image
A picture. In a program's part it is a file of the trick's media/ folder. In a Decision's view or an agent view it names one of the pictures that came with it, by ref.
Sits. the top of a view, in a card, in a group, in a compare.
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
src | picture path | in a program's part | a .png, .jpg, .jpeg or .webp file in media/, such as media/chart.png, with no step that starts with a dot | A picture file in the trick's media/ folder. Used in a program's part. |
alt | text | in a program's part | at most 120 characters, may be empty | What the picture shows, in words. |
w | whole number | in a program's part | 1 to 4096, as text | The picture's width in pixels. It reserves the box. |
h | whole number | in a program's part | 1 to 4096, as text | The picture's height in pixels. It reserves the box. |
ref | whole number | in a Decision's view and an agent view | 0 to 3, as text | The place of one of the Decision's or the screen's own pictures, counted from 0. Used in a Decision's view and an agent view. |
caption | text | no | at most 80 characters | A line of words under the picture. In a compare it labels the frame. |
fit | word | no | one of contain, cover | contain shows the whole picture. cover fills the frame and cuts the edges. |
focus | numbers | no | "x y" or "x y zoom": x and y from 0 to 100 (percent), zoom from 1 to 8 | The point of the picture to keep in the middle of its frame, and how far to zoom in on it. |
In an agent view. The agent adds pictures with --image (at most 4) and names each by ref.
In a Decision's view. Names one of the Decision's own pictures by ref.
{
"kind": "image",
"attrs": {
"src": "media/chart.png",
"alt": "Latency chart",
"w": "640",
"h": "360"
}
}meter
An amount, or the progress of a task. With role progress and no value it is indeterminate.
Sits. the top of a view, in a card, in a group.
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
value | number | yes, unless role is progress | 0 or more, as text, such as "68" or "0.5" | How much, from 0 to max. |
max | number | no | 0 or more, as text, such as "68" or "0.5" | The full amount. It defaults to 1. |
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the meter. |
label | text | no | at most 40 characters | A short name for the meter. |
role | word | no | one of progress, meter | meter is an amount. progress is the steps of a task. |
{
"kind": "meter",
"attrs": {
"value": "68",
"max": "100",
"label": "Disk",
"tone": "warn"
}
}spacer
Space between nodes. With a label it is a divider with words.
Sits. the top of a view, in a card, in a group.
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
label | text | no | at most 40 characters | Words in the divider. |
{
"kind": "spacer",
"attrs": {
"label": "Today"
}
}number
A big figure with a label under it.
Sits. the top of a view, in a card, in a group.
Text. The figure, such as 23/34 or 1.2k. (required, at most 12 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
label | text | no | at most 40 characters | The words under the figure. |
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the figure. |
unit | text | no | at most 24 characters | A short unit after the figure. |
{
"kind": "number",
"text": "23/34",
"attrs": {
"label": "checks passed",
"tone": "ok"
}
}compare
Two images side by side at one height, as before and after.
Sits. the top of a view, in a card, in a group.
Holds. exactly two image.
In an agent view. Two images named by ref.
In a Decision's view. Two images named by ref.
{
"kind": "compare",
"kids": [
{
"kind": "image",
"attrs": {
"src": "media/before.png",
"alt": "Before",
"w": "320",
"h": "200"
}
},
{
"kind": "image",
"attrs": {
"src": "media/after.png",
"alt": "After",
"w": "320",
"h": "200"
}
}
]
}table
A small table: its column heads first, then its cells row by row.
Sits. the top of a view, in a card, in a group.
Holds. col (1 to 4), then cell row by row, at most 12 rows.
{
"kind": "table",
"kids": [
{
"kind": "col",
"text": "Check"
},
{
"kind": "col",
"text": "Time",
"attrs": {
"align": "end"
}
},
{
"kind": "cell",
"text": "build"
},
{
"kind": "cell",
"text": "12 s"
}
]
}col
A column head of a table. It sits only inside a table.
Sits. in a table.
Text. The column head. (required, at most 40 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
align | word | no | one of start, end | Which side of its column the words keep. A column of figures keeps the end side by default. |
{
"kind": "table",
"kids": [
{
"kind": "col",
"text": "Check"
},
{
"kind": "cell",
"text": "build"
}
]
}cell
One cell of a table. It sits only inside a table. An empty cell has no text.
Sits. in a table.
Text. The cell's words. It may be empty. (optional, at most 120 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the cell. |
{
"kind": "table",
"kids": [
{
"kind": "col",
"text": "Check"
},
{
"kind": "cell",
"text": "build",
"attrs": {
"tone": "ok"
}
}
]
}diff
A hunk of a diff. Each line starts with + (added), - (removed) or @@ (a hunk head).
Sits. the top of a view, in a card, in a group.
Text. The lines of the hunk, one line break between two lines. (required, at most 8040 characters).
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
file | text | no | at most 120 characters | The name of the file the hunk is from. |
{
"kind": "diff",
"text": "@@ -1 +1 @@\n-const a = 1;\n+const a = 2;",
"attrs": {
"file": "app.ts"
}
}spark
A trend as a small line with no axes. The last point is marked.
Sits. the top of a view, in a card, in a group.
| Attribute | Type | Needed | Limit | What it is |
|---|---|---|---|---|
values | numbers | yes | 2 to 32 numbers with one space between | The numbers of the trend, oldest first. |
tone | tone | no | one of plain, accent, warn, danger, ok, muted | The tone of the line. |
label | text | no | at most 40 characters | A short name for the trend. |
{
"kind": "spark",
"attrs": {
"values": "3 5 4 8 6",
"tone": "accent",
"label": "latency"
}
}Shared values
| Name | Values |
|---|---|
| tone | plain, accent, warn, danger, ok, muted |
| icon | archive, back, bell, branch, camera, chat, check, clock, close, copy, crew, delete, down, download, edit, eye, file, flag, flask, folder, git-pull-request, image, info, key, link, lock, machine, menu, mic, minus, more, move, next, note, pause, pin, play, plug, plus, refresh, search, send, settings, share, star, tag, terminal, up, upload, warn, x. The default icon of a trick is plug |
| action icon | play, pause, check, x, refresh, archive, flag, star, send, note, search, more |
| chip state | working, waiting, idle, done, gone |
| clock | ago, elapsed, left, time |
| style | bold, dim, italic, underline, inverse, strike, box, fg-<colour>, bg-<colour> and the syntax inks syn-keyword, syn-string, syn-comment, syn-number, syn-type, syn-func, syn-const, syn-punct. The colours are black, red, green, yellow, blue, magenta, cyan, white, bright-black, bright-red, bright-green, bright-yellow, bright-blue, bright-magenta, bright-cyan, bright-white |
| button intent | 1 to 48 of a-z, 0-9, ., _ and -, starting with a letter or a digit |
| Decision option intent | 1 to 32 of a-z, 0-9 and -, starting with a letter, never answer or dismiss |
Manifest keys
These are all the keys of trick.toml. At the same contract, any other key is refused, so a typo shows.
| Key | Type | Needed | Limit | Contract | What it is |
|---|---|---|---|---|---|
id | text | yes | 1 to 32 of a-z, 0-9 and -, starting with a letter or a digit. It equals the folder's name. Not walky-talky, hill, collie, view | 1 | The trick's id, which is also the name of its folder. |
name | text | yes | at most 40 characters | 1 | The name a person reads on the row. |
run | text | yes, unless the trick is only an agent view | at most 1024 characters | 1 | What Collie runs: a TypeScript file in the folder ("program.ts"), or a shell command line. An agent view alone has none. |
every | duration | no | 5s to 24h, one whole number and s, m or h, such as 30s or 5m | 1 | How often it runs on its timer. Left out, it runs at start and on taps only. |
watch | list of paths | no | at most 8 paths of at most 256 characters, each an absolute path, or a path under the home folder written with a leading tilde | 1 | Run when one of these files changes. A right: the card names the paths. See When a trick reacts. |
on | list of words | no | session.status, turn.end, ask.open | 1 | Run when a session of an agent changes in one of these ways. A right: the card says it. See When a trick reacts. |
mode | word | no | once or serve. Default once | 1 | once runs once per trigger and prints one document. serve is kept for a later Collie. |
contract | whole number | no | 1 to 999. Default 1. This Collie speaks 1 to 3 | 1 | The contract the trick is written for. Write 2 to read files with inputs or to add an agent view, 3 to keep settings with [[field]] or to read Collie with access. A higher number than this Collie knows is refused with one line. |
icon | word | no | one of the icon words in Shared values. Default plug | 1 | The trick's icon. collie trick check names a wrong one. |
places | list of words | yes | 1 to 16 of belt, session, dashboard, status, tabbar, menu, float, agent-view. Each once | 1 | Where its parts draw. Each place a part uses must be listed. agent-view adds an agent view and needs contract 2. |
env | list of names | no | at most 32 names of at most 64 characters: letters, digits and _, not starting with a digit | 1 | Environment names the program gets beyond the base list, such as GH_TOKEN. The person sees each one. |
inputs | list of globs | no | at most 8 globs of at most 256 characters and 6 steps, relative to a session's folder | 2 | Files the program reads from each agent session's folder. They are untrusted data: show them, never run them. |
description | text | no | at most 140 characters, plain text | 1 | One plain line that says what the trick does. Settings shows it under the name. |
about | text | no | at most 1200 characters, plain text, a blank line splits paragraphs | 1 | The text of the trick's details page. |
version | text | no | 1 to 24 characters: letters, digits, ., + and -, such as 1.2.0 | 1 | The trick's own version. The details page shows it. Collie never compares it and reads no tag. |
rules | file name | yes, with agent-view; refused without it | a file in the trick's folder of at most 64 characters ending in .md, such as rules.md | 2 | The instructions the agent of a session reads. The person reads them whole before they switch the trick on. |
decides | word | no | reply. Refused on a trick that is only an agent view | 1 | Whether its Decisions answer into a session. reply lets a Decision name replyTo, and the person's answer is typed into that session as their own message. Without it, a Decision with replyTo is refused. It is a right: a version that adds it asks again. |
drafts | word | no | session. Refused on a trick that is only an agent view | 1 | Whether its buttons may put text into a reply box. session lets a button set does to draft: a tap puts its value into the reply box of the session the page is open for, only when that box is empty, and never sends. Without it, a part with such a button is refused. The card says: "Its buttons can put text into the reply box of the session you are in. You read it and send it yourself." It is a right: a version that adds it asks again. |
field | list of tables | no | at most 12 [[field]] tables. Each has key (spelled like a trick id, each once), kind (text, choice, switch or number), label (at most 40 characters) and may have hint (at most 120), default and required. A choice lists 2 to 8 options of at most 40 characters; a number names whole min and max within 999999999 either way; a text value is one line of at most 200 characters; a switch is never required | 3 | Settings the person keeps for the trick, set on its details page on the phone. The program reads them in its facts as values. A value is the person's data and untrusted for the program: show it, never run it. A setting is never a secret: a key comes through env. A new or changed field is a new version and asks again; a changed value does not ask, and runs the trick once. |
access | word | no | none, see or read. Default none | 3 | How much of Collie's local API the trick reads through t.api. see reads lists and states, read adds the text of a screen. A right: a version that raises it asks again. See Reading Collie through the local API. Experimental. |
In trick.toml:
id = "legs"
name = "Legs"
run = "program.ts"
every = "5m"
icon = "check"
places = ["belt", "status", "session"]
description = "Shows how many checks passed."The program
A trick's program reads one JSON document on stdin, the facts, and prints one JSON document on stdout, exits 0, and may use the helper trick.ts. This section lists what each side holds.
What the program receives
Collie writes the facts on stdin. The program ignores a field it does not know, because a later Collie at the same contract may add one.
| Field | Present | What it holds |
|---|---|---|
contract | always | The trick's own contract number: contract of trick.toml, or 1 when it names none. |
trigger | always | Why this run happened. See the table of triggers below. |
trick | always | id, dir, state: the trick's id, the folder of the approved copy that the program runs in, and the state folder. The program keeps its notes in state, never in dir. |
memberId | always | The bridge that runs the trick: its crew member id, or on a solo install its install id (m_ and ten characters). It stays the same when the machine is renamed. Key anything the program keeps on it. |
host | always | The machine's name, for display only. It changes with a rename. Never key on it. |
sessions | always | The agent and shell sessions, at most 256. On a crew's lead they are every member's, the lead's own first. |
spaces | always | Each space as name, folder (folder is left out when there is none), at most 64. |
sessionsOmitted | only when some are left out | How many sessions the caps left out. Only a crew's lead counts them: a solo machine past the cap leaves the rest out with no count. Absent when none. |
values | contract 3, a trick with [[field]] | Each field's value by its key: the person's own, else the field's default. A field with neither is left out. A value is the person's data and untrusted for the program: show it, never run it. |
api | only with access, while the local API stands | socket, access, token: the path of Collie's local API socket, the level access declares (see or read), and this run's token. t.api dials the socket and names the token. The token dies when the run ends. Nothing of it is in the environment, and your program must not print, log or save the token. Absent when the trick declares no access, and when the socket does not stand. |
A session in sessions has these fields:
| Field | Present | What it holds |
|---|---|---|
id | always | The scope key <memberId>:<paneId>. Pass it back in a Decision's about and replyTo, or as the href of a link or a row. |
memberId | always | The bridge the session runs on. Read it, and do not parse id. |
sessionId | always | An opaque id. Never parse it: it can change. |
paneId | always | The multiplexer pane the session is in now. |
host | always | The name of the session's machine, for display only. Never a key. |
name | when it has one | The session's name. |
agent | an agent only | The agent's name. A shell has none. |
status | always | One of idle, working, blocked, done, unknown. |
cwd | when known | The session's working folder. cwd is the pane's folder. A workspace folder can hold several repositories; look inside it. |
space | when known | The label of the session's space. |
tab | when known | The label of the session's tab. |
lastActiveAt | when known | When the session was last active, as an ISO 8601 time. The sessions of a crew's members have none. |
reachable | a crew's lead only | Whether the lead's last sweep reached the session's machine. The lead's own sessions are true. |
inputs | contract 2, with inputs | The files of the session's folder that the manifest's globs matched: state, files, skipped. See Input globs. |
The trigger tells why the run happened:
trigger.kind | When | Other fields |
|---|---|---|
start | The first run after the trick loads, is switched on, a new version is approved or its config.toml changes. | none |
timer | Every every after the last run, while a phone has looked in the last 5 minutes. A trick with no every gets none. | none |
tap | A person tapped a control of the trick, or answered one of its Decisions. | rid, node, intent, value, from, seen |
watch | A file of the manifest's watch changed. path is the path as the manifest wrote it, and count is how many files changed in the same burst. | path, count |
event | An event of the manifest's on reached the trick. session is the id of the newest event's session, and count is how many events were folded into this run. | event, session, count |
A tap on a control of the trick's own part has node set to the part's id (belt for the Belt mark). Its intent is the control's, its value the control's one fixed text, and its from the session open on the phone, as { "session": ... }, when there is one.
A tap on a row in a session's settings (contract 2) always has from: the session whose sheet it was. For a bound part, a belt mark or a menu part with sessions, it is one of the part's sessions, at the pane it was bound to; Collie refuses the rest before the program runs.
An answer to a Decision is a tap too: its node is hill/<key>, and its seen is the hash of the version the person saw. See The Hill.
rid is a UUID. A retried tap has the same rid, and Collie runs nothing twice for one rid: it answers with the first receipt. A program that records an answer keys the record on rid. The same rid with a different tap is refused.
Collie checks a tap before the program runs. It refuses one that names a part or a control the trick did not draw, or a session this Collie does not list, runs nothing, and answers with one of these words in refused:
refused | Receipt | When | Collie's line |
|---|---|---|---|
part | rejected | The trick holds no part with that node now. A trick that has drawn nothing since Collie started answers changed instead. | The trick holds no such part now, so nothing ran. |
intent | rejected | No control of the part sends that intent. | No control of this part sends that intent, so nothing ran. |
value | rejected | No control of the part sends that value with that intent. | No control of this part sends that value, so nothing ran. |
changed | changed | The part changed since the phone drew it: the tap's rev is older than the part, or missing. The reply carries the trick's parts now, and the phone draws them. | The part changed since the phone drew it, so nothing ran. Look at it again. |
session | rejected | from.session names no agent session that is open here now, or one on a crew member this Collie cannot reach. | The tap names no agent session that is open here now, so nothing ran. |
from.session is not proof of who tapped, nor of the session the part was drawn for. Collie checks only that it is an agent session open here now. A program never lets it decide who may do what.
What the program prints
The program prints one JSON document on stdout and exits 0:
{ "v": 1, "parts": [], "decisions": [], "asOf": "2026-11-08T09:41:00Z", "fresh": "90s" }| Key | Needed | What it is |
|---|---|---|
v | yes | The contract number of the document: a whole number from 1 to 3, this Collie's own. The helper prints the contract of the facts. |
parts | yes | The parts, at most 24, each at most 16 KiB. [] is allowed. See Places. |
asOf | no | When the data was true, as an ISO 8601 time with a zone, such as 2026-11-08T09:41:00Z. Give it when the data is older than the run. |
fresh | no | How long the parts stay fresh: 5s to 24h, one whole number and s, m or h, such as 90s. Left out, 3 times every, at least 1 minute, or 10 minutes for a trick with no timer, and never more than 24h. Past it, the phone draws every tone as unknown. |
decisions | no | The Decisions to ask, at most 20. Left out, the open Decisions stay as they are. [] withdraws them all. See The Hill. |
There is no draft and no open key in the document: Collie ignores each with a note. What a trick wants to show is a link. What it wants to tell the person is a Decision.
Collie never sends a trick's text into a session on its own. Text reaches a session in three ways, and each one waits for the person's own tap:
| Way | What happens | What the trick needs |
|---|---|---|
A button with does set to draft | A tap puts the button's value into the reply box of the session the trick's page is open for, and opens that session. It fills only an empty box: a box with words is left as it is. Collie never sends it: the person reads it and taps Send. | drafts = "session" in trick.toml |
A Decision with replyTo | The person's answer is typed into that session as their own message. | decides = "reply" in trick.toml |
| A button in an agent view | A tap sends the button's label to the session the view belongs to. | the place agent-view and its rules |
Apart from a draft, which opens the session it filled, a tap never moves the phone. The trick learns nothing back: not whether the person sent the text, changed it or cleared it.
Strict at write, tolerant at read
Collie checks strictly what a person or an agent writes: trick.toml, collie hill post and a trick's Decisions. An unknown key, kind or attribute there is refused. It reads a program's output tolerantly, so a trick written for a newer Collie runs on an older one, which leaves out only what it does not know. From contract 2 a part is read closed: an unknown key inside it leaves that part out, since it may carry a meaning this Collie cannot keep. The document's own keys stay open.
| The program prints | Collie does |
|---|---|
| A node of a kind this Collie does not know | Left out, with a dropped note. The rest of the view draws. |
| A part in a place this Collie does not know | Left out whole, with a dropped note. The other parts draw. |
| A key or an attribute this Collie does not know, inside a part, at contract 1 | Ignored, with an ignored note. A node with only such attributes draws as if it had none. |
| A key or an attribute this Collie does not know, at any depth of a part, at contract 2 or newer | That part is refused alone, with an unknown-key refusal that names the key and ends: "A contract 2 trick uses only the keys this Collie knows, so the part is left out; the other parts draw." Collie keeps no last good version of it. |
A key this Collie does not know at the top of the document, beside v, parts, asOf, fresh and decisions | Ignored, with an ignored note, at every contract. Every part draws. A key that changes how a part draws or what a tap does goes in the part, never at the top. |
| A bad value of a known field | That part is refused alone, and the other parts draw. The last good version of the part stays on the phone, marked old. |
A button with does set to draft in a trick whose trick.toml does not say drafts = "session" | That part is refused alone with "This trick did not say that its buttons put text into a reply box. Add drafts = "session" to trick.toml." The other parts draw. |
| A bad Decision | That Decision is refused alone. Its open card stays as it is. |
A bad asOf or fresh | Refused alone. The parts still draw. |
A document that is too big, not JSON, not an object, with no usable v, or with parts that is not a list | The whole document is refused. The run counts as failed, and the last good parts stay, marked old. |
The helper
trick.ts is the helper of a TypeScript trick. run((t) => { ... }) reads the facts, calls your function once and prints the document. These are its calls:
| Call | What it does |
|---|---|
t.facts, t.config, t.tap | The facts, config.toml parsed ({} when there is none), and the tap that started the run or null. A tap has rid, node, intent, value, decision (the key of the Decision it answers, or null), text, from and seen. |
t.status({ text, icon?, tone? }) | The chip in the status line. text is at most 12 characters. |
t.belt({ label, icon?, tone?, badge?, intent?, sessions?, id? }) | The mark at the end of the Belt. With sessions (contract 2) it shows only in those sessions; a bound mark without an id is numbered belt-1, belt-2. |
t.menu(rows, { sessions?, id? }) | Rows in a session's settings (contract 2): buttons { kind: "button", id, label, intent, icon?, confirm? } and switches { kind: "switch", id, label, intent, on, icon? }. The phone shows a switch's on from your next document, never a guess. |
t.dashboard(item), t.tabbar(item) | The Dashboard tile and the bottom bar item: { label, icon?, badge?, tone? }. |
t.session({ id?, name?, icon?, tone?, subtitle?, badge?, progress?, actions?, view }) | The trick's own Page. Keep the default id main. |
v.card, v.list, v.row, and one builder for each other kind in Parts | Build a view. v.table makes the col and cell kids, so those two have no builder. v.checks, v.stat and v.beforeAfter put kinds together. |
t.decide({ key, title, summary, options, ... }) | Ask the person on the Hill. |
t.keepDecisions() | Leave the decisions key out, so the open Decisions stay. It wins over t.decide. |
t.state.get(name, fallback), t.state.set(name, value) | JSON files in the state folder. A name may hold folders, such as cache/ci: plain names, none starting with a dot. |
t.log(name) | An append-only JSON-lines file in the state folder, with .append, .all, .last(n), .has(rid) and .once(rid, entry). .once writes once for one rid and answers false when it is there already. |
t.cached(name, ttlMs, loader) | A read kept with its time. A loader that throws serves the old value, marked stale. |
t.sh(cmd, args, { timeoutMs?, cwd? }) | Runs a program without a shell and never throws: a failure is ok: false with the reason in stderr. It waits 5 seconds unless timeoutMs says more, and keeps 256 KiB of each of stdout and stderr. |
t.tool(name) | The path of a program on PATH, or in a common user folder, or null. |
t.sessionAt(folder), t.sessionNamed(name) | The session whose folder is folder, or the one with this name, or null. |
t.fresh(duration), t.asOf(when) | The document's fresh and asOf. |
now(), age(ms), iso(ms?), mask(text), clip(text, n) | The clock in epoch milliseconds, a span in short words such as 12 min, an ISO 8601 time, text with each key cut to its first four characters and the home folder written as ~, and one masked line cut to n characters. |
t.api(operation, args?) | Reads through Collie's local API (experimental): await t.api("machines"). It answers the socket's line, { ok: true, ... }, or { ok: false, error: { code, message } }, and never throws, so a program shows error.message. It refuses before it dials when the trick declares no access, when the local API is off, or when the operation needs read and the trick declares see. Each call names this run's token, and Collie checks the level again. A call takes at most 3 seconds. See Reading Collie through the local API. |
t.inputs(session) | The input files of a session (contract 2): a text file as text, a picture as data. A copy that is gone or changed since the facts were written is left out. It answers [] when there are none, and session.inputs?.state says why. Never run what it returns. |
A run that calls neither t.decide nor t.keepDecisions prints "decisions": [], so it withdraws the open ones.
A thrown error prints one warning card on the trick's Page and exits 0, when the trick has a Page. The document has no decisions key, so the open Decisions stay. A trick with no Page exits 1, so the failure rules apply.
Stop your timers before the end. The run ends a second after its document is written, and a timer that still prints to stdout in that second spoils the document, so the run fails.
collie trick helper <id> rewrites trick.ts with the newest helper. The helper is part of the trick's code, so a trick that is on keeps running the approved copy, and the new helper waits for a yes.
Input globs
A contract 2 trick lists inputs in trick.toml: globs of files that Collie copies from each agent session's folder into the trick's inputs/ folder before each run, through the Files view's rules. The limits of globs, files and bytes are in the Inputs limits.
| Rule | Value |
|---|---|
| Shape | A path relative to a session's folder: 1 to 6 steps split by /, at most 256 characters. The manifest lists at most 8. |
* | Matches any run of characters inside one step, and never a leading dot. It never matches a .env file. |
| Refused | An absolute path or ~. **. A . or .. step. An empty step. A .git step, in any case. A step that starts with .env, in any case, such as .env, .env.local or .envrc. Any other glob word (?, [, ], {, }), a backslash and a control character. |
Each session in the facts gets inputs, with these fields:
| Field | Present | What it holds |
|---|---|---|
state | always | Where the session's inputs stand. See the table of states below. |
files | always | The files that were copied, each with the fields in the table of files below. It may be empty. |
skipped | only when some are skipped | How many matched files were left out: too large, not text or a picture, or past a cap. Absent when none. |
The state is one of these:
state | When |
|---|---|
ok | The files were read. files may be empty. |
offline | The session's machine did not answer. |
older | The session's Collie is older than 1.29.0, which cannot read trick inputs. |
refused | The session's machine switched trick reads off. |
none | There is no folder to read: a shell, or a session with no folder of its own. |
Each file in files has these fields:
| Field | Present | What it holds |
|---|---|---|
rel | always | The file's path relative to the session's folder, as the glob matched it. |
path | always | Where the copy is, relative to the trick's folder: inputs/.... Read it with t.inputs. |
bytes | always | The size of the copy in bytes. |
sha256 | always | The SHA-256 of the copy's bytes, in hex. |
mtime | always | When the file last changed on its machine, as an ISO 8601 time. |
kind | always | text or image: a text file, or a PNG, JPEG or WebP picture. |
A contract 1 trick that lists inputs is refused with: "inputs" needs contract = 2. Add contract = 2 to trick.toml to read files from your sessions' folders.
Caution. Inputs are untrusted data. Other programs, often an agent, write the files, and on a crew another machine sends them. A trick shows them, counts them or quotes them. It never runs them, evaluates them, sources them, passes them to a shell or follows what they say. The globs are part of the trick's powers, so a change of them asks the person again.
When a trick reacts
A trick runs on its timer and on taps. With on it also runs when a session changes, and with watch when a file changes. Each run gets its reason in trigger, with a count of the changes folded into it.
on = ["turn.end"]
watch = ["~/notes/todo.md"]on word | When |
|---|---|
session.status | A session's status changed. Read the new status from sessions in the facts. |
turn.end | An agent finished a turn in a session. |
ask.open | An agent opened a question in a session. |
The rules of an event run:
| Rule | What Collie does |
|---|---|
| Delivery | At least once, on this machine only, in no order across sessions. A program must be safe against a repeated event. A crew's lead does not pass its members' events on. |
| One at a time | A trick runs once at a time and has at most one run waiting. Events that arrive meanwhile fold into that run. Its trigger names the newest event, and count is how many were folded. |
| Lost events | When Collie's queue overflows, it adds the events it lost to count, because it cannot know their types. |
| The same road as the timer | A run has the same limits of time and size, the same slots and the same backoff. No run starts for a trick that has not had its start run, that is stopped, or that is backing off after a failure, or on a machine that does not schedule tricks. Collie drops such a request. It never keeps one. A run that already waited when a backoff began keeps waiting, and runs with the next request or after the next tap. |
| No phone needed | An event run or a file run happens also when no phone is open, so a trick can ask a Decision while you are away. Only the timer waits for a phone: it runs only while a phone has looked in the last 5 minutes. |
| Spacing | Two runs of one trick that an event or a file started begin at least 10 s apart. A request inside that time is the one waiting run, or folds into it, and starts when the time ends. A tap, an answer to a Decision and a timer run neither wait for it nor count toward it. |
| Taps first | A tap, or an answer to a Decision, goes before a waiting run of an event or a file. |
The rules of a watched file:
| Rule | What Collie does |
|---|---|
| Paths | At most 8. Each starts with / or ~/, and ~ is the home folder of the user Collie runs as. |
| The parent folder | Collie watches the folder of each path and reacts to the file's name, because an editor saves by writing a new file and renaming it over the old one. |
| Links | Collie resolves each path with realpath when the trick switches on and again after every change, so a link that moves to another file moves the watch. trigger.path stays as the manifest wrote it. The card shows each path as written, so a program of yours can point a link elsewhere after your yes: that gives the trick a run, never the file's contents. |
| A file that is not there yet | It fires when it appears, if its folder exists. If the folder is missing too, Collie checks that path every 5 s. |
| Waiting for a burst | A change waits 300 ms after the last change of a burst, and at most 2 s after the first, so a steady stream fires at least that often. One run waits, never a queue. |
| A trick's own writes | Collie records each file's time, size and inode when a run of the trick ends. A change starts a run only when the file differs from that record, so a trick that writes the file it watches does not loop. A write by someone else that lands during a run is absorbed too: the next change after the run starts the next one. |
| When the system cannot watch | Out of watches, too many open files or a folder it refuses: Collie checks the files' times and presence every 5 s instead, and the trick's row says so. |
| The same road as events | The same gates, limits and backoff as an event run. |
Note.onandwatchare rights. The card says it "runs when a session changes state" or "runs when these files change", with the paths. A new version that adds one, or names another event or path, asks for a new yes.
Reading Collie through the local API
A trick reads live facts of Collie (its machines, its sessions, your usage, the Hill) through Collie's local API, with no list of surfaces in its manifest. Your yes to the trick is the grant. The manifest says how much with access, which needs contract = 3, and the program calls t.api. Each run gets its own token in its facts, and the local API answers only a connection that names a live one, at the level the trick declares.
contract = 3
access = "see"const machines = await t.api("machines");
if (!machines.ok) throw new Error(machines.error.message);access | What the trick gets | Operations |
|---|---|---|
none | The default, also when access is left out. No api in the facts, and t.api answers an error. | none |
see | Lists and states: your machines, your sessions and their states, your usage and the Hill. Never the text of a screen. One field is text an agent wrote: the title of each card in hill.list. | hello, sessions, brief, accounts, hill.list, events, machines |
read | Everything in see, and the text of a session's screen, masked as the phone's own read is. | all of see, and read |
Experimental.accessandt.apiare new, and their words may still change.
Note. The run token keeps a program that only finds the socket out of this socket, and nothing more. A program that runs as you can still read a pane through the multiplexer itself, and can read another program's memory. It can also read Collie's local secret file and use it on the bridge's loopback address, which still answers the routes that return a session's text. Collie does not stop that. A trick's own program runs as you too. Collie's text search of the code flags a trick that names the socket, reads its path or token from the facts, opens a socket of its own (createConnection,Bun.connect, aunix:option) or runscollie apiitself, and the card shows that line like the other findings. Such a trick would have to send its own token from its own facts.
The socket stands while tricks are switched on, on a machine where tricks run. Where it does not (a crew peer, a deputy, Windows), the facts carry no api, t.api answers Collie's local API is off here., and the trick's row says so once.
Limits
The limits that no place, part or key owns. Every number is read from the code that checks it.
Tricks do not run on a Windows machine yet. Collie on Windows says what works there.
A run
| Limit | Value |
|---|---|
| Time | 10 seconds |
| Output on stdout | 64 KiB |
| Output on stderr kept | 8 KiB |
| Programs at once, across all tricks | 4 |
| Waits after a failed run | 1 minute, then 5 minutes, then 30 minutes, then the trick stops |
| Environment | the base list PATH, HOME, USER, LOGNAME, SHELL, LANG, TZ, TERM, TMPDIR, XDG_RUNTIME_DIR, XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME, NVM_DIR, BUN_INSTALL and every LC_*, plus the names in env |
Files of a trick
| Limit | Value |
|---|---|
Pictures in media/ and captures/, copied with the approved copy, from collie trick add and collie trick propose alike | at most 500 files and 64 MiB in all |
SKILL.md | at most 32 KiB. A larger file is refused, never cut |
Timers
| Limit | Value |
|---|---|
every in the manifest | 5s to 24h |
fresh in a document | 5s to 24h |
A document
| Limit | Value |
|---|---|
| The document | at most 64 KiB |
| Parts | at most 24, each at most 16 KiB |
| Decisions | at most 20 |
| A view | 1 to 24 nodes at the top, 6 levels, 300 nodes in all |
| Kids of a card, group or row | at most 24 |
| Kids of a list | at most 50 |
| Kids of a bar | at most 12 |
| A table | 1 to 4 columns, 1 to 12 rows |
| A diff | at most 40 lines of at most 200 characters |
| A spark | 2 to 32 numbers |
| A progress | max 1 to 12 |
A button's or an action's value | at most 1024 bytes |
A draft button's value | at most 4000 characters |
Bound parts, contract 2
| Limit | Value |
|---|---|
| Sessions one part names | 1 to 8, agent sessions of this run's facts. Another id is dropped with a note |
| Bound parts of one place per trick | 8, beside one unbound part |
| A part with no session left | not kept, with a note. It never shows in every session instead |
Facts
| Limit | Value |
|---|---|
| Sessions in the facts | at most 256, and 512 KiB of them. sessionsOmitted counts the rest |
| Spaces in the facts | at most 64 |
Inputs
| Limit | Value |
|---|---|
| Globs | at most 8, each at most 256 characters and 6 steps |
| Files per session | 32 |
| A text file | at most 256 KiB |
| A picture | at most 2 MiB |
| One answer of one machine | at most 8 MiB |
| One run | at most 24 MiB |
Fields, contract 3
| Limit | Value |
|---|---|
| Fields of one trick | at most 12 |
| A label, a hint | at most 40 and 120 characters |
| A text value | one line of at most 200 characters, no control character |
| A choice | 2 to 8 options of at most 40 characters |
| A number | a whole number from min to max, each within 999999999 either way |
The rules file
| Limit | Value |
|---|---|
| Name | one file at the top of the folder, at most 64 characters, ending in .md, a regular file and not a link |
| Size | at most 8 KiB, not empty, with a line break at the end |
| Characters | plain ASCII (bytes 0x20 to 0x7E) and line breaks only: no tab |
| A line | at most 160 characters, no space at its end, no run of more than 2 spaces |
| Blank lines | at most 2 in a row |
A proposal from an agent
| Limit | Value |
|---|---|
| Files | at most 300, 5 MiB in all, 8 folders deep |
Pictures from media/ and captures/ | at most 50, a PNG, JPEG or WebP by its first bytes, 2 MiB each, counted in the files above. The card names each one. Any other file there stays behind |
| Open at once | 2 per session, 4 per crew machine, 8 on the lead |
| Per hour | 6 per session, 12 per machine |
| The card closes by itself after | 3 days |
A repository's index, collie-tricks.json
| Limit | Value |
|---|---|
| The file | at most 32 KiB of JSON at the top of the repository, contract 1, no other key |
| Tricks listed | at most 50, each folder, name and about and nothing else |
folder | spelled as a trick id: one folder at the top, no /, no .., no leading dot |
name, about | one line each of at most 40 and 160 characters, no control or invisible character |
| Hosts the phone reads from | github.com, gitlab.com, codeberg.org, https, written exactly. Any other host: collie trick add <url> at the terminal |
| A read or an add on the phone | one at a time per machine, at most 2 minutes, the size cap of the official list, no redirect, no git config of yours |
Card groups
| Limit | Value |
|---|---|
| Cards | card 1 holds the facts and at most 7 cards hold the code, 6 KB each |
| Code shown in all | 42 KB, at most 64 files |
Commands
collie trick
Every verb of collie trick.
| Verb | Usage | What it does | ||
|---|---|---|---|---|
list | collie trick list [--json] [--official] | Lists every trick folder with its switch, state, last run and last error. | ||
add | `collie trick add [<name> \ | <https-url>[//<folder>][#<ref>]]` | Copies a trick from a git repository into the tricks folder, off. With no source, or a repository's collie-tricks.json and no //<folder>, it lists and adds nothing. | |
update | `collie trick update <id> [--ref <branch\ | tag\ | commit>] [--dry-run]` | Fetches an added trick again and replaces its code, keeping config.toml. |
remove | collie trick remove <id> | Deletes a trick that is off, with its state folder and its approved code. It refuses while a run of it is still going. | ||
on | collie trick on <id> | Switches a trick on, approving its code as it is now. It refuses inside an agent's pane. | ||
off | collie trick off <id> | Switches a trick off. | ||
auto | `collie trick auto <id> on\ | off` | Takes new versions without asking while the powers do not change. A trick with rules never takes one. | |
check | collie trick check [--run] [--json] <folder> | Checks a trick folder: its manifest, places and command lines. | ||
dev | `collie trick dev <folder\ | id> [--tap <intent> [--text <words>] [--node <node>] [--rid <uuid>]] [--facts <file.json>] [--state <dir>] [--inputs <dir>] [--json] [--watch]` | Runs a trick once with fixture facts and prints what the phone would get. It never talks to the bridge. | |
init | collie trick init [--sh] [--dir <folder>] <id> | Makes a new trick folder with a program and the helper. In an agent's pane the folder is a draft in the working folder, outside the tricks folder. | ||
helper | `collie trick helper <id\ | folder>` | Rewrites a trick's trick.ts with the helper this Collie carries. | |
skill | collie trick skill [<id>] | Prints what a trick that is on asks of an agent. With no id, prints how to write a trick. | ||
guide | collie trick guide [--json] | Prints how to write a trick and hand it to the person, as plain text for an agent. | ||
propose | collie trick propose <folder> [--request-id <uuid>] [--json] | Hands a trick folder to the person as a card of Collie's own on the lead: in the proposing session on the phone and in Settings, Tricks and the Hill, and on the Hill while it is on. Nothing runs before their yes. It brings the code and the pictures of media/ and captures/; config.toml stays behind. | ||
view | collie trick view <trick> <verb> [args] | Runs one verb of an agent view, from the agent's pane. The verbs are the trick view commands below. |
| Verb | Flag | What it does |
|---|---|---|
list | --json | Print one JSON document instead of text. |
list | --official | List the official tricks this Collie can add from the phone. |
update | --ref | Fetch this branch, tag or commit instead of the same ref. |
update | --dry-run | Print what would change and change nothing. |
check | --run | Run the program once, as the bridge would. |
check | --json | Print one JSON document instead of text. |
dev | --tap | Run it as a tap with this intent. |
dev | --text | The person's words for a Decision answer, with --tap. |
dev | --node | The node the tap names. Default main. |
dev | --rid | The tap's request id, a UUID, with --tap. |
dev | --facts | Run on the facts in this file instead of the fixture's. |
dev | --state | Use and keep this state folder. |
dev | --inputs | Read a contract 2 trick's inputs from this folder. |
dev | --json | Print one JSON document instead of text. |
dev | --watch | Run again when a file in the folder changes. |
init | --sh | Write a shell program instead of a TypeScript one. |
init | --dir | Make <folder>/<id> as a draft, outside the tricks folder, instead of the tricks folder. |
guide | --json | Print one JSON document instead of text. |
propose | --request-id | The proposal's request id, a UUID. The same sender, id and files get the same answer. |
propose | --json | Print one JSON document instead of text. |
collie tricks
The switch for tricks as a whole on this machine. Tricks are an experiment and off until switched on.
| Verb | Usage | What it does |
|---|---|---|
on | collie tricks on [--json] | Switches tricks on for this machine. They are an experiment and off until switched on. Each trick still has its own switch. |
off | collie tricks off [--json] | Switches tricks off for this machine: no trick runs or draws. Each trick keeps its own switch. |
status | collie tricks status [--json] | Says whether tricks are on for this machine. |
| Verb | Flag | What it does |
|---|---|---|
on | --json | Print one JSON document instead of text. |
off | --json | Print one JSON document instead of text. |
status | --json | Print one JSON document instead of text. |
collie trick view
The verbs an agent runs to draw an agent view, as collie trick view <trick> <verb>.
| Verb | Usage | What it does | ||
|---|---|---|---|---|
start | collie trick view <trick> start [--session <address>] [--rules <id>] ["<what you do>"] [--json] | Says the agent is drawing. The phone shows Drawing and the note until show lands. | ||
show | `collie trick view <trick> show [--session <address>] <file.json \ | -> [--title "<one line, at most 80>"] [--image <path>[=<caption>]]... [--json]` | Draws one whole screen from a file, or from stdin with -. | |
set | `collie trick view <trick> set [--session <address>] <id> <file.json \ | -> [--after <id> \ | --first] [--image <path>[=<caption>]]... [--json]` | Puts one block on the screen. A block with that id is replaced where it stands. |
pending | `collie trick view <trick> pending [--session <address>] <id> "<label>" [--after <id> \ | --first] [--json]` | Puts a placeholder block for one still in work. | |
remove | collie trick view <trick> remove [--session <address>] <id> [--json] | Removes one block. | ||
choice | `collie trick view <trick> choice [--session <address>] <file.json \ | -> \ | --clear [--json]` | Sets or drops the decision block alone. It takes no picked: Collie marks the pick. |
keep | `collie trick view <trick> keep [--session <address>] <id>... \ | --all [--json]` | Says these blocks still hold for the new request. | |
clear | collie trick view <trick> clear [--session <address>] [--json] | Takes the whole screen away. The switch stays. | ||
status | collie trick view <trick> status [--session <address>] [--json] | Shows the session, the switch, the screen and the tail line. | ||
help | collie trick view <trick> help [--session <address>] | Prints Collie's view help and, while the view is on for the session, the trick's own rules after it. |
| Verb | Flag | What it does |
|---|---|---|
start | --session | The session's address, copied from the request's head. |
start | --rules | The id of the rules the agent holds. |
start | --json | Print one JSON document instead of text. |
show | --session | The session's address. |
show | --title | The screen's title, one line. |
show | --image | Add a picture, with an optional caption. The first is ref 0. |
show | --json | Print one JSON document instead of text. |
set | --session | The session's address. |
set | --after | Put a new block after this one. |
set | --first | Put a new block first. |
set | --image | Add a picture to the screen's set. |
set | --json | Print one JSON document instead of text. |
pending | --session | The session's address. |
pending | --after | Put the block after this one. |
pending | --first | Put the block first. |
pending | --json | Print one JSON document instead of text. |
remove | --session | The session's address. |
remove | --json | Print one JSON document instead of text. |
choice | --session | The session's address. |
choice | --clear | Drop the decision block. |
choice | --json | Print one JSON document instead of text. |
keep | --session | The session's address. |
keep | --all | Keep every block. |
keep | --json | Print one JSON document instead of text. |
clear | --session | The session's address. |
clear | --json | Print one JSON document instead of text. |
status | --session | The session's address. |
status | --json | Print one JSON document instead of text. |
help | --session | The session's address. |
collie hill
The verbs an agent or a person runs to post and read Decisions.
| Verb | Usage | What it does | ||
|---|---|---|---|---|
post | collie hill post --title "<question>" --summary "<plain words>" --option <intent>="<label>" ... --recommend <intent> --why "<reason>" [flags] [-- "<body>"] | Puts one Decision on the Hill. collie hill post --help prints every flag and the rules. | ||
status | collie hill status <dc_id> [--json] | Reads a Decision's state and its answer. | ||
withdraw | collie hill withdraw <dc_id> [--json] | Withdraws a Decision that is open. | ||
list | collie hill list [--json] | Lists the sender's own Decisions, open first. | ||
clear | collie hill clear [--json] | Removes every closed Decision from the Hill. Open ones stay. | ||
state | `collie hill state [here\ | quiet\ | away] [--json]` | Reads the crew state. With a word, the person sets it. |
on | collie hill on | Switches the Hill on for this Collie. | ||
off | collie hill off | Switches the Hill off: every post is refused and the open Decisions stay. |
| Verb | Flag | What it does |
|---|---|---|
post | --title | The question. |
post | --summary | The summary, in plain words. |
post | --option | One option, as intent=label. Repeat it. |
post | --recommend | The intent of the recommended option. |
post | --why | The reason for the recommendation. |
post | --confirm | A second label for an option, as intent=word. |
post | --detail | A line of detail for an option, as intent=line. |
post | --priority | now, today or later. |
post | --text | none, optional or required. |
post | --link | A web page, as "label=https://...". |
post | --about | The session the card is about: here or an address. |
post | --reply-to | The session that gets the person's words. |
post | --supersedes | The id of an open Decision that this one replaces. |
post | --expires | When it closes by itself, such as 2h or 3d. |
post | --request-id | Post again with the same id and it posts once. |
post | --image | A picture, with an optional caption. Repeat it. |
post | --view | A JSON file with a small view under the summary. |
post | --json | Print one JSON document instead of text. |
status | --json | Print one JSON document instead of text. |
withdraw | --json | Print one JSON document instead of text. |
list | --json | Print one JSON document instead of text. |
clear | --spoken | Withdraw and clear the open cards the person answered in the session. Not from an agent's pane. |
clear | --json | Print one JSON document instead of text. |
state | --json | Print one JSON document instead of text. |
Not in this Collie yet
A trick that names one of these still runs. This Collie leaves the word out, says so in a note, and the rest draws.
| Kind | Word | What it will be |
|---|---|---|
| place | header.line | A line in the header. |
| place | settings | A part of the Settings screen. |
| manifest key | serve | Keep the program running between triggers (manifest mode = "serve"). |