@timqi/pier 0.0.9 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +7 -1
  2. package/dist/agent/events.js +53 -7
  3. package/dist/agent/listing.js +253 -0
  4. package/dist/agent/pi.js +190 -31
  5. package/dist/boards/boards.js +65 -16
  6. package/dist/boards/pier.css +1 -1
  7. package/dist/channels/attach.js +87 -0
  8. package/dist/channels/control.js +2 -2
  9. package/dist/channels/lark-api.js +38 -0
  10. package/dist/channels/lark-outbound.js +11 -2
  11. package/dist/channels/slack-api.js +36 -0
  12. package/dist/channels/slack-outbound.js +12 -2
  13. package/dist/channels/slack-tool.js +49 -9
  14. package/dist/channels/telegram-api.js +21 -2
  15. package/dist/channels/telegram.js +23 -8
  16. package/dist/cli.js +34 -0
  17. package/dist/core/identity.js +18 -0
  18. package/dist/core/inbound-file.js +3 -1
  19. package/dist/core/reply.js +2 -1
  20. package/dist/core/router.js +72 -0
  21. package/dist/db.js +78 -0
  22. package/dist/extensions/index.js +5 -2
  23. package/dist/extensions/web/artifacts.js +7 -2
  24. package/dist/extensions/web/content.js +5 -0
  25. package/dist/extensions/web/language.js +5 -0
  26. package/dist/extensions/web/tools.js +33 -8
  27. package/dist/limits.js +14 -0
  28. package/dist/main.js +47 -6
  29. package/dist/paths.js +6 -1
  30. package/dist/settings.js +44 -0
  31. package/dist/tasks/agent.js +23 -4
  32. package/dist/tasks/callbacks.js +20 -1
  33. package/dist/tasks/command.js +15 -0
  34. package/dist/tasks/definitions.js +60 -12
  35. package/dist/tasks/execution.js +9 -1
  36. package/dist/tasks/groups.js +8 -4
  37. package/dist/tasks/messages.js +10 -2
  38. package/dist/tasks/routes.js +4 -0
  39. package/dist/tasks/runs.js +7 -2
  40. package/dist/tasks/service.js +22 -6
  41. package/dist/tasks/store.js +4 -0
  42. package/dist/tasks/tool.js +0 -12
  43. package/dist/tasks/types.js +4 -0
  44. package/dist/tools-task.js +155 -0
  45. package/dist/tools.js +875 -0
  46. package/dist/web/auth.js +5 -3
  47. package/dist/web/explorer.js +15 -2
  48. package/dist/web/files.js +1 -1
  49. package/dist/web/instance.js +165 -36
  50. package/dist/web/public/assets/{ghostty-web-C4N9kjtH.js → ghostty-web-C4ivXTBE.js} +1 -1
  51. package/dist/web/public/assets/index-2E9_cwpg.css +2 -0
  52. package/dist/web/public/assets/index-DVUvzNK1.js +93 -0
  53. package/dist/web/public/index.html +5 -8
  54. package/dist/web/public/sw.js +4 -0
  55. package/dist/web/push.js +22 -7
  56. package/dist/web/repos.js +75 -0
  57. package/dist/web/server.js +145 -64
  58. package/dist/web/session-state.js +33 -51
  59. package/dist/web/types.js +5 -0
  60. package/docs/deploy.md +12 -3
  61. package/package.json +1 -1
  62. package/skills/pier-boards/SKILL.md +23 -13
  63. package/skills/pier-help/SKILL.md +1 -1
  64. package/skills/pier-slack/SKILL.md +21 -1
  65. package/skills/pier-tasks/SKILL.md +2 -2
  66. package/dist/web/public/assets/index-DNCJJRSS.js +0 -91
  67. package/dist/web/public/assets/index-DYl1xk5y.css +0 -2
package/docs/deploy.md CHANGED
@@ -177,9 +177,9 @@ journalctl --user -u pier --since -1h | grep 'tasks:' # one area
177
177
  ```
178
178
 
179
179
  Every line is `area: message` — `core`, `agent`, `tasks`, `slack`, `telegram`,
180
- `channels`, `slack.tool`, `auth`, `boards`, `client`, `db`, `drain`, `secrets`,
181
- `settings`, `credentials`, `update`, `web.providers`, `pier` — so an area is a
182
- grep
180
+ `lark`, `channels`, `slack.tool`, `auth`, `boards`, `client`, `db`, `drain`,
181
+ `secrets`, `settings`, `credentials`, `update`, `tools`, `terminal`, `push`,
182
+ `web`, `web.providers`, `pier` — so an area is a grep
183
183
  and a level is a `-p`. The level reaches journald as a syslog priority prefix, which Pier
184
184
  emits only when systemd says the output is a journal (`$JOURNAL_STREAM`); run
185
185
  in a terminal, the same lines carry a timestamp and a level word instead.
@@ -237,6 +237,7 @@ with the stored hash.
237
237
  ```sh
238
238
  pier restart # finish active work, then restart the service
239
239
  pier reload # apply channel config and recycle idle sessions in place
240
+ pier tools sync # install/update the managed CLI tools
240
241
  ```
241
242
 
242
243
  Both commands signal the installed systemd service; they are not foreground
@@ -246,6 +247,14 @@ next process. At the deadline it records every aborted IM turn first, and the
246
247
  next process posts that note after its adapter starts. Cleanup after the deadline
247
248
  has one shared 10-second bound regardless of how many sessions are stuck.
248
249
 
250
+ `pier tools sync` converges the command-line tools switched on in Console →
251
+ Settings — they install into `~/.pier/tools/bin`, which the service puts first
252
+ on the PATH every session, task and terminal inherits. Normally a switch runs
253
+ it for you as a task; typing it is for a machine that was offline when one was
254
+ flipped. One sync runs at a time per machine: an overlapping one waits for the
255
+ lock (and converges on the switches as they stand when its turn comes) instead
256
+ of racing the other's installs.
257
+
249
258
  `pier reload` does not stop active work. It reloads Slack and Telegram adapters
250
259
  and immediately evicts idle sessions nobody is watching, so their next message
251
260
  opens with current agent files and configuration. Streaming sessions and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timqi/pier",
3
- "version": "0.0.9",
3
+ "version": "0.0.16",
4
4
  "description": "A self-hosted workspace for coding agents: web workbench and IM channels in front of Pi sessions",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": "github:timqi/pier",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pier-boards
3
- description: Publish a Board — a folder of static HTML Pier serves at a stable URL — to present a report, digest, dashboard or handover note to the user. Read before building any page-shaped deliverable, or before editing an existing board.
3
+ description: Publish a Board — a folder of static HTML Pier serves at a stable URL. Read before building any page-shaped deliverable (report, digest, dashboard) or editing an existing board.
4
4
  ---
5
5
 
6
6
  # Building a Pier board
@@ -27,23 +27,33 @@ session may read or rewrite any board, and closing this one changes nothing.
27
27
  }
28
28
  ```
29
29
 
30
- Those four fields are the whole manifest.
30
+ Those four fields are the whole manifest (publishing adds a fifth — below).
31
31
 
32
- - `slug`: `[a-z0-9][a-z0-9-]{0,63}`, and it is the URL — short and stable.
32
+ - `slug`: `[a-z0-9][a-z0-9-]{0,63}`, and it is the URL — short and stable. Do
33
+ not add random characters of your own; publishing adds them (see below).
33
34
  - `description` is the Console list entry: write it for someone who has
34
35
  forgotten this conversation.
35
36
  - `sessions`: append your own id, never replace — other ids are provenance too.
36
37
 
37
38
  ## Publish, then hand over the link
38
39
 
39
- `"public": true` serves the board at `/p/<slug>/` **with no password**. Set it
40
- only if the user asked for a public or shareable board *in this request*;
41
- otherwise leave it `false` and say the board is private. Never publish personal
42
- data or anything the user has not seen.
40
+ `"public": true` serves the board **with no password**. Set it only if the user
41
+ asked for a public or shareable board *in this request*; otherwise leave it
42
+ `false` and say the board is private. Never publish personal data or anything
43
+ the user has not seen.
43
44
 
44
- Asked to make an existing board public? Flip `"public"` to `true` in
45
- `board.json` and reply with the `/p/<slug>/` link that is the whole answer.
46
- No verification step, no narrating the edit, no restating what the page holds.
45
+ The published address is `/p/<slug>-<token>/`, not `/p/<slug>/`, so a public
46
+ board's URL cannot be guessed from its name. `token` is a fifth manifest field
47
+ you write next to `"public": true` eight hex characters from
48
+ `openssl rand -hex 4`, never invented in your head, never reused between
49
+ boards. Leave it out and Pier mints one on the first request, but then the link
50
+ is only visible in the Console, so write it yourself and you can hand it over
51
+ in the same message.
52
+
53
+ Asked to make an existing board public? Set `"public": true` and a fresh
54
+ `token` in `board.json`, then reply with the `/p/<slug>-<token>/` link — that is
55
+ the whole answer. Already has a token? Keep it: the link may be out there. No
56
+ verification step, no narrating the edit, no restating what the page holds.
47
57
 
48
58
  The message announcing the board carries **one bare URL** — paste the address
49
59
  itself, never `[title](url)`: link labels get mangled or truncated on some chat
@@ -54,10 +64,10 @@ surfaces, and the title is already on the page. No filesystem paths either —
54
64
  | The user asked for | Send |
55
65
  | --- | --- |
56
66
  | a board, nothing about sharing | `https://pier.example.com/boards/weekly-digest/` — behind the Pier password; Console → Boards makes it public |
57
- | a **public** board | `https://pier.example.com/p/weekly-digest/` — no password |
67
+ | a **public** board | `https://pier.example.com/p/weekly-digest-3f9ac128/` — no password; the suffix is the manifest's `token`, copied verbatim |
58
68
 
59
69
  Never both: the pair invites pasting the password-free URL of a board that was
60
- never meant to leave the workspace, and `/p/<slug>/` 404s unless the manifest
70
+ never meant to leave the workspace, and `/p/<slug>-<token>/` 404s unless the manifest
61
71
  says `"public": true`. No address configured? Give the path, say Console →
62
72
  Settings turns it into a link, and never guess a host.
63
73
 
@@ -74,7 +84,7 @@ build, no npm, no framework:
74
84
  <meta charset="utf-8">
75
85
  <meta name="viewport" content="width=device-width, initial-scale=1">
76
86
  <title>Weekly digest — infra</title>
77
- <link rel="stylesheet" href="/boards/_assets/pier.css">
87
+ <link rel="stylesheet" href="/p/_assets/pier.css">
78
88
  </head>
79
89
  <body>
80
90
  <div class="hero">
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pier-help
3
- description: How Pier itself works — durable sessions and what survives a restart, how messages and files reach you from Slack and Telegram, in-chat commands (/stop, /settings, /bind), interrupting a running turn, and what only the operator's Console can change. Read before explaining Pier's behavior or advising a user on how to use it.
3
+ description: How Pier itself works — durable sessions, what survives a restart, how messages and files reach you from IM, in-chat commands, and what only the operator's Console can change. Read before explaining Pier's behavior or advising a user on it.
4
4
  ---
5
5
 
6
6
  # How Pier works
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pier-slack
3
- description: Read and write Slack through Pier's slack tool — a channel's history for a time range, one thread, posting into a thread, deleting a message Pier posted, and the Slack-specific syntax for mentions and links. Read before answering questions about Slack conversations or posting anything to a workspace.
3
+ description: Read and write Slack through Pier's slack tool, including the Slack-specific syntax for mentions and links. Read before answering questions about Slack conversations or posting anything to a workspace.
4
4
  ---
5
5
 
6
6
  # Reading and writing Slack
@@ -97,6 +97,26 @@ Going top-level takes the explicit `"none"`: a channel's main flow is wider
97
97
  than a thread. A `thread_ts` is never inherited across a change of `channel`.
98
98
  The response carries `ts` and `threadTs` for replying under what you posted.
99
99
 
100
+ ## Editing
101
+
102
+ ```json
103
+ {"operation":"edit","channel":"#ops","ts":"1717243800.000100",
104
+ "text":"**Deploy done** — 3 services, 1 rollback."}
105
+ ```
106
+
107
+ `text` replaces the message outright; there is no partial edit. Read the
108
+ message first if you are changing part of it.
109
+
110
+ - Slack only lets Pier edit what **its own bot** posted — anyone else's message
111
+ answers `cant_update_message`, and the answer is to reply, not to retry.
112
+ - `ts` is always explicit, as with `delete`, and means nothing outside the
113
+ channel it was read in.
114
+ - The old text is gone — Slack keeps no version a reader can open, and may not
115
+ mark the message as edited at all. When the previous wording mattered to
116
+ people reading, say what changed rather than quietly rewriting history.
117
+ - A long-running update — a status line, a running tally — is better as one
118
+ message edited in place than as a new message per change.
119
+
100
120
  ## Deleting
101
121
 
102
122
  ```json
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pier-tasks
3
- description: Delegate work to Pier subagents with the task tool — one-shot delegation, core-joined parallel fan-out, chained steps, and mid-run control (steer/resume/contact). Read before delegating to a subagent, coordinating multiple agents, or running long background work.
3
+ description: Delegate work to Pier subagents with the task tool — one-shot, parallel fan-out, chains, mid-run control. Read before delegating to a subagent, coordinating agents, or running long background work.
4
4
  ---
5
5
 
6
6
  # Orchestrating Pier tasks
@@ -38,7 +38,7 @@ schedule policy, where `manual` means on-demand — by a human or by you.
38
38
  - The child inherits your current model unless `launch.model` is set.
39
39
  Unknown models fail with the available list in the error. `launch` applies to
40
40
  `fresh` and `fork` only — a `reuse` session owns its own model and tools.
41
- - The child has the same tools you do; there is no capability knob to pick.
41
+ - The child has the same tools you do.
42
42
  - Runs time out after 900s by default; set `timeoutSeconds` in the draft for
43
43
  longer jobs.
44
44