@cerebriline/core 4.100.245 → 4.100.247

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 (126) hide show
  1. package/assets/prompt-templates/claude.md +2 -0
  2. package/assets/prompt-templates/deepseek.md +1 -0
  3. package/assets/prompt-templates/default.md +2 -1
  4. package/assets/prompt-templates/kimi-k3.md +1 -0
  5. package/assets/prompt-templates/kimi.md +1 -0
  6. package/assets/prompt-templates/minimax.md +2 -0
  7. package/assets/prompt-templates/nemotron.md +1 -0
  8. package/assets/skills/browser-automation/SKILL.md +113 -0
  9. package/dist/ClineCore.d.ts +9 -0
  10. package/dist/account/index.d.ts +1 -0
  11. package/dist/account/telemetry.d.ts +22 -0
  12. package/dist/cloud/api.d.ts +122 -0
  13. package/dist/cloud/controller.d.ts +172 -0
  14. package/dist/cloud/index.d.ts +9 -0
  15. package/dist/cloud/index.js +21 -0
  16. package/dist/cloud/models.d.ts +9 -0
  17. package/dist/cloud/repositories.d.ts +21 -0
  18. package/dist/cloud/snapshots.d.ts +22 -0
  19. package/dist/cloud/state.d.ts +13 -0
  20. package/dist/cloud/types.d.ts +84 -0
  21. package/dist/cron/events/cron-event-ingress.d.ts +4 -2
  22. package/dist/cron/runner/cron-runner.d.ts +5 -2
  23. package/dist/cron/service/cron-service.d.ts +2 -1
  24. package/dist/cron/service/schedule-service.d.ts +2 -1
  25. package/dist/cron/store/sqlite-cron-store.d.ts +7 -1
  26. package/dist/extensions/composio/composio-meta-tools.d.ts +39 -0
  27. package/dist/extensions/composio/composio-tools-extension.d.ts +13 -0
  28. package/dist/extensions/context/agentic-compaction.d.ts +1 -1
  29. package/dist/extensions/context/cap-thoughts.d.ts +39 -0
  30. package/dist/extensions/context/capped-thinking.d.ts +5 -0
  31. package/dist/extensions/context/compaction-shared.d.ts +76 -1
  32. package/dist/extensions/context/compaction.d.ts +81 -3
  33. package/dist/extensions/mcp/client.d.ts +1 -1
  34. package/dist/extensions/tools/code-search.d.ts +16 -0
  35. package/dist/extensions/tools/definitions.d.ts +5 -5
  36. package/dist/extensions/tools/executors/bash.d.ts +26 -0
  37. package/dist/extensions/tools/executors/index.d.ts +1 -1
  38. package/dist/extensions/tools/index.d.ts +1 -1
  39. package/dist/extensions/tools/library-tools.d.ts +14 -0
  40. package/dist/extensions/tools/schemas.d.ts +2 -11
  41. package/dist/extensions/tools/task-progress.d.ts +37 -0
  42. package/dist/extensions/tools/team/index.d.ts +1 -0
  43. package/dist/extensions/tools/team/multi-agent.d.ts +48 -0
  44. package/dist/extensions/tools/team/persistence-policy.d.ts +56 -0
  45. package/dist/extensions/tools/team/runtime.d.ts +1 -1
  46. package/dist/extensions/tools/team/sanitize-team-name.d.ts +5 -0
  47. package/dist/extensions/tools/team/team-tools.d.ts +1 -1
  48. package/dist/extensions/tools/types.d.ts +9 -1
  49. package/dist/extensions/tools/web-scrape-tool.d.ts +49 -0
  50. package/dist/extensions/tools/web-site-crawl.d.ts +96 -0
  51. package/dist/hooks/checkpoint-hooks.d.ts +23 -1
  52. package/dist/hooks/hook-file-hooks.d.ts +27 -0
  53. package/dist/hooks/subprocess-runner.d.ts +23 -0
  54. package/dist/hooks/subprocess.d.ts +10 -0
  55. package/dist/hub/client/index.d.ts +29 -3
  56. package/dist/hub/client/session-client.d.ts +0 -3
  57. package/dist/hub/daemon/bind-diagnostics.d.ts +16 -0
  58. package/dist/hub/daemon/entry.js +701 -652
  59. package/dist/hub/daemon/index.d.ts +17 -8
  60. package/dist/hub/discovery/index.d.ts +1 -0
  61. package/dist/hub/index.js +690 -642
  62. package/dist/hub/runtime-host/hub-runtime-host.d.ts +4 -2
  63. package/dist/hub/server/handlers/session-handlers.d.ts +6 -1
  64. package/dist/index.d.ts +24 -12
  65. package/dist/index.js +1137 -1062
  66. package/dist/remote/remote-environments.d.ts +155 -0
  67. package/dist/remote/remote-helper-entry.d.ts +1 -0
  68. package/dist/remote/remote-helper-entry.js +5 -0
  69. package/dist/remote/remote-helper.d.ts +29 -0
  70. package/dist/remote/remote-helper.js +4 -0
  71. package/dist/remote/shell-path.d.ts +88 -0
  72. package/dist/runtime/host/local-runtime-host.d.ts +4 -2
  73. package/dist/runtime/host/runtime-host.d.ts +13 -1
  74. package/dist/runtime/orchestration/oauth-refresh-lock.d.ts +6 -0
  75. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +7 -0
  76. package/dist/runtime/orchestration/team-persistence-writer.d.ts +65 -0
  77. package/dist/runtime/safety/rules.d.ts +11 -0
  78. package/dist/runtime/turn-queue/pending-prompt-service.d.ts +1 -0
  79. package/dist/services/agent-events.d.ts +1 -0
  80. package/dist/services/cloud-handoff/git-preflight.d.ts +24 -0
  81. package/dist/services/cloud-handoff/index.d.ts +4 -0
  82. package/dist/services/cloud-handoff/metadata.d.ts +7 -0
  83. package/dist/services/cloud-handoff/transcript.d.ts +5 -0
  84. package/dist/services/cloud-handoff/types.d.ts +35 -0
  85. package/dist/services/feature-flags/FeatureFlagsService.d.ts +2 -0
  86. package/dist/services/feature-flags/cline-account-feature-flags.d.ts +5 -0
  87. package/dist/services/llms/cline-recommended-models.d.ts +1 -0
  88. package/dist/services/llms/handler-factory.d.ts +12 -0
  89. package/dist/services/llms/provider-defaults.d.ts +1 -1
  90. package/dist/services/llms/provider-settings.d.ts +19 -17
  91. package/dist/services/local-runtime-bootstrap.d.ts +7 -0
  92. package/dist/services/mcp-install.d.ts +9 -0
  93. package/dist/services/plugin-commands.d.ts +28 -0
  94. package/dist/services/providers/local-provider-registry.d.ts +8 -3
  95. package/dist/services/providers/local-provider-service.d.ts +20 -10
  96. package/dist/services/providers/model-source.d.ts +6 -1
  97. package/dist/services/providers/provider-config-fields.d.ts +11 -0
  98. package/dist/services/retrieval/code-index.d.ts +2 -0
  99. package/dist/services/retrieval/firecrawl.d.ts +15 -0
  100. package/dist/services/retrieval/web-mirror.d.ts +101 -0
  101. package/dist/services/session-import/claude-code.d.ts +1 -1
  102. package/dist/services/session-import/paths.d.ts +9 -0
  103. package/dist/services/storage/file-team-store.d.ts +10 -4
  104. package/dist/services/storage/sqlite-team-store.d.ts +48 -5
  105. package/dist/services/storage/team-store.d.ts +1 -0
  106. package/dist/services/telemetry/core-events.d.ts +97 -5
  107. package/dist/services/telemetry/index.d.ts +1 -0
  108. package/dist/services/telemetry/index.js +1 -1
  109. package/dist/services/telemetry/scoped-telemetry.d.ts +31 -0
  110. package/dist/services/workspace/workspace-manifest.d.ts +34 -0
  111. package/dist/services/workspace/workspace-telemetry.d.ts +5 -0
  112. package/dist/session/fork-metadata.d.ts +7 -0
  113. package/dist/session/models/session-compaction.d.ts +8 -1
  114. package/dist/session/services/message-builder.d.ts +8 -1
  115. package/dist/session/services/persistence-service.d.ts +4 -1
  116. package/dist/session/services/tool-result-cache.d.ts +30 -0
  117. package/dist/session/session-versioning-service.d.ts +8 -0
  118. package/dist/session/stores/session-manifest-store.d.ts +2 -4
  119. package/dist/session/team/team-session-coordinator.d.ts +3 -1
  120. package/dist/tasks/task-tool.d.ts +2 -2
  121. package/dist/types/provider-settings.d.ts +11 -0
  122. package/dist/types/session.d.ts +2 -0
  123. package/dist/types/storage.d.ts +22 -1
  124. package/package.json +16 -4
  125. package/dist/cron/runner/resource-limiter.d.ts +0 -8
  126. package/dist/services/storage/team-events-retention.d.ts +0 -25
