Skip to content

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.

Three phone screens, the Dashboard, a session and a session's settings sheet, with the eight places of a trick numbered.
Three phone screens, the Dashboard, a session and a session's settings sheet, with the eight places of a trick numbered.

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.

PlaceNameWhere it showsDrawn by
beltBeltA 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
sessionPageA 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
dashboardDashboard tileA round tile in the strip at the top of the Dashboard. The strip is hidden while no trick has a tile.A program
statusStatus chipOne 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
tabbarBottom bar itemAn 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
menuSession settings rowsRows 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
floatFloating pictureA 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-viewAgent viewA 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

A session, with a trick's mark at the end of the Belt's scrolling strip, before Collie's fixed block.
A session, with a trick's mark at the end of the Belt's scrolling strip, before Collie's fixed block.

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.

LimitValue
Parts of this place per trickone unbound, and up to 8 bound ones with sessions. No session is named by two parts
label, the face wordat most 12 characters
badgea count from 0 to 9999 as text, or "" for a dot
A mark needsat least one of icon, label and badge
sessions, contract 21 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 JSONat 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

The Dashboard, with a trick's Page as a row under Tricks.
The Dashboard, with a trick's Page as a row under Tricks.

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".

LimitValue
nameat most 40 characters. Left out, the manifest's name
subtitleat most 120 characters
badge{ "count": 0 to 9999 } or { "text": 1 to 12 characters }, one of the two
progressvalue of max, max a whole number from 1 to 12. No value means indeterminate
actionsat 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
view1 to 24 nodes at the top, 6 levels, 300 nodes in all
Parts of this place per trickas many as it needs, each with its own id
One part, as compact JSONat 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

The Dashboard, with a trick's tile at the end of the strip of tiles at the top.
The Dashboard, with a trick's tile at the end of the strip of tiles at the top.

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.

LimitValue
Parts of this place per trickone
label1 to 16 characters
badgea count from 0 to 9999 (0 draws none), or text of 1 to 12 characters
One part, as compact JSONat most 16 KiB

A program prints:

{
  "v": 1,
  "parts": [
    {
      "at": "dashboard",
      "id": "legs",
      "item": {
        "label": "Legs",
        "icon": "check",
        "badge": 3,
        "tone": "ok"
      }
    }
  ]
}

status

A session, with a trick's chip at the left end of the status line, above the Belt.
A session, with a trick's chip at the left end of the status line, above the Belt.

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.

LimitValue
Parts of this place per trickone
text1 to 12 characters
One part, as compact JSONat most 16 KiB

A program prints:

{
  "v": 1,
  "parts": [
    {
      "at": "status",
      "id": "ci",
      "chip": {
        "text": "CI red",
        "icon": "check",
        "tone": "danger"
      }
    }
  ]
}

tabbar

The Dashboard, with a trick's item at the end of the bottom bar, after the Hill.
The Dashboard, with a trick's item at the end of the bottom bar, after the Hill.

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.

LimitValue
Parts of this place per trickone
label1 to 16 characters
badgea count from 0 to 9999 (0 draws none), or text of 1 to 12 characters
One part, as compact JSONat most 16 KiB

A program prints:

{
  "v": 1,
  "parts": [
    {
      "at": "tabbar",
      "id": "legs",
      "item": {
        "label": "Legs",
        "icon": "check",
        "badge": "new"
      }
    }
  ]
}
A session's settings sheet, with a trick's rows in a group of its own after Collie's rows.
A session's settings sheet, with a trick's rows in a group of its own after Collie's rows.

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.

LimitValue
Contract2
Rows1 to 6 in a part. Each id and each intent once
A rowid, kind (button or switch), label, intent, and optionally icon, disabled, on (required on a switch) and confirm (a button only). Nothing else
label1 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 trickone 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 21 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 sheet12 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 JSONat 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

A session, with a trick's small moving picture in the free area above the status line, clear of the Belt and the composer.
A session, with a trick's small moving picture in the free area above the status line, clear of the Belt and the composer.

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.

