@letta-ai/letta-code 0.34.64 → 0.34.65

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.
package/letta.js CHANGED
@@ -6139,7 +6139,7 @@ var package_default;
6139
6139
  var init_package = __esm(() => {
6140
6140
  package_default = {
6141
6141
  name: "@letta-ai/letta-code",
6142
- version: "0.34.64",
6142
+ version: "0.34.65",
6143
6143
  lettaStartupLogProtocol: 1,
6144
6144
  lettaConfigDirProtocol: 1,
6145
6145
  description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -90321,7 +90321,7 @@ If you come across a reference to something you do not currently have any inform
90321
90321
  ## Working across time
90322
90322
  To act across time, you must create future invocations explicitly. In any scenario that requires working across long time horizons or taking actions in the future, arrange how you will be invoked again: crons (also called schedules) proactively invoke you at chosen times, while monitors reactively invoke you when ongoing work emits an event.
90323
90323
 
90324
- Use Monitor when work already in progress can signal a result you need to act on, such as pull request checks and reviews, deployments, background services, or long-running jobs. Use Wake for a future turn in the current conversation. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90324
+ When you are waiting for something to happen, such as pull request checks and reviews, a deployment, a background service, or a long-running job, use Monitor: it brings you back when the thing happens. Use Wake only when there is an explicit time condition, such as a reminder or a follow-up at a set time, or when no monitor is possible. Never use a wake to poll for something a monitor could watch. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90325
90325
 
90326
90326
  You **MUST** be proactive in arranging the appropriate future invocation when work continues beyond the current turn. Do not wait for the user to notice and return with the result.
90327
90327
 
@@ -90503,7 +90503,7 @@ If you come across a reference to something you do not currently have any inform
90503
90503
  ## Working across time
90504
90504
  To act across time, you must create future invocations explicitly. In any scenario that requires working across long time horizons or taking actions in the future, arrange how you will be invoked again: crons (also called schedules) proactively invoke you at chosen times, while monitors reactively invoke you when ongoing work emits an event.
90505
90505
 
90506
- Use Monitor when work already in progress can signal a result you need to act on, such as pull request checks and reviews, deployments, background services, or long-running jobs. Use Wake for a future turn in the current conversation. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90506
+ When you are waiting for something to happen, such as pull request checks and reviews, a deployment, a background service, or a long-running job, use Monitor: it brings you back when the thing happens. Use Wake only when there is an explicit time condition, such as a reminder or a follow-up at a set time, or when no monitor is possible. Never use a wake to poll for something a monitor could watch. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90507
90507
 
90508
90508
  You **MUST** be proactive in arranging the appropriate future invocation when work continues beyond the current turn. Do not wait for the user to notice and return with the result.
90509
90509
 
@@ -90619,7 +90619,7 @@ You can have multiple concurrent conversations. Memory is shared across all of t
90619
90619
 
90620
90620
  To act across time, you must create future invocations explicitly. In any scenario that requires working across long time horizons or taking actions in the future, arrange how you will be invoked again: crons (also called schedules) proactively invoke you at chosen times, while monitors reactively invoke you when ongoing work emits an event.
90621
90621
 
90622
- Use Monitor when work already in progress can signal a result you need to act on, such as pull request checks and reviews, deployments, background services, or long-running jobs. Use Wake for a future turn in the current conversation. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90622
+ When you are waiting for something to happen, such as pull request checks and reviews, a deployment, a background service, or a long-running job, use Monitor: it brings you back when the thing happens. Use Wake only when there is an explicit time condition, such as a reminder or a follow-up at a set time, or when no monitor is possible. Never use a wake to poll for something a monitor could watch. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90623
90623
 
90624
90624
  You **MUST** be proactive in arranging the appropriate future invocation when work continues beyond the current turn. Do not wait for the user to notice and return with the result.
90625
90625
 
@@ -90838,7 +90838,7 @@ If you come across a reference to something you do not currently have any inform
90838
90838
  ## Working across time
90839
90839
  To act across time, you must create future invocations explicitly. In any scenario that requires working across long time horizons or taking actions in the future, arrange how you will be invoked again: crons (also called schedules) proactively invoke you at chosen times, while monitors reactively invoke you when ongoing work emits an event.
90840
90840
 
90841
- Use Monitor when work already in progress can signal a result you need to act on, such as pull request checks and reviews, deployments, background services, or long-running jobs. Use Wake for a future turn in the current conversation. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90841
+ When you are waiting for something to happen, such as pull request checks and reviews, a deployment, a background service, or a long-running job, use Monitor: it brings you back when the thing happens. Use Wake only when there is an explicit time condition, such as a reminder or a follow-up at a set time, or when no monitor is possible. Never use a wake to poll for something a monitor could watch. Use \`letta cron\` when you need another conversation, runner, or computer, or need to inspect run history or replace a schedule. Do **NOT** commit to actions beyond the current session without arranging a future invocation.
90842
90842
 
90843
90843
  You **MUST** be proactive in arranging the appropriate future invocation when work continues beyond the current turn. Do not wait for the user to notice and return with the result.
90844
90844
 
@@ -203369,7 +203369,7 @@ var init_mcp_client = __esm(() => {
203369
203369
  init_streamableHttp();
203370
203370
  DEFAULT_CLIENT_INFO = {
203371
203371
  name: "letta-code",
203372
- version: "0.34.64"
203372
+ version: "0.34.65"
203373
203373
  };
203374
203374
  });
203375
203375
 
@@ -207652,7 +207652,7 @@ Usage notes:
207652
207652
  var init_AskUserQuestion = () => {};
207653
207653
 
207654
207654
  // src/tools/descriptions/Bash.md
207655
- var Bash_default = "Executes a shell command and returns its output.\n\n- Each Bash call starts from the conversation's current working directory. A `cd` affects only that command and does not change the directory used by later tool calls. To change the working directory for later tool calls, use `SetWorkingDirectory`. For a one-off command elsewhere, use an absolute path or an option such as `git -C /path/to/repo status`.\n- IMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed. Use Read, Edit and Write for file operations instead. Quote paths that contain spaces.\n- Command output is displayed to you, not reliably to the user.\n- `timeout` is in milliseconds. Without it, commands run until they exit; foreground timeouts max out at 600000.\n- If the output exceeds 30000 characters, you receive only the first 2000 characters plus the path of a file containing the full output. A failed command whose output exceeds 10000 characters returns a head-and-tail excerpt plus that file path. Read or search that file when you need the rest instead of re-running the command.\n- Commands still running after a brief wait continue in the background automatically: you receive a task ID and one completion notification. Do not predict command duration, set `run_in_background` merely because a command may be slow, or poll for completion. Set `run_in_background` only when you want the task ID immediately; no `&` needed.\n- Foreground `sleep` is blocked. To be notified once when a condition is true, run a command that exits then, e.g. `until grep -q \"Ready\" dev.log; do sleep 0.5; done`. For one notification per event, use Monitor.\n- Run independent commands as parallel tool calls; chain dependent ones with `&&`.\n\n# Git\n- Interactive flags (`-i`, e.g. `git rebase -i`, `git add -i`) are not supported in this environment.\n- Use the `gh` CLI for GitHub operations (PRs, issues, API).\n- GitHub notifies the owner of any `@name` written in a PR, issue, or comment. Write a bare `@name` only for a real login you mean to notify. Put roles, placeholders, and code (`@human`, `@reviewer`, `@types/node`) in backticks or drop the `@`.\n- Commit or push only when the user asks. Do not amend, skip hooks, force-push, or run other destructive git commands unless the user asks; if a pre-commit hook fails, fix the issue and create a new commit.\n- Pass commit messages and PR bodies as single-quoted strings with embedded newlines. Do not wrap them in `$(...)` or backticks. End commit messages with:\n{{COMMIT_TRAILER}}\n<example>\ngit commit -m 'Commit message here.\n\n{{COMMIT_TRAILER}}'\n</example>\n- Passing `gh pr checks` does not mean GitHub will merge the PR — unresolved review threads and still-pending required checks leave the merge state BLOCKED. If WatchPR is available and you will follow the PR toward merge, start it on the PR URL, and call the PR ready, green, or mergeable only once WatchPR reports it merge-ready.\n";
207655
+ var Bash_default = "Executes a shell command and returns its output.\n\n- Each Bash call starts from the conversation's current working directory. A `cd` affects only that command and does not change the directory used by later tool calls. To change the working directory for later tool calls, use `SetWorkingDirectory`. For a one-off command elsewhere, use an absolute path or an option such as `git -C /path/to/repo status`.\n- IMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed. Use Read, Edit and Write for file operations instead. Quote paths that contain spaces.\n- Command output is displayed to you, not reliably to the user.\n- `timeout` is in milliseconds. Without it, commands run until they exit; foreground timeouts max out at 600000.\n- If the output exceeds 30000 characters, you receive only the first 2000 characters plus the path of a file containing the full output. A failed command whose output exceeds 10000 characters returns a head-and-tail excerpt plus that file path. Read or search that file when you need the rest instead of re-running the command.\n- Commands still running after a brief wait continue in the background automatically: you receive a task ID and one completion notification. Do not predict command duration, set `run_in_background` merely because a command may be slow, or poll for completion. Set `run_in_background` only when you want the task ID immediately; no `&` needed.\n- Foreground `sleep` is blocked. To wait for a condition, use Monitor.\n- Run independent commands as parallel tool calls; chain dependent ones with `&&`.\n\n# Git\n- Interactive flags (`-i`, e.g. `git rebase -i`, `git add -i`) are not supported in this environment.\n- Use the `gh` CLI for GitHub operations (PRs, issues, API).\n- GitHub notifies the owner of any `@name` written in a PR, issue, or comment. Write a bare `@name` only for a real login you mean to notify. Put roles, placeholders, and code (`@human`, `@reviewer`, `@types/node`) in backticks or drop the `@`.\n- Commit or push only when the user asks. Do not amend, skip hooks, force-push, or run other destructive git commands unless the user asks; if a pre-commit hook fails, fix the issue and create a new commit.\n- Pass commit messages and PR bodies as single-quoted strings with embedded newlines. Do not wrap them in `$(...)` or backticks. End commit messages with:\n{{COMMIT_TRAILER}}\n<example>\ngit commit -m 'Commit message here.\n\n{{COMMIT_TRAILER}}'\n</example>\n- Passing `gh pr checks` does not mean GitHub will merge the PR — unresolved review threads and still-pending required checks leave the merge state BLOCKED. If WatchPR is available and you will follow the PR toward merge, start it on the PR URL, and call the PR ready, green, or mergeable only once WatchPR reports it merge-ready.\n";
207656
207656
  var init_Bash = () => {};
207657
207657
 
207658
207658
  // src/tools/descriptions/CodeMode.md
@@ -207743,7 +207743,34 @@ Do not use this tool for root memory files (already loaded) or skills/ (use Skil
207743
207743
  var init_Memory = () => {};
207744
207744
 
207745
207745
  // src/tools/descriptions/Monitor.md
207746
- var Monitor_default = 'Start a background monitor that streams events from a long-running script. Each stdout line is an event — you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you\'re waiting for the user to answer a question.\n\nUse Monitor when you need one notification per occurrence: indefinitely ("every time an ERROR line appears": `tail -f`, `inotifywait -m`, `while true`), or until a known end ("each CI step result, stop when the run completes": a command that emits lines and then exits). For a single notification ("tell me when the server is ready"), run a command that exits when the condition is true, e.g. `until grep -q "Ready" dev.log; do sleep 0.5; done`, in the background with your shell tool; you get one completion notification. An unbounded command used for a single notification stays armed until timeout, and `tail -f log | grep -m 1 ...` can hang the same way.\n\nFor open github.com pull requests, use WatchPR instead. It covers the whole PR surface and keeps watching after CI finishes. Use Monitor only when WatchPR does not apply.\n\n- Every pipe stage must flush per line or matches sit in its buffer unseen: `grep` needs `--line-buffered`, `awk` needs `fflush()`. `| head -N` delivers nothing until N matches accumulate.\n- In poll loops, handle transient failures (`curl ... || true`). Poll remote APIs every 30s+, local checks every 0.5–1s.\n- Only stdout is the event stream. Stderr goes to the output file named in the result, without notifications; merge it with `2>&1` for commands you run directly so failures reach your filter.\n- Every stdout line is a conversation message, so filter to the lines you\'d act on. Lines within 200ms are batched into one notification. Monitors that produce too many events are stopped automatically; restart with a tighter filter.\n\n**Coverage — silence is not success.** When watching a job for an outcome, your filter must match every terminal state, not just the happy path. A monitor that greps only for the success marker stays silent through a crashloop, a hung process, or an unexpected exit — and silence looks identical to "still running." Match failures too, e.g. `grep -E --line-buffered "elapsed_steps=|Traceback|Error|FAILED|Killed|OOM"`, and in poll loops emit on every terminal status (`succeeded|failed|cancelled|timeout`).\n\nExit ends the watch (exit code is reported). Timeout → killed. Set `persistent: true` for session-length watches (log tails, long-lived event streams). In managed Cloud sandboxes, every monitor, including persistent ones, stops after {{MONITOR_MAX_TIMEOUT}} (this sandbox\'s monitor cap); elsewhere persistent monitors run until TaskStop or session end. Call Monitor again to re-arm it if you still need to watch. For much longer Cloud waits, schedule a Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter monitors. Use TaskStop to cancel early.\n\nWhen someone is waiting on the result, set `backup_after_seconds` (e.g. 900). If the monitor goes that long without an event, a durable Wake brings you back to check the real state, so a queued, hung, or dead watch can\'t leave them waiting in silence.\n\nInstead of `command`, `ws` streams each WebSocket text frame as an event (prefer it over `websocat`), and `script` runs a JavaScript watch loop with CodeMode\'s globals plus `emit(text)` and `sleep(ms)`; `decide()` spends money on every call, so call it only when an observed change needs judgment.\n\nPass `resume` with a paused monitor id to restart it with its saved arguments.\n';
207746
+ var Monitor_default = `Start a background monitor that streams events from a long-running script. Each stdout line is an event — you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you're waiting for the user to answer a question.
207747
+
207748
+ Use Monitor whenever you are waiting for something to happen. Wake is only for an explicit time condition, or when no monitor is possible.
207749
+
207750
+ Pick the command by how many notifications you need:
207751
+ - One ("tell me when the server is ready"): a command that exits when the condition is true, e.g. \`until grep -q "Ready" dev.log; do sleep 0.5; done\`. You are notified when it exits.
207752
+ - One per occurrence, indefinitely ("every time an ERROR line appears"): an unbounded command (\`tail -f\`, \`inotifywait -m\`, \`while true\`).
207753
+ - One per occurrence, until a known end ("each CI step result, stop when the run completes"): a command that emits lines and then exits.
207754
+
207755
+ An unbounded command used for a single notification stays armed until timeout, and \`tail -f log | grep -m 1 ...\` can hang the same way.
207756
+
207757
+ For open github.com pull requests, use WatchPR instead. It covers the whole PR surface and keeps watching after CI finishes. Use Monitor only when WatchPR does not apply.
207758
+
207759
+ - Every pipe stage must flush per line or matches sit in its buffer unseen: \`grep\` needs \`--line-buffered\`, \`awk\` needs \`fflush()\`. \`| head -N\` delivers nothing until N matches accumulate.
207760
+ - In poll loops, handle transient failures (\`curl ... || true\`). Poll remote APIs every 30s+, local checks every 0.5–1s.
207761
+ - Only stdout is the event stream. Stderr goes to the output file named in the result, without notifications; merge it with \`2>&1\` for commands you run directly so failures reach your filter.
207762
+ - Every stdout line is a conversation message, so filter to the lines you'd act on. Lines within 200ms are batched into one notification. Monitors that produce too many events are stopped automatically; restart with a tighter filter.
207763
+
207764
+ **Coverage — silence is not success.** When watching a job for an outcome, your filter must match every terminal state, not just the happy path. A monitor that greps only for the success marker stays silent through a crashloop, a hung process, or an unexpected exit — and silence looks identical to "still running." Match failures too, e.g. \`grep -E --line-buffered "elapsed_steps=|Traceback|Error|FAILED|Killed|OOM"\`, and in poll loops emit on every terminal status (\`succeeded|failed|cancelled|timeout\`).
207765
+
207766
+ Exit ends the watch (exit code is reported). Timeout → killed. Set \`persistent: true\` for session-length watches (log tails, long-lived event streams). In managed Cloud sandboxes, every monitor, including persistent ones, stops after {{MONITOR_MAX_TIMEOUT}} (this sandbox's monitor cap); elsewhere persistent monitors run until TaskStop or session end. Call Monitor again to re-arm it if you still need to watch. For much longer Cloud waits, schedule a Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter monitors. Use TaskStop to cancel early.
207767
+
207768
+ Set \`backup_after_seconds\` (e.g. 900) as the durable fallback when someone is waiting on the result. If the monitor goes that long without an event, a durable Wake brings you back to check the real state, so a queued, hung, or dead watch can't leave them waiting in silence.
207769
+
207770
+ Instead of \`command\`, \`ws\` streams each WebSocket text frame as an event (prefer it over \`websocat\`), and \`script\` runs a JavaScript watch loop with CodeMode's globals plus \`emit(text)\` and \`sleep(ms)\`; \`decide()\` spends money on every call, so call it only when an observed change needs judgment.
207771
+
207772
+ Pass \`resume\` with a paused monitor id to restart it with its saved arguments.
207773
+ `;
207747
207774
  var init_Monitor = () => {};
207748
207775
 
207749
207776
  // src/tools/descriptions/Read.md
@@ -207866,23 +207893,23 @@ var ViewImage_default = `View a local image file from the filesystem when visual
207866
207893
  var init_ViewImage = () => {};
207867
207894
 
207868
207895
  // src/tools/descriptions/Wake.md
207869
- var Wake_default = "Schedule a future turn for the current conversation. Wake is the durable, time-based counterpart to Monitor: use Monitor when ongoing work can emit an event, and Wake when you need to act at a future time even if nothing emits one.\n\nWake is always self-bound. It cannot target another agent, conversation, or computer.\n\n- `create`: provide `name`, `prompt`, and exactly one of `after_seconds`, `scheduled_at`, or `cron`.\n- `list`: list active and paused wakes for this conversation.\n- `cancel`: provide the `id` returned by create or list.\n\nWrite `prompt` as a note to your future self, not a script: what you are waiting on, what you planned and why, and what to check before acting. When the wake fires, the situation or people's wishes may have changed since you wrote it.\n\nUse `after_seconds` for ordinary follow-ups. `scheduled_at` must be RFC 3339 with `Z` or an explicit UTC offset. `cron` is a recurring five-field UTC expression and cannot run more often than hourly. For calendar requests such as \"tomorrow at 9am,\" resolve the time in the user's timezone (inferred from context), pass an explicit offset, and state the timezone you used.\n\nFor schedules targeting other conversations or computers, load the `scheduling-tasks` skill.\n";
207896
+ var Wake_default = "Schedule a future turn for the current conversation at a time you choose.\n\nDo not use Wake to wait for something to happen. If you can check for the condition (a job finishing, a deploy landing, a file or reply appearing), use Monitor: it brings you back when the thing happens, while a wake fires at a time you guessed, which is either too early or later than necessary. Never use a wake to poll.\n\nUse Wake only when:\n- there is an explicit time condition: a reminder, a follow-up at a set time, a recurring check-in; or\n- no monitor is possible, because nothing you can check would show the change.\n\nWake is always self-bound. It cannot target another agent, conversation, or computer.\n\n- `create`: provide `name`, `prompt`, and exactly one of `after_seconds`, `scheduled_at`, or `cron`.\n- `list`: list active and paused wakes for this conversation.\n- `cancel`: provide the `id` returned by create or list.\n\nWrite `prompt` as a note to your future self, not a script: what you are waiting on, what you planned and why, and what to check before acting. When the wake fires, the situation or people's wishes may have changed since you wrote it.\n\nUse `after_seconds` for follow-ups after a delay. `scheduled_at` must be RFC 3339 with `Z` or an explicit UTC offset. `cron` is a recurring five-field UTC expression and cannot run more often than hourly. For calendar requests such as \"tomorrow at 9am,\" resolve the time in the user's timezone (inferred from context), pass an explicit offset, and state the timezone you used.\n\nFor schedules targeting other conversations or computers, load the `scheduling-tasks` skill.\n";
207870
207897
  var init_Wake = () => {};
207871
207898
 
207872
207899
  // src/tools/descriptions/WatchPR.md
207873
- var WatchPR_default = `Watch one open github.com pull request until it merges, closes, is stopped with TaskStop, or the session ends.
207900
+ var WatchPR_default = `Watch one open github.com PR until merge, close, TaskStop or timeout; local watches also stop at session end.
207874
207901
 
207875
- In managed Cloud sandboxes, WatchPR also stops after {{MONITOR_MAX_TIMEOUT}} (this sandbox's monitor cap) and sends a timeout notification. Call WatchPR again to re-arm it if you still need to watch. For much longer waits, use Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter watches. Local watches have no duration limit.
207902
+ In managed Cloud, WatchPR stops after {{MONITOR_MAX_TIMEOUT}} (the monitor cap) and sends a timeout notification. Call WatchPR again to re-arm it if you still need to watch. For much longer waits, use Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter watches. Outside managed Cloud, local watches have no duration limit.
207876
207903
 
207877
207904
  Use WatchPR instead of writing a Monitor or shell polling loop when you need ongoing notifications about a PR: checks, comments, reviews, review threads, pushes, conflicts, merge state, merge, and close. Start at most one watch per PR.
207878
207905
 
207879
- The initial result includes current blockers and changes since the previous watch ended for the same agent, conversation, and PR, when a locally saved snapshot is at most seven days old. The first snapshot is never merge-ready: readiness requires a second consecutive read on the same head, so \`awaiting a second same-head readiness read\` is expected at startup. Later changes arrive as task notifications in this conversation. It uses the locally authenticated \`gh\` CLI and keeps watching after checks become green because reviews, comments, conflicts, and new pushes can still arrive. Green checks are not the same as a mergeable PR, so report the PR as ready, green, or mergeable only once the watcher reports it merge-ready.
207906
+ The initial result includes current blockers. Local watches also compare a saved snapshot up to seven days old. The first snapshot is never merge-ready: readiness requires a second consecutive read on the same head, so \`awaiting a second same-head readiness read\` is expected at startup. Later changes arrive as task notifications in this conversation. Cloud watches run remotely when enabled; others poll locally via the Cloud GitHub integration or \`gh\`. It keeps watching green PRs for feedback, conflicts and pushes. Green checks are not the same as a mergeable PR, so report the PR as ready, green, or mergeable only once the watcher reports it merge-ready.
207880
207907
 
207881
207908
  Pass a URL ending at the PR number, such as \`https://github.com/owner/repo/pull/123\`. Remove \`/files\`, \`/commits\`, \`/checks\`, and other suffixes. The watcher is read-only and errors if the PR is already merged or closed.
207882
207909
 
207883
- Use \`notify_on\` to limit PR notifications (for example \`["merged", "closed", "conflict"]\` or \`["checks_done"]\`); watcher errors still report. For several PRs, start one watch per URL. Workflow run URLs (\`https://github.com/owner/repo/actions/runs/123\`) report status changes and completion with conclusion and failed jobs/steps, including runs without a PR. Reruns remain a separate action.
207910
+ Use \`notify_on\` to limit PR notifications (for example \`["merged", "closed", "conflict"]\` or \`["checks_done"]\`); watcher errors still report. Workflow run URLs (\`https://github.com/owner/repo/actions/runs/123\`) report status changes and completion with conclusion and failed jobs/steps, including runs without a PR. Reruns remain a separate action.
207884
207911
 
207885
- Pass \`resume\` with a paused monitor id to restart it with its saved arguments.
207912
+ Pass \`resume\` with a local paused monitor id to restart it; a cloud id returns status only, without replaying a PR snapshot. Cloud watches continue between sessions.
207886
207913
  `;
207887
207914
  var init_WatchPR = () => {};
207888
207915
 
@@ -208672,6 +208699,12 @@ var init_manager = __esm(() => {
208672
208699
  init_settings_manager();
208673
208700
  ENABLED_TOGGLE_VALUES = new Set(["1", "true", "yes"]);
208674
208701
  EXPERIMENT_DEFINITIONS = [
208702
+ {
208703
+ id: "cloud_watch_pr",
208704
+ label: "Cloud WatchPR",
208705
+ description: "Run pull request watches in Cloud instead of polling locally.",
208706
+ envVar: "LETTA_CLOUD_WATCH_PR"
208707
+ },
208675
208708
  {
208676
208709
  id: "cloud_monitors",
208677
208710
  label: "Cloud monitors",
@@ -217185,7 +217218,26 @@ var init_subagent_tool_policy = __esm(() => {
217185
217218
  });
217186
217219
 
217187
217220
  // src/tools/descriptions/MonitorCloud.md
217188
- var MonitorCloud_default = 'Start a background monitor that streams events from a public http(s) URL. Each change to the HTTP status or body is an event — you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you\'re waiting for the user to answer a question.\n\nUse Monitor when you need one notification per occurrence: until the timeout ("every time the status changes"), or until a known end ("each CI step result, stop when the run completes": use `match` with `stop_on_match: true`). For a single notification ("tell me when the server is ready"), use `match` with `stop_on_match: true`.\n\nFor open github.com pull requests, use WatchPR instead. It covers the whole PR surface and keeps watching after CI finishes. Use Monitor only when WatchPR does not apply.\n\n- Cloud polls the URL with GET every 60s by default. Set `interval_seconds` to 60 or more. The first response is the baseline; by default, it notifies only when the HTTP status or body changes.\n- Use `select` to compare one JSON field instead of the whole body, and `match` to be notified when it reaches a value, with `stop_on_match` to finish after that. The first response is checked against `match` too, so a pipeline that already finished notifies right away. A value that keeps matching does not notify again.\n- Every event is a conversation message, so filter to the events you\'d act on.\n\n**Coverage — silence is not success.** When watching a job for an outcome, your filter must match every terminal state, not just the happy path. A monitor that matches only the success marker stays silent through a crashloop, a hung process, or an unexpected exit — and silence looks identical to "still running." Match failures too, e.g. `select: "0.status"`, `match: {"equals": ["success", "failed", "canceled"]}`, `stop_on_match: true`.\n\nA match ends the watch when `stop_on_match` is true. Timeout → killed. Set `timeout_ms` for longer watches; the default is 24 hours and the maximum is 7 days. Call Monitor again to re-arm it if you still need to watch. For much longer Cloud waits, schedule a Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter monitors. Use TaskStop to cancel early.\n\nWhen someone is waiting on the result, schedule a Wake or cron to check the real state, so a queued, hung, or dead watch can\'t leave them waiting in silence.\n\nFor an authenticated API, pass `headers` that reference agent secrets as `$NAME`, the same as in shell commands: `{"PRIVATE-TOKEN": "$GITLAB_TOKEN"}`. Cloud fills them in on every poll, so the token is never written into the monitor.\n';
217221
+ var MonitorCloud_default = `Start a background monitor that streams events from a public http(s) URL. Each change to the HTTP status or body is an event — you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you're waiting for the user to answer a question.
217222
+
217223
+ Use Monitor whenever you are waiting for something to happen that a URL can show. Wake is only for an explicit time condition, or when no monitor is possible.
217224
+
217225
+ Use Monitor when you need one notification per occurrence: until the timeout ("every time the status changes"), or until a known end ("each CI step result, stop when the run completes": use \`match\` with \`stop_on_match: true\`). For a single notification ("tell me when the server is ready"), use \`match\` with \`stop_on_match: true\`.
217226
+
217227
+ For open github.com pull requests, use WatchPR instead. It covers the whole PR surface and keeps watching after CI finishes. Use Monitor only when WatchPR does not apply.
217228
+
217229
+ - Cloud polls the URL with GET every 60s by default. Set \`interval_seconds\` to 60 or more. The first response is the baseline; by default, it notifies only when the HTTP status or body changes.
217230
+ - Use \`select\` to compare one JSON field instead of the whole body, and \`match\` to be notified when it reaches a value, with \`stop_on_match\` to finish after that. The first response is checked against \`match\` too, so a pipeline that already finished notifies right away. A value that keeps matching does not notify again.
217231
+ - Every event is a conversation message, so filter to the events you'd act on.
217232
+
217233
+ **Coverage — silence is not success.** When watching a job for an outcome, your filter must match every terminal state, not just the happy path. A monitor that matches only the success marker stays silent through a crashloop, a hung process, or an unexpected exit — and silence looks identical to "still running." Match failures too, e.g. \`select: "0.status"\`, \`match: {"equals": ["success", "failed", "canceled"]}\`, \`stop_on_match: true\`.
217234
+
217235
+ A match ends the watch when \`stop_on_match\` is true. Timeout → killed. Set \`timeout_ms\` for longer watches; the default is 24 hours and the maximum is 7 days. Call Monitor again to re-arm it if you still need to watch. For much longer Cloud waits, schedule a Wake or cron (which does not keep the sandbox running between turns) and combine it with shorter monitors. Use TaskStop to cancel early.
217236
+
217237
+ When someone is waiting on the result, schedule a Wake or cron to check the real state, so a queued, hung, or dead watch can't leave them waiting in silence.
217238
+
217239
+ For an authenticated API, pass \`headers\` that reference agent secrets as \`$NAME\`, the same as in shell commands: \`{"PRIVATE-TOKEN": "$GITLAB_TOKEN"}\`. Cloud fills them in on every poll, so the token is never written into the monitor.
217240
+ `;
217189
217241
  var init_MonitorCloud = () => {};
217190
217242
 
217191
217243
  // src/tools/schemas/MonitorCloud.json
@@ -226008,7 +226060,7 @@ var init_manager2 = __esm(() => {
226008
226060
  "Workflow"
226009
226061
  ]);
226010
226062
  SCOPED_BACKGROUND_TOOLS = new Set(["Monitor", "Workflow", "CodeMode"]);
226011
- TOOL_CALL_ID_TOOLS = new Set(["Task", "Skill", "Monitor"]);
226063
+ TOOL_CALL_ID_TOOLS = new Set(["Task", "Skill", "Monitor", "WatchPR"]);
226012
226064
  FILE_MUTATING_TOOLS = new Set(["Edit", "Write"]);
226013
226065
  ARTIFACT_TOOL_NAMES = [
226014
226066
  "read_artifact_file",
@@ -240616,7 +240668,7 @@ class CodexAppServerClient {
240616
240668
  await this.request("initialize", {
240617
240669
  clientInfo: {
240618
240670
  name: "letta-code",
240619
- version: "0.34.64"
240671
+ version: "0.34.65"
240620
240672
  },
240621
240673
  capabilities: null
240622
240674
  });
@@ -245149,7 +245201,7 @@ async function fetchParentConversationMessages(params) {
245149
245201
  }
245150
245202
  return messages.reverse();
245151
245203
  }
245152
- function contentText2(content) {
245204
+ function contentText3(content) {
245153
245205
  if (typeof content === "string")
245154
245206
  return content;
245155
245207
  if (!Array.isArray(content))
@@ -245175,7 +245227,7 @@ function renderToolCall(call) {
245175
245227
  }
245176
245228
  function renderToolResult(result3) {
245177
245229
  const raw2 = result3.tool_return ?? result3.func_response;
245178
- const text2 = typeof raw2 === "string" ? raw2 : contentText2(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
245230
+ const text2 = typeof raw2 === "string" ? raw2 : contentText3(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
245179
245231
  return {
245180
245232
  type: "tool_result",
245181
245233
  call_id: result3.tool_call_id ?? undefined,
@@ -245211,11 +245263,11 @@ function userEvents(text2, speaker) {
245211
245263
  function renderMessage(message2) {
245212
245264
  switch (message2.message_type) {
245213
245265
  case "user_message": {
245214
- const text2 = contentText2(message2.content).replace(SYSTEM_REMINDER_PATTERN, "").trim();
245266
+ const text2 = contentText3(message2.content).replace(SYSTEM_REMINDER_PATTERN, "").trim();
245215
245267
  return userEvents(text2, message2.name ?? undefined);
245216
245268
  }
245217
245269
  case "assistant_message": {
245218
- const text2 = contentText2(message2.content).trim();
245270
+ const text2 = contentText3(message2.content).trim();
245219
245271
  return text2 ? [
245220
245272
  {
245221
245273
  type: "message",
@@ -249617,6 +249669,10 @@ function createGitHubPullRequestSnapshotFetcher(deps = {}) {
249617
249669
  continue;
249618
249670
  }
249619
249671
  if (entry?.inaccessible) {
249672
+ if (!hasSnapshot && deps.allowInaccessibleFallback) {
249673
+ unsupported = true;
249674
+ return fetchGh(ref, options);
249675
+ }
249620
249676
  throw new Error(`Cloud could not access ${ref.url}`);
249621
249677
  }
249622
249678
  if (!entry?.snapshot) {
@@ -249916,6 +249972,96 @@ var init_github_workflow_run = __esm(() => {
249916
249972
  init_github_pull_request_cloud();
249917
249973
  });
249918
249974
 
249975
+ // src/tools/impl/watch-pr-cloud.ts
249976
+ async function startCloudPullRequestWatch(args, deps = {}) {
249977
+ const resuming = Boolean(args.resume && isCloudMonitorId(args.resume));
249978
+ if (args.resume && !resuming)
249979
+ return;
249980
+ const enabled = deps.enabled ?? (() => experimentManager.isEnabled("cloud_watch_pr") && isManagedCloudRuntime() && resolveBackendMode() === "api" && isCloudServerUrl());
249981
+ if (!resuming && !enabled())
249982
+ return;
249983
+ if (!resuming && args.url?.includes("/actions/runs/"))
249984
+ return;
249985
+ const scope = resolveNotificationScope(args.parentScope);
249986
+ if (!scope || scope.conversationId === "default")
249987
+ return;
249988
+ const path32 = `/v1/conversations/${encodeURIComponent(scope.conversationId)}/cloud-monitors`;
249989
+ const request4 = deps.request ?? apiRequest;
249990
+ if (resuming) {
249991
+ const record5 = await request4("GET", `${path32}/${encodeURIComponent(args.resume ?? "")}`, undefined, actingUserRequestOptions(scope.actingUserId));
249992
+ if (record5.source.type !== "github_pull_request")
249993
+ throw new Error("Use Monitor for this cloud monitor.");
249994
+ const { owner, repo, number: number6 } = record5.source;
249995
+ return {
249996
+ content: [
249997
+ {
249998
+ type: "text",
249999
+ text: `WatchPR ${record5.id} is ${record5.status}. Cloud watches continue between sessions; start a new watch after it stops.`
250000
+ }
250001
+ ],
250002
+ taskId: record5.id,
250003
+ url: `https://github.com/${owner}/${repo}/pull/${number6}`,
250004
+ headSha: "",
250005
+ persistent: false
250006
+ };
250007
+ }
250008
+ if (typeof args.url !== "string")
250009
+ throw new Error("WatchPR url is required");
250010
+ const ref = parseGitHubPullRequestUrl(args.url);
250011
+ let created;
250012
+ try {
250013
+ created = await request4("POST", path32, {
250014
+ description: `PR ${ref.owner}/${ref.repo}#${ref.number} checks, reviews, and mergeability`,
250015
+ source: {
250016
+ type: "github_pull_request",
250017
+ owner: ref.owner,
250018
+ repo: ref.repo,
250019
+ number: ref.number,
250020
+ ...args.notify_on && { notify_on: args.notify_on }
250021
+ },
250022
+ timeout_ms: getMonitorMaxTimeoutMs(),
250023
+ ...args.toolCallId && { tool_call_id: args.toolCallId }
250024
+ }, actingUserRequestOptions(scope.actingUserId));
250025
+ } catch (error4) {
250026
+ if (error4 instanceof ApiRequestError && error4.status === 400) {
250027
+ let body3 = {};
250028
+ try {
250029
+ body3 = JSON.parse(error4.responseText);
250030
+ } catch {}
250031
+ if (body3.errorCode === "REPOSITORY_INACCESSIBLE" || body3.errorCode === "CLOUD_WATCH_PR_DISABLED")
250032
+ return;
250033
+ }
250034
+ throw error4;
250035
+ }
250036
+ const initial2 = toClientSnapshot(ref, created.initial_snapshot);
250037
+ return {
250038
+ content: [
250039
+ {
250040
+ type: "text",
250041
+ text: `WatchPR started (task ${created.id}). You will be notified on PR events. It stops when the PR merges/closes, on TaskStop, or at its timeout. Keep working — do not poll or sleep.
250042
+
250043
+ Current state:
250044
+ ${describeGitHubPullRequestSnapshot(initial2)}`
250045
+ }
250046
+ ],
250047
+ taskId: created.id,
250048
+ url: ref.url,
250049
+ headSha: initial2.headSha,
250050
+ persistent: false
250051
+ };
250052
+ }
250053
+ var init_watch_pr_cloud = __esm(() => {
250054
+ init_request();
250055
+ init_server_url();
250056
+ init_backend_mode();
250057
+ init_manager();
250058
+ init_task_notifications();
250059
+ init_github_pull_request_cloud();
250060
+ init_github_pull_request_watch();
250061
+ init_monitor_timeout();
250062
+ init_monitor_url_cloud();
250063
+ });
250064
+
249919
250065
  // src/tools/impl/watch-pr.ts
249920
250066
  import { createHash as createHash12, randomUUID as randomUUID48 } from "node:crypto";
249921
250067
  import {
@@ -250005,6 +250151,9 @@ ${text2}`;
250005
250151
  }
250006
250152
  }
250007
250153
  async function watch_pr(args, deps = {}) {
250154
+ const cloud = await startCloudPullRequestWatch(args);
250155
+ if (cloud)
250156
+ return cloud;
250008
250157
  const resumeRecord = args.resume ? await readResumableMonitor(args.resume, args.parentScope) : undefined;
250009
250158
  if (resumeRecord) {
250010
250159
  if (resumeRecord.kind !== "github_pull_request")
@@ -250024,7 +250173,9 @@ async function watch_pr(args, deps = {}) {
250024
250173
  const ref = isRun ? parseGitHubWorkflowRunUrl(args.url) : parseGitHubPullRequestUrl(args.url);
250025
250174
  const describe2 = isRun ? describeWorkflowRun : describeGitHubPullRequestSnapshot;
250026
250175
  const cwd2 = getCurrentWorkingDirectory();
250027
- const fetchSnapshot = deps.fetchSnapshot ?? (isRun ? createGitHubWorkflowRunFetcher() : createGitHubPullRequestSnapshotFetcher());
250176
+ const fetchSnapshot = deps.fetchSnapshot ?? (isRun ? createGitHubWorkflowRunFetcher() : createGitHubPullRequestSnapshotFetcher({
250177
+ allowInaccessibleFallback: experimentManager.isEnabled("cloud_watch_pr") && isManagedCloudRuntime()
250178
+ }));
250028
250179
  const runtimeContext = getRuntimeContext();
250029
250180
  const parentScope = args.parentScope ?? (runtimeContext?.agentId ? {
250030
250181
  agentId: runtimeContext.agentId,
@@ -250285,6 +250436,7 @@ Output file: ${outputFile}`
250285
250436
  var WATCH_POLL_MS = 30000, WATCH_MAX_POLL_MS, WATCH_FRESH_SNAPSHOT_NOTIFY_AFTER_MS;
250286
250437
  var init_watch_pr = __esm(() => {
250287
250438
  init_monitors();
250439
+ init_manager();
250288
250440
  init_runtime_context();
250289
250441
  init_secret_substitution();
250290
250442
  init_settings_path();
@@ -250299,6 +250451,7 @@ var init_watch_pr = __esm(() => {
250299
250451
  init_monitor_state();
250300
250452
  init_monitor_timeout();
250301
250453
  init_process_manager();
250454
+ init_watch_pr_cloud();
250302
250455
  WATCH_MAX_POLL_MS = 5 * 60000;
250303
250456
  WATCH_FRESH_SNAPSHOT_NOTIFY_AFTER_MS = 30 * 60000;
250304
250457
  });
@@ -446720,12 +446873,12 @@ function rowToolCalls(row, index, diagnostics2) {
446720
446873
  }
446721
446874
  return calls;
446722
446875
  }
446723
- function contentText3(content) {
446876
+ function contentText4(content) {
446724
446877
  if (typeof content === "string") {
446725
446878
  if (content.startsWith(CONTENT_JSON_PREFIX)) {
446726
446879
  const encoded = content.slice(CONTENT_JSON_PREFIX.length);
446727
446880
  try {
446728
- return contentText3(JSON.parse(encoded));
446881
+ return contentText4(JSON.parse(encoded));
446729
446882
  } catch {
446730
446883
  return encoded;
446731
446884
  }
@@ -446811,7 +446964,7 @@ var init_hermes = __esm(() => {
446811
446964
  });
446812
446965
  };
446813
446966
  if (row.role === "user") {
446814
- const content = contentText3(row.content);
446967
+ const content = contentText4(row.content);
446815
446968
  if (content) {
446816
446969
  emit({
446817
446970
  type: "message",
@@ -446831,7 +446984,7 @@ var init_hermes = __esm(() => {
446831
446984
  ...timestamp ? { timestamp } : {}
446832
446985
  });
446833
446986
  }
446834
- const content = contentText3(row.content);
446987
+ const content = contentText4(row.content);
446835
446988
  if (content) {
446836
446989
  emit({
446837
446990
  type: "message",
@@ -446854,7 +447007,7 @@ var init_hermes = __esm(() => {
446854
447007
  if (row.role === "tool") {
446855
447008
  emit({
446856
447009
  type: "tool_result",
446857
- content: contentText3(row.content),
447010
+ content: contentText4(row.content),
446858
447011
  ...typeof row.tool_call_id === "string" && row.tool_call_id ? { callId: row.tool_call_id } : {},
446859
447012
  ...timestamp ? { timestamp } : {}
446860
447013
  });
@@ -537425,4 +537578,4 @@ function registerBunOAuthFlows() {
537425
537578
  registerBunOAuthFlows();
537426
537579
  await init_src5().then(() => exports_src2);
537427
537580
 
537428
- //# debugId=E9010BF867CFE3EB64756E2164756E21
537581
+ //# debugId=070ABAF64C8E926164756E2164756E21
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.64",
3
+ "version": "0.34.65",
4
4
  "lockfileVersion": 3,
5
5
  "packages": {
6
6
  "node_modules/@alcalzone/ansi-tokenize": {
@@ -5087,7 +5087,7 @@
5087
5087
  },
5088
5088
  "": {
5089
5089
  "name": "@letta-ai/letta-code",
5090
- "version": "0.34.64",
5090
+ "version": "0.34.65",
5091
5091
  "dependencies": {
5092
5092
  "@cursor/sdk": "1.1.0",
5093
5093
  "@earendil-works/pi-ai": "^1.5.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.64",
3
+ "version": "0.34.65",
4
4
  "lettaStartupLogProtocol": 1,
5
5
  "lettaConfigDirProtocol": 1,
6
6
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -35,7 +35,7 @@
35
35
  "src/settings-manager.ts": 2092,
36
36
  "src/tools/manager.ts": 2582,
37
37
  "src/tools/tool-execution-context.test.ts": 1025,
38
- "src/types/protocol_v2.ts": 2409,
38
+ "src/types/protocol_v2.ts": 2402,
39
39
  "src/websocket/listen-client-concurrency.test.ts": 2519,
40
40
  "src/websocket/listen-client-protocol.test.ts": 5664,
41
41
  "src/websocket/listener/commands/memory.ts": 1114,