@bridgebrew/sessions 0.0.0-stage → 0.0.8

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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -2
  3. package/answers.ts +167 -0
  4. package/browser/branch-actions.tsx +166 -0
  5. package/browser/changes.tsx +415 -0
  6. package/browser/children.tsx +650 -0
  7. package/browser/conversation.tsx +2381 -0
  8. package/browser/decision-questions.tsx +191 -0
  9. package/browser/elapsed.tsx +44 -0
  10. package/browser/gallery.tsx +218 -0
  11. package/browser/index.tsx +3434 -0
  12. package/browser/media-origins.tsx +38 -0
  13. package/browser/mobile.tsx +663 -0
  14. package/browser/open-link.tsx +30 -0
  15. package/browser/pull-request.tsx +116 -0
  16. package/browser/questions.tsx +156 -0
  17. package/browser/session-scheduled.tsx +203 -0
  18. package/browser/subagent-view.tsx +136 -0
  19. package/browser/subagents.tsx +339 -0
  20. package/browser/tabs.tsx +228 -0
  21. package/browser/tsconfig.json +15 -0
  22. package/browser/views/view.tsx +1064 -0
  23. package/browser/views.tsx +166 -0
  24. package/contract.ts +287 -0
  25. package/delegations.ts +1975 -0
  26. package/diff.ts +88 -0
  27. package/docs/en/images.mdx +51 -0
  28. package/docs/en/index.mdx +22 -0
  29. package/docs/en/meta.json +4 -0
  30. package/docs/en/organize-sessions.mdx +53 -0
  31. package/docs/en/start-a-session.mdx +63 -0
  32. package/docs/meta.json +4 -0
  33. package/git.ts +223 -0
  34. package/listing.ts +382 -0
  35. package/package.json +1023 -4
  36. package/peers.ts +677 -0
  37. package/pull-request-watch.ts +282 -0
  38. package/pull-requests.ts +606 -0
  39. package/server.ts +5920 -0
  40. package/text.ts +19 -0
  41. package/tsconfig.json +3 -0
  42. package/viewer-activity.ts +57 -0
  43. package/views/examples.ts +153 -0
  44. package/views/library.ts +1116 -0