LimitValue
Parts of this place per trickone 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 partid, mode (once or stay), motion, sprite, and optionally edge, along, from, mood, opens and sessions. Nothing else
motion of oncefly-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 stayperch, 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
spritesrc, 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 sizes, 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 fpsframes 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 looptrue 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 afterOne 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 rowsThe 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
moodworking, 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
alongstart, 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
fromWith 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
openspage, on a stay part with perch or idle. The trick needs a Page for the tap to open
On screen at onceat 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 playswhen 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
Contractsessions needs contract 2, as on a belt mark. The place itself works at contract 1
Motiontransform 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 appearsIn 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
Artoriginal art only, never a known character
sessions, contract 21 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 JSONat 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

A session, with the agent view as a third view beside Terminal and Chat.
A session, with the agent view as a third view beside Terminal and Chat.

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.

LimitValue
Contract2, and the manifest needs rules
Screen titleat most 80 characters
The note of startat most 80 characters
A button's labelone line, at most 60 characters
A group's labelone line, at most 40 characters
The view, as compact JSONat most 16 KiB, and the view limits of a part
Picturesat most 4 on a screen, 2 MiB each, 8 MiB together, caption at most 80 characters
Decision blocka question of at most 120 characters, 1 to 5 options
A pending block's labelat most 40 characters
Writes by the agent120 a minute for one trick and session
Sends from the view20 a minute for one session, one in flight at a time
Marks of a pickCollie'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
Linksa web address only. A session href is refused. The phone shows the host after each link, whole
Collie's own wordsno 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 filesee 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:

KeyTypeNeededLimitWhat it is
keytextyes1 to 64 of a-z, 0-9 and -, unique in the documentThe trick's own name for the Decision. The answer comes back with it.
titletextyesat most 120 charactersThe question, as a sentence the options answer.
summarytextyesat most 280 charactersWhat the recommended option does, and the one fact that decides it.
bodytextnoat most 4000 charactersLonger text, shown behind More.
optionslistnoat 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.
recommendsobject or nullno{ intent, why }, why at most 200 charactersThe trick's pick, one of the options. Shown as Recommended, never pre-selected.
prioritywordnoone of now, today, later. Default todayA request, not a fact. Only now sends a notification, and one sender holds at most 3 open now Decisions.
textwordnoone of none, optional, required. Default optionalWhether the person may, must, or may not add words to the answer. none needs at least one option.
aboutsession idnoan id from the facts' sessions, memberId:paneIdThe session the card is about. The card opens its Chat.
replyTosession idnoan 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.
medialistnoat 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.
linkslistnoat most 5; each label (at most 40) and href (an https or http address, at most 500 characters)Web pages that give more.
expiresAtinstantnoepoch milliseconds. Left out, 14 days; never more than 30 daysWhen the Decision closes by itself, as expired.
viewlist of nodesnosee Parts: a Decision's viewA small display-only view under the summary: facts to read, never a control.
LimitValue
Open Decisions per sender20
Open now Decisions per sender3. A further one shows as today
Closed Decisions served20, newest first
The person's words in an answerat most 4000 characters
Expiry14 days when left out, at most 30
Answers waiting for one trick32. 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.

WhenCollie does
A new keyPosts once. A second run, or a restart, posts nothing twice.
A listed key with changed contentPosts 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 holdsThe card is withdrawn, "by the trick".
A key the person answered or dismissedStays 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 trickPosts 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 keyChanges 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 thereChanges 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 runChanges nothing.
The trick switched off or removedEvery open card of the trick is withdrawn at once, "the trick is off".
The Hill switched offNo 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.