@@ -236,6 +236,8 @@ Changes or creates one text file. Use this, never the shell, for anything that w
236
236
 
237
237
  Which arguments you send decides what the call does. Use one form per call; don't mix `old_text` with a line range.
238
238
 
239
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
240
+
239
241
  1. Replace text: `path`, `old_text`, `new_text`. `old_text` must match exactly, whitespace and indentation included. If it occurs more than once, add `occurrence` (one-based, in file order) to pick one, or `replace_all: true` for all of them.
240
242
  2. Replace lines: `path`, `start_line`, `new_text`, optional `end_line` (inclusive, defaults to `start_line`). Best where the text is long, minified or repeated, because a line number cannot be ambiguous. An empty `new_text` deletes the range.
241
243
  3. Replace characters: `path`, `start_line`, `start_column`, `new_text`, optional `end_line`/`end_column` (inclusive, each defaulting to its start). This is the unit a diagnostic speaks in — `line 108, column 385` — and on a minified line it is the only form that leaves the other 400 characters alone. `start_column` alone replaces exactly one character.
@@ -120,6 +120,7 @@ An editor for controlled filesystem edits on the text file at the provided path.
120
120
  - Insert: `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert *within* that line instead, before the character at that column — this is how you add one missing bracket. Use `line_length + 1` to append at the end of the line.
121
121
  - Create, or replace a file whole: `new_text` alone. When the file does not exist this creates it; when it exists this replaces every line, which is allowed once you have read the file, since reading it is what tells you what you are overwriting. `start_line: 1` with `end_line: <line count>` is the same write by another name. Neither has a size limit, because a file written whole cannot be split — but reach for a whole-file write only once a targeted edit has failed, since a rewrite that is slightly wrong quietly loses the parts you did not mean to touch. Never delete a file to get a clean slate: this call already is one, and a deleted file is simply gone if the turn ends before you write it back.
122
122
 
123
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
123
124
  Use this rather than a shell command for anything that changes a file. Make one edit at a time and check it before starting the next: reads and searches cost nothing if one turns out to be unnecessary, but several edits made together and checked once leave several things to undo and no way to tell which one was wrong.
124
125
 
125
126
  Read the lines you are about to change before you change them: an edit aimed at a range you have not read in its current state is refused. Your own edits count — one that changes the file's length moves every line below it, so read that region again before editing it a second time. Line numbers taken from an earlier turn, from a task summary, or from a diagnostic issued before your last edit are the ones that go stale.
@@ -73,6 +73,7 @@ An editor for controlled filesystem edits on the text file at the provided path.
73
73
  - Replace characters: `start_line` and `start_column` plus `new_text`, with optional `end_line`/`end_column` (both inclusive; each defaults to its start). This is the unit a diagnostic speaks in — `Line 108, column 385` — and on a long or minified line it is the only edit that leaves the other 400 characters untouched. `start_column` on its own replaces exactly one character.
74
74
  - Insert: `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert *within* that line instead, before the character at that column — this is how you add one missing bracket. Use `line_length + 1` to append at the end of the line.
75
75
  - Create, or replace a file whole: `new_text` alone. When the file does not exist this creates it; when it exists this replaces every line, which is allowed once you have read the file, since reading it is what tells you what you are overwriting. `start_line: 1` with `end_line: <line count>` is the same write by another name. Neither has a size limit, because a file written whole cannot be split — but reach for a whole-file write only once a targeted edit has failed, since a rewrite that is slightly wrong quietly loses the parts you did not mean to touch. Never delete a file to get a clean slate: this call already is one, and a deleted file is simply gone if the turn ends before you write it back.
76
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
76
77
  Use this rather than a shell command for anything that changes a file. Make one edit at a time and check it before starting the next: reads and searches cost nothing if one turns out to be unnecessary, but several edits made together and checked once leave several things to undo and no way to tell which one was wrong. Read the lines you are about to change before you change them: an edit aimed at a range you have not read in its current state is refused. Your own edits count — one that changes the file's length moves every line below it, so read that region again before editing it a second time. Line numbers taken from an earlier turn, from a task summary, or from a diagnostic issued before your last edit are the ones that go stale. Repeating the lines already in the range and then continuing is how you insert after them, and it is allowed — the range says which lines you mean, so repeating them is your own choice. What is refused is a `new_text` that goes on to repeat lines from *outside* the range: that appends a second copy of text already elsewhere in the file rather than replacing anything, and the refusal names the lines it matched so you can aim the next call at them. Output: a single `{query, result, success, error?}` object for this one edit, where `query` is `edit:<path>` or `insert:<path>` and `result` describes what changed. A failed edit changes nothing: `success` is false, `error` says why, and the file is exactly as it was. Do not resend the same call — `error` names the fix. In particular, text copied out of a `read_files` result must have its `123 | ` line-number gutter removed first.
77
78
 
78
79
  # tool: sed
@@ -123,7 +124,7 @@ Output: a single `{query, result, success, error?}` object covering the whole pa
123
124
  Ask user a question for clarifying or gathering information needed to complete the task. For example, ask the user clarifying questions about a key implementation decision. You should only ask one question. Provide an array of 2-5 options for the user to choose from. Never include an option to toggle to Act mode. Mark the option you would pick: end it with ' (recommended)' and say why in one sentence in the question. Mark exactly one. Leave every option unmarked only when the choice turns on the user's taste or on something only they know. Output: the user's answer, as plain text — one of the options you offered, or whatever they wrote instead. Act on it in the same turn; the answer arriving is not a reason to stop.
124
125
 
125
126
  # tool: submit_and_exit
126
- Submit the final answer and exit the conversation. For example, submit a summary of the investigation and confirm the issue is resolved. You should only submit once all necessary steps are completed. Make sure to verify your output matches the expected format, data types, and file locations specified. Provide a summary of the investigation and confirm the issue is resolved. Output: a short confirmation, as plain text. This call ends the run — nothing you plan after it will happen, so call it only when there is nothing left to do.
127
+ Submit the final answer and exit the conversation. For example, submit a summary of the investigation and confirm the issue is resolved. You should only submit once all necessary steps are completed AND you have verified the result by execution. Before calling this, re-read the task, then confirm from your own tool output that every required file exists at the specified path and that its contents match the expected format, data types, and values. If the task provides tests, run them and confirm they pass; if it does not, run your own solution end to end and read the output back as evidence. Do not submit on the assumption that your solution works — submit because you have observed evidence that it does. Provide a summary of the investigation and confirm the issue is resolved. Output: a short confirmation, as plain text. This call ends the run — nothing you plan after it will happen, so call it only when there is nothing left to do.
127
128
 
128
129
  # tool: run_commands
129
130
  {{DEFAULT}}
@@ -167,6 +167,7 @@ Make precise edits to a single text file at `path`. Six modes, chosen by which a
167
167
  - Insert: `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert inside that line instead, before the character at that column — this is how you add one missing bracket, with `line_length + 1` appending at the end of the line.
168
168
  - Create or replace whole: `new_text` alone. Creates the file when it does not exist; replaces every line when it does, which needs the file read first. No size limit on this one — a file written whole cannot be split. Never `rm` a file to write it fresh: this is that, and a deleted file is gone if the turn ends first.
169
169
 
170
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
170
171
  Use this rather than a shell command for anything that changes a file. Make one edit at a time and check it before starting the next: reads and searches cost nothing if one turns out to be unnecessary, but several edits made together and checked once leave several things to undo and no way to tell which one was wrong. Read the lines you are about to change before you change them: an edit aimed at a range you have not read in its current state is refused. Your own edits count — one that changes the file's length moves every line below it, so read that region again before editing it a second time. Line numbers taken from an earlier turn, from a task summary, or from a diagnostic issued before your last edit are the ones that go stale. Repeating the lines already in the range and then continuing is how you insert after them, and it is allowed — the range says which lines you mean, so repeating them is your own choice. What is refused is a `new_text` that goes on to repeat lines from *outside* the range: that appends a second copy of text already elsewhere in the file rather than replacing anything, and the refusal names the lines it matched so you can aim the next call at them.
171
172
 
172
173
  Output: a single `{query, result, success, error?}` object for this one edit, where `query` is `edit:<path>` or `insert:<path>` and `result` describes what changed. A failed edit changes nothing: `success` is false, `error` says why, and the file is exactly as it was. Do not resend the same call — `error` names the fix. In particular, text copied out of a `read_files` result must have its `123 | ` line-number gutter removed first.
@@ -107,6 +107,7 @@ Make precise edits to a single text file at `path`. Six modes, chosen by which a
107
107
  - Insert: `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert inside that line instead, before the character at that column — this is how you add one missing bracket, with `line_length + 1` appending at the end of the line.
108
108
  - Create or replace whole: `new_text` alone. Creates the file when it does not exist; replaces every line when it does, which needs the file read first. No size limit on this one — a file written whole cannot be split. Never `rm` a file to write it fresh: this is that, and a deleted file is gone if the turn ends first.
109
109
 
110
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
110
111
  Use this rather than a shell command for anything that changes a file. Make one edit at a time and check it before starting the next: reads and searches cost nothing if one turns out to be unnecessary, but several edits made together and checked once leave several things to undo and no way to tell which one was wrong.
111
112
 
112
113
  Read the lines you are about to change before you change them: an edit aimed at a range you have not read in its current state is refused. Your own edits count — one that changes the file's length moves every line below it, so read that region again before editing it a second time. Line numbers from an earlier turn, from a task summary, or from a diagnostic issued before your last edit are the ones that go stale.
@@ -134,6 +134,8 @@ An editor for controlled filesystem edits on the text file at `path`. Six operat
134
134
  4. **Insert** — `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert *within* that line, before the character at that column — this is how you add one missing bracket. Use `line_length + 1` to append at the end of the line.
135
135
  5. **Create or replace a file whole** — `new_text` alone. When the file does not exist this creates it; when it exists this replaces every line, which is allowed once you have read the file, since reading it is what tells you what you are overwriting. `start_line: 1` with `end_line: <line count>` is the same write by another name. Neither has a size limit, because a file written whole cannot be split — but reach for a whole-file write only once a targeted edit has failed, since a rewrite that is slightly wrong quietly loses the parts you did not mean to touch. Never delete a file to get a clean slate: this call already is one, and a deleted file is simply gone if the turn ends before you write it back.
136
136
 
137
+ **Argument order:** write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
138
+
137
139
  **When to use it:** for anything that changes a file. Use `editor` rather than `run_commands` for `sed -i`, `echo >`, `> file`, redirect-into-file, or any other shell write.
138
140
 
139
141
  **One at a time, confirmed before the next:** send one `editor` call, run the cheap check (`check_file`, or a `read_files` of the lines you touched if no language server covers that file), and only then send the next. Reads, searches and commands are batched; edits are not, because several edits made together and checked once leave several things to undo and no way to tell which one was wrong.
@@ -92,6 +92,7 @@ An editor for controlled filesystem edits on the text file at the provided path.
92
92
  - Insert: `insert_line` plus `new_text`, which adds text before that line without replacing anything. Use `line_count + 1` to append at EOF. Add `insert_column` to insert *within* that line instead, before the character at that column — this is how you add one missing bracket. Use `line_length + 1` to append at the end of the line.
93
93
  - Create, or replace a file whole: `new_text` alone. When the file does not exist this creates it; when it exists this replaces every line, which is allowed once you have read the file, since reading it is what tells you what you are overwriting. `start_line: 1` with `end_line: <line count>` is the same write by another name. Neither has a size limit, because a file written whole cannot be split — but reach for a whole-file write only once a targeted edit has failed, since a rewrite that is slightly wrong quietly loses the parts you did not mean to touch. Never delete a file to get a clean slate: this call already is one, and a deleted file is simply gone if the turn ends before you write it back.
94
94
 
95
+ Write the arguments in this order: `path` and every other short argument first — line and column numbers, `intent`, `task_progress`, `old_text` — and `new_text` last. The text you are writing is the long part of the call, and whatever is written after a long text is the part most easily left out.
95
96
  Use this rather than a shell command for anything that changes a file. Make one edit at a time and check it before starting the next: reads and searches cost nothing if one turns out to be unnecessary, but several edits made together and checked once leave several things to undo and no way to tell which one was wrong. Read the lines you are about to change before you change them: an edit aimed at a range you have not read in its current state is refused. Your own edits count — one that changes the file's length moves every line below it, so read that region again before editing it a second time. Line numbers taken from an earlier turn, from a task summary, or from a diagnostic issued before your last edit are the ones that go stale. Repeating the lines already in the range and then continuing is how you insert after them, and it is allowed — the range says which lines you mean, so repeating them is your own choice. What is refused is a `new_text` that goes on to repeat lines from *outside* the range: that appends a second copy of text already elsewhere in the file rather than replacing anything, and the refusal names the lines it matched so you can aim the next call at them. Output: a single `{query, result, success, error?}` object for this one edit, where `query` is `edit:<path>` or `insert:<path>` and `result` describes what changed. A failed edit changes nothing: `success` is false, `error` says why, and the file is exactly as it was. Do not resend the same call — `error` names the fix. In particular, text copied out of a `read_files` result must have its `123 | ` line-number gutter removed first.
96
97
 
97
98
  **Do not use `run_commands` for file operations when `read_files`, `editor`, `apply_patch`, `search_codebase`, `list_files`, `check_file`, or `ask_lsp` exist for that purpose.** The shell is for running the program, not for inspecting or changing its source.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: browser-automation
3
+ description: >-
4
+ Drives a real browser through the Playwright MCP server: opening pages,
5
+ clicking, typing, filling forms, uploading files, reading what a page shows
6
+ and what it requested, taking screenshots. Use when the user asks to automate
7
+ a browser task, test a web page or flow end to end, fill in a web form, or
8
+ get content from a page that only renders with JavaScript or behind a login.
9
+ disabled: true
10
+ ---
11
+
12
+ # Browser automation with Playwright
13
+
14
+ This skill uses the tools of the Playwright MCP server. They appear as
15
+ `playwright__browser_navigate`, `playwright__browser_click` and so on, where
16
+ `playwright` is the name the server was added under. The names below leave the
17
+ prefix out.
18
+
19
+ ## Before starting
20
+
21
+ If no `…__browser_navigate` tool is offered, the server is not set up. Tell the
22
+ user to add it under **MCP Servers > Add Local**, where **Playwright** is a
23
+ preset (command `npx`, argument `@playwright/mcp@latest`), then stop. Do not
24
+ try to install it or drive a browser from the shell instead.
25
+
26
+ The first call downloads the server and may download a browser, so it can take
27
+ a minute. If a call reports that the browser is not installed, say so and name
28
+ the command the message gives.
29
+
30
+ ## The loop
31
+
32
+ 1. `browser_navigate` to the URL.
33
+ 2. `browser_snapshot`. It returns the page as an accessibility tree in which
34
+ every element carries a reference. This is how you see the page: it is
35
+ text, it is exact, and it is what the other tools take.
36
+ 3. Act on one element: `browser_click`, `browser_type`, `browser_select_option`,
37
+ `browser_hover`, `browser_press_key`, `browser_file_upload`.
38
+ 4. Read the result the tool returns. Take a new snapshot when the page changed
39
+ and you need references for what is on it now.
40
+
41
+ References belong to the snapshot they came from. After a navigation or any
42
+ change that redraws the page, the old ones are gone: take a new snapshot
43
+ before the next action, never reuse a reference from an earlier one.
44
+
45
+ ## Naming an element
46
+
47
+ Tools that act on an element take two things:
48
+
49
+ - `target`: the element's reference copied exactly from the latest snapshot,
50
+ or a selector that matches one element only.
51
+ - `element`: a short description in plain words ("Submit button"). It is what
52
+ the user is shown when asked to allow the action.
53
+
54
+ Prefer the reference. Use a selector only when the snapshot does not list the
55
+ element, and make it specific enough to match once. A selector that matches
56
+ several elements is refused.
57
+
58
+ ## Forms
59
+
60
+ `browser_fill_form` fills several fields in one call. Each entry needs all of
61
+ `target`, `name`, `type` and `value`. `type` is one of `textbox`, `checkbox`,
62
+ `radio`, `combobox`, `slider`. For a checkbox the value is `true` or `false`;
63
+ for a combobox it is the visible text of the option.
64
+
65
+ Fill, then snapshot and check the values took before submitting. Submit with a
66
+ click on the form's own button, or `browser_type` with `submit: true` on the
67
+ last field.
68
+
69
+ ## Waiting
70
+
71
+ Do not guess with fixed delays. `browser_wait_for` takes `text` (wait until it
72
+ appears), `textGone` (until it disappears) or `time` in seconds as a last
73
+ resort. After a click that loads something, wait for a text that only the
74
+ loaded state shows.
75
+
76
+ ## Reading a page
77
+
78
+ - `browser_snapshot` for what is on the page. `browser_find` searches the
79
+ snapshot for a text or a regular expression when the page is long.
80
+ - `browser_evaluate` runs a function in the page and returns its value. Use it
81
+ to read data the snapshot does not carry, such as a table as rows:
82
+ `() => [...document.querySelectorAll("table tr")].map((r) => [...r.cells].map((c) => c.innerText))`
83
+ - `browser_console_messages` and `browser_network_requests` for what the page
84
+ logged and requested; `browser_network_request` for one request's headers
85
+ and body.
86
+ - `browser_take_screenshot` is for the user to look at, or for a model that
87
+ reads images. You cannot act on a screenshot; act on a snapshot.
88
+
89
+ Large results take a `filename` and are saved to the workspace instead of
90
+ being returned. Use it for a long snapshot or a full-page screenshot.
91
+
92
+ For a whole site as files (pages, stylesheets, scripts, pictures), the
93
+ `web_scrape` tool is the right one when it is offered. Use the browser for
94
+ pages that need a login, a click or a form before they show their content.
95
+
96
+ ## When an action is refused or does nothing
97
+
98
+ 1. Take a new snapshot. The element may have moved, been replaced, or sit
99
+ under a dialog. `browser_handle_dialog` answers an alert or a confirm.
100
+ 2. Check the element is the one you mean: same text, same role.
101
+ 3. Check `browser_tabs`: a link may have opened a new tab, and the tools act on
102
+ the selected one.
103
+ 4. Only then use `browser_run_code_unsafe`. It takes a function,
104
+ `async (page) => { ... }`, and runs it with full access to the machine the
105
+ server is on, not only to the page. Keep the snippet to the one step that
106
+ failed, and await every call in it.
107
+
108
+ ## Finishing
109
+
110
+ - Report what was done and what the page showed at the end, with the URL.
111
+ - `browser_close` when the task is over, so no browser is left open.
112
+ - Never type a password, a card number or a one-time code the user did not
113
+ give you for this task. If a page asks for one, stop and ask.
@@ -344,6 +344,15 @@ export declare class ClineCore {
344
344
  * ```
345
345
  */
346
346
  subscribe(listener: (event: CoreSessionEvent) => void, options?: RuntimeHostSubscribeOptions): () => void;
347
+ /**
348
+ * Whether this instance is subscribed to a session's live events.
349
+ *
350
+ * In hub mode ClineCore subscribes to a session when it starts, sends to,
351
+ * or lists pending prompts for it, and unsubscribes on stop. A client that
352
+ * also observes the hub directly can use this to render one copy of the
353
+ * session's events instead of both.
354
+ */
355
+ hasSessionSubscription(sessionId: string): boolean;
347
356
  /**
348
357
  * Updates the AI model used by an active session.
349
358
  *
@@ -1,3 +1,4 @@
1
1
  export { ClineAccountService, type ClineAccountServiceOptions, } from "./cline-account-service";
2
2
  export { type ClineAccountOperations, executeClineAccountAction, isClineAccountActionRequest, type ProviderActionExecutor, RpcClineAccountService, } from "./rpc";
3
+ export { type ClineAccountTelemetryIdentity, persistClineAccountTelemetryIdentity, resolveClineAccountTelemetryIdentity, } from "./telemetry";
3
4
  export type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, ClineOrganization, ClineSubscriptionPlan, FeaturebaseTokenResponse, UserCurrentPlan, UserRemoteConfigOrganization, UserRemoteConfigResponse, } from "./types";
@@ -0,0 +1,22 @@
1
+ import type { ProviderSettingsManager } from "../services/storage/provider-settings-manager";
2
+ import type { ClineAccountUser } from "./types";
3
+ /** Account identity shared by telemetry and feature-flag integrations. */
4
+ export interface ClineAccountTelemetryIdentity {
5
+ id: string;
6
+ email?: string;
7
+ provider: "cline";
8
+ organizationId?: string;
9
+ organizationName?: string;
10
+ memberId?: string;
11
+ }
12
+ /**
13
+ * Resolve the authenticated user and active organization once so every client
14
+ * applies the same cross-surface account dimensions.
15
+ */
16
+ export declare function resolveClineAccountTelemetryIdentity(user: ClineAccountUser): ClineAccountTelemetryIdentity;
17
+ /**
18
+ * Persist the latest active organization alongside OAuth settings. Detached
19
+ * runtime processes (notably the shared Hub) can then enrich task telemetry
20
+ * without making their own account API request.
21
+ */
22
+ export declare function persistClineAccountTelemetryIdentity(manager: Pick<ProviderSettingsManager, "getProviderSettings" | "saveProviderSettings">, identity: ClineAccountTelemetryIdentity): boolean;
@@ -0,0 +1,122 @@
1
+ import { type AgentMode, type MessageWithMetadata } from "@cerebriline/shared";
2
+ import type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult } from "./repositories";
3
+ type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
4
+ export type CloudSessionRecord = {
5
+ id: string;
6
+ status: string;
7
+ sandboxType?: "standard" | "resumable";
8
+ title?: string;
9
+ sandboxUrl: string;
10
+ repoContext: {
11
+ repoUrl?: string;
12
+ branch?: string;
13
+ };
14
+ metadata: {
15
+ sandboxType?: "standard" | "resumable";
16
+ modelId?: string;
17
+ taskId?: string;
18
+ statusReason?: string;
19
+ provisioningPhase?: CloudProvisioningPhase;
20
+ createRequestTitle?: string;
21
+ cwd?: string;
22
+ };
23
+ expiredAt?: string | null;
24
+ lastActivityAt?: string;
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ };
28
+ export type CloudProvisioningPhase = "provisioning" | "cloning_repo" | "agent_starting" | "ready" | "failed";
29
+ export declare function deriveCloudSessionTitle(prompt: string): string;
30
+ export type CreateCloudSessionInput = {
31
+ sandboxType?: "standard" | "resumable";
32
+ /** Stable client-planned id for single-flighting one chat's start request. */
33
+ requestId?: string;
34
+ modelId: string;
35
+ repoUrl: string;
36
+ initialPrompt?: string;
37
+ branch?: string;
38
+ autoApproveTools?: boolean;
39
+ thinking?: boolean;
40
+ reasoningEffort?: "low" | "medium" | "high" | "xhigh";
41
+ mode?: AgentMode;
42
+ workspaceRelativePath?: string;
43
+ /** Null explicitly selects Personal; controllers resolve an omitted scope. */
44
+ organizationId?: string | null;
45
+ /** Host persistence hooks; never serialized into the provisioning request. */
46
+ handoff?: {
47
+ sourceSessionId: string;
48
+ resolveMessages: () => Promise<MessageWithMetadata[]>;
49
+ /** Persist dispatch intent after successful recovery lookup, before POST. */
50
+ onCreating: () => void | Promise<void>;
51
+ onOuterSessionCreated: (sessionId: string, context?: {
52
+ created: boolean;
53
+ }) => Promise<void>;
54
+ onOuterSessionRemoved?: (sessionId: string) => Promise<void>;
55
+ onSeeding?: () => void | Promise<void>;
56
+ };
57
+ };
58
+ export type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult, CloudRepositoryOption, } from "./repositories";
59
+ export type CloudSessionApiOptions = {
60
+ apiBaseUrl: string;
61
+ appBaseUrl: string;
62
+ getAuthToken: () => Promise<string | undefined>;
63
+ fetch?: FetchLike;
64
+ createTimeoutMs?: number;
65
+ };
66
+ export type CloudErrorCode = "authentication_required" | "github_not_connected" | "session_not_found" | "session_expired" | "session_failed" | "request_failed";
67
+ export declare class CloudSessionError extends Error {
68
+ readonly code: CloudErrorCode;
69
+ readonly detail: string;
70
+ readonly connectUrl?: string | undefined;
71
+ /** HTTP status of the failed request, when one was received. */
72
+ readonly status?: number | undefined;
73
+ constructor(code: CloudErrorCode, detail: string, connectUrl?: string | undefined,
74
+ /** HTTP status of the failed request, when one was received. */
75
+ status?: number | undefined);
76
+ }
77
+ /** The fresh handoff POST definitely did not create a workspace. Marker/list
78
+ * failures and ambiguous transport outcomes deliberately never use this type. */
79
+ export declare class CloudHandoffCreationRejectedError extends Error {
80
+ constructor(cause: unknown);
81
+ }
82
+ export declare function parseCloudProvisioningPhase(value: unknown): CloudProvisioningPhase | undefined;
83
+ export declare class CloudSessionApi {
84
+ private readonly options;
85
+ private readonly apiBaseUrl;
86
+ private readonly appBaseUrl;
87
+ private readonly fetchImpl;
88
+ private readonly createTimeoutMs;
89
+ private readonly unconfirmedHandoffCreates;
90
+ private readonly completedHandoffCreates;
91
+ constructor(options: CloudSessionApiOptions);
92
+ private request;
93
+ list(organizationId?: string): Promise<CloudSessionRecord[]>;
94
+ private listWithToken;
95
+ listRepositories(organizationId?: string): Promise<CloudRepositoryListResult>;
96
+ listBranches(repositoryId: number, organizationId?: string, options?: CloudBranchListOptions): Promise<CloudBranchListResult>;
97
+ status(sessionId: string, options?: {
98
+ authToken?: string;
99
+ signal?: AbortSignal;
100
+ }): Promise<{
101
+ sessionId?: string;
102
+ status?: string;
103
+ phase?: CloudProvisioningPhase;
104
+ statusReason?: string;
105
+ }>;
106
+ create(input: CreateCloudSessionInput): Promise<{
107
+ sessionId: string;
108
+ status: string;
109
+ sandboxUrl: string;
110
+ cleanupAuthToken: string;
111
+ }>;
112
+ private persistHandoffOuterSession;
113
+ waitUntilReady(sessionId: string, signal: AbortSignal, onStatus?: (status: {
114
+ phase?: CloudProvisioningPhase;
115
+ }) => void): Promise<void>;
116
+ resume(sessionId: string, signal?: AbortSignal): Promise<CloudSessionRecord>;
117
+ delete(sessionId: string, authToken?: string): Promise<void>;
118
+ private deleteWithAuth;
119
+ updateTitle(sessionId: string, title: string): Promise<CloudSessionRecord>;
120
+ /** Raw archived snapshot; null distinguishes a missing archive from []. */
121
+ history(sessionId: string): Promise<unknown[] | null>;
122
+ }
@@ -0,0 +1,172 @@
1
+ import type { BasicLogger, MessageWithMetadata, ToolApprovalResult } from "@cerebriline/shared";
2
+ import { NodeHubClient } from "../hub/client/index";
3
+ import { type CloudSessionApi, CloudSessionError, type CloudSessionRecord, type CreateCloudSessionInput } from "./api";
4
+ import { type CloudModel } from "./models";
5
+ import type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult } from "./repositories";
6
+ import type { CloudCreationOptions, CloudHandoffSeed, CloudSessionAttachment, CloudSessionEvent, CloudSessionSnapshot, CloudSessionState, JsonRecord } from "./types";
7
+ /** The seed command was not dispatched; the host may clear its seed marker. */
8
+ export declare class CloudHandoffSeedRejectedError extends Error {
9
+ constructor(cause: unknown);
10
+ }
11
+ /** A queued prompt may have been accepted even when recovery also fails. */
12
+ export declare class CloudQueueUnconfirmedError extends CloudSessionError {
13
+ constructor();
14
+ }
15
+ export declare class CloudHandoffSeedUnsupportedError extends Error {
16
+ constructor();
17
+ }
18
+ type CloudHubClient = Pick<NodeHubClient, "command" | "connect" | "dispose" | "getClientId" | "subscribe">;
19
+ export type CloudSessionControllerOptions = {
20
+ logger?: BasicLogger;
21
+ clientIdentity?: {
22
+ prefix: string;
23
+ type: string;
24
+ displayName: string;
25
+ source: string;
26
+ };
27
+ /** Desktop preserves its historical cleanup; CLI keeps late successful creations recoverable. */
28
+ lateCreateDisposition?: "preserve" | "delete";
29
+ /** Host-owned first-task policy survives controller replacement; established tasks never qualify. */
30
+ pendingInitialTasks?: Map<string, CloudCreationOptions>;
31
+ api: Pick<CloudSessionApi, "create" | "resume" | "delete" | "list" | "status" | "waitUntilReady" | "history" | "updateTitle" | "listRepositories" | "listBranches">;
32
+ getAuthToken: () => Promise<string | undefined>;
33
+ apiBaseUrl: string;
34
+ getActiveOrganizationId?: (options?: {
35
+ fresh?: boolean;
36
+ }) => Promise<string | undefined>;
37
+ createHubClient?: (options: ConstructorParameters<typeof NodeHubClient>[0]) => CloudHubClient;
38
+ };
39
+ export declare function isCloudOuterSessionId(sessionId: string): boolean;
40
+ export declare function cloudSessionToDiscoveryRecord(record: CloudSessionRecord): JsonRecord;
41
+ export declare class CloudSessionController {
42
+ private readonly options;
43
+ private readonly sessionGenerations;
44
+ private readonly sessions;
45
+ private readonly approvals;
46
+ private readonly listeners;
47
+ private readonly detachedSessions;
48
+ private readonly restoredOptions;
49
+ private readonly authoritativeMessages;
50
+ private readonly streamingMessages;
51
+ private disposed;
52
+ private readonly connections;
53
+ private readonly connectionPromises;
54
+ private readonly knownSessions;
55
+ private readonly unlistedSessions;
56
+ private readonly pendingInitialTasks;
57
+ private lastListedSessions;
58
+ private discoveryRefresh?;
59
+ private readonly unconfirmedInnerCreates;
60
+ private readonly createRequests;
61
+ private readonly provisioningControllers;
62
+ private readonly sendAbortTokens;
63
+ private readonly titleWrites;
64
+ private readonly deletingSessions;
65
+ private readonly createHubClient;
66
+ constructor(options: CloudSessionControllerOptions);
67
+ /** Restores only pre-creation settings; never mutates a running Hub session's policy. */
68
+ restoreCreationOptions(sessionId: string, options: CloudCreationOptions): void;
69
+ protected seedSessionState(sessionId: string, state: CloudSessionState): void;
70
+ private stateFromRecord;
71
+ getSnapshot(sessionId: string): CloudSessionSnapshot | undefined;
72
+ subscribe(listener: (event: CloudSessionEvent) => void, sessionId?: string): () => void;
73
+ private publish;
74
+ private publishSnapshot;
75
+ private readonly snapshotTimers;
76
+ private cancelScheduledSnapshot;
77
+ private scheduleSnapshot;
78
+ private notify;
79
+ private applyLiveEvent;
80
+ respondApproval(sessionId: string, approvalId: string, result: ToolApprovalResult): Promise<void>;
81
+ /** Detaches this viewer and invalidates waiting sends without stopping or deleting remote work. */
82
+ detach(sessionId: string): Promise<void>;
83
+ isCloudSession(sessionId: string): boolean;
84
+ /** Returns a session this process already created or discovered without
85
+ * making account/environment availability a prerequisite for opening it. */
86
+ getCachedDiscoveryRecord(sessionId: string): JsonRecord | undefined;
87
+ /** Revalidates a cached row by id when the active-scope list does not include it. */
88
+ getCrossScopeDiscoveryRecord(sessionId: string): Promise<JsonRecord | undefined>;
89
+ list(): Promise<CloudSessionRecord[]>;
90
+ handoffTargetExists(sessionId: string): Promise<boolean>;
91
+ private preserveConnectedRuntimeModel;
92
+ private resolveActiveOrganizationId;
93
+ listRepositories(): Promise<CloudRepositoryListResult>;
94
+ listModels(): Promise<CloudModel[]>;
95
+ /** Validates account auth and GitHub access before provisioning a handoff. */
96
+ prepareHandoffRepository(repoUrl: string): Promise<{
97
+ organizationId?: string;
98
+ }>;
99
+ listBranches(repositoryId: number, options?: CloudBranchListOptions): Promise<CloudBranchListResult>;
100
+ listForDiscovery(options?: {
101
+ timeoutMs?: number;
102
+ }): Promise<JsonRecord[]>;
103
+ create(input: CreateCloudSessionInput): Promise<CloudSessionAttachment>;
104
+ private trackProvisioningController;
105
+ private abortProvisioningControllers;
106
+ /** Waits for an adopted pending handoff target before opening its Hub proxy. */
107
+ waitUntilReady(outerSessionId: string): Promise<void>;
108
+ /** Seeds an already-provisioned outer session when retrying a pending handoff. */
109
+ seedHandoff(outerSessionId: string, seed: CloudHandoffSeed): Promise<{
110
+ innerSessionId: string;
111
+ }>;
112
+ verifyHandoffTranscript(outerSessionId: string, expected: readonly MessageWithMetadata[], options?: {
113
+ allowAppendedMessages?: boolean;
114
+ }): Promise<void>;
115
+ private createOnce;
116
+ private deleteProvisionedSessionAfterDispose;
117
+ attach(outerSessionId: string, creationOptions?: CloudCreationOptions): Promise<CloudSessionAttachment>;
118
+ send(outerSessionId: string, prompt: string, requestedDelivery?: "queue" | "steer", modelId?: string, userImages?: string[]): Promise<{
119
+ sessionId: string;
120
+ ok: true;
121
+ queued?: boolean;
122
+ recoveredAfterDisconnect?: boolean;
123
+ status?: string;
124
+ result?: unknown;
125
+ }>;
126
+ private updateModel;
127
+ private applyModel;
128
+ private rehydrateAfterTransportDrop;
129
+ private performTransportRehydration;
130
+ abort(outerSessionId: string): Promise<{
131
+ sessionId: string;
132
+ ok: true;
133
+ }>;
134
+ pendingPrompts(outerSessionId: string): Promise<JsonRecord>;
135
+ updatePendingPrompt(outerSessionId: string, promptId: string, changes: {
136
+ prompt?: string;
137
+ delivery?: "queue" | "steer";
138
+ }): Promise<JsonRecord>;
139
+ removePendingPrompt(outerSessionId: string, promptId: string): Promise<JsonRecord>;
140
+ private queueCommand;
141
+ private applyQueueSnapshot;
142
+ readMessages(outerSessionId: string): Promise<unknown[]>;
143
+ updateTitle(outerSessionId: string, title: string): Promise<void>;
144
+ delete(outerSessionId: string): Promise<void>;
145
+ dispose(): Promise<void>;
146
+ private attachExpired;
147
+ private loadArchivedMessages;
148
+ private refreshKnownSession;
149
+ private ensureKnownSession;
150
+ private assertSessionActive;
151
+ private ensureConnection;
152
+ private resolveInnerSession;
153
+ private restoreSavedInnerSession;
154
+ private assertHandoffConnectionReusable;
155
+ private createInnerSession;
156
+ private adoptExistingHandoffSession;
157
+ private createInnerSessionOnce;
158
+ private handleEvent;
159
+ private forwardEvent;
160
+ private handleApprovalRequested;
161
+ private storePendingApproval;
162
+ private removeApproval;
163
+ private clearPendingApprovals;
164
+ private sendApprovalSnapshot;
165
+ private ensureAttached;
166
+ private subscribeToInnerSession;
167
+ private applySessionModel;
168
+ private disposeConnection;
169
+ /** Stop reconnecting when the sandbox is unavailable, not when lookup fails. */
170
+ private disposeConnectionIfSessionGone;
171
+ }
172
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Experimental cloud execution client. No local runtime or tool execution is initialized. */
2
+ export * from "../services/cloud-handoff";
3
+ export * from "./api";
4
+ export * from "./controller";
5
+ export * from "./models";
6
+ export * from "./repositories";
7
+ export * from "./snapshots";
8
+ export { normalizeSessionTitle, resolveSessionListTitle, stringifyMessageContent, } from "./state";
9
+ export * from "./types";