@agentproto/apps 0.11.0 → 0.13.0

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 (70) hide show
  1. package/dist/agents-overview/panel.mjs +39 -67
  2. package/dist/agents-overview/panel.mjs.map +1 -1
  3. package/dist/agents-overview.mjs +38 -68
  4. package/dist/agents-overview.mjs.map +1 -1
  5. package/dist/bin/sync.d.ts.map +1 -1
  6. package/dist/bin/sync.mjs +2374 -2
  7. package/dist/bin/sync.mjs.map +1 -1
  8. package/dist/bureau-sessions/panel.mjs +39 -67
  9. package/dist/bureau-sessions/panel.mjs.map +1 -1
  10. package/dist/bureau-sessions.mjs +38 -68
  11. package/dist/bureau-sessions.mjs.map +1 -1
  12. package/dist/config/fragment.d.ts +50 -0
  13. package/dist/config/fragment.d.ts.map +1 -0
  14. package/dist/config/index.d.ts +23 -0
  15. package/dist/config/index.d.ts.map +1 -0
  16. package/dist/config/ui.d.ts +43 -0
  17. package/dist/config/ui.d.ts.map +1 -0
  18. package/dist/config.mjs +2373 -0
  19. package/dist/config.mjs.map +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.mjs +3200 -150
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/live-session/logic.d.ts +2 -0
  25. package/dist/live-session/logic.d.ts.map +1 -1
  26. package/dist/live-session/panel.d.ts.map +1 -1
  27. package/dist/live-session/panel.mjs +52 -74
  28. package/dist/live-session/panel.mjs.map +1 -1
  29. package/dist/live-session.mjs +51 -75
  30. package/dist/live-session.mjs.map +1 -1
  31. package/dist/panel-bridge.d.ts +11 -6
  32. package/dist/panel-bridge.d.ts.map +1 -1
  33. package/dist/session-chat/blob-embed.d.ts +53 -0
  34. package/dist/session-chat/blob-embed.d.ts.map +1 -0
  35. package/dist/session-chat/index.d.ts +13 -0
  36. package/dist/session-chat/index.d.ts.map +1 -1
  37. package/dist/session-chat/panel.d.ts +38 -2
  38. package/dist/session-chat/panel.d.ts.map +1 -1
  39. package/dist/session-chat/panel.mjs +556 -6
  40. package/dist/session-chat/panel.mjs.map +1 -1
  41. package/dist/session-chat.mjs +591 -14
  42. package/dist/session-chat.mjs.map +1 -1
  43. package/dist/session-story/panel.mjs +39 -67
  44. package/dist/session-story/panel.mjs.map +1 -1
  45. package/dist/session-story.mjs +38 -68
  46. package/dist/session-story.mjs.map +1 -1
  47. package/dist/session-viewer/ui.d.ts.map +1 -1
  48. package/dist/session-viewer.mjs +10 -0
  49. package/dist/session-viewer.mjs.map +1 -1
  50. package/dist/sessions-panel/panel.d.ts.map +1 -1
  51. package/dist/sessions-panel/panel.mjs +40 -67
  52. package/dist/sessions-panel/panel.mjs.map +1 -1
  53. package/dist/sessions-panel.mjs +39 -68
  54. package/dist/sessions-panel.mjs.map +1 -1
  55. package/dist/work-board/panel.d.ts +1 -1
  56. package/dist/work-board/panel.d.ts.map +1 -1
  57. package/dist/work-board/panel.generated.d.ts +1 -1
  58. package/dist/work-board/panel.generated.d.ts.map +1 -1
  59. package/dist/work-board/panel.mjs +318 -62
  60. package/dist/work-board/panel.mjs.map +1 -1
  61. package/dist/work-board.mjs +318 -62
  62. package/dist/work-board.mjs.map +1 -1
  63. package/package.json +12 -4
  64. package/repo-maintenance/.agentproto/APP.md +22 -0
  65. package/repo-maintenance/.agentproto/agents/repo-maintenance-reviewer/AGENT.md +142 -0
  66. package/repo-maintenance/.agentproto/workflows/maintain/WORKFLOW.md +262 -0
  67. package/repo-maintenance/.agentproto/workflows/maintain/entry.mjs +672 -0
  68. package/repo-maintenance/README.md +79 -0
  69. package/repo-maintenance/routines/repo-maintenance-daily/ROUTINE.md +77 -0
  70. package/repo-maintenance/routines/repo-maintenance-weekly/ROUTINE.md +82 -0
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: Repo Maintenance
3
+ id: maintain
4
+ description: >-
5
+ Plan worktree_gc + branch_gc, fan a review agent out over up to
6
+ `maxReviews` unreviewed branch candidates, newest first (small model for a
7
+ small residual, large model otherwise), verify every candidate got a verdict, optionally apply
8
+ (reclaim-only) worktree/branch gc, and report — plus an agentpush
9
+ notification when `notify` is set. Entry-based (see entry.mjs): the
10
+ `review` map step's per-candidate model selector is a real run-time
11
+ function, which the pure-.md path cannot express (`defineWorkflow` rejects
12
+ a non-string `model` — "a run-time selector is only available on the
13
+ TS-authored runtime step").
14
+ version: 0.1.0
15
+ entry: ./entry.mjs
16
+ inputs:
17
+ repoRoot:
18
+ type: string
19
+ description: Absolute path to the git repo. Wins over `workspaceSlug`.
20
+ workspaceSlug:
21
+ type: string
22
+ description: Workspace slug. The active workspace when both are omitted.
23
+ applyMerged:
24
+ type: boolean
25
+ description: Execute branch_gc/worktree_gc (reclaim-class only) after review.
26
+ default: false
27
+ reviewModelSmall:
28
+ type: string
29
+ description: Model for a review candidate with residualFileCount <= 3.
30
+ default: claude-haiku-4-5-20251001
31
+ reviewModelLarge:
32
+ type: string
33
+ description: Model for a review candidate with residualFileCount > 3.
34
+ default: claude-sonnet-5
35
+ maxReviews:
36
+ type: number
37
+ description: >-
38
+ Most review candidates to review this run — newest tip first, then the
39
+ larger residual. The rest are reported as not reviewed this run; tips
40
+ with a stored verdict are never re-reviewed, so daily runs walk the
41
+ backlog.
42
+ default: 40
43
+ notify:
44
+ type: object
45
+ description: >-
46
+ Optional agentpush `to` target ({ channel, address }) to notify with
47
+ the report when set. Omit for no notification.
48
+ outputs: {}
49
+ steps:
50
+ - id: worktreeGcPlan
51
+ kind: tool
52
+ name: Plan worktree gc
53
+ tool: worktree_gc
54
+ inputs:
55
+ repoRoot: $input.repoRoot
56
+ workspaceSlug: $input.workspaceSlug
57
+ apply: false
58
+
59
+ - id: branchGcPlan
60
+ kind: tool
61
+ name: Plan branch gc
62
+ tool: branch_gc
63
+ inputs:
64
+ repoRoot: $input.repoRoot
65
+ workspaceSlug: $input.workspaceSlug
66
+ apply: false
67
+ includeReviewed: false
68
+
69
+ - id: reviewQueue
70
+ kind: transform
71
+ name: Queue unreviewed review candidates, one per branch name
72
+ description: >-
73
+ Entry-based — no string expression language for `compute` in the
74
+ declarative manifest. See entry.mjs's buildReviewQueue: dedupes by tip
75
+ sha, then merges candidates whose refs share one branch name (a local
76
+ branch and its remote twin review together even when their tips
77
+ diverged — the newest tip is primary, the older ones ride along as
78
+ otherTips), skips names whose every tip already carries a stored
79
+ verdict, and orders oldest first, then the larger residual.
80
+
81
+ - id: reviewCandidates
82
+ kind: transform
83
+ name: Take this run's share of the queue
84
+ description: Entry-based — the first `maxReviews` of reviewQueue.
85
+
86
+ - id: reviewWorktreePaths
87
+ kind: transform
88
+ name: Name each candidate's disposable review worktree
89
+ description: >-
90
+ Entry-based. Every candidate carries `reviewWorktree`, a detached
91
+ worktree path under the OS tmp dir (`agentproto-maintain-review/`),
92
+ never the live checkout. This step lists them for the cleanups.
93
+
94
+ - id: review
95
+ kind: map
96
+ name: Review every unmerged branch
97
+ description: >-
98
+ One reviewer-agent turn per branch name, parallelism 4. Model is
99
+ picked per item by entry.mjs: haiku when residualFileCount <= 3, else
100
+ sonnet. The agent records its verdict via branch_gc_verdict — one call
101
+ PER tip the item carries (an item may hold a local + a remote tip that
102
+ diverged); this step never applies anything. After the turn,
103
+ branch_gc_verdict_get checks the store for EVERY tip; with any
104
+ verdict missing, the SAME session is re-prompted once, then one fresh
105
+ large-model reviewer retries, and only then are the still-missing tips
106
+ left as gaps. Each item first creates its own
107
+ detached review worktree of the primary tip (`branch_gc_review_worktree`),
108
+ runs its reviewers there — never in the live checkout — and removes it
109
+ last. Three spawn
110
+ failures in a row open the engine's circuit breaker: the remaining
111
+ candidates are not started and are reported as not reviewed. See
112
+ entry.mjs for the body.
113
+ over: $steps.reviewCandidates
114
+ parallelism: 4
115
+ onError: collect
116
+ steps:
117
+ - id: reviewOne
118
+ kind: agent
119
+ agent:
120
+ ref: "@agentproto/repo-maintenance-reviewer"
121
+ prompt: See entry.mjs — mustache-templated over $item + branchGcPlan.
122
+
123
+ - id: reviewCleanup
124
+ kind: tool
125
+ name: Remove every review worktree
126
+ description: >-
127
+ An item that failed never reached its own removal — clear them all
128
+ before anything re-plans or gc's worktrees. The entry's `finally`
129
+ block runs the same removal again whatever happens (failure, cancel).
130
+ tool: branch_gc_review_worktree
131
+ inputs:
132
+ repoRoot: $steps.branchGcPlan.plan.repoRoot
133
+ action: remove
134
+ paths: $steps.reviewWorktreePaths
135
+
136
+ - id: branchGcVerify
137
+ kind: tool
138
+ name: Re-plan to pick up recorded verdicts
139
+ tool: branch_gc
140
+ inputs:
141
+ repoRoot: $input.repoRoot
142
+ workspaceSlug: $input.workspaceSlug
143
+ apply: false
144
+ includeReviewed: false
145
+
146
+ - id: gaps
147
+ kind: transform
148
+ name: Review candidates with no recorded verdict
149
+ description: Entry-based — see entry.mjs's computeReviewGaps.
150
+
151
+ - id: branchGcApply
152
+ kind: tool
153
+ name: Apply branch gc (reclaim only)
154
+ description: >-
155
+ `apply` is $input.applyMerged — a dry-run plan again when false.
156
+ `includeReviewed` stays false: this workflow never reclaims a
157
+ review-class branch, even an agreed one (see the approve-reviewed
158
+ seam below).
159
+ tool: branch_gc
160
+ inputs:
161
+ repoRoot: $input.repoRoot
162
+ workspaceSlug: $input.workspaceSlug
163
+ apply: $input.applyMerged
164
+ includeReviewed: false
165
+ scopes: [local, remote, orphan]
166
+
167
+ - id: worktreeGcApply
168
+ kind: tool
169
+ name: Apply worktree gc
170
+ tool: worktree_gc
171
+ inputs:
172
+ repoRoot: $input.repoRoot
173
+ workspaceSlug: $input.workspaceSlug
174
+ apply: $input.applyMerged
175
+ salvageDirty: false
176
+
177
+ - id: report
178
+ kind: transform
179
+ name: Build the markdown summary
180
+ description: Entry-based — see entry.mjs's buildReport.
181
+
182
+ - id: notifyBody
183
+ kind: transform
184
+ name: Format the agentpush notification body
185
+ description: Entry-based — turns the report into agentpush's send_message JSON body.
186
+
187
+ - id: shouldNotify
188
+ kind: transform
189
+ name: Decide whether there's anything worth notifying about
190
+ description: >-
191
+ Entry-based — true only when `notify` is set AND there's a
192
+ reclaimable ref or a review candidate. A clean plan-only sweep
193
+ shouldn't page anyone.
194
+
195
+ - id: maybeNotify
196
+ kind: branch
197
+ name: Notify only when shouldNotify is true
198
+ branches:
199
+ - when: $steps.shouldNotify
200
+ next: notify
201
+ default: skip-notify
202
+
203
+ - id: notify
204
+ kind: tool
205
+ name: Send the agentpush notification
206
+ tool: command_execute
207
+ inputs:
208
+ command: bash
209
+ args:
210
+ - "-c"
211
+ - >-
212
+ curl -s --max-time 30 -X POST -H "Authorization: Bearer
213
+ ${AGENTPUSH_API_KEY:-}" -H "Content-Type: application/json"
214
+ https://api.agentpush.io/tools/send_message --data-binary @-
215
+ stdin: $steps.notifyBody
216
+
217
+ - id: skip-notify
218
+ kind: gate
219
+ name: No notification requested
220
+ command: "true"
221
+
222
+ result:
223
+ report: $steps.report
224
+ gaps: $steps.gaps
225
+ applyMerged: $input.applyMerged
226
+ branchGcApply: $steps.branchGcApply
227
+ worktreeGcApply: $steps.worktreeGcApply
228
+ ---
229
+
230
+ # Repo Maintenance — `maintain` workflow
231
+
232
+ `worktree_gc` + `branch_gc` plan → fan a reviewer agent out over every
233
+ unmerged branch (small model for a small residual, large model otherwise) →
234
+ verify every candidate got a verdict → optionally apply (reclaim-class only)
235
+ → markdown report, plus an agentpush notification when `notify` is set.
236
+
237
+ Entry-based (`entry.mjs`) for one reason: `review`'s per-candidate `model`
238
+ selector is a real run-time function, which only the entry-loader path can
239
+ carry (see the description above and entry.mjs's own docblock).
240
+
241
+ ## Review worktrees
242
+
243
+ Reviewers never run in the live checkout. Each review item creates a
244
+ disposable DETACHED worktree of the tip under review under the OS tmp dir
245
+ (`branch_gc_review_worktree`, which refuses any other location) and removes
246
+ it when the item ends; `reviewCleanup` removes them all after the map, and
247
+ entry.mjs's `finally` block removes them once more on failure or cancel — a
248
+ `finally` step always runs.
249
+
250
+ ## Out of scope, on purpose
251
+
252
+ Recording a verdict via `branch_gc_verdict` never reclaims a branch by
253
+ itself — `branchGcApply` always runs with `includeReviewed: false`. A
254
+ human-in-the-loop gate that reclaims `review`-class branches whose stored
255
+ verdict agreed is a documented, unwired seam (`approve-reviewed`), not built
256
+ here — see the app README, "Out of scope: the approval gate".
257
+
258
+ ## Enabling
259
+
260
+ `command_execute` (the `notify` step) needs `bash` allowlisted in the
261
+ workspace's `.agentproto/allowed-commands.json`, and `AGENTPUSH_API_KEY` set
262
+ in the daemon's environment, before passing a `notify` input.