PartHow to write it
TitleThe 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.
SummaryAt 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.
OptionStarts 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 session part): 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, diff or spark. 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.
PartWhat it isSitsIn a Decision's view
cardA block that groups what belongs together. Its tone colours its edge.the top of a viewno
groupA 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 listyes
listA list of rows and groups. It keeps the height of its kids, so a change inside one row moves nothing.the top of a viewyes
rowOne line: a title, an optional end word, and optionally a second line, chips and one trailing button.in a group, in a listyes
barA 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 groupyes
chipA 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 baryes
buttonSends 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 barno
paraOne paragraph of plain text, or of run and link kids.the top of a view, in a card, in a group, in a rowyes
lineOne 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 codeyes
runA piece of text inside a para or a line, with its own style, link or live time.in a para, in a lineyes
codeA block of code. Its kids are line nodes. It scrolls on its own past max lines.the top of a viewyes
linkA link that opens a web page, or one agent session of the crew.in a group, in a bar, in a para, in a lineyes
imageA 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 compareyes
meterAn 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 groupyes
spacerSpace between nodes. With a label it is a divider with words.the top of a view, in a card, in a groupyes
numberA big figure with a label under it.the top of a view, in a card, in a groupyes
compareTwo images side by side at one height, as before and after.the top of a view, in a card, in a groupyes
tableA small table: its column heads first, then its cells row by row.the top of a view, in a card, in a groupyes
colA column head of a table. It sits only inside a table.in a tableyes
cellOne cell of a table. It sits only inside a table. An empty cell has no text.in a tableyes
diffA hunk of a diff. Each line starts with + (added), - (removed) or @@ (a hunk head).the top of a view, in a card, in a groupyes
sparkA trend as a small line with no axes. The last point is marked.the top of a view, in a card, in a groupyes

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).

AttributeTypeNeededLimitWhat it is
tonetonenoone of plain, accent, warn, danger, ok, mutedThe 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).

AttributeTypeNeededLimitWhat it is
labeltextnoat most 60 charactersThe group's title.
foldwordnoone of open, closedWhether the group starts open or closed. The person owns the toggle after the first draw.
badgecount or dotnoa count from 0 to 9999 as text, or "" for a dotA 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).

AttributeTypeNeededLimitWhat it is
hrefaddressnowith no rel, an https or http address (at most 2048 characters) or a session's id from the factsMakes the row tappable: an https or http address, or a session's id from the facts.
endtextnoat most 24 charactersA short word at the end of the row.
badgecount or dotnoa count from 0 to 9999 as text, or "" for a dotA count, or a dot, on the row.
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the row.
cutwordnoone of end, midWhere a long title is cut.
iconiconnoone of the icon words in Shared valuesAn icon at the start of the row.
disabledtextnoat most 120 characters, may be emptyThe 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).

AttributeTypeNeededLimitWhat it is
rolewordnoone of stripstrip makes the bar one band that scrolls sideways.
scrollwordnoone of xSideways scroll for a bar of chips.
labeltextnoat most 40 charactersA 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).

AttributeTypeNeededLimitWhat it is
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the chip.
iconiconnoone of the icon words in Shared valuesAn icon before the text.
atinstantnoepoch milliseconds as digits, such as "1794130692000"An instant that the chip shows as a live time. It goes with clock.
clockwordnoone of ago, elapsed, left, timeHow the instant is told. It goes with at.
statewordnoone of working, waiting, idle, done, goneDraws a status dot. Chips with a state in a bar draw a strip of steps.
currentflagnothe empty text "" when on, left out when offMarks this chip as the current step.
shorttextnoat most 12 charactersThe 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.

AttributeTypeNeededLimitWhat it is
intentintentyes, unless does is copy or draft1 to 48 of a-z, 0-9, ., _ and -, starting with a letter or a digitThe intent a tap sends to the trick.
labeltextyesat most 24 charactersThe words on the button.
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the button.
disabledtextnoat most 120 characters, may be emptyThe reason the button cannot be used. An empty text means no reason is given.
pressedwordnoone of true, false, mixedDraws the button as a toggle: on, off or mixed. An agent view refuses it: Collie marks the pick.
confirmtextnoat most 24 charactersA second label. The first tap arms the button and the second sends the intent.
badgecount or dotnoa count from 0 to 9999 as text, or "" for a dotA count, or a dot, on the button.
iconiconnoone of the icon words in Shared valuesAn icon on the button.
hinttextnoat most 120 charactersA short line of help for the button.
doeswordnoone of copy, draftcopy 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.
valuetextyes, when does is copy or draft1 to 1024 bytes, or with does draft 1 to 4000 characters; no control or invisible character but a line break and a tabThe 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).

AttributeTypeNeededLimitWhat it is
rolewordnoone of heading, quoteDraws the paragraph as a heading or a quote.
bullettextnoat most 4 charactersA marker before the paragraph, such as - or 1..
termtextnoat most 40 charactersA 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).

AttributeTypeNeededLimitWhat it is
stylestyle wordsnowords with single spaces between, each once, from Shared valuesStyle words for the whole line.
rolewordnoone of text, status, noteDraws 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).