package/package.json CHANGED
@@ -1,6 +1,1025 @@
1
1
  {
2
2
  "name": "@bridgebrew/sessions",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.8",
4
+ "license": "MIT",
5
+ "description": "Conversations with agents, in the workspace or in a project, through the Profile.",
6
+ "keywords": [
7
+ "bridge-plugin"
8
+ ],
9
+ "type": "module",
10
+ "files": [
11
+ "*.json",
12
+ "*.ts",
13
+ "browser/",
14
+ "docs/",
15
+ "views/",
16
+ "!**/*.test.ts",
17
+ "!**/*.test.tsx",
18
+ "!vitest.config.ts"
19
+ ],
20
+ "bridge": {
21
+ "kind": "application",
22
+ "title": "Sessions",
23
+ "icon": "scroll-text",
24
+ "domain": "agents",
25
+ "server": "./server.ts",
26
+ "browser": "./browser/index.tsx",
27
+ "implements": [
28
+ "sessions"
29
+ ],
30
+ "requires": {
31
+ "storage": {},
32
+ "harness": {}
33
+ },
34
+ "needs": {
35
+ "fs": [
36
+ "data",
37
+ "projects"
38
+ ]
39
+ },
40
+ "settings": {
41
+ "type": "object",
42
+ "properties": {
43
+ "autoSettleAfterDays": {
44
+ "type": "integer",
45
+ "title": "Auto-settle after (days)",
46
+ "description": "Days before an idle session moves to Settled.",
47
+ "x-bridge-details": "A session you have not written to for this many days, unless it is pinned, running, or you un-settled it. 0: never.",
48
+ "minimum": 0,
49
+ "maximum": 90,
50
+ "default": 3,
51
+ "applies": "live"
52
+ },
53
+ "inbox": {
54
+ "type": "boolean",
55
+ "title": "Fold working sessions",
56
+ "description": "Sessions whose agent is working fold into Working; Active keeps the ones that need you.",
57
+ "x-bridge-details": "A session comes back to the top of Active when its turn ends, fails or stops, or when it asks a decision. Off: Active lists every session, newest activity first.",
58
+ "default": true,
59
+ "applies": "live"
60
+ },
61
+ "snoozeChoices": {
62
+ "type": "array",
63
+ "title": "Snooze choices",
64
+ "description": "What Snooze offers, soonest first. Custom… stays there for any other time.",
65
+ "x-bridge-details": "A delay from the moment you snooze, or a time on a day: today (offered while more than an hour ahead), tomorrow, or a weekday's next date. Two choices waking at the same minute show once.",
66
+ "default": [
67
+ {
68
+ "when": "after",
69
+ "minutes": 60
70
+ },
71
+ {
72
+ "when": "after",
73
+ "minutes": 180
74
+ },
75
+ {
76
+ "when": "today",
77
+ "time": "18:00"
78
+ },
79
+ {
80
+ "when": "tomorrow",
81
+ "time": "09:00"
82
+ },
83
+ {
84
+ "when": "monday",
85
+ "time": "09:00"
86
+ }
87
+ ],
88
+ "applies": "live",
89
+ "items": {
90
+ "type": "object",
91
+ "title": "Snooze choice",
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "when": {
95
+ "type": "string",
96
+ "title": "When",
97
+ "description": "After a delay, or at a time on a day.",
98
+ "enum": [
99
+ "after",
100
+ "today",
101
+ "tomorrow",
102
+ "monday",
103
+ "tuesday",
104
+ "wednesday",
105
+ "thursday",
106
+ "friday",
107
+ "saturday",
108
+ "sunday"
109
+ ],
110
+ "x-bridge-labels": [
111
+ "After a delay",
112
+ "Today",
113
+ "Tomorrow",
114
+ "Next Monday",
115
+ "Next Tuesday",
116
+ "Next Wednesday",
117
+ "Next Thursday",
118
+ "Next Friday",
119
+ "Next Saturday",
120
+ "Next Sunday"
121
+ ],
122
+ "default": "after"
123
+ },
124
+ "minutes": {
125
+ "type": "integer",
126
+ "title": "Delay (minutes)",
127
+ "description": "How long after you snooze it comes back: 60 is in 1 hour, 1440 in 1 day.",
128
+ "minimum": 1,
129
+ "maximum": 43200,
130
+ "default": 60,
131
+ "x-bridge-shown-if": {
132
+ "when": [
133
+ "after"
134
+ ]
135
+ }
136
+ },
137
+ "time": {
138
+ "type": "string",
139
+ "title": "Time",
140
+ "description": "The time it comes back that day, 24-hour (09:00).",
141
+ "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
142
+ "x-bridge-pattern-message": "a time is HH:MM, 24-hour (09:00, 18:30)",
143
+ "default": "09:00",
144
+ "x-bridge-shown-if": {
145
+ "when": [
146
+ "today",
147
+ "tomorrow",
148
+ "monday",
149
+ "tuesday",
150
+ "wednesday",
151
+ "thursday",
152
+ "friday",
153
+ "saturday",
154
+ "sunday"
155
+ ]
156
+ }
157
+ }
158
+ }
159
+ }
160
+ },
161
+ "questionMinutes": {
162
+ "type": "integer",
163
+ "x-bridge-advanced": true,
164
+ "title": "Time to answer a question (minutes)",
165
+ "description": "How long an agent has to answer another session.",
166
+ "x-bridge-details": "Past it, you decide: force continue, wait again, or stop.",
167
+ "minimum": 1,
168
+ "maximum": 1440,
169
+ "default": 10,
170
+ "applies": "live"
171
+ },
172
+ "prompt": {
173
+ "type": "string",
174
+ "title": "Prompt",
175
+ "description": "The field you write to the agent in.",
176
+ "x-bridge-details": "Full, Basic (a field and Send), or another one installed. Default: the first installed.",
177
+ "maxLength": 214,
178
+ "minLength": 1,
179
+ "x-bridge-options": "session-prompts",
180
+ "applies": "live"
181
+ },
182
+ "newSessionBranch": {
183
+ "type": "string",
184
+ "title": "New session's branch",
185
+ "description": "What a new session of a git project works on, until you pick another in its prompt.",
186
+ "x-bridge-details": "main: the project's active branch (its own folder unless a branch is active). New branch: Bridge makes a branch at the session's first message, in a folder of its own, named from that message.",
187
+ "enum": [
188
+ "main",
189
+ "new"
190
+ ],
191
+ "x-bridge-labels": [
192
+ "main",
193
+ "New branch"
194
+ ],
195
+ "default": "main",
196
+ "applies": "live"
197
+ },
198
+ "pullRequestWatchMinutes": {
199
+ "type": "integer",
200
+ "title": "Watched pull request: read every (minutes)",
201
+ "description": "How often Bridge reads a pull request a session's agent watches, to wake it when a check fails, the required checks pass, someone else comments or the branch conflicts.",
202
+ "minimum": 1,
203
+ "maximum": 60,
204
+ "default": 2,
205
+ "applies": "live"
206
+ },
207
+ "pullRequestSyncMinutes": {
208
+ "type": "integer",
209
+ "title": "Linked pull request: read every (minutes)",
210
+ "description": "How often Bridge reads an open pull request linked to a session that is not settled, for its header and to settle it on merge.",
211
+ "x-bridge-details": "Also read at the end of each turn and when the session's page opens. A merged or closed pull request is not read again.",
212
+ "minimum": 1,
213
+ "maximum": 240,
214
+ "default": 10,
215
+ "applies": "live"
216
+ },
217
+ "pullRequestSettle": {
218
+ "type": "string",
219
+ "title": "Settle on pull request",
220
+ "description": "A session moves to Settled when its pull request is merged, or merged or closed.",
221
+ "enum": [
222
+ "merged",
223
+ "merged or closed",
224
+ "never"
225
+ ],
226
+ "default": "merged",
227
+ "applies": "live"
228
+ },
229
+ "pullRequestKeepsActive": {
230
+ "type": "boolean",
231
+ "title": "Open pull request keeps a session active",
232
+ "description": "A session whose pull request is open or a draft is never auto-settled.",
233
+ "default": true,
234
+ "applies": "live"
235
+ }
236
+ }
237
+ },
238
+ "screen": {
239
+ "id": "sessions",
240
+ "title": "Sessions",
241
+ "icon": "scroll-text",
242
+ "home": "fallback",
243
+ "mobile": true
244
+ },
245
+ "tools": {
246
+ "list_sessions": {
247
+ "description": "List every session of this Bridge workspace with its triage state: node, title, harness, running, waiting (a decision open), unread (a turn ended since the user last looked), pinnedAt, settledAt and settledBy (user or auto), snoozedUntil (snoozed until then) or woke (its snooze ended since the user last looked), lastTurn { endedAt, reason }, tags, files (what it changed in its git repository, relative to the repository's top), commits, and target (what the user pointed at in the page, when it started there).",
248
+ "method": "GET",
249
+ "path": "/sessions",
250
+ "input": {
251
+ "type": "object",
252
+ "properties": {},
253
+ "additionalProperties": false
254
+ }
255
+ },
256
+ "triage_session": {
257
+ "description": "Triage a session of this workspace (its id from list_sessions). settle: done for now, moves it to Settled (refused while a turn runs; settle a session whose work you finished); unsettle: back to Active; pin / unpin: keep it at the top; visit / unread: mark it read or unread; archive: hide it (restore brings it back); snooze: hide it until `until` (an ISO time, within a year; refused while a decision waits; needs the scheduler plugin), wake: end a snooze now. Refused for a session that runs above your own permission mode (the user triages it). Answers the session's new state.",
258
+ "method": "POST",
259
+ "path": "/sessions/triage",
260
+ "input": {
261
+ "type": "object",
262
+ "properties": {
263
+ "id": {
264
+ "type": "string",
265
+ "description": "The session's id."
266
+ },
267
+ "action": {
268
+ "type": "string",
269
+ "enum": [
270
+ "settle",
271
+ "unsettle",
272
+ "pin",
273
+ "unpin",
274
+ "visit",
275
+ "unread",
276
+ "archive",
277
+ "restore",
278
+ "snooze",
279
+ "wake"
280
+ ]
281
+ },
282
+ "until": {
283
+ "type": "string",
284
+ "description": "With snooze: when the session comes back, an ISO time such as 2026-10-12T09:00:00+02:00."
285
+ },
286
+ "unpin": {
287
+ "type": "boolean",
288
+ "description": "With snooze on a pinned session: unpin it too (by default it stays pinned and comes back to Pinned)."
289
+ }
290
+ },
291
+ "required": [
292
+ "id",
293
+ "action"
294
+ ],
295
+ "additionalProperties": false
296
+ }
297
+ },
298
+ "tag_session": {
299
+ "description": "Tag a session of this workspace with 1 to 5 short tags naming its subject (lowercase words joined by -), replacing its tags; reuse the workspace's existing tags (list_tags) when one fits, so sessions about the same subject group together. An empty list removes them. Answers the session's new state.",
300
+ "method": "POST",
301
+ "path": "/sessions/tags",
302
+ "input": {
303
+ "type": "object",
304
+ "properties": {
305
+ "id": {
306
+ "type": "string",
307
+ "description": "The session's id."
308
+ },
309
+ "tags": {
310
+ "type": "array",
311
+ "items": {
312
+ "type": "string"
313
+ },
314
+ "maxItems": 5
315
+ }
316
+ },
317
+ "required": [
318
+ "id",
319
+ "tags"
320
+ ],
321
+ "additionalProperties": false
322
+ }
323
+ },
324
+ "list_tags": {
325
+ "description": "List the tags of this workspace's sessions, most used first, each with its count.",
326
+ "method": "GET",
327
+ "path": "/sessions/tags",
328
+ "input": {
329
+ "type": "object",
330
+ "properties": {},
331
+ "additionalProperties": false
332
+ }
333
+ },
334
+ "session_changes": {
335
+ "description": "Read what a session of this workspace changed in its git repository and has not committed yet: its files (pending: still uncommitted), its commits, the uncommitted diff of its files, and the other sessions whose uncommitted changes share files with it (shared). Use it before editing a file another session is changing, to keep its work.",
336
+ "method": "POST",
337
+ "path": "/sessions/changes",
338
+ "input": {
339
+ "type": "object",
340
+ "properties": {
341
+ "id": {
342
+ "type": "string",
343
+ "description": "The session's id (list_sessions)."
344
+ }
345
+ },
346
+ "required": [
347
+ "id"
348
+ ],
349
+ "additionalProperties": false
350
+ }
351
+ },
352
+ "notify_session": {
353
+ "description": "Tell another session of this workspace what you are doing, when it may be affected (a file it changed or claimed): no answer is needed, nothing is interrupted; its agent reads it at the start of its next turn. A settled session is made active again by it; an archived one is refused.",
354
+ "method": "POST",
355
+ "path": "/sessions/peer/notify",
356
+ "input": {
357
+ "type": "object",
358
+ "properties": {
359
+ "from": {
360
+ "type": "string",
361
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
362
+ "x-bridge-session": true
363
+ },
364
+ "to": {
365
+ "type": "string",
366
+ "description": "The other session's id (list_sessions)."
367
+ },
368
+ "text": {
369
+ "type": "string",
370
+ "description": "What you are doing and why it concerns it."
371
+ }
372
+ },
373
+ "required": [
374
+ "to",
375
+ "text"
376
+ ],
377
+ "additionalProperties": false
378
+ }
379
+ },
380
+ "ask_session": {
381
+ "description": "Ask another session of this workspace before you change something it works on (\"I must rename X in file Y, OK for you?\"). Answers { request, delivery }: a session with a turn running answers once that turn ends (call wait_answer); one without a turn running is not interrupted and reads it at its next user prompt, so do not wait for it then. A settled session is made active again by it; an archived one is refused.",
382
+ "method": "POST",
383
+ "path": "/sessions/peer/ask",
384
+ "input": {
385
+ "type": "object",
386
+ "properties": {
387
+ "from": {
388
+ "type": "string",
389
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
390
+ "x-bridge-session": true
391
+ },
392
+ "to": {
393
+ "type": "string",
394
+ "description": "The other session's id (list_sessions)."
395
+ },
396
+ "text": {
397
+ "type": "string",
398
+ "description": "The question: what you want to change, where, and why."
399
+ }
400
+ },
401
+ "required": [
402
+ "to",
403
+ "text"
404
+ ],
405
+ "additionalProperties": false
406
+ }
407
+ },
408
+ "wait_answer": {
409
+ "description": "Wait up to 25 seconds for the answer to a question you asked with ask_session: { verdict: ok | wait | no, text, by } once answered, else { pending: true } (call it again, or go on without it). An answer that comes later reaches you at your next turn.",
410
+ "method": "POST",
411
+ "path": "/sessions/peer/wait",
412
+ "input": {
413
+ "type": "object",
414
+ "properties": {
415
+ "from": {
416
+ "type": "string",
417
+ "description": "Your own session id; filled in when left out.",
418
+ "x-bridge-session": true
419
+ },
420
+ "request": {
421
+ "type": "string",
422
+ "description": "The request id ask_session gave."
423
+ }
424
+ },
425
+ "required": [
426
+ "request"
427
+ ],
428
+ "additionalProperties": false
429
+ }
430
+ },
431
+ "answer_session": {
432
+ "description": "Answer a question another session asked yours (an ask in <bridge_messages>): ok (go ahead), wait (not now: say until when), or no (say why and what to do instead).",
433
+ "method": "POST",
434
+ "path": "/sessions/peer/answer",
435
+ "input": {
436
+ "type": "object",
437
+ "properties": {
438
+ "from": {
439
+ "type": "string",
440
+ "description": "Your own session id; filled in when left out.",
441
+ "x-bridge-session": true
442
+ },
443
+ "request": {
444
+ "type": "string",
445
+ "description": "The question's request id."
446
+ },
447
+ "verdict": {
448
+ "type": "string",
449
+ "enum": [
450
+ "ok",
451
+ "wait",
452
+ "no"
453
+ ]
454
+ },
455
+ "text": {
456
+ "type": "string",
457
+ "description": "Why, or what to do instead."
458
+ }
459
+ },
460
+ "required": [
461
+ "request",
462
+ "verdict"
463
+ ],
464
+ "additionalProperties": false
465
+ }
466
+ },
467
+ "claim_files": {
468
+ "description": "Claim files you are about to change (paths relative to your working folder, or absolute), so the other active sessions see it before they edit them; answers your claims and the other sessions claiming the same files. Committing a file, or settling the session, releases its claim.",
469
+ "method": "POST",
470
+ "path": "/sessions/claims",
471
+ "input": {
472
+ "type": "object",
473
+ "properties": {
474
+ "id": {
475
+ "type": "string",
476
+ "description": "Your own session id; filled in when left out.",
477
+ "x-bridge-session": true
478
+ },
479
+ "files": {
480
+ "type": "array",
481
+ "items": {
482
+ "type": "string"
483
+ },
484
+ "maxItems": 200
485
+ },
486
+ "note": {
487
+ "type": "string",
488
+ "description": "What you are about to do with them."
489
+ }
490
+ },
491
+ "required": [
492
+ "files"
493
+ ],
494
+ "additionalProperties": false
495
+ }
496
+ },
497
+ "release_files": {
498
+ "description": "Release your claims on files you no longer change (all of them without files).",
499
+ "method": "POST",
500
+ "path": "/sessions/claims/release",
501
+ "input": {
502
+ "type": "object",
503
+ "properties": {
504
+ "id": {
505
+ "type": "string",
506
+ "description": "Your own session id; filled in when left out.",
507
+ "x-bridge-session": true
508
+ },
509
+ "files": {
510
+ "type": "array",
511
+ "items": {
512
+ "type": "string"
513
+ }
514
+ }
515
+ },
516
+ "additionalProperties": false
517
+ }
518
+ },
519
+ "list_session_profiles": {
520
+ "description": "List the profiles (harnesses) a child session may use from yours, each with its models (and their reasoning efforts) and its permission modes (and their options), and your own session's profile, model, effort, mode and options (current). Call it before you choose a delegate_session target.",
521
+ "method": "POST",
522
+ "path": "/sessions/profiles",
523
+ "input": {
524
+ "type": "object",
525
+ "properties": {
526
+ "from": {
527
+ "type": "string",
528
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
529
+ "x-bridge-session": true
530
+ }
531
+ },
532
+ "additionalProperties": false
533
+ }
534
+ },
535
+ "delegate_session": {
536
+ "description": "Delegate a task to a new child session of this workspace, which works on its own and gives its result back to yours: when it ends, its final answer reaches you as a message (a turn starts for it when you have none running). The child gets only your prompt, never this conversation: give it the full context. By default it takes your profile, model, effort, options and permission mode; target and mode override them, never above your own mode. Answers { delegation, session, status, title } at once; with isolation: worktree, preparing: true while its worktree is made in the background (its task starts there once it is ready, a failure to make it ends the delegation failed), and read_delegation gives worktree { slug, branch } once added. Prefer wait: async and go on with other work; wait: wait only when this turn needs the result to go on. The same clientRequestId with the same input answers the same delegation (safe to retry); a new task takes a new clientRequestId.",
537
+ "method": "POST",
538
+ "path": "/sessions/delegate",
539
+ "input": {
540
+ "type": "object",
541
+ "properties": {
542
+ "from": {
543
+ "type": "string",
544
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
545
+ "x-bridge-session": true
546
+ },
547
+ "prompt": {
548
+ "type": "string",
549
+ "description": "The task, with all the context the child needs."
550
+ },
551
+ "title": {
552
+ "type": "string",
553
+ "description": "A short title (default: the prompt's first line)."
554
+ },
555
+ "role": {
556
+ "type": "string",
557
+ "enum": [
558
+ "implementation",
559
+ "research",
560
+ "review",
561
+ "design",
562
+ "test",
563
+ "general"
564
+ ],
565
+ "description": "What the child acts as (default general)."
566
+ },
567
+ "target": {
568
+ "type": "object",
569
+ "description": "Where and how the child runs; each field left out is yours (list_session_profiles lists them).",
570
+ "properties": {
571
+ "profile": {
572
+ "type": "string",
573
+ "description": "The profile (harness) id."
574
+ },
575
+ "model": {
576
+ "type": "string"
577
+ },
578
+ "effort": {
579
+ "type": "string",
580
+ "description": "The reasoning effort."
581
+ },
582
+ "options": {
583
+ "type": "object",
584
+ "properties": {
585
+ "plan": {
586
+ "type": "boolean"
587
+ },
588
+ "auto": {
589
+ "type": "boolean"
590
+ }
591
+ },
592
+ "additionalProperties": false,
593
+ "description": "The mode's options: plan (it plans first), auto (its reviewer answers its requests). Given, they replace yours."
594
+ },
595
+ "project": {
596
+ "type": "string",
597
+ "description": "Another project node of this workspace for the child to work in (default: yours)."
598
+ }
599
+ },
600
+ "additionalProperties": false
601
+ },
602
+ "mode": {
603
+ "type": "string",
604
+ "description": "The child's permission mode (default yours): never above your own."
605
+ },
606
+ "interaction": {
607
+ "type": "string",
608
+ "enum": [
609
+ "default",
610
+ "plan"
611
+ ],
612
+ "description": "plan: the child plans first."
613
+ },
614
+ "isolation": {
615
+ "type": "string",
616
+ "enum": [
617
+ "shared",
618
+ "worktree"
619
+ ],
620
+ "description": "shared (the default): the child works where you do (your folder, your stage). worktree: the child works on a new git branch of its own, in a new stage of this workspace running it (give worktree.plugins), made in the background (the child preparing meanwhile), both kept when it ends: the branch merges by its pull request, stage_remove removes the stage."
621
+ },
622
+ "worktree": {
623
+ "type": "object",
624
+ "description": "With isolation: worktree, the child's branch: Bridge creates it in the repository this workspace runs the plugins from (from its default branch; uncommitted changes are not in it), then a stage running it. Allowed from Ask, Build or God.",
625
+ "properties": {
626
+ "plugins": {
627
+ "type": "array",
628
+ "items": {
629
+ "type": "string"
630
+ },
631
+ "description": "The plugins the child changes (key or package name), all from one git checkout."
632
+ },
633
+ "branch": {
634
+ "type": "string",
635
+ "description": "A new git branch for it (default: child-<title>-<8 hex digits>)."
636
+ }
637
+ },
638
+ "required": [
639
+ "plugins"
640
+ ],
641
+ "additionalProperties": false
642
+ },
643
+ "wait": {
644
+ "type": "string",
645
+ "enum": [
646
+ "async",
647
+ "wait"
648
+ ],
649
+ "description": "async (the default): answers at once, and the result reaches you as a message when it ends. wait: answers when the delegation ends (with its result, not sent again as a message), when its child asks a question (hasPendingQuestion: answer it with answer_delegation list, read, respond) or waits for the user's approval (the user answers it in the child), or at timeoutMs (waitTimedOut: the child keeps running, its result comes as a message)."
650
+ },
651
+ "timeoutMs": {
652
+ "type": "integer",
653
+ "minimum": 0,
654
+ "maximum": 3600000,
655
+ "description": "With wait: wait, how long to wait at most, in ms (default 600000, 10 minutes; at most 3600000, 60 minutes)."
656
+ },
657
+ "clientRequestId": {
658
+ "type": "string",
659
+ "description": "Your own key for this task: retrying with it never makes a second child."
660
+ }
661
+ },
662
+ "required": [
663
+ "prompt",
664
+ "clientRequestId"
665
+ ],
666
+ "additionalProperties": false
667
+ }
668
+ },
669
+ "read_delegation": {
670
+ "description": "Read a delegation of yours (delegate_session's delegation): waits up to timeoutMs (25000 by default, 3600000 at most; 0 reads at once) for it to end, then answers its status (running, completed, failed, interrupted, cancelled) and, once ended, its result. A question of its child or an approval it waits for ends the wait too (approvals are the user's, in the child); past timeoutMs it answers waitTimedOut. A result read here is not sent to you again as a message.",
671
+ "method": "POST",
672
+ "path": "/sessions/delegation/read",
673
+ "input": {
674
+ "type": "object",
675
+ "properties": {
676
+ "from": {
677
+ "type": "string",
678
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
679
+ "x-bridge-session": true
680
+ },
681
+ "delegation": {
682
+ "type": "string"
683
+ },
684
+ "timeoutMs": {
685
+ "type": "integer",
686
+ "minimum": 0,
687
+ "maximum": 3600000
688
+ }
689
+ },
690
+ "required": [
691
+ "delegation"
692
+ ],
693
+ "additionalProperties": false
694
+ }
695
+ },
696
+ "cancel_delegation": {
697
+ "description": "Cancel a delegation of yours: its child session stops, with its own children; nothing is sent to you for it. Refused while one of them runs above your permission mode (the user stops it then).",
698
+ "method": "POST",
699
+ "path": "/sessions/delegation/cancel",
700
+ "input": {
701
+ "type": "object",
702
+ "properties": {
703
+ "from": {
704
+ "type": "string",
705
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
706
+ "x-bridge-session": true
707
+ },
708
+ "delegation": {
709
+ "type": "string"
710
+ }
711
+ },
712
+ "required": [
713
+ "delegation"
714
+ ],
715
+ "additionalProperties": false
716
+ }
717
+ },
718
+ "answer_delegation": {
719
+ "description": "Handle the pending questions your child session (a delegation of yours, or one a session below you made) asks the user, when you know the answer; otherwise ask the user, who may also answer them in that session. action list: the ids of its pending questions (requests). action read: one request in full (its questions as the child's agent asked them, each with its header, its options and what they mean; multiSelect, allowCustomAnswer, required). action respond: answer one request, answers: [{ question, options: [the option ids you choose], text? }], one per question: several options only where multiSelect is true, a text only where allowCustomAnswer is true, every required question answered. Approvals (a tool or a command to allow) are never listed nor yours: only the user answers them. Refused once the request is answered or closed.",
720
+ "method": "POST",
721
+ "path": "/sessions/delegation/answer",
722
+ "input": {
723
+ "type": "object",
724
+ "properties": {
725
+ "from": {
726
+ "type": "string",
727
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
728
+ "x-bridge-session": true
729
+ },
730
+ "action": {
731
+ "type": "string",
732
+ "enum": [
733
+ "list",
734
+ "read",
735
+ "respond"
736
+ ],
737
+ "description": "list the pending questions, read one, or respond to one."
738
+ },
739
+ "delegation": {
740
+ "type": "string",
741
+ "description": "The delegation whose child asks (delegate_session's delegation)."
742
+ },
743
+ "request": {
744
+ "type": "string",
745
+ "description": "With read and respond: the request's id (from list, or the message that told you of it)."
746
+ },
747
+ "answers": {
748
+ "type": "array",
749
+ "minItems": 1,
750
+ "description": "With respond: one answer per question of the request.",
751
+ "items": {
752
+ "type": "object",
753
+ "properties": {
754
+ "question": {
755
+ "type": "string",
756
+ "description": "The question's id (read gives it); the request's only question when left out."
757
+ },
758
+ "options": {
759
+ "type": "array",
760
+ "items": {
761
+ "type": "string"
762
+ },
763
+ "description": "The ids of the options you choose: one, or several where multiSelect is true."
764
+ },
765
+ "text": {
766
+ "type": "string",
767
+ "description": "A free-text answer, for a question whose allowCustomAnswer is true (with or without options)."
768
+ }
769
+ },
770
+ "additionalProperties": false
771
+ }
772
+ }
773
+ },
774
+ "required": [
775
+ "action",
776
+ "delegation"
777
+ ],
778
+ "additionalProperties": false
779
+ }
780
+ },
781
+ "prompt_session": {
782
+ "description": "Send another session of this workspace a message that starts a turn there, or reaches the turn it runs as delivery says. To your own child session it is a follow-up: a new delegation, whose result reaches you as a message when it ends (answered with its delegation). To any other session it is delivered and nothing comes back. Refused when the session runs above your permission mode, was stopped, or is archived; a settled one is made active again. The answer's delivery says what happened: started, steered, queued or restarted.",
783
+ "method": "POST",
784
+ "path": "/sessions/prompt",
785
+ "input": {
786
+ "type": "object",
787
+ "properties": {
788
+ "from": {
789
+ "type": "string",
790
+ "description": "Your own session id (<bridge_session>); filled in when left out.",
791
+ "x-bridge-session": true
792
+ },
793
+ "to": {
794
+ "type": "string",
795
+ "description": "The session's id (list_sessions)."
796
+ },
797
+ "text": {
798
+ "type": "string",
799
+ "description": "The message, with all the context it needs: it does not see your conversation."
800
+ },
801
+ "delivery": {
802
+ "type": "string",
803
+ "enum": [
804
+ "auto",
805
+ "queue",
806
+ "steer",
807
+ "restart"
808
+ ],
809
+ "description": "What it does while the session runs a turn (none running: it starts one; steer and restart are then refused). auto (the default): into that turn when its harness can steer, else queued after it; queue: a turn of its own after the active work; steer: into that turn, refused when its harness cannot steer (steer_unavailable); restart: stops that turn, then starts a new one with the message (when its harness cannot steer and it must not wait)."
810
+ }
811
+ },
812
+ "required": [
813
+ "to",
814
+ "text"
815
+ ],
816
+ "additionalProperties": false
817
+ }
818
+ },
819
+ "view_language": {
820
+ "description": "The language of show_view's program (OpenUI Lang over Bridge's UI kit): its components, their arguments in order, state, queries through bridge_read, actions. Read it once per session before your first show_view.",
821
+ "method": "GET",
822
+ "path": "/sessions/views/language",
823
+ "input": {
824
+ "type": "object",
825
+ "properties": {},
826
+ "additionalProperties": false
827
+ }
828
+ },
829
+ "show_view": {
830
+ "description": "Show the user a view in this session: a real screen of Bridge's UI kit (tables, cards, lists, forms, tabs…) written in the language view_language gives, instead of a markdown table or list. A view is frozen by default: its queries' answers are kept with it, so it draws as it was (pass dynamic: true to have its queries run each time it is shown, for a form, a search, data that must follow changes). Read live data in it with Query(\"bridge_read\", …) rather than copying values, so the user keeps using it without you. To change a view you showed, send only the changed statements with base (its seq, from this tool's answer). Answers { seq, errors, queries, drawn, warnings }: what the view drew, its queries run as you (each one's outcome, item count and fields); fix each error and warning with a patch.",
831
+ "method": "POST",
832
+ "path": "/sessions/views",
833
+ "input": {
834
+ "type": "object",
835
+ "properties": {
836
+ "id": {
837
+ "type": "string",
838
+ "description": "This session's id; filled in when left out.",
839
+ "x-bridge-session": true
840
+ },
841
+ "title": {
842
+ "type": "string",
843
+ "description": "A short title for the view."
844
+ },
845
+ "program": {
846
+ "type": "string",
847
+ "description": "The view in the language view_language gives (at most 16384 characters)."
848
+ },
849
+ "base": {
850
+ "type": "integer",
851
+ "description": "With a patch: the seq of the view it changes."
852
+ },
853
+ "dynamic": {
854
+ "type": "boolean",
855
+ "description": "true: its queries run each time it is shown and its actions act (a form, a search); default false: frozen on what its queries answer now"
856
+ }
857
+ },
858
+ "required": [
859
+ "program"
860
+ ],
861
+ "additionalProperties": false
862
+ }
863
+ },
864
+ "branch_status": {
865
+ "description": "This session's git branch (research: a branch is a variant of its project, with its own folder): its name, its folder (your working directory), the project's own folder, and whether it is the project's default branch (onMain). Use it before changing files when you are unsure where you work.",
866
+ "method": "POST",
867
+ "path": "/sessions/branch/status",
868
+ "input": {
869
+ "type": "object",
870
+ "properties": {
871
+ "id": {
872
+ "type": "string",
873
+ "description": "This session's id; filled in when left out.",
874
+ "x-bridge-session": true
875
+ }
876
+ },
877
+ "additionalProperties": false
878
+ }
879
+ },
880
+ "branch_list": {
881
+ "description": "The branches of this session's project that have a folder (git worktree list): each one's name and folder, main first; yours marked yours. Several sessions may work on one branch.",
882
+ "method": "POST",
883
+ "path": "/sessions/branch/list",
884
+ "input": {
885
+ "type": "object",
886
+ "properties": {
887
+ "id": {
888
+ "type": "string",
889
+ "description": "This session's id; filled in when left out.",
890
+ "x-bridge-session": true
891
+ }
892
+ },
893
+ "additionalProperties": false
894
+ }
895
+ },
896
+ "branch_handoff": {
897
+ "description": "Move this session, working on its project's default branch (main), to a new branch of the project: Bridge makes the branch and its folder (a git worktree, its dependencies installed), this turn ends at once, and the session works on the branch from its next turn, which prompt starts (say there what to do next: the next turn may not remember this one). Use it when the user asks for work on a branch, or before changing a project's code from main. Refused for a session already on a branch (its branch is fixed: the user starts a new session for another), and for one in a read-only mode (ask the user). The branch merges by its pull request.",
898
+ "method": "POST",
899
+ "path": "/sessions/branch/handoff",
900
+ "input": {
901
+ "type": "object",
902
+ "properties": {
903
+ "id": {
904
+ "type": "string",
905
+ "description": "This session's id; filled in when left out.",
906
+ "x-bridge-session": true
907
+ },
908
+ "name": {
909
+ "type": "string",
910
+ "description": "A short name for the branch (a few words; default: from prompt, else the session title)."
911
+ },
912
+ "prompt": {
913
+ "type": "string",
914
+ "description": "What the session does next, on the branch: it starts the next turn there."
915
+ }
916
+ },
917
+ "additionalProperties": false
918
+ }
919
+ },
920
+ "link_pull_request": {
921
+ "description": "Link a GitHub pull request to this session (its one pull request, replacing any). Bridge finds the pull request of this session's branch by itself at the end of each turn; use this for another one, or when it did not. The session's header then shows its state and checks, and the session settles when it merges. Answers the session's pull request as Bridge read it.",
922
+ "method": "POST",
923
+ "path": "/sessions/pull-request/link",
924
+ "input": {
925
+ "type": "object",
926
+ "properties": {
927
+ "id": {
928
+ "type": "string",
929
+ "description": "This session's id; filled in when left out.",
930
+ "x-bridge-session": true
931
+ },
932
+ "url": {
933
+ "type": "string",
934
+ "description": "The pull request's URL: https://github.com/<owner>/<name>/pull/<number>."
935
+ }
936
+ },
937
+ "required": [
938
+ "url"
939
+ ],
940
+ "additionalProperties": false
941
+ }
942
+ },
943
+ "unlink_pull_request": {
944
+ "description": "Unlink this session's pull request: Bridge no longer shows it nor finds it again from the branch; its watch ends.",
945
+ "method": "POST",
946
+ "path": "/sessions/pull-request/unlink",
947
+ "input": {
948
+ "type": "object",
949
+ "properties": {
950
+ "id": {
951
+ "type": "string",
952
+ "description": "This session's id; filled in when left out.",
953
+ "x-bridge-session": true
954
+ }
955
+ },
956
+ "additionalProperties": false
957
+ }
958
+ },
959
+ "watch_pull_request": {
960
+ "description": "Watch this session's pull request (or the one at url, linked first) after it is marked ready: Bridge reads it every two minutes and wakes you with a message, queued after your turn, when a check fails, the required checks pass, someone else comments or reviews, the branch conflicts, or no check reports for 15 minutes. End your turn while you wait. The watch ends when it merges (the session settles) or closes, on unwatch_pull_request, or when the user stops or settles the session. Refused in a child session (its parent watches).",
961
+ "method": "POST",
962
+ "path": "/sessions/pull-request/watch",
963
+ "input": {
964
+ "type": "object",
965
+ "properties": {
966
+ "id": {
967
+ "type": "string",
968
+ "description": "This session's id; filled in when left out.",
969
+ "x-bridge-session": true
970
+ },
971
+ "url": {
972
+ "type": "string",
973
+ "description": "The pull request's URL when it is not the session's linked one."
974
+ }
975
+ },
976
+ "additionalProperties": false
977
+ }
978
+ },
979
+ "unwatch_pull_request": {
980
+ "description": "Stop watching this session's pull request (it stays linked): call it when you hand the work back to the user, so the session returns to their inbox.",
981
+ "method": "POST",
982
+ "path": "/sessions/pull-request/unwatch",
983
+ "input": {
984
+ "type": "object",
985
+ "properties": {
986
+ "id": {
987
+ "type": "string",
988
+ "description": "This session's id; filled in when left out.",
989
+ "x-bridge-session": true
990
+ }
991
+ },
992
+ "additionalProperties": false
993
+ }
994
+ }
995
+ },
996
+ "provenance": "official",
997
+ "deadlines": {
998
+ "/sessions": 120000,
999
+ "/sessions/branch/handoff": 120000,
1000
+ "/sessions/write": 120000
1001
+ },
1002
+ "bodies": {
1003
+ "/sessions/write": 524288
1004
+ }
1005
+ },
1006
+ "scripts": {
1007
+ "test": "node ../bridge/node_modules/vitest/vitest.mjs run --config vitest.config.ts",
1008
+ "e2e": "node ../scripts/e2e.mjs .",
1009
+ "e2e:run": "node --test --test-concurrency=1 --test-timeout=300000 e2e.test.ts e2e-journeys.test.ts",
1010
+ "typecheck": "bridge plugin check ."
1011
+ },
1012
+ "dependencies": {
1013
+ "@openuidev/lang-core": "1.0.1",
1014
+ "react-markdown": "10.1.0",
1015
+ "remark-gfm": "4.0.1",
1016
+ "zod": "4.6.5"
1017
+ },
1018
+ "peerDependencies": {
1019
+ "@bridge/session-ui": ">=0.0.1",
1020
+ "@bridge/ui": ">=0.0.1",
1021
+ "cordis": "4.0.0-rc.11",
1022
+ "react": "19.3.0"
1023
+ },
1024
+ "releaseStage": "dev"
1025
+ }