@pasko70/pibo 1.9.13 → 1.10.1

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 (163) hide show
  1. package/README.md +183 -183
  2. package/context/codex-base-prompt.md +148 -148
  3. package/context/compute-worker.md +23 -23
  4. package/context/pibo-compaction-prompt.md +100 -100
  5. package/context/pibo-native-tooling.md +18 -18
  6. package/context/pibo-system-prompt.md +77 -77
  7. package/dist/apps/chat/agent-profiles.js +2 -2
  8. package/dist/apps/chat/agent-store.js +263 -250
  9. package/dist/apps/chat/chat-request-normalizers.js +17 -0
  10. package/dist/apps/chat/data/chat-data-mappers.js +2 -0
  11. package/dist/apps/chat/data/project-service.js +168 -168
  12. package/dist/apps/chat/data/read-state-service.js +18 -18
  13. package/dist/apps/chat/data/session-query-service.js +25 -25
  14. package/dist/apps/chat/data/timeline-query-service.js +19 -19
  15. package/dist/apps/chat/loop-api.js +181 -0
  16. package/dist/apps/chat/static-assets.js +854 -854
  17. package/dist/apps/chat/web-app.js +36 -16
  18. package/dist/apps/chat/workflow-manual-trigger-runtime.js +149 -46
  19. package/dist/apps/chat/workflow-persistence.js +255 -255
  20. package/dist/apps/chat-ui/assets/{dist-BZ2eTC4f.js → dist-3Sts0Afa.js} +1 -1
  21. package/dist/apps/chat-ui/assets/{dist-BHa-kcGl.js → dist-4NlLjLs7.js} +1 -1
  22. package/dist/apps/chat-ui/assets/{dist-yCYNNb5d.js → dist-BA6mhAec.js} +1 -1
  23. package/dist/apps/chat-ui/assets/{dist-D811wJeV.js → dist-BPl-fzRB.js} +1 -1
  24. package/dist/apps/chat-ui/assets/{dist-Dq4GxJi3.js → dist-BPnn9e2B.js} +1 -1
  25. package/dist/apps/chat-ui/assets/{dist-CzE6k3F3.js → dist-BpfBSMzK.js} +1 -1
  26. package/dist/apps/chat-ui/assets/{dist-CnVsqwSG.js → dist-Cvx5M97R.js} +1 -1
  27. package/dist/apps/chat-ui/assets/{dist-WyXdYl-w.js → dist-DnXWNQRm.js} +1 -1
  28. package/dist/apps/chat-ui/assets/{dist-BNMu92bb.js → dist-hU-2oAb6.js} +1 -1
  29. package/dist/apps/chat-ui/assets/{dist-BCB6zezO.js → dist-r31x5Fcc.js} +1 -1
  30. package/dist/apps/chat-ui/assets/{dist-HqTN67dc.js → dist-uF6UXzI7.js} +1 -1
  31. package/dist/apps/chat-ui/assets/index-CaTGYBOS.js +173 -0
  32. package/dist/apps/chat-ui/assets/{index-C0x9nEcf.css → index-al8DeEjA.css} +1 -1
  33. package/dist/apps/chat-ui/index.html +18 -18
  34. package/dist/apps/chat-ui/manifest.webmanifest +25 -25
  35. package/dist/apps/chat-ui/sw.js +47 -47
  36. package/dist/apps/chat-vscode-web/assets/index-CK4SMZuu.js +41 -0
  37. package/dist/apps/chat-vscode-web/index.html +13 -13
  38. package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
  39. package/dist/apps/context-files-ui/index.html +11 -11
  40. package/dist/cli-session/localSessionSource.js +34 -12
  41. package/dist/cli.js +61 -44
  42. package/dist/compute/cli.js +54 -54
  43. package/dist/compute/resource-health.js +35 -2
  44. package/dist/core/events.js +6 -1
  45. package/dist/core/routed-session.js +97 -5
  46. package/dist/core/runtime.js +6 -1
  47. package/dist/core/session-router.js +27 -8
  48. package/dist/cron/cli.js +15 -15
  49. package/dist/cron/store.js +49 -49
  50. package/dist/data/cli.js +23 -23
  51. package/dist/data/event-log.js +23 -23
  52. package/dist/data/ingest-service.js +3 -1
  53. package/dist/data/message-store.js +27 -27
  54. package/dist/data/navigation-store.js +9 -9
  55. package/dist/data/observation-store.js +4 -4
  56. package/dist/data/payload-store.js +17 -17
  57. package/dist/data/schema.js +433 -433
  58. package/dist/data/session-store.js +4 -4
  59. package/dist/data/telemetry-queries.js +54 -54
  60. package/dist/data/telemetry.js +197 -197
  61. package/dist/debug/events.js +12 -12
  62. package/dist/debug/failures.js +6 -6
  63. package/dist/debug/index.js +231 -227
  64. package/dist/debug/messages.js +6 -6
  65. package/dist/debug/pty.js +124 -124
  66. package/dist/debug/session.js +29 -29
  67. package/dist/debug/tools.js +5 -5
  68. package/dist/debug/trace.js +42 -7
  69. package/dist/debug/web-snapshot-browser-scripts.js +294 -294
  70. package/dist/debug/web-streaming-browser-library.js +925 -925
  71. package/dist/debug/web-streaming-browser-scripts.js +232 -232
  72. package/dist/debug/web-streaming-provider-telemetry.js +4 -4
  73. package/dist/debug/web.js +93 -93
  74. package/dist/gateway/cli.js +19 -19
  75. package/dist/gateway/server.js +4 -2
  76. package/dist/gateway/web.js +2 -2
  77. package/dist/index.js +1 -0
  78. package/dist/loops/accounting.js +19 -0
  79. package/dist/loops/channel.js +8 -0
  80. package/dist/loops/cli.js +224 -0
  81. package/dist/loops/plugin.js +16 -0
  82. package/dist/loops/prompts.js +86 -0
  83. package/dist/loops/service.js +446 -0
  84. package/dist/loops/stopping.js +170 -0
  85. package/dist/loops/store.js +642 -0
  86. package/dist/loops/templates.js +232 -0
  87. package/dist/loops/tools.js +184 -0
  88. package/dist/loops/types.js +1 -0
  89. package/dist/mcp/config-command.js +53 -53
  90. package/dist/mcp/index.js +21 -21
  91. package/dist/mcp/registry.js +11 -11
  92. package/dist/pi-packages/cli.js +11 -11
  93. package/dist/plugins/builtin.js +8 -0
  94. package/dist/plugins/context-files-store.js +110 -110
  95. package/dist/plugins/context-files.js +4 -4
  96. package/dist/plugins/registry.js +23 -12
  97. package/dist/ralph/cli.js +18 -18
  98. package/dist/ralph/templates.js +140 -140
  99. package/dist/reliability/store.js +256 -229
  100. package/dist/runs/lifecycle.js +59 -0
  101. package/dist/runs/registry.js +47 -1
  102. package/dist/runs/tools.js +31 -13
  103. package/dist/session-ui/terminalRows.js +66 -2
  104. package/dist/sessions/pibo-data-store.js +16 -16
  105. package/dist/sessions/sqlite-store.js +53 -53
  106. package/dist/setup/cli.js +58 -58
  107. package/dist/shared/trace-async-agent-runs.js +4 -4
  108. package/dist/shared/trace-event-projection.js +59 -19
  109. package/dist/shared/trace-nodes.js +5 -0
  110. package/dist/shared/trace-page-merge.js +15 -0
  111. package/dist/shared/trace-run-notifications.js +3 -1
  112. package/dist/signals/projector.js +6 -2
  113. package/dist/tools/agent-browser-wrapper.js +80 -80
  114. package/dist/tools/browser-pool.js +50 -0
  115. package/dist/tools/browser-use-cdp.js +12 -12
  116. package/dist/tools/browser-use-leases.js +12 -8
  117. package/dist/tools/browser-use-wrapper.js +762 -762
  118. package/dist/tools/guides.js +596 -538
  119. package/dist/tools/index.js +123 -99
  120. package/dist/tools/registry.js +21 -3
  121. package/dist/tools/runtime/node-worker-source.js +205 -205
  122. package/dist/tools/runtime/python-worker-source.js +177 -177
  123. package/dist/vscode/cli.js +9 -9
  124. package/dist/web-annotations/cdp.js +900 -900
  125. package/dist/web-annotations/store.js +96 -96
  126. package/docs/README.md +23 -23
  127. package/docs/ops/install-developer-host.md +112 -112
  128. package/docs/ops/install-user-host.md +96 -96
  129. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  130. package/docs/ops/vscode-extension-release.md +160 -160
  131. package/package.json +99 -95
  132. package/skills/builtin/graphify/SKILL.md +52 -52
  133. package/skills/builtin/loop/SKILL.md +78 -0
  134. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  135. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  136. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  137. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  138. package/skills/builtin/prd/SKILL.md +143 -143
  139. package/skills/builtin/ralph-loop/SKILL.md +361 -359
  140. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  141. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  142. package/skills/builtin/skill-creator/SKILL.md +513 -513
  143. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  144. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  145. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  146. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  147. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  148. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  149. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  150. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  151. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  152. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  153. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  154. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  155. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  156. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  157. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  158. package/skills/builtin/web-annotations/SKILL.md +93 -93
  159. package/src/mcp/LICENSE.mcp-cli +21 -21
  160. package/dist/apps/chat-ui/assets/index-DwHJfmiF.js +0 -173
  161. package/dist/apps/chat-vscode-web/assets/index-BAMxIaI_.js +0 -41
  162. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  163. package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.9.13.vsix +0 -0