AttributeTypeNeededLimitWhat it is
stylestyle wordsnowords with single spaces between, each once, from Shared valuesStyle words for this piece of text.
codeflagnothe empty text "" when on, left out when offA flag: draws the text as inline code.
hrefweb addressnohttps or http, at most 2048 charactersMakes the text a link to a web address.
atinstantnoepoch milliseconds as digits, such as "1794130692000"An instant that the text shows as a live time. It goes with clock.
clockwordnoone of ago, elapsed, left, timeHow 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).

AttributeTypeNeededLimitWhat it is
langwordno1 to 24 of a-z, 0-9, +, #, ., _ and -The language word of the code.
maxwhole numberno1 to 40, as textHow many lines show before the block scrolls on its own.
{
  "kind": "code",
  "attrs": {
    "lang": "ts"
  },
  "kids": [
    {
      "kind": "line",
      "text": "const total = 3;"
    }
  ]
}

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).

AttributeTypeNeededLimitWhat it is
hrefaddressyeswith no rel, an https or http address (at most 2048 characters) or a session's id from the factsWhere the link goes: a web address, or a session's id from the facts with rel pane.
relwordnoone of url, file, paneWhat the href names: url or pane. file is refused: a trick opens no file.
badgecount or dotnoa count from 0 to 9999 as text, or "" for a dotA count, or a dot, on the link.
iconiconnoone of the icon words in Shared valuesAn 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.

AttributeTypeNeededLimitWhat it is
srcpicture pathin a program's parta .png, .jpg, .jpeg or .webp file in media/, such as media/chart.png, with no step that starts with a dotA picture file in the trick's media/ folder. Used in a program's part.
alttextin a program's partat most 120 characters, may be emptyWhat the picture shows, in words.
wwhole numberin a program's part1 to 4096, as textThe picture's width in pixels. It reserves the box.
hwhole numberin a program's part1 to 4096, as textThe picture's height in pixels. It reserves the box.
refwhole numberin a Decision's view and an agent view0 to 3, as textThe 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.
captiontextnoat most 80 charactersA line of words under the picture. In a compare it labels the frame.
fitwordnoone of contain, covercontain shows the whole picture. cover fills the frame and cuts the edges.
focusnumbersno"x y" or "x y zoom": x and y from 0 to 100 (percent), zoom from 1 to 8The 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.

AttributeTypeNeededLimitWhat it is
valuenumberyes, unless role is progress0 or more, as text, such as "68" or "0.5"How much, from 0 to max.
maxnumberno0 or more, as text, such as "68" or "0.5"The full amount. It defaults to 1.
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the meter.
labeltextnoat most 40 charactersA short name for the meter.
rolewordnoone of progress, metermeter 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.

AttributeTypeNeededLimitWhat it is
labeltextnoat most 40 charactersWords 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).

AttributeTypeNeededLimitWhat it is
labeltextnoat most 40 charactersThe words under the figure.
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the figure.
unittextnoat most 24 charactersA 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).

AttributeTypeNeededLimitWhat it is
alignwordnoone of start, endWhich 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).

AttributeTypeNeededLimitWhat it is
tonetonenoone of plain, accent, warn, danger, ok, mutedThe 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).

AttributeTypeNeededLimitWhat it is
filetextnoat most 120 charactersThe 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.

AttributeTypeNeededLimitWhat it is
valuesnumbersyes2 to 32 numbers with one space betweenThe numbers of the trend, oldest first.
tonetonenoone of plain, accent, warn, danger, ok, mutedThe tone of the line.
labeltextnoat most 40 charactersA short name for the trend.
{
  "kind": "spark",
  "attrs": {
    "values": "3 5 4 8 6",
    "tone": "accent",
    "label": "latency"
  }
}

Shared values

NameValues
toneplain, accent, warn, danger, ok, muted
iconarchive, 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 iconplay, pause, check, x, refresh, archive, flag, star, send, note, search, more
chip stateworking, waiting, idle, done, gone
clockago, elapsed, left, time
stylebold, 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 intent1 to 48 of a-z, 0-9, ., _ and -, starting with a letter or a digit
Decision option intent1 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.