@@ -1,563 +1,621 @@
1
+ export const LOOP_GUIDE = {
2
+ name: 'loop',
3
+ description: 'Create, inspect, and control Pibo Goal and legacy Ralph loops from the CLI.',
4
+ content: `---
5
+ name: loop
6
+ description: Creates and controls persistent Goal Loops and legacy fresh-session Ralph loops.
7
+ allowed-tools: Bash(pibo:*), Bash(npm:*)
8
+ ---
9
+
10
+ # Loop CLI Tool
11
+
12
+ Use \`pibo loop\` as the standard continuous-work CLI. Goal mode is the default and continues one Pibo Session across turns. Use \`--mode ralph\` or \`pibo ralph\` only for legacy fresh-session runs.
13
+
14
+ ## Discover
15
+
16
+ \`\`\`bash
17
+ pibo loop --help
18
+ pibo loop add --help
19
+ pibo loop templates --json
20
+ pibo loop conditions
21
+ \`\`\`
22
+
23
+ ## Create a Goal Loop
24
+
25
+ \`\`\`bash
26
+ pibo loop add \\
27
+ --room <room-id> \\
28
+ --profile <profile> \\
29
+ --prompt "<complete objective>" \\
30
+ --token-budget <optional-positive-token-count> \\
31
+ --max-iterations <optional-run-fallback> \\
32
+ --start
33
+ \`\`\`
34
+
35
+ Goal-capable agents use native \`get_goal\`, \`create_goal\`, and \`update_goal\` tools. Agent Designer can disable the default-enabled \`pibo-goal-control\` package.
36
+
37
+ Use \`update_goal\` with \`complete\` only after current evidence proves every requirement. Use \`blocked\` only after the same impasse repeats for at least three consecutive Goal turns and progress requires user input or external change.
38
+
39
+ ## Inspect and Control
40
+
41
+ \`\`\`bash
42
+ pibo loop list --all --json
43
+ pibo loop runs --job <job-id> --json
44
+ pibo loop start <job-id>
45
+ pibo loop stop <job-id>
46
+ pibo loop cancel <job-id>
47
+ \`\`\`
48
+
49
+ Token budgets count usage reported by completed assistant model messages. One request can overshoot because usage is known after the response returns.
50
+ `,
51
+ };
1
52
  export const RALPH_GUIDE = {
2
53
  name: 'ralph',
3
54
  description: 'Create, inspect, and control Pibo Ralph jobs from the CLI.',
4
- content: `---
5
- name: ralph
6
- description: Creates and controls continuous Pibo agent jobs for implementation loops, bug fixing, validation, and PRD/story execution.
7
- allowed-tools: Bash(pibo:*), Bash(npm:*)
8
- ---
9
-
10
- # Ralph CLI Tool
11
-
12
- Ralph runs repeatable Pibo agent jobs. Use it when the user wants an implementation loop, PRD/story execution, bug fixing, validation, or a background job that can be started, stopped, inspected, and resumed.
13
-
14
- ## Required Context
15
-
16
- Ralph jobs are app-global. Choose either:
17
-
18
- - room target: \`--room <current-room-id>\`
19
- - shared default target: \`--default-chat\`
20
-
21
- Inside the Pibo source repo, use \`npm run --silent dev -- ralph ...\` for uninstalled local changes. For the installed CLI, use \`pibo ralph ...\`.
22
-
23
- ## Discover Templates
24
-
25
- \`\`\`bash
26
- pibo ralph templates
27
- pibo ralph templates --json
28
- pibo tools guide ralph ralph
29
- \`\`\`
30
-
31
- Good defaults:
32
-
33
- - \`prd-single-story-standard\`: one failing PRD story per run; promise-complete stop policy.
34
- - \`prd-batch-stories\`: multiple PRD stories in priority order; commit after each story.
35
- - \`single-run-objective\`: one focused non-PRD objective; stops after one completed run attempt.
36
-
37
- ## Create Jobs
38
-
39
- Create stopped, inspect, then start:
40
-
41
- \`\`\`bash
42
- pibo ralph add \\
43
- --room "<room-id>" \\
44
- --template prd-single-story-standard \\
45
- --name "Implement story X" \\
46
- --prompt "Implement exactly one failing PRD story, test it, and commit." \\
47
- --json
48
-
49
- pibo ralph start <job-id>
50
- \`\`\`
51
-
52
- Create and start immediately:
53
-
54
- \`\`\`bash
55
- pibo ralph add \\
56
- --room "<room-id>" \\
57
- --template single-run-objective \\
58
- --name "Fix bug Y" \\
59
- --prompt "Reproduce and fix bug Y, then run focused tests." \\
60
- --start \\
61
- --json
62
- \`\`\`
63
-
64
- Explicit options override template fields.
65
-
66
- Runtime overrides are optional and apply to sessions created by the job:
67
-
68
- \`\`\`bash
69
- pibo ralph add \\
70
- --room "<room-id>" \\
71
- --prompt "Use a specific runtime." \\
72
- --model openai/gpt-5 \\
73
- --thinking high \\
74
- --fast \\
75
- --json
76
-
77
- pibo ralph edit <job-id> --model openai/gpt-5 --thinking medium --no-fast --json
78
- pibo ralph edit <job-id> --clear-model --clear-thinking --clear-fast --json
79
- \`\`\`
80
-
81
- Use \`--model <provider/model>\`, \`--thinking off|minimal|low|medium|high|xhigh|max\`, and \`--fast\`/\`--no-fast\` to set runtime options. Use the \`--clear-*\` flags on \`edit\` to return to profile/default runtime behavior.
82
-
83
- ## Inspect and Debug
84
-
85
- \`\`\`bash
86
- pibo ralph status --json
87
- pibo ralph list --all --json
88
- pibo ralph runs --job <job-id> --json
89
- pibo ralph policy show <job-id> --json
90
- \`\`\`
91
-
92
- Use \`runs --json\` to debug failures, session ids, completion state, and recent activity. Prefer bounded JSON output when another agent will parse it.
93
-
94
- ## Control Jobs
95
-
96
- \`\`\`bash
97
- pibo ralph stop <job-id> # finish current session, then stop
98
- pibo ralph cancel <job-id> # abort current session and stop
99
- pibo ralph edit <job-id> --prompt "Updated objective" --json
100
- pibo ralph remove <job-id>
101
- \`\`\`
102
-
103
- Prefer \`stop\` for normal shutdown and \`cancel\` only when the active run is stuck or unsafe.
104
-
105
- ## Safety
106
-
107
- 1. Do not start many Ralph jobs unless the user asked for parallel work.
108
- 2. Use templates first; avoid ad-hoc long prompts when a preset fits.
109
- 3. Inspect with \`list --json\` and \`runs --json\` before editing or canceling an unknown job.
110
- 4. If working in the source repo before install, use \`npm run --silent dev -- ralph ...\`.
55
+ content: `---
56
+ name: ralph
57
+ description: Creates and controls continuous Pibo agent jobs for implementation loops, bug fixing, validation, and PRD/story execution.
58
+ allowed-tools: Bash(pibo:*), Bash(npm:*)
59
+ ---
60
+
61
+ # Ralph CLI Tool
62
+
63
+ Ralph runs repeatable Pibo agent jobs. Use it when the user wants an implementation loop, PRD/story execution, bug fixing, validation, or a background job that can be started, stopped, inspected, and resumed.
64
+
65
+ ## Required Context
66
+
67
+ Ralph jobs are app-global. Choose either:
68
+
69
+ - room target: \`--room <current-room-id>\`
70
+ - shared default target: \`--default-chat\`
71
+
72
+ Inside the Pibo source repo, use \`npm run --silent dev -- ralph ...\` for uninstalled local changes. For the installed CLI, use \`pibo ralph ...\`.
73
+
74
+ ## Discover Templates
75
+
76
+ \`\`\`bash
77
+ pibo ralph templates
78
+ pibo ralph templates --json
79
+ pibo tools guide ralph ralph
80
+ \`\`\`
81
+
82
+ Good defaults:
83
+
84
+ - \`prd-single-story-standard\`: one failing PRD story per run; promise-complete stop policy.
85
+ - \`prd-batch-stories\`: multiple PRD stories in priority order; commit after each story.
86
+ - \`single-run-objective\`: one focused non-PRD objective; stops after one completed run attempt.
87
+
88
+ ## Create Jobs
89
+
90
+ Create stopped, inspect, then start:
91
+
92
+ \`\`\`bash
93
+ pibo ralph add \\
94
+ --room "<room-id>" \\
95
+ --template prd-single-story-standard \\
96
+ --name "Implement story X" \\
97
+ --prompt "Implement exactly one failing PRD story, test it, and commit." \\
98
+ --json
99
+
100
+ pibo ralph start <job-id>
101
+ \`\`\`
102
+
103
+ Create and start immediately:
104
+
105
+ \`\`\`bash
106
+ pibo ralph add \\
107
+ --room "<room-id>" \\
108
+ --template single-run-objective \\
109
+ --name "Fix bug Y" \\
110
+ --prompt "Reproduce and fix bug Y, then run focused tests." \\
111
+ --start \\
112
+ --json
113
+ \`\`\`
114
+
115
+ Explicit options override template fields.
116
+
117
+ Runtime overrides are optional and apply to sessions created by the job:
118
+
119
+ \`\`\`bash
120
+ pibo ralph add \\
121
+ --room "<room-id>" \\
122
+ --prompt "Use a specific runtime." \\
123
+ --model openai/gpt-5 \\
124
+ --thinking high \\
125
+ --fast \\
126
+ --json
127
+
128
+ pibo ralph edit <job-id> --model openai/gpt-5 --thinking medium --no-fast --json
129
+ pibo ralph edit <job-id> --clear-model --clear-thinking --clear-fast --json
130
+ \`\`\`
131
+
132
+ Use \`--model <provider/model>\`, \`--thinking off|minimal|low|medium|high|xhigh|max\`, and \`--fast\`/\`--no-fast\` to set runtime options. Use the \`--clear-*\` flags on \`edit\` to return to profile/default runtime behavior.
133
+
134
+ ## Inspect and Debug
135
+
136
+ \`\`\`bash
137
+ pibo ralph status --json
138
+ pibo ralph list --all --json
139
+ pibo ralph runs --job <job-id> --json
140
+ pibo ralph policy show <job-id> --json
141
+ \`\`\`
142
+
143
+ Use \`runs --json\` to debug failures, session ids, completion state, and recent activity. Prefer bounded JSON output when another agent will parse it.
144
+
145
+ ## Control Jobs
146
+
147
+ \`\`\`bash
148
+ pibo ralph stop <job-id> # finish current session, then stop
149
+ pibo ralph cancel <job-id> # abort current session and stop
150
+ pibo ralph edit <job-id> --prompt "Updated objective" --json
151
+ pibo ralph remove <job-id>
152
+ \`\`\`
153
+
154
+ Prefer \`stop\` for normal shutdown and \`cancel\` only when the active run is stuck or unsafe.
155
+
156
+ ## Safety
157
+
158
+ 1. Do not start many Ralph jobs unless the user asked for parallel work.
159
+ 2. Use templates first; avoid ad-hoc long prompts when a preset fits.
160
+ 3. Inspect with \`list --json\` and \`runs --json\` before editing or canceling an unknown job.
161
+ 4. If working in the source repo before install, use \`npm run --silent dev -- ralph ...\`.
111
162
  `,
112
163
  };
113
164
  export const AGENT_BROWSER_GUIDE = {
114
165
  name: 'agent-browser',
115
166
  description: 'Ref-based browser automation with the Agent Browser CLI.',
116
- content: `---
117
- name: agent-browser
118
- description: Fast native browser automation CLI for AI agents. Use when you need to open pages, inspect snapshots, click refs, fill fields, and keep browser state under a Pibo-owned tool home.
119
- allowed-tools: Bash(agent-browser:*)
120
- ---
121
-
122
- # Browser Automation with Agent Browser
123
-
124
- Agent Browser uses refs from interactive snapshots. Inspect first, act on refs, then inspect again after navigation or DOM changes.
125
-
126
- ## Prerequisites
127
-
128
- Initialize one shell with the Pibo tool environment:
129
-
130
- \`\`\`bash
131
- eval "$(pibo tools env agent-browser)"
132
- agent-browser doctor --offline --quick
133
- \`\`\`
134
-
135
- Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env agent-browser)"\`. The Pibo wrapper comes first on \`PATH\` and keeps state under \`AGENT_BROWSER_HOME\`, normally \`$PIBO_HOME/tools/agent-browser/home\`. For \`agent-browser@0.27.0\`, the wrapper also redirects \`HOME\` there by default so \`~/.agent-browser\` stays inside the tool home.
136
-
137
- ## Core Workflow
138
-
139
- \`\`\`bash
140
- agent-browser open <url>
141
- agent-browser snapshot -i
142
- agent-browser click @e1
143
- agent-browser fill @e2 "text"
144
- agent-browser snapshot -i
145
- agent-browser get title
146
- agent-browser close --all
147
- \`\`\`
148
-
149
- Re-run \`snapshot -i\` after navigation, submit, scroll, animation, or any DOM-changing action. Do not reuse stale refs.
150
-
151
- ## Sessions
152
-
153
- Use sessions for separate browser tasks:
154
-
155
- \`\`\`bash
156
- agent-browser --session pibo-check open https://example.com
157
- AGENT_BROWSER_SESSION=pibo-check agent-browser snapshot -i
158
- agent-browser session list
159
- \`\`\`
160
-
161
- Keep mutating commands against the same session serial. Avoid parallel \`click\`, \`fill\`, \`open\`, or \`snapshot\` calls for one session.
162
-
163
- ## State and Profiles
164
-
165
- The wrapper defaults browser-launching commands to a persistent Pibo profile:
166
-
167
- \`\`\`bash
168
- agent-browser open https://example.com
169
- \`\`\`
170
-
171
- Opt out when needed:
172
-
173
- \`\`\`bash
174
- agent-browser --fresh-profile open https://example.com
175
- agent-browser --profile /path/to/profile open https://example.com
176
- agent-browser --session-name saved-check open https://example.com
177
- \`\`\`
178
-
179
- Treat profiles, saved states, auth vaults, cookies, and headers as secrets. Do not print or copy their contents into chat.
180
-
181
- ## Authenticated Chat Web Work
182
-
183
- Prefer isolated leases when more than one agent may use authenticated Chat Web:
184
-
185
- \`\`\`bash
186
- eval "$(pibo tools agent-browser lease acquire --app pibo-chat --holder "$USER")"
187
- agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
188
- agent-browser snapshot -i
189
- \`\`\`
190
-
191
- To prepare the reusable template profile:
192
-
193
- \`\`\`bash
194
- eval "$(pibo tools agent-browser auth-template env --app pibo-chat)"
195
- agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
196
- \`\`\`
197
-
198
- Sign in once, close the browser, then acquire leases from the template.
199
-
200
- For an already-open browser, inspect CDP targets:
201
-
202
- \`\`\`bash
203
- pibo tools agent-browser targets
204
- pibo tools agent-browser attach-chat
205
- \`\`\`
206
-
207
- ## Upstream Skills
208
-
209
- Pibo keeps the full upstream skill out of default runtime context. Fetch it only when needed:
210
-
211
- \`\`\`bash
212
- agent-browser skills get core --full
213
- \`\`\`
167
+ content: `---
168
+ name: agent-browser
169
+ description: Fast native browser automation CLI for AI agents. Use when you need to open pages, inspect snapshots, click refs, fill fields, and keep browser state under a Pibo-owned tool home.
170
+ allowed-tools: Bash(agent-browser:*)
171
+ ---
172
+
173
+ # Browser Automation with Agent Browser
174
+
175
+ Agent Browser uses refs from interactive snapshots. Inspect first, act on refs, then inspect again after navigation or DOM changes.
176
+
177
+ ## Prerequisites
178
+
179
+ Initialize one shell with the Pibo tool environment:
180
+
181
+ \`\`\`bash
182
+ eval "$(pibo tools env agent-browser)"
183
+ agent-browser doctor --offline --quick
184
+ \`\`\`
185
+
186
+ Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env agent-browser)"\`. The Pibo wrapper comes first on \`PATH\` and keeps state under \`AGENT_BROWSER_HOME\`, normally \`$PIBO_HOME/tools/agent-browser/home\`. For \`agent-browser@0.27.0\`, the wrapper also redirects \`HOME\` there by default so \`~/.agent-browser\` stays inside the tool home.
187
+
188
+ ## Core Workflow
189
+
190
+ \`\`\`bash
191
+ agent-browser open <url>
192
+ agent-browser snapshot -i
193
+ agent-browser click @e1
194
+ agent-browser fill @e2 "text"
195
+ agent-browser snapshot -i
196
+ agent-browser get title
197
+ agent-browser close --all
198
+ \`\`\`
199
+
200
+ Re-run \`snapshot -i\` after navigation, submit, scroll, animation, or any DOM-changing action. Do not reuse stale refs.
201
+
202
+ ## Sessions
203
+
204
+ Use sessions for separate browser tasks:
205
+
206
+ \`\`\`bash
207
+ agent-browser --session pibo-check open https://example.com
208
+ AGENT_BROWSER_SESSION=pibo-check agent-browser snapshot -i
209
+ agent-browser session list
210
+ \`\`\`
211
+
212
+ Keep mutating commands against the same session serial. Avoid parallel \`click\`, \`fill\`, \`open\`, or \`snapshot\` calls for one session.
213
+
214
+ ## State and Profiles
215
+
216
+ The wrapper defaults browser-launching commands to a persistent Pibo profile:
217
+
218
+ \`\`\`bash
219
+ agent-browser open https://example.com
220
+ \`\`\`
221
+
222
+ Opt out when needed:
223
+
224
+ \`\`\`bash
225
+ agent-browser --fresh-profile open https://example.com
226
+ agent-browser --profile /path/to/profile open https://example.com
227
+ agent-browser --session-name saved-check open https://example.com
228
+ \`\`\`
229
+
230
+ Treat profiles, saved states, auth vaults, cookies, and headers as secrets. Do not print or copy their contents into chat.
231
+
232
+ ## Authenticated Chat Web Work
233
+
234
+ Prefer isolated leases when more than one agent may use authenticated Chat Web:
235
+
236
+ \`\`\`bash
237
+ eval "$(pibo tools agent-browser lease acquire --app pibo-chat --holder "$USER")"
238
+ agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
239
+ agent-browser snapshot -i
240
+ \`\`\`
241
+
242
+ To prepare the reusable template profile:
243
+
244
+ \`\`\`bash
245
+ eval "$(pibo tools agent-browser auth-template env --app pibo-chat)"
246
+ agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
247
+ \`\`\`
248
+
249
+ Sign in once, close the browser, then acquire leases from the template.
250
+
251
+ For an already-open browser, inspect CDP targets:
252
+
253
+ \`\`\`bash
254
+ pibo tools agent-browser targets
255
+ pibo tools agent-browser attach-chat
256
+ \`\`\`
257
+
258
+ ## Upstream Skills
259
+
260
+ Pibo keeps the full upstream skill out of default runtime context. Fetch it only when needed:
261
+
262
+ \`\`\`bash
263
+ agent-browser skills get core --full
264
+ \`\`\`
214
265
  `,
215
266
  };
216
267
  export const BROWSER_USE_GUIDE = {
217
268
  name: 'browser-use',
218
269
  description: 'Local browser automation with the browser-use CLI.',
219
- content: `---
220
- name: browser-use
221
- description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
222
- allowed-tools: Bash(browser-use:*)
223
- ---
224
-
225
- # Browser Automation with browser-use CLI
226
-
227
- The browser-use command provides persistent browser automation. A background daemon keeps the browser open across commands, so repeated commands are fast.
228
-
229
- ## Prerequisites
230
-
231
- Initialize one persistent browser-use shell by applying the Pibo tool environment once:
232
-
233
- \`\`\`bash
234
- eval "$(pibo tools env browser-use)"
235
- browser-use doctor
236
- \`\`\`
237
-
238
- Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, it includes detected desktop variables such as \`DISPLAY\`, \`WAYLAND_DISPLAY\`, and \`XAUTHORITY\` when a local desktop is available.
239
-
240
- The Pibo tool environment wraps \`browser-use\`: when a new browser daemon session is started, it starts a Pibo-managed persistent Chrome profile named \`PIBo\` with CDP and connects Browser Use to it. This avoids Browser Use's normal temporary profile copy, so sign-ins made in that profile stay on disk. Pass \`--fresh-profile\` to start a fresh temporary browser profile instead.
241
-
242
- ## Core Workflow
243
-
244
- 1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
245
- 2. Inspect: \`browser-use state\`
246
- 3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
247
- 4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
248
- 5. Repeat while the browser stays open
249
-
250
- Run browser-mutating commands one at a time per session. Do not issue parallel \`click\`, \`input\`, \`open\`, \`eval\`, or \`screenshot\` calls against the same session.
251
-
252
- If a command fails, run \`browser-use close\` first to clear the session, then retry.
253
-
254
- After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
255
-
256
- ## Browser Modes
257
-
258
- \`\`\`bash
259
- browser-use --headed open <url> # Starts Pibo-managed persistent PIBo Chrome via CDP
260
- browser-use --fresh-profile open <url> # Starts a fresh temporary browser profile
261
- browser-use --connect open <url> # Connect to local Chrome via CDP (requires --remote-debugging-port)
262
- browser-use --profile "Default" open <url> # Upstream profile mode; Browser Use may copy it to a temp dir
263
- \`\`\`
264
-
265
- ## Commands
266
-
267
- \`\`\`bash
268
- # Navigation
269
- browser-use open <url>
270
- browser-use back
271
- browser-use scroll down
272
- browser-use scroll up
273
- browser-use switch <index>
274
- browser-use close-tab [index]
275
-
276
- # Page state
277
- browser-use state
278
- browser-use screenshot [path.png]
279
- browser-use screenshot --full path.png
280
-
281
- # Interactions
282
- browser-use click <index>
283
- browser-use click <x> <y>
284
- browser-use type "text"
285
- browser-use input <index> "text"
286
- browser-use input <index> ""
287
- browser-use keys "Enter"
288
- browser-use keys "Control+a"
289
- browser-use select <index> "option"
290
- browser-use upload <index> <path>
291
- browser-use hover <index>
292
- browser-use dblclick <index>
293
- browser-use rightclick <index>
294
-
295
- # Data extraction
296
- browser-use eval "js code"
297
- browser-use get title
298
- browser-use get html
299
- browser-use get html --selector "h1"
300
- browser-use get text <index>
301
- browser-use get value <index>
302
- browser-use get attributes <index>
303
- browser-use get bbox <index>
304
-
305
- # Wait
306
- browser-use wait selector "css"
307
- browser-use wait text "Success"
308
-
309
- # Cookies
310
- browser-use cookies get
311
- browser-use cookies get --url <url>
312
- browser-use cookies set <name> <value>
313
- browser-use cookies clear
314
- browser-use cookies export <file>
315
- browser-use cookies import <file>
316
-
317
- # Session
318
- browser-use close
319
- browser-use sessions
320
- browser-use close --all
321
- \`\`\`
322
-
323
- ## Authenticated Browsing
324
-
325
- For the Pibo Chat Web App, prefer an isolated authenticated lease when multiple agents may use the browser at the same time:
326
-
327
- \`\`\`bash
328
- eval "$(pibo tools browser-use lease acquire --app pibo-chat --holder "$USER")"
329
- browser-use state
330
- \`\`\`
331
-
332
- The lease exports \`BROWSER_USE_HOME\`, \`PIBO_BROWSER_USE_SESSION\`, \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\`, and \`PIBO_BROWSER_USE_DEFAULT_PROFILE\`. The Pibo browser-use wrapper uses \`PIBO_BROWSER_USE_SESSION\` as the default session, so later commands can omit \`--session\` in that shell.
333
-
334
- Before acquiring leases, prepare one authenticated template profile:
335
-
336
- \`\`\`bash
337
- eval "$(pibo tools browser-use auth-template env)"
338
- browser-use --headed open http://4788.192.168.0.204.sslip.io/apps/chat
339
- \`\`\`
340
-
341
- Sign in once in that template browser, then close it before agents acquire leases. Inspect and clean up leases with:
342
-
343
- \`\`\`bash
344
- pibo tools browser-use lease list
345
- pibo tools browser-use lease release <lease-id>
346
- pibo tools browser-use lease reap-stale
347
- \`\`\`
348
-
349
- If a shared legacy session is already available, inspect it before navigating:
350
-
351
- \`\`\`bash
352
- browser-use --session pibo-auth state
353
- \`\`\`
354
-
355
- If \`pibo-auth\` is unavailable and must be recreated, the default wrapper behavior is enough:
356
-
357
- \`\`\`bash
358
- browser-use --headed --session pibo-auth open http://4788.192.168.0.204.sslip.io/apps/chat
359
- \`\`\`
360
-
361
- For low-level Chat Web debugging, prefer an already-open authenticated browser over launching a new profile. Start by listing CDP targets:
362
-
363
- \`\`\`bash
364
- npm run dev -- tools browser-use targets
365
- npm run dev -- tools browser-use attach-chat
366
- curl -s http://127.0.0.1:56663/json/list
367
- \`\`\`
368
-
369
- Inspect Chat Web targets and pick the one that is authenticated and has a composer textarea. \`attach-chat\` prints shell exports for the best existing authenticated Chat target. If Browser Use cannot attach cleanly or MCP resources are unavailable, use the target \`webSocketDebuggerUrl\` from \`targets\`, \`attach-chat\`, or \`/json/list\` and direct CDP \`Runtime.evaluate\`, \`Network\`, and DOM inspection.
370
-
371
- For authenticated sites, the default Pibo wrapper path is the persistent path. Use \`profile list\` only to inspect available Chrome profiles:
372
-
373
- \`\`\`bash
374
- browser-use profile list
375
- \`\`\`
376
-
377
- To intentionally use a real local Chrome user data directory instead of the Pibo-managed one, set \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\` before starting the session.
378
-
379
- If \`browser-use --connect\` cannot find Chrome, ask the user whether they want to relaunch Chrome with remote debugging or use a managed Chromium profile.
380
-
381
- ## Tips
382
-
383
- 1. Apply \`eval "$(pibo tools env browser-use)"\` once per persistent shell before using the CLI from Pibo, then reuse that shell.
384
- 2. Always run \`state\` before using element indices.
385
- 3. Re-run \`state\` after navigation or large DOM changes because element indices can change.
386
- 4. For forms, verify inputs with \`get value <index>\`; \`state\` does not always show current text values.
387
- 5. For large pages, prefer \`get html --selector\`, \`get text <index>\`, or \`eval\` over dumping the full page with \`state\`.
388
- 6. Use \`--headed\` when debugging browser behavior if the env output includes a display.
389
- 7. Sessions persist until \`browser-use close\`.
390
- 8. Use \`--session NAME\` for separate browser sessions.
391
- 9. Wrap long waits or JavaScript-heavy mutations with an external timeout, for example \`timeout 30s browser-use --session NAME wait text "Success"\`.
392
- 10. Prefer \`--json\` for machine-readable \`get\` and \`sessions\` results.
393
- 11. \`select\` confirms the visible option text, while \`get value\` returns the underlying option value.
394
- 12. Avoid \`browser-use --version\`; this CLI does not support it.
395
- 13. Avoid \`extract\`; it is listed by the CLI but is not implemented in this version.
396
- 14. If Chrome fails to start with a "SingletonLock" error, the wrapper auto-detects and terminates stale Chrome processes holding the lock. Retry your command.
270
+ content: `---
271
+ name: browser-use
272
+ description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
273
+ allowed-tools: Bash(browser-use:*)
274
+ ---
275
+
276
+ # Browser Automation with browser-use CLI
277
+
278
+ The browser-use command provides persistent browser automation. A background daemon keeps the browser open across commands, so repeated commands are fast.
279
+
280
+ ## Prerequisites
281
+
282
+ Initialize one persistent browser-use shell by applying the Pibo tool environment once:
283
+
284
+ \`\`\`bash
285
+ eval "$(pibo tools env browser-use)"
286
+ browser-use doctor
287
+ \`\`\`
288
+
289
+ Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, it includes detected desktop variables such as \`DISPLAY\`, \`WAYLAND_DISPLAY\`, and \`XAUTHORITY\` when a local desktop is available.
290
+
291
+ The Pibo tool environment wraps \`browser-use\`: when a new browser daemon session is started, it starts a Pibo-managed persistent Chrome profile named \`PIBo\` with CDP and connects Browser Use to it. This avoids Browser Use's normal temporary profile copy, so sign-ins made in that profile stay on disk. Pass \`--fresh-profile\` to start a fresh temporary browser profile instead.
292
+
293
+ ## Core Workflow
294
+
295
+ 1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
296
+ 2. Inspect: \`browser-use state\`
297
+ 3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
298
+ 4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
299
+ 5. Repeat while the browser stays open
300
+
301
+ Run browser-mutating commands one at a time per session. Do not issue parallel \`click\`, \`input\`, \`open\`, \`eval\`, or \`screenshot\` calls against the same session.
302
+
303
+ If a command fails, run \`browser-use close\` first to clear the session, then retry.
304
+
305
+ After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
306
+
307
+ ## Browser Modes
308
+
309
+ \`\`\`bash
310
+ browser-use --headed open <url> # Starts Pibo-managed persistent PIBo Chrome via CDP
311
+ browser-use --fresh-profile open <url> # Starts a fresh temporary browser profile
312
+ browser-use --connect open <url> # Connect to local Chrome via CDP (requires --remote-debugging-port)
313
+ browser-use --profile "Default" open <url> # Upstream profile mode; Browser Use may copy it to a temp dir
314
+ \`\`\`
315
+
316
+ ## Commands
317
+
318
+ \`\`\`bash
319
+ # Navigation
320
+ browser-use open <url>
321
+ browser-use back
322
+ browser-use scroll down
323
+ browser-use scroll up
324
+ browser-use switch <index>
325
+ browser-use close-tab [index]
326
+
327
+ # Page state
328
+ browser-use state
329
+ browser-use screenshot [path.png]
330
+ browser-use screenshot --full path.png
331
+
332
+ # Interactions
333
+ browser-use click <index>
334
+ browser-use click <x> <y>
335
+ browser-use type "text"
336
+ browser-use input <index> "text"
337
+ browser-use input <index> ""
338
+ browser-use keys "Enter"
339
+ browser-use keys "Control+a"
340
+ browser-use select <index> "option"
341
+ browser-use upload <index> <path>
342
+ browser-use hover <index>
343
+ browser-use dblclick <index>
344
+ browser-use rightclick <index>
345
+
346
+ # Data extraction
347
+ browser-use eval "js code"
348
+ browser-use get title
349
+ browser-use get html
350
+ browser-use get html --selector "h1"
351
+ browser-use get text <index>
352
+ browser-use get value <index>
353
+ browser-use get attributes <index>
354
+ browser-use get bbox <index>
355
+
356
+ # Wait
357
+ browser-use wait selector "css"
358
+ browser-use wait text "Success"
359
+
360
+ # Cookies
361
+ browser-use cookies get
362
+ browser-use cookies get --url <url>
363
+ browser-use cookies set <name> <value>
364
+ browser-use cookies clear
365
+ browser-use cookies export <file>
366
+ browser-use cookies import <file>
367
+
368
+ # Session
369
+ browser-use close
370
+ browser-use sessions
371
+ browser-use close --all
372
+ \`\`\`
373
+
374
+ ## Authenticated Browsing
375
+
376
+ For the Pibo Chat Web App, prefer an isolated authenticated lease when multiple agents may use the browser at the same time:
377
+
378
+ \`\`\`bash
379
+ # Default headless browser
380
+ eval "$(pibo tools browser-use lease acquire --app pibo-chat --holder "$USER")"
381
+
382
+ # For headed mode, use this instead:
383
+ # eval "$(pibo tools browser-use lease acquire --app pibo-chat --holder "$USER" --headed)"
384
+
385
+ browser-use state
386
+ \`\`\`
387
+
388
+ Acquire only one lease for the task. The warm-up fixes the mode of the managed Chrome process, so choose \`--headed\` during acquisition rather than adding it only to a later Browser Use command.
389
+
390
+ The lease exports \`BROWSER_USE_HOME\`, \`PIBO_BROWSER_USE_SESSION\`, \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\`, and \`PIBO_BROWSER_USE_DEFAULT_PROFILE\`. Stdout contains only shell-safe exports and comments so it can be evaluated; warm-up diagnostics are written to stderr. The Pibo browser-use wrapper uses \`PIBO_BROWSER_USE_SESSION\` as the default session, so later commands can omit \`--session\` in that shell.
391
+
392
+ Before acquiring leases, prepare one authenticated template profile:
393
+
394
+ \`\`\`bash
395
+ eval "$(pibo tools browser-use auth-template env)"
396
+ browser-use --headed open http://4788.192.168.0.204.sslip.io/apps/chat
397
+ \`\`\`
398
+
399
+ Sign in once in that template browser, then close it before agents acquire leases. Inspect and clean up leases with:
400
+
401
+ \`\`\`bash
402
+ pibo tools browser-use lease list
403
+ pibo tools browser-use lease release <lease-id>
404
+ pibo tools browser-use lease reap-stale
405
+ \`\`\`
406
+
407
+ If a shared legacy session is already available, inspect it before navigating:
408
+
409
+ \`\`\`bash
410
+ browser-use --session pibo-auth state
411
+ \`\`\`
412
+
413
+ If \`pibo-auth\` is unavailable and must be recreated, the default wrapper behavior is enough:
414
+
415
+ \`\`\`bash
416
+ browser-use --headed --session pibo-auth open http://4788.192.168.0.204.sslip.io/apps/chat
417
+ \`\`\`
418
+
419
+ For low-level Chat Web debugging, prefer an already-open authenticated browser over launching a new profile. Start by listing CDP targets:
420
+
421
+ \`\`\`bash
422
+ npm run dev -- tools browser-use targets
423
+ npm run dev -- tools browser-use attach-chat
424
+ curl -s http://127.0.0.1:56663/json/list
425
+ \`\`\`
426
+
427
+ Inspect Chat Web targets and pick the one that is authenticated and has a composer textarea. \`attach-chat\` prints shell exports for the best existing authenticated Chat target. If Browser Use cannot attach cleanly or MCP resources are unavailable, use the target \`webSocketDebuggerUrl\` from \`targets\`, \`attach-chat\`, or \`/json/list\` and direct CDP \`Runtime.evaluate\`, \`Network\`, and DOM inspection.
428
+
429
+ For authenticated sites, the default Pibo wrapper path is the persistent path. Use \`profile list\` only to inspect available Chrome profiles:
430
+
431
+ \`\`\`bash
432
+ browser-use profile list
433
+ \`\`\`
434
+
435
+ To intentionally use a real local Chrome user data directory instead of the Pibo-managed one, set \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\` before starting the session.
436
+
437
+ If \`browser-use --connect\` cannot find Chrome, ask the user whether they want to relaunch Chrome with remote debugging or use a managed Chromium profile.
438
+
439
+ ## Tips
440
+
441
+ 1. Apply \`eval "$(pibo tools env browser-use)"\` once per persistent shell before using the CLI from Pibo, then reuse that shell.
442
+ 2. Always run \`state\` before using element indices.
443
+ 3. Re-run \`state\` after navigation or large DOM changes because element indices can change.
444
+ 4. For forms, verify inputs with \`get value <index>\`; \`state\` does not always show current text values.
445
+ 5. For large pages, prefer \`get html --selector\`, \`get text <index>\`, or \`eval\` over dumping the full page with \`state\`.
446
+ 6. Use \`--headed\` when debugging browser behavior if the env output includes a display.
447
+ 7. Sessions persist until \`browser-use close\`.
448
+ 8. Use \`--session NAME\` for separate browser sessions.
449
+ 9. Wrap long waits or JavaScript-heavy mutations with an external timeout, for example \`timeout 30s browser-use --session NAME wait text "Success"\`.
450
+ 10. Prefer \`--json\` for machine-readable \`get\` and \`sessions\` results.
451
+ 11. \`select\` confirms the visible option text, while \`get value\` returns the underlying option value.
452
+ 12. Avoid \`browser-use --version\`; this CLI does not support it.
453
+ 13. Avoid \`extract\`; it is listed by the CLI but is not implemented in this version.
454
+ 14. If Chrome fails to start with a "SingletonLock" error, the wrapper auto-detects and terminates stale Chrome processes holding the lock. Retry your command.
397
455
  `,
398
456
  };
399
457
  export const GRAPHIFY_GUIDE = {
400
458
  name: 'graphify',
401
459
  description: 'Generate codebase knowledge graphs with the Graphify CLI.',
402
- content: `---
403
- name: graphify
404
- description: Generates interactive codebase knowledge graphs and markdown reports from a workspace folder.
405
- allowed-tools: Bash(graphify:*)
406
- ---
407
-
408
- # Codebase Visualization with Graphify
409
-
410
- Graphify turns a folder into derived artifacts under \`graphify-out/\`:
411
-
412
- - \`graphify-out/graph.html\` — an interactive clickable graph;
413
- - \`graphify-out/graph.json\` — machine-readable graph data;
414
- - \`graphify-out/GRAPH_REPORT.md\` — a markdown summary with key concepts and suggested questions.
415
-
416
- Use it when a user asks to graph, map, visualize, or quickly understand a repo/workspace shape.
417
-
418
- ## Prerequisites
419
-
420
- Install and apply the Pibo tool environment:
421
-
422
- \`\`\`bash
423
- pibo tools install graphify
424
- eval "$(pibo tools env graphify)"
425
- graphify --help
426
- \`\`\`
427
-
428
- Inside the Pibo source repo, use \`npm run --silent dev -- tools ...\` while testing local changes:
429
-
430
- \`\`\`bash
431
- npm run --silent dev -- tools install graphify
432
- eval "$(npm run --silent dev -- tools env graphify)"
433
- \`\`\`
434
-
435
- The installer uses the PyPI package \`graphifyy\` and runs \`graphify install --platform pi\` so the CLI is ready for Pi/Pibo workflows.
436
-
437
- ## Core Workflow
438
-
439
- 1. Choose the workspace path. Prefer the active Pibo Room or session workspace boundary when known.
440
- 2. Run Graphify from that folder or pass the target path explicitly. With \`graphifyy==0.9.x\`, \`graphify .\` writes extraction output under \`graphify-out/\`.
441
- 3. For a code-only workspace without an LLM key, run \`graphify cluster-only . --no-label\` after extraction to produce the HTML graph and markdown report.
442
- 4. Put generated artifacts in an ignored room/session artifact directory when possible; do not commit them unless the user explicitly asks.
443
- 5. Read \`graphify-out/GRAPH_REPORT.md\` first, then open \`graphify-out/graph.html\` when an interactive view is useful.
444
-
445
- \`\`\`bash
446
- cd /path/to/workspace
447
- graphify .
448
- graphify cluster-only . --no-label
449
- ls graphify-out/graph.html graphify-out/graph.json graphify-out/GRAPH_REPORT.md
450
- \`\`\`
451
-
452
- ## Pibo Usage Notes
453
-
454
- - For Room-bound work, graph the Room workspace rather than the agent harness checkout unless the user asks otherwise.
455
- - If generating inside a Git repo, check \`git status --short\` before and after so graph artifacts are not accidentally included in unrelated commits.
456
- - Code-only extraction can run without an LLM API key. Including docs, README files, papers, images, or semantic-labeling steps may require a configured Graphify backend/API key; if no key is available, graph a code-only subdirectory or skip semantic labels with \`cluster-only . --no-label\`.
457
- - For large monorepos, start with a subdirectory such as \`src/\`, a code package, or a docs folder only when the needed LLM backend is configured.
458
- - Treat graph output as derived data. Recompute on demand when the branch or workspace changes.
459
-
460
- ## Next Commands
461
-
462
- \`\`\`bash
463
- pibo tools show graphify
464
- pibo tools guide graphify graphify
465
- pibo tools path graphify
466
- pibo tools doctor graphify
467
- \`\`\`
460
+ content: `---
461
+ name: graphify
462
+ description: Generates interactive codebase knowledge graphs and markdown reports from a workspace folder.
463
+ allowed-tools: Bash(graphify:*)
464
+ ---
465
+
466
+ # Codebase Visualization with Graphify
467
+
468
+ Graphify turns a folder into derived artifacts under \`graphify-out/\`:
469
+
470
+ - \`graphify-out/graph.html\` — an interactive clickable graph;
471
+ - \`graphify-out/graph.json\` — machine-readable graph data;
472
+ - \`graphify-out/GRAPH_REPORT.md\` — a markdown summary with key concepts and suggested questions.
473
+
474
+ Use it when a user asks to graph, map, visualize, or quickly understand a repo/workspace shape.
475
+
476
+ ## Prerequisites
477
+
478
+ Install and apply the Pibo tool environment:
479
+
480
+ \`\`\`bash
481
+ pibo tools install graphify
482
+ eval "$(pibo tools env graphify)"
483
+ graphify --help
484
+ \`\`\`
485
+
486
+ Inside the Pibo source repo, use \`npm run --silent dev -- tools ...\` while testing local changes:
487
+
488
+ \`\`\`bash
489
+ npm run --silent dev -- tools install graphify
490
+ eval "$(npm run --silent dev -- tools env graphify)"
491
+ \`\`\`
492
+
493
+ The installer uses the PyPI package \`graphifyy\` and runs \`graphify install --platform pi\` so the CLI is ready for Pi/Pibo workflows.
494
+
495
+ ## Core Workflow
496
+
497
+ 1. Choose the workspace path. Prefer the active Pibo Room or session workspace boundary when known.
498
+ 2. Run Graphify from that folder or pass the target path explicitly. With \`graphifyy==0.9.x\`, \`graphify .\` writes extraction output under \`graphify-out/\`.
499
+ 3. For a code-only workspace without an LLM key, run \`graphify cluster-only . --no-label\` after extraction to produce the HTML graph and markdown report.
500
+ 4. Put generated artifacts in an ignored room/session artifact directory when possible; do not commit them unless the user explicitly asks.
501
+ 5. Read \`graphify-out/GRAPH_REPORT.md\` first, then open \`graphify-out/graph.html\` when an interactive view is useful.
502
+
503
+ \`\`\`bash
504
+ cd /path/to/workspace
505
+ graphify .
506
+ graphify cluster-only . --no-label
507
+ ls graphify-out/graph.html graphify-out/graph.json graphify-out/GRAPH_REPORT.md
508
+ \`\`\`
509
+
510
+ ## Pibo Usage Notes
511
+
512
+ - For Room-bound work, graph the Room workspace rather than the agent harness checkout unless the user asks otherwise.
513
+ - If generating inside a Git repo, check \`git status --short\` before and after so graph artifacts are not accidentally included in unrelated commits.
514
+ - Code-only extraction can run without an LLM API key. Including docs, README files, papers, images, or semantic-labeling steps may require a configured Graphify backend/API key; if no key is available, graph a code-only subdirectory or skip semantic labels with \`cluster-only . --no-label\`.
515
+ - For large monorepos, start with a subdirectory such as \`src/\`, a code package, or a docs folder only when the needed LLM backend is configured.
516
+ - Treat graph output as derived data. Recompute on demand when the branch or workspace changes.
517
+
518
+ ## Next Commands
519
+
520
+ \`\`\`bash
521
+ pibo tools show graphify
522
+ pibo tools guide graphify graphify
523
+ pibo tools path graphify
524
+ pibo tools doctor graphify
525
+ \`\`\`
468
526
  `,
469
527
  };
470
528
  export const REMOTE_BROWSER_GUIDE = {
471
529
  name: 'remote-browser',
472
530
  description: 'Browser automation workflow for sandboxed or remote agents.',
473
- content: `---
474
- name: remote-browser
475
- description: Controls a browser from a sandboxed or remote machine. Use when the agent has no local GUI and needs to navigate websites, interact with web pages, take screenshots, or expose local dev servers via tunnels.
476
- allowed-tools: Bash(browser-use:*)
477
- ---
478
-
479
- # Browser Automation for Sandboxed Agents
480
-
481
- This guide is for agents running in a sandbox, CI, cloud VM, or remote coding environment.
482
-
483
- ## Prerequisites
484
-
485
- Initialize one persistent browser-use shell by applying the Pibo tool environment once:
486
-
487
- \`\`\`bash
488
- eval "$(pibo tools env browser-use)"
489
- browser-use doctor
490
- \`\`\`
491
-
492
- Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, this lets Browser Use see a local desktop session when one exists.
493
-
494
- ## Core Workflow
495
-
496
- 1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
497
- 2. Inspect: \`browser-use state\`
498
- 3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
499
- 4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
500
- 5. Cleanup: \`browser-use close\`
501
-
502
- Run browser-mutating commands one at a time per session. Use separate session names for parallel workflows.
503
- After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
504
-
505
- ## Browser Modes
506
-
507
- \`\`\`bash
508
- browser-use open <url>
509
- browser-use --headed open <url>
510
- browser-use --connect open <url>
511
- browser-use --cdp-url ws://localhost:9222/devtools/browser/... open <url>
512
- \`\`\`
513
-
514
- ## Commands
515
-
516
- \`\`\`bash
517
- browser-use open <url>
518
- browser-use back
519
- browser-use state
520
- browser-use screenshot [path.png]
521
- browser-use click <index>
522
- browser-use input <index> "text"
523
- browser-use keys "Enter"
524
- browser-use wait selector "css"
525
- browser-use wait text "Success"
526
- browser-use get html
527
- browser-use eval "document.title"
528
- browser-use switch <index>
529
- browser-use close-tab [index]
530
- browser-use close
531
- \`\`\`
532
-
533
- ## Exposing Local Dev Servers
534
-
535
- \`\`\`bash
536
- browser-use tunnel <port>
537
- browser-use tunnel list
538
- browser-use open <tunnel-url>
539
- browser-use tunnel stop <port>
540
- \`\`\`
541
-
542
- Tunnels are independent from browser sessions and can persist after \`browser-use close\`.
543
-
544
- ## Multiple Sessions
545
-
546
- \`\`\`bash
547
- browser-use --session agent-a open https://example.com
548
- browser-use --session agent-b open https://example.org
549
- \`\`\`
550
-
551
- Use named sessions when multiple agents or workflows need separate browsers.
552
-
553
- ## Troubleshooting
554
-
555
- - Browser will not start: run \`browser-use close\`, then retry.
556
- - Element not found: run \`browser-use scroll down\`, then \`browser-use state\`.
557
- - Form value unclear: use \`browser-use get value <index>\`.
558
- - Large page state is noisy: use \`get html --selector\`, \`get text <index>\`, or \`eval\`.
559
- - Need to debug visually: use \`--headed\`.
560
- - Long wait hangs: wrap the command with \`timeout 30s\`.
561
- - Tunnel not working: run \`browser-use tunnel list\`.
531
+ content: `---
532
+ name: remote-browser
533
+ description: Controls a browser from a sandboxed or remote machine. Use when the agent has no local GUI and needs to navigate websites, interact with web pages, take screenshots, or expose local dev servers via tunnels.
534
+ allowed-tools: Bash(browser-use:*)
535
+ ---
536
+
537
+ # Browser Automation for Sandboxed Agents
538
+
539
+ This guide is for agents running in a sandbox, CI, cloud VM, or remote coding environment.
540
+
541
+ ## Prerequisites
542
+
543
+ Initialize one persistent browser-use shell by applying the Pibo tool environment once:
544
+
545
+ \`\`\`bash
546
+ eval "$(pibo tools env browser-use)"
547
+ browser-use doctor
548
+ \`\`\`
549
+
550
+ Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, this lets Browser Use see a local desktop session when one exists.
551
+
552
+ ## Core Workflow
553
+
554
+ 1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
555
+ 2. Inspect: \`browser-use state\`
556
+ 3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
557
+ 4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
558
+ 5. Cleanup: \`browser-use close\`
559
+
560
+ Run browser-mutating commands one at a time per session. Use separate session names for parallel workflows.
561
+ After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
562
+
563
+ ## Browser Modes
564
+
565
+ \`\`\`bash
566
+ browser-use open <url>
567
+ browser-use --headed open <url>
568
+ browser-use --connect open <url>
569
+ browser-use --cdp-url ws://localhost:9222/devtools/browser/... open <url>
570
+ \`\`\`
571
+
572
+ ## Commands
573
+
574
+ \`\`\`bash
575
+ browser-use open <url>
576
+ browser-use back
577
+ browser-use state
578
+ browser-use screenshot [path.png]
579
+ browser-use click <index>
580
+ browser-use input <index> "text"
581
+ browser-use keys "Enter"
582
+ browser-use wait selector "css"
583
+ browser-use wait text "Success"
584
+ browser-use get html
585
+ browser-use eval "document.title"
586
+ browser-use switch <index>
587
+ browser-use close-tab [index]
588
+ browser-use close
589
+ \`\`\`
590
+
591
+ ## Exposing Local Dev Servers
592
+
593
+ \`\`\`bash
594
+ browser-use tunnel <port>
595
+ browser-use tunnel list
596
+ browser-use open <tunnel-url>
597
+ browser-use tunnel stop <port>
598
+ \`\`\`
599
+
600
+ Tunnels are independent from browser sessions and can persist after \`browser-use close\`.
601
+
602
+ ## Multiple Sessions
603
+
604
+ \`\`\`bash
605
+ browser-use --session agent-a open https://example.com
606
+ browser-use --session agent-b open https://example.org
607
+ \`\`\`
608
+
609
+ Use named sessions when multiple agents or workflows need separate browsers.
610
+
611
+ ## Troubleshooting
612
+
613
+ - Browser will not start: run \`browser-use close\`, then retry.
614
+ - Element not found: run \`browser-use scroll down\`, then \`browser-use state\`.
615
+ - Form value unclear: use \`browser-use get value <index>\`.
616
+ - Large page state is noisy: use \`get html --selector\`, \`get text <index>\`, or \`eval\`.
617
+ - Need to debug visually: use \`--headed\`.
618
+ - Long wait hangs: wrap the command with \`timeout 30s\`.
619
+ - Tunnel not working: run \`browser-use tunnel list\`.
562
620
  `,
563
621
  };