KeyTypeNeededLimitContractWhat it is
idtextyes1 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, view1The trick's id, which is also the name of its folder.
nametextyesat most 40 characters1The name a person reads on the row.
runtextyes, unless the trick is only an agent viewat most 1024 characters1What Collie runs: a TypeScript file in the folder ("program.ts"), or a shell command line. An agent view alone has none.
everydurationno5s to 24h, one whole number and s, m or h, such as 30s or 5m1How often it runs on its timer. Left out, it runs at start and on taps only.
watchlist of pathsnoat most 8 paths of at most 256 characters, each an absolute path, or a path under the home folder written with a leading tilde1Run when one of these files changes. A right: the card names the paths. See When a trick reacts.
onlist of wordsnosession.status, turn.end, ask.open1Run when a session of an agent changes in one of these ways. A right: the card says it. See When a trick reacts.
modewordnoonce or serve. Default once1once runs once per trigger and prints one document. serve is kept for a later Collie.
contractwhole numberno1 to 999. Default 1. This Collie speaks 1 to 31The 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.
iconwordnoone of the icon words in Shared values. Default plug1The trick's icon. collie trick check names a wrong one.
placeslist of wordsyes1 to 16 of belt, session, dashboard, status, tabbar, menu, float, agent-view. Each once1Where its parts draw. Each place a part uses must be listed. agent-view adds an agent view and needs contract 2.
envlist of namesnoat most 32 names of at most 64 characters: letters, digits and _, not starting with a digit1Environment names the program gets beyond the base list, such as GH_TOKEN. The person sees each one.
inputslist of globsnoat most 8 globs of at most 256 characters and 6 steps, relative to a session's folder2Files the program reads from each agent session's folder. They are untrusted data: show them, never run them.
descriptiontextnoat most 140 characters, plain text1One plain line that says what the trick does. Settings shows it under the name.
abouttextnoat most 1200 characters, plain text, a blank line splits paragraphs1The text of the trick's details page.
versiontextno1 to 24 characters: letters, digits, ., + and -, such as 1.2.01The trick's own version. The details page shows it. Collie never compares it and reads no tag.
rulesfile nameyes, with agent-view; refused without ita file in the trick's folder of at most 64 characters ending in .md, such as rules.md2The instructions the agent of a session reads. The person reads them whole before they switch the trick on.
decideswordnoreply. Refused on a trick that is only an agent view1Whether 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.
draftswordnosession. Refused on a trick that is only an agent view1Whether 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.
fieldlist of tablesnoat 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 required3Settings 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.
accesswordnonone, see or read. Default none3How 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.

FieldPresentWhat it holds
contractalwaysThe trick's own contract number: contract of trick.toml, or 1 when it names none.
triggeralwaysWhy this run happened. See the table of triggers below.
trickalwaysid, 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.
memberIdalwaysThe 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.
hostalwaysThe machine's name, for display only. It changes with a rename. Never key on it.
sessionsalwaysThe agent and shell sessions, at most 256. On a crew's lead they are every member's, the lead's own first.
spacesalwaysEach space as name, folder (folder is left out when there is none), at most 64.
sessionsOmittedonly when some are left outHow 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.
valuescontract 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.
apionly with access, while the local API standssocket, 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:

FieldPresentWhat it holds
idalwaysThe scope key <memberId>:<paneId>. Pass it back in a Decision's about and replyTo, or as the href of a link or a row.
memberIdalwaysThe bridge the session runs on. Read it, and do not parse id.
sessionIdalwaysAn opaque id. Never parse it: it can change.
paneIdalwaysThe multiplexer pane the session is in now.
hostalwaysThe name of the session's machine, for display only. Never a key.
namewhen it has oneThe session's name.
agentan agent onlyThe agent's name. A shell has none.
statusalwaysOne of idle, working, blocked, done, unknown.
cwdwhen knownThe session's working folder. cwd is the pane's folder. A workspace folder can hold several repositories; look inside it.
spacewhen knownThe label of the session's space.
tabwhen knownThe label of the session's tab.
lastActiveAtwhen knownWhen the session was last active, as an ISO 8601 time. The sessions of a crew's members have none.
reachablea crew's lead onlyWhether the lead's last sweep reached the session's machine. The lead's own sessions are true.
inputscontract 2, with inputsThe 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.kindWhenOther fields
startThe first run after the trick loads, is switched on, a new version is approved or its config.toml changes.none
timerEvery every after the last run, while a phone has looked in the last 5 minutes. A trick with no every gets none.none
tapA person tapped a control of the trick, or answered one of its Decisions.rid, node, intent, value, from, seen
watchA 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
eventAn 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:

refusedReceiptWhenCollie's line
partrejectedThe 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.
intentrejectedNo control of the part sends that intent.No control of this part sends that intent, so nothing ran.
valuerejectedNo control of the part sends that value with that intent.No control of this part sends that value, so nothing ran.
changedchangedThe 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.
sessionrejectedfrom.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" }
KeyNeededWhat it is
vyesThe contract number of the document: a whole number from 1 to 3, this Collie's own. The helper prints the contract of the facts.
partsyesThe parts, at most 24, each at most 16 KiB. [] is allowed. See Places.
asOfnoWhen 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.
freshnoHow 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.
decisionsnoThe 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:

WayWhat happensWhat the trick needs
A button with does set to draftA 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 replyToThe person's answer is typed into that session as their own message.decides = "reply" in trick.toml
A button in an agent viewA 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 printsCollie does
A node of a kind this Collie does not knowLeft out, with a dropped note. The rest of the view draws.
A part in a place this Collie does not knowLeft 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 1Ignored, 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 newerThat 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 decisionsIgnored, 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 fieldThat 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 DecisionThat Decision is refused alone. Its open card stays as it is.
A bad asOf or freshRefused 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 listThe 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:

CallWhat it does
t.facts, t.config, t.tapThe 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 PartsBuild 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.

RuleValue
ShapeA 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.
RefusedAn 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:

FieldPresentWhat it holds
statealwaysWhere the session's inputs stand. See the table of states below.
filesalwaysThe files that were copied, each with the fields in the table of files below. It may be empty.
skippedonly when some are skippedHow 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:

stateWhen
okThe files were read. files may be empty.
offlineThe session's machine did not answer.
olderThe session's Collie is older than 1.29.0, which cannot read trick inputs.
refusedThe session's machine switched trick reads off.
noneThere is no folder to read: a shell, or a session with no folder of its own.

Each file in files has these fields:

FieldPresentWhat it holds
relalwaysThe file's path relative to the session's folder, as the glob matched it.
pathalwaysWhere the copy is, relative to the trick's folder: inputs/.... Read it with t.inputs.
bytesalwaysThe size of the copy in bytes.
sha256alwaysThe SHA-256 of the copy's bytes, in hex.
mtimealwaysWhen the file last changed on its machine, as an ISO 8601 time.
kindalwaystext 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 wordWhen
session.statusA session's status changed. Read the new status from sessions in the facts.
turn.endAn agent finished a turn in a session.
ask.openAn agent opened a question in a session.

The rules of an event run:

RuleWhat Collie does
DeliveryAt 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 timeA 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 eventsWhen Collie's queue overflows, it adds the events it lost to count, because it cannot know their types.
The same road as the timerA 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 neededAn 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.
SpacingTwo 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 firstA tap, or an answer to a Decision, goes before a waiting run of an event or a file.

The rules of a watched file:

RuleWhat Collie does
PathsAt most 8. Each starts with / or ~/, and ~ is the home folder of the user Collie runs as.
The parent folderCollie 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.
LinksCollie 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 yetIt fires when it appears, if its folder exists. If the folder is missing too, Collie checks that path every 5 s.
Waiting for a burstA 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 writesCollie 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 watchOut 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 eventsThe same gates, limits and backoff as an event run.
Note. on and watch are 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);
accessWhat the trick getsOperations
noneThe default, also when access is left out. No api in the facts, and t.api answers an error.none
seeLists 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
readEverything in see, and the text of a session's screen, masked as the phone's own read is.all of see, and read
Experimental. access and t.api are 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, a unix: option) or runs collie api itself, 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

LimitValue
Time10 seconds
Output on stdout64 KiB
Output on stderr kept8 KiB
Programs at once, across all tricks4
Waits after a failed run1 minute, then 5 minutes, then 30 minutes, then the trick stops
Environmentthe 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

LimitValue
Pictures in media/ and captures/, copied with the approved copy, from collie trick add and collie trick propose alikeat most 500 files and 64 MiB in all
SKILL.mdat most 32 KiB. A larger file is refused, never cut

Timers

LimitValue
every in the manifest5s to 24h
fresh in a document5s to 24h

A document

LimitValue
The documentat most 64 KiB
Partsat most 24, each at most 16 KiB
Decisionsat most 20
A view1 to 24 nodes at the top, 6 levels, 300 nodes in all
Kids of a card, group or rowat most 24
Kids of a listat most 50
Kids of a barat most 12
A table1 to 4 columns, 1 to 12 rows
A diffat most 40 lines of at most 200 characters
A spark2 to 32 numbers
A progressmax 1 to 12
A button's or an action's valueat most 1024 bytes
A draft button's valueat most 4000 characters

Bound parts, contract 2

LimitValue
Sessions one part names1 to 8, agent sessions of this run's facts. Another id is dropped with a note
Bound parts of one place per trick8, beside one unbound part
A part with no session leftnot kept, with a note. It never shows in every session instead

Facts

LimitValue
Sessions in the factsat most 256, and 512 KiB of them. sessionsOmitted counts the rest
Spaces in the factsat most 64

Inputs

LimitValue
Globsat most 8, each at most 256 characters and 6 steps
Files per session32
A text fileat most 256 KiB
A pictureat most 2 MiB
One answer of one machineat most 8 MiB
One runat most 24 MiB

Fields, contract 3

LimitValue
Fields of one trickat most 12
A label, a hintat most 40 and 120 characters
A text valueone line of at most 200 characters, no control character
A choice2 to 8 options of at most 40 characters
A numbera whole number from min to max, each within 999999999 either way

The rules file

LimitValue
Nameone file at the top of the folder, at most 64 characters, ending in .md, a regular file and not a link
Sizeat most 8 KiB, not empty, with a line break at the end
Charactersplain ASCII (bytes 0x20 to 0x7E) and line breaks only: no tab
A lineat most 160 characters, no space at its end, no run of more than 2 spaces
Blank linesat most 2 in a row

A proposal from an agent

LimitValue
Filesat 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 once2 per session, 4 per crew machine, 8 on the lead
Per hour6 per session, 12 per machine
The card closes by itself after3 days

A repository's index, collie-tricks.json

LimitValue
The fileat most 32 KiB of JSON at the top of the repository, contract 1, no other key
Tricks listedat most 50, each folder, name and about and nothing else
folderspelled as a trick id: one folder at the top, no /, no .., no leading dot
name, aboutone line each of at most 40 and 160 characters, no control or invisible character
Hosts the phone reads fromgithub.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 phoneone 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

LimitValue
Cardscard 1 holds the facts and at most 7 cards hold the code, 6 KB each
Code shown in all42 KB, at most 64 files

Commands

collie trick

Every verb of collie trick.

VerbUsageWhat it does
listcollie 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.
removecollie 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.
oncollie trick on <id>Switches a trick on, approving its code as it is now. It refuses inside an agent's pane.
offcollie 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.
checkcollie 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.
initcollie 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.
skillcollie trick skill [<id>]Prints what a trick that is on asks of an agent. With no id, prints how to write a trick.
guidecollie trick guide [--json]Prints how to write a trick and hand it to the person, as plain text for an agent.
proposecollie 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.
viewcollie 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.
VerbFlagWhat it does
list--jsonPrint one JSON document instead of text.
list--officialList the official tricks this Collie can add from the phone.
update--refFetch this branch, tag or commit instead of the same ref.
update--dry-runPrint what would change and change nothing.
check--runRun the program once, as the bridge would.
check--jsonPrint one JSON document instead of text.
dev--tapRun it as a tap with this intent.
dev--textThe person's words for a Decision answer, with --tap.
dev--nodeThe node the tap names. Default main.
dev--ridThe tap's request id, a UUID, with --tap.
dev--factsRun on the facts in this file instead of the fixture's.
dev--stateUse and keep this state folder.
dev--inputsRead a contract 2 trick's inputs from this folder.
dev--jsonPrint one JSON document instead of text.
dev--watchRun again when a file in the folder changes.
init--shWrite a shell program instead of a TypeScript one.
init--dirMake <folder>/<id> as a draft, outside the tricks folder, instead of the tricks folder.
guide--jsonPrint one JSON document instead of text.
propose--request-idThe proposal's request id, a UUID. The same sender, id and files get the same answer.
propose--jsonPrint 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.

VerbUsageWhat it does
oncollie 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.
offcollie tricks off [--json]Switches tricks off for this machine: no trick runs or draws. Each trick keeps its own switch.
statuscollie tricks status [--json]Says whether tricks are on for this machine.
VerbFlagWhat it does
on--jsonPrint one JSON document instead of text.
off--jsonPrint one JSON document instead of text.
status--jsonPrint 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>.

VerbUsageWhat it does
startcollie 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.
removecollie 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.
clearcollie trick view <trick> clear [--session <address>] [--json]Takes the whole screen away. The switch stays.
statuscollie trick view <trick> status [--session <address>] [--json]Shows the session, the switch, the screen and the tail line.
helpcollie 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.
VerbFlagWhat it does
start--sessionThe session's address, copied from the request's head.
start--rulesThe id of the rules the agent holds.
start--jsonPrint one JSON document instead of text.
show--sessionThe session's address.
show--titleThe screen's title, one line.
show--imageAdd a picture, with an optional caption. The first is ref 0.
show--jsonPrint one JSON document instead of text.
set--sessionThe session's address.
set--afterPut a new block after this one.
set--firstPut a new block first.
set--imageAdd a picture to the screen's set.
set--jsonPrint one JSON document instead of text.
pending--sessionThe session's address.
pending--afterPut the block after this one.
pending--firstPut the block first.
pending--jsonPrint one JSON document instead of text.
remove--sessionThe session's address.
remove--jsonPrint one JSON document instead of text.
choice--sessionThe session's address.
choice--clearDrop the decision block.
choice--jsonPrint one JSON document instead of text.
keep--sessionThe session's address.
keep--allKeep every block.
keep--jsonPrint one JSON document instead of text.
clear--sessionThe session's address.
clear--jsonPrint one JSON document instead of text.
status--sessionThe session's address.
status--jsonPrint one JSON document instead of text.
help--sessionThe session's address.

collie hill

The verbs an agent or a person runs to post and read Decisions.

VerbUsageWhat it does
postcollie 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.
statuscollie hill status <dc_id> [--json]Reads a Decision's state and its answer.
withdrawcollie hill withdraw <dc_id> [--json]Withdraws a Decision that is open.
listcollie hill list [--json]Lists the sender's own Decisions, open first.
clearcollie 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.
oncollie hill onSwitches the Hill on for this Collie.
offcollie hill offSwitches the Hill off: every post is refused and the open Decisions stay.
VerbFlagWhat it does
post--titleThe question.
post--summaryThe summary, in plain words.
post--optionOne option, as intent=label. Repeat it.
post--recommendThe intent of the recommended option.
post--whyThe reason for the recommendation.
post--confirmA second label for an option, as intent=word.
post--detailA line of detail for an option, as intent=line.
post--prioritynow, today or later.
post--textnone, optional or required.
post--linkA web page, as "label=https://...".
post--aboutThe session the card is about: here or an address.
post--reply-toThe session that gets the person's words.
post--supersedesThe id of an open Decision that this one replaces.
post--expiresWhen it closes by itself, such as 2h or 3d.
post--request-idPost again with the same id and it posts once.
post--imageA picture, with an optional caption. Repeat it.
post--viewA JSON file with a small view under the summary.
post--jsonPrint one JSON document instead of text.
status--jsonPrint one JSON document instead of text.
withdraw--jsonPrint one JSON document instead of text.
list--jsonPrint one JSON document instead of text.
clear--spokenWithdraw and clear the open cards the person answered in the session. Not from an agent's pane.
clear--jsonPrint one JSON document instead of text.
state--jsonPrint 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.

KindWordWhat it will be
placeheader.lineA line in the header.
placesettingsA part of the Settings screen.
manifest keyserveKeep the program running between triggers (manifest mode = "serve").

Edit this page on GitHub

The rest of the documentation