replicas-engine 0.1.1484 → 0.1.1486

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.
@@ -8,12 +8,12 @@ import {
8
8
  listCodexModelsForDetails,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-QZ43VWR7.js";
12
- import "./chunk-YXCKKNQQ.js";
13
- import "./chunk-MBKXXNBY.js";
14
- import "./chunk-6ZBLFVDT.js";
11
+ } from "./chunk-G4ELW4DF.js";
12
+ import "./chunk-GTSY6K43.js";
13
+ import "./chunk-CZWLDQGX.js";
14
+ import "./chunk-HWGDTBWL.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-LF5H4WKL.js";
16
+ import "./chunk-34WRZFGY.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -11459,6 +11459,7 @@ var ENGINE_PORT = 3737;
11459
11459
  var DESKTOP_STREAM_PORT = 6080;
11460
11460
  var DEVICES_DIR = ".ssh/replicas-devices";
11461
11461
  var DEVICE_SCREEN_FILE_SUFFIX = ".screen.json";
11462
+ var LOCAL_CONTROL_FILE_PREFIX = "desktop-";
11462
11463
 
11463
11464
  // ../shared/src/git.ts
11464
11465
  var GIT_CREDENTIAL_HELPER_FILENAME = ".git-credential-replicas";
@@ -13471,8 +13472,83 @@ var LINEAR_ABILITY = {
13471
13472
  referenceFile: { name: "LINEAR.md", content: REFERENCE7 }
13472
13473
  };
13473
13474
 
13475
+ // ../shared/src/default-skills/replicas-agent/abilities/local-computer.ts
13476
+ var SECTION8 = `### The user's computer
13477
+ Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices.
13478
+
13479
+ **Reference:** \`references/LOCAL-COMPUTER.md\`
13480
+
13481
+ Use this when:
13482
+ - A task needs macOS, Xcode, the iOS Simulator, or hardware, files, or accounts that only the user's computer has
13483
+ - The user asks you to run something "on my computer", "locally", or "on my Mac"`;
13484
+ var REFERENCE8 = `# The user's computer
13485
+
13486
+ Your instructions list the computers you can reach and how: \`ssh <name>\`, \`scp\` and \`rsync\` work as usual. If none are listed, the user hasn't set any up: point them to **Local control** under Dashboard \u2192 Personal \u2192 Preferences \u2192 Experimental, with the Replicas desktop app open on that computer.
13487
+
13488
+ It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (opening apps, booting a simulator window, changing settings).
13489
+
13490
+ ## Running commands
13491
+
13492
+ Other workspaces can reach the same computer at the same time, so keep everything you create (code, build output, logs, screenshots) under \`~/replicas/<ws>\`, where \`<ws>\` is this workspace's \`$REPLICAS_WORKSPACE_ID\`. The examples below use that folder.
13493
+
13494
+
13495
+ - Quote the remote command in single quotes so the workspace shell doesn't expand it: \`ssh mac 'cd ~/replicas/<ws>/app && make'\`. For multi-line scripts, pipe a heredoc into \`bash -s\`, since the login shell is often zsh:
13496
+ \`\`\`bash
13497
+ ssh mac 'bash -s' <<'EOF'
13498
+ set -euo pipefail
13499
+ cd ~/replicas/<ws>/app
13500
+ xcodebuild -version
13501
+ EOF
13502
+ \`\`\`
13503
+ - Commands run as the user in their home directory, with their login shell's \`PATH\` (Homebrew included) and no terminal. Anything that prompts hangs or fails: \`sudo\` needs a password, so use \`sudo -n\` and ask the user to run the command themselves if it refuses. Check a tool exists (\`command -v xcbeautify\`) before relying on it, and ask before installing one.
13504
+ - Each new connection takes a few seconds. Batch related commands into one \`ssh\` call, or share one connection across calls:
13505
+ \`\`\`bash
13506
+ ssh -o ControlMaster=auto -o ControlPath=/tmp/ssh-%C -o ControlPersist=10m mac true
13507
+ ssh -o ControlPath=/tmp/ssh-%C mac 'xcrun simctl list devices booted'
13508
+ \`\`\`
13509
+ - A command stops when its connection drops. For a build or job that runs longer than your tool's timeout, start it detached with a log, then poll the log:
13510
+ \`\`\`bash
13511
+ ssh mac 'cd ~/replicas/<ws>/app && nohup xcodebuild build -scheme App > ~/replicas/<ws>/build.log 2>&1 & echo $!'
13512
+ ssh mac 'tail -n 20 ~/replicas/<ws>/build.log; kill -0 <pid> 2>/dev/null && echo running'
13513
+ \`\`\`
13514
+ A plain \`&\` without \`nohup\` dies with the connection.
13515
+ - Through the desktop app, \`ssh -L\` and \`ssh -R\` port forwarding are refused. To reach a service running there, run the client there too (\`ssh mac 'curl -s localhost:3000/health'\`).
13516
+
13517
+ ## Moving code and files
13518
+
13519
+ The user's computer doesn't have this workspace's checkout. Sync it into a folder of your own, never over the user's own clones unless they ask:
13520
+
13521
+ \`\`\`bash
13522
+ rsync -az --delete --exclude node_modules --exclude .build --exclude DerivedData ./ mac:replicas/<ws>/<repo>/
13523
+ \`\`\`
13524
+
13525
+ Run the build there, then copy back what you need (logs, \`.xcresult\` bundles, screenshots) with \`scp\` or \`rsync\`. Edit code in the workspace and sync again, so the change stays in the workspace's git checkout.
13526
+
13527
+ ## Xcode and the iOS Simulator (macOS)
13528
+
13529
+ \`\`\`bash
13530
+ ssh mac 'xcodebuild -version; xcrun simctl list runtimes; xcrun simctl list devices available'
13531
+ \`\`\`
13532
+
13533
+ - No runtime listed means no simulators: ask before running \`xcodebuild -downloadPlatform iOS\` (several GB).
13534
+ - Build with \`-quiet\` and your own \`-derivedDataPath ~/replicas/<ws>/DerivedData\`, so the output stays readable and the user's own builds aren't touched. Pipe through \`xcbeautify\` only if it's installed.
13535
+ - \`xcrun simctl boot <udid>\` runs a simulator without opening its window. Install and launch with \`xcrun simctl install booted <App.app>\` and \`xcrun simctl launch booted <bundle id>\`, then screenshot with \`xcrun simctl io booted screenshot ~/replicas/<ws>/sim.png\` and copy it back to share it with \`replicas media upload\`. Shut down simulators you booted when you're done.
13536
+
13537
+ ## When it fails
13538
+
13539
+ - \`ssh\` closes straight away, such as "Connection closed by UNKNOWN port 65535": for a desktop app computer, the app isn't running there or local control is off. Ask the user to open the app.
13540
+ - "Operation not permitted" on the user's files: macOS is blocking the app. Ask the user to allow Replicas under System Settings \u2192 Privacy & Security \u2192 Full Disk Access.
13541
+ `;
13542
+ var LOCAL_COMPUTER_ABILITY = {
13543
+ label: "User's computer",
13544
+ description: "Run commands, builds and simulators on the user's own Mac or Linux computer over `ssh`.",
13545
+ bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator",
13546
+ section: SECTION8,
13547
+ referenceFile: { name: "LOCAL-COMPUTER.md", content: REFERENCE8 }
13548
+ };
13549
+
13474
13550
  // ../shared/src/default-skills/replicas-agent/abilities/media.ts
13475
- var SECTION8 = `### Media
13551
+ var SECTION9 = `### Media
13476
13552
  Deliver screenshots, GIFs, screen recordings, generated diagrams, and audio clips to the Replicas dashboard and, when applicable, inline in the destination workflow.
13477
13553
 
13478
13554
  **Reference:** \`references/MEDIA.md\`
@@ -13483,7 +13559,7 @@ Use this when:
13483
13559
  - You need to show motion or an interaction (an animation, a popup that moves, a flow) in a PR or message: make a short looping GIF with \`replicas media gif\`, never a grid of frames
13484
13560
  - You record video output (browser automation, screen capture) \u2014 including the recommended aspect ratio and FPS
13485
13561
  - You need to embed media in a Slack/Linear/GitHub/GitLab message AND keep a referenceable copy in the Replicas dashboard`;
13486
- var REFERENCE8 = `# Media (Screenshots, GIFs, Recordings, Audio)
13562
+ var REFERENCE9 = `# Media (Screenshots, GIFs, Recordings, Audio)
13487
13563
 
13488
13564
  This is the single source of truth for delivering screenshots, GIFs, screen recordings, generated diagrams, and audio clips through Replicas and external surfaces (Slack, Linear, GitHub, GitLab). HTML pages are visuals: publish them with \`replicas visualize\` (see \`replicas visualize --help\`), not \`media upload\`.
13489
13565
 
@@ -13855,12 +13931,12 @@ var MEDIA_ABILITY = {
13855
13931
  label: "Media",
13856
13932
  description: "Deliver media to Replicas and destination workflows with inline uploads.",
13857
13933
  bullet: "- Producing or showing the user any media \u2014 screenshots, screen recordings, generated images or diagrams, or audio clips \u2014 including in your Replicas chat reply, PR descriptions/comments, and other external platforms. Paste the printed `![\u2026](\u2026)` embeds in your chat reply, never only dashboard links, and upload the file itself to Slack, Linear, or GitLab. To show motion, turn the recording into a short GIF with `replicas media gif` instead of a grid of frames",
13858
- section: SECTION8,
13859
- referenceFile: { name: "MEDIA.md", content: REFERENCE8 }
13934
+ section: SECTION9,
13935
+ referenceFile: { name: "MEDIA.md", content: REFERENCE9 }
13860
13936
  };
13861
13937
 
13862
13938
  // ../shared/src/default-skills/replicas-agent/abilities/previews.ts
13863
- var SECTION9 = `### Previews
13939
+ var SECTION10 = `### Previews
13864
13940
  Expose locally running services (web apps, APIs, databases) as public preview URLs so humans can interact with them directly.
13865
13941
 
13866
13942
  **Reference:** \`references/PREVIEWS.md\`
@@ -13870,7 +13946,7 @@ Use this when:
13870
13946
  - The task involves UI work that benefits from human review
13871
13947
  - You are verifying frontend/backend integrations visually
13872
13948
  - You need a URL for OAuth redirects, GitHub App callbacks, or webhooks (never the sandbox's \`*.e2b.app\` address)`;
13873
- var REFERENCE9 = `# Preview URLs
13949
+ var REFERENCE10 = `# Preview URLs
13874
13950
 
13875
13951
  When you run services on ports \u2014 such as a web app, API server, or database \u2014 humans may want to interact with them directly. You can expose your locally running services as public preview URLs.
13876
13952
 
@@ -13959,12 +14035,12 @@ var PREVIEWS_ABILITY = {
13959
14035
  label: "Previews",
13960
14036
  description: "Expose locally running services on public preview URLs for humans.",
13961
14037
  bullet: "- Creating preview URLs for locally running services, including OAuth redirect, app callback, and webhook URLs (never a raw `*.e2b.app` address)",
13962
- section: SECTION9,
13963
- referenceFile: { name: "PREVIEWS.md", content: REFERENCE9 }
14038
+ section: SECTION10,
14039
+ referenceFile: { name: "PREVIEWS.md", content: REFERENCE10 }
13964
14040
  };
13965
14041
 
13966
14042
  // ../shared/src/default-skills/replicas-agent/abilities/plugins.ts
13967
- var SECTION10 = `### Plugins
14043
+ var SECTION11 = `### Plugins
13968
14044
  Discover and execute installed marketplace tools through the workspace-scoped TypeScript SDK.
13969
14045
 
13970
14046
  **Reference:** \`references/PLUGINS.md\`
@@ -13983,7 +14059,7 @@ Use this when:
13983
14059
  - The user asks to read, triage, label, or draft replies to LinkedIn messages through Kondo
13984
14060
  - The user asks to query Sazabi logs, investigate Sazabi issues, or ask the Sazabi agent about production
13985
14061
  - The user asks to analyze text with Pangram`;
13986
- var REFERENCE10 = `# Plugins
14062
+ var REFERENCE11 = `# Plugins
13987
14063
 
13988
14064
  Plugins are TypeScript libraries, not MCP servers. Import \`@replicas/sdk\`; Replicas authenticates the workspace and uses the connection from the most specific environment in the workspace's fork chain. Provider credentials, sessions, and project keys are never exposed.
13989
14065
 
@@ -14189,12 +14265,12 @@ var PLUGINS_ABILITY = {
14189
14265
  label: "Plugins",
14190
14266
  description: "Use installed marketplace tools through @replicas/sdk.",
14191
14267
  bullet: "- Interacting with installed marketplace plugins through TypeScript",
14192
- section: SECTION10,
14193
- referenceFile: { name: "PLUGINS.md", content: REFERENCE10 }
14268
+ section: SECTION11,
14269
+ referenceFile: { name: "PLUGINS.md", content: REFERENCE11 }
14194
14270
  };
14195
14271
 
14196
14272
  // ../shared/src/default-skills/replicas-agent/abilities/replicas.ts
14197
- var SECTION11 = `### Replicas (in-workspace CLI)
14273
+ var SECTION12 = `### Replicas (in-workspace CLI)
14198
14274
  Take action *with* Replicas itself \u2014 manage automations, environments (variables, files), repos, and \`replicas.json\` config \u2014 using the pre-installed, pre-authenticated \`replicas\` CLI.
14199
14275
 
14200
14276
  **Reference:** \`references/REPLICAS.md\`
@@ -14206,7 +14282,7 @@ Use this when:
14206
14282
  - The user asks "what envs / repos / automations do I have?"
14207
14283
  - The user asks you to scaffold a \`replicas.json\` / \`replicas.yaml\` in a repo
14208
14284
  - You need to run a long-lived service (dev server, daemon) \u2014 always use \`replicas service start\` so it survives workspace sleep/wake`;
14209
- var REFERENCE11 = `# Replicas (in-workspace CLI)
14285
+ var REFERENCE12 = `# Replicas (in-workspace CLI)
14210
14286
 
14211
14287
  This guide covers how to take action *with* Replicas itself from inside a Replicas workspace \u2014 managing automations, environments (and their variables/files), repos, previews, and the user's \`replicas.json\` config \u2014 using the pre-installed \`replicas\` CLI.
14212
14288
 
@@ -14486,13 +14562,13 @@ var REPLICAS_ABILITY = {
14486
14562
  label: "Replicas",
14487
14563
  description: "Teach the agent about Replicas itself \u2014 automations, environments, the in-workspace CLI.",
14488
14564
  bullet: "- Getting a secret, API key, or token you don't have from the user: run `replicas environment vars request <KEY>...`, which shows them a form. Never ask for the value in chat or tell them to add it in settings.",
14489
- section: SECTION11,
14490
- referenceFile: { name: "REPLICAS.md", content: REFERENCE11 },
14565
+ section: SECTION12,
14566
+ referenceFile: { name: "REPLICAS.md", content: REFERENCE12 },
14491
14567
  locked: true
14492
14568
  };
14493
14569
 
14494
14570
  // ../shared/src/default-skills/replicas-agent/abilities/sentry.ts
14495
- var SECTION12 = `### Sentry
14571
+ var SECTION13 = `### Sentry
14496
14572
  Read issues and project data through the workspace-scoped TypeScript SDK.
14497
14573
 
14498
14574
  **Reference:** \`references/SENTRY.md\`
@@ -14501,7 +14577,7 @@ Use this when:
14501
14577
  - A user shares a Sentry link (sentry.io or a self-hosted Sentry server)
14502
14578
  - You need to inspect Sentry projects or issues
14503
14579
  - A user asks for error-monitoring context outside a webhook-triggered task`;
14504
- var REFERENCE12 = `# Sentry Integration
14580
+ var REFERENCE13 = `# Sentry Integration
14505
14581
 
14506
14582
  Use \`@replicas/sdk\`; never request or read a Sentry token. Sentry access is organization-scoped and read-only.
14507
14583
 
@@ -14532,8 +14608,8 @@ var SENTRY_ABILITY = {
14532
14608
  label: "Sentry",
14533
14609
  description: "Read Sentry projects and issues through @replicas/sdk.",
14534
14610
  bullet: "- Interacting with Sentry (reading projects, issues, and error context, including any Sentry issue link the user shares): use replicas.sentry.request from @replicas/sdk. Read references/SENTRY.md to turn an issue link into API paths.",
14535
- section: SECTION12,
14536
- referenceFile: { name: "SENTRY.md", content: REFERENCE12 }
14611
+ section: SECTION13,
14612
+ referenceFile: { name: "SENTRY.md", content: REFERENCE13 }
14537
14613
  };
14538
14614
 
14539
14615
  // ../shared/src/memory.ts
@@ -14541,11 +14617,11 @@ var HISTORY_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/history`;
14541
14617
  var HISTORY_INDEX_FILENAME = "INDEX.md";
14542
14618
 
14543
14619
  // ../shared/src/default-skills/replicas-agent/abilities/session-history.ts
14544
- var SECTION13 = `### Session history
14620
+ var SECTION14 = `### Session history
14545
14621
  Search past agent sessions in this organization when the user refers to prior work, a date, a teammate's session, or "last time".
14546
14622
 
14547
14623
  **Reference:** \`references/SESSION-HISTORY.md\``;
14548
- var REFERENCE13 = `# Session history
14624
+ var REFERENCE14 = `# Session history
14549
14625
 
14550
14626
  Past sessions are installed under \`${HISTORY_ROOT}\`:
14551
14627
 
@@ -14574,8 +14650,8 @@ var SESSION_HISTORY_ABILITY = {
14574
14650
  label: "Session history",
14575
14651
  description: "Search past agent sessions in this organization.",
14576
14652
  bullet: "",
14577
- section: SECTION13,
14578
- referenceFile: { name: "SESSION-HISTORY.md", content: REFERENCE13 },
14653
+ section: SECTION14,
14654
+ referenceFile: { name: "SESSION-HISTORY.md", content: REFERENCE14 },
14579
14655
  locked: true
14580
14656
  };
14581
14657
 
@@ -14586,7 +14662,7 @@ var SLACK_BLOCK_KIT_GUIDANCE = "Use Block Kit whenever structure or a link would
14586
14662
  var SLACK_PR_BUTTON_GUIDANCE = 'The first time you share a given pull request or merge request link in a thread (the message announcing you opened it), attach a button for it: send `blocks` alongside `text`, with a `section` block holding your message as `mrkdwn`, then an `actions` block with one element per newly shared link, `{"type": "button", "style": "primary", "text": {"type": "plain_text", "text": "View PR"}, "url": "<pr url>", "action_id": "view_pr"}`. The button replaces the link, so never put the raw URL in the section text. Later messages about a pull request you already linked in this thread get no button and refer to it with a short labeled link like `<pr url|#944>`, never a raw URL, and never re-post a button for a link someone already has. Label it "View MR" for GitLab, and if there are several give each button a unique `action_id` and name its repository in the label ("View PR \xB7 web"). Always keep `text` populated with the same message plus the link, since Slack uses it for notifications and fallback.';
14587
14663
 
14588
14664
  // ../shared/src/default-skills/replicas-agent/abilities/slack.ts
14589
- var SECTION14 = `### Slack
14665
+ var SECTION15 = `### Slack
14590
14666
  Send messages, read threads, search conversations, and transfer files through the workspace-scoped TypeScript SDK.
14591
14667
 
14592
14668
  **Reference:** \`references/SLACK.md\`
@@ -14596,7 +14672,7 @@ Use this when:
14596
14672
  - You need to read or search Slack conversations
14597
14673
  - You need to download a file attached to a Slack message
14598
14674
  - You encounter a Slack message link and need its full thread`;
14599
- var REFERENCE14 = `# Slack Integration
14675
+ var REFERENCE15 = `# Slack Integration
14600
14676
 
14601
14677
  Use \`@replicas/sdk\`; never read or send a Slack token directly. The SDK calls Replicas, which selects only this workspace's organization connection.
14602
14678
 
@@ -14675,8 +14751,8 @@ var SLACK_ABILITY = {
14675
14751
  label: "Slack",
14676
14752
  description: "Send messages, read threads, search, and transfer files through @replicas/sdk.",
14677
14753
  bullet: "- Interacting with Slack (listing channels, sending messages, reading threads, or searching): use replicas.slack.call from @replicas/sdk. Read references/SLACK.md; no Slack MCP server or provider token in the VM is required.",
14678
- section: SECTION14,
14679
- referenceFile: { name: "SLACK.md", content: REFERENCE14 }
14754
+ section: SECTION15,
14755
+ referenceFile: { name: "SLACK.md", content: REFERENCE15 }
14680
14756
  };
14681
14757
 
14682
14758
  // ../shared/src/visuals.ts
@@ -14774,7 +14850,7 @@ var BOOTSTRAP_SCRIPT = `
14774
14850
  `.trim().replace(/\s*\n\s*/g, " ");
14775
14851
 
14776
14852
  // ../shared/src/default-skills/replicas-agent/abilities/visuals.ts
14777
- var SECTION15 = `### Visuals
14853
+ var SECTION16 = `### Visuals
14778
14854
  Show a chart, diagram, comparison, timeline, or mockup inline in your Replicas chat reply, in the chat's own font and colors.
14779
14855
 
14780
14856
  **Reference:** \`references/VISUALS.md\`
@@ -14782,7 +14858,7 @@ Show a chart, diagram, comparison, timeline, or mockup inline in your Replicas c
14782
14858
  Use this when:
14783
14859
  - Seeing it would explain faster than reading it: numbers over time, a flow or architecture, a before and after, options side by side
14784
14860
  - The user asks to see, chart, plot, compare, or visualize something`;
14785
- var REFERENCE15 = `# Visuals
14861
+ var REFERENCE16 = `# Visuals
14786
14862
 
14787
14863
  A visual is a self-contained HTML page shown inline in your Replicas chat reply. It sits on the chat background in the chat's font and colors, grows to fit its content, and follows the user's light or dark theme live.
14788
14864
 
@@ -14820,8 +14896,8 @@ var VISUALS_ABILITY = {
14820
14896
  description: "Show charts, diagrams, comparisons, and mockups inline in chat replies.",
14821
14897
  // The visuals_instructions system prompt block is its trigger.
14822
14898
  bullet: "",
14823
- section: SECTION15,
14824
- referenceFile: { name: "VISUALS.md", content: REFERENCE15 }
14899
+ section: SECTION16,
14900
+ referenceFile: { name: "VISUALS.md", content: REFERENCE16 }
14825
14901
  };
14826
14902
 
14827
14903
  // ../shared/src/default-skills/replicas-agent/registry.ts
@@ -14835,6 +14911,7 @@ var REPLICAS_AGENT_ABILITY_REGISTRY = {
14835
14911
  gitlab: GITLAB_ABILITY,
14836
14912
  gpu: GPU_ABILITY,
14837
14913
  linear: LINEAR_ABILITY,
14914
+ local_computer: LOCAL_COMPUTER_ABILITY,
14838
14915
  media: MEDIA_ABILITY,
14839
14916
  plugins: PLUGINS_ABILITY,
14840
14917
  previews: PREVIEWS_ABILITY,
@@ -14889,6 +14966,7 @@ var DEFAULT_USER_PREFERENCES = {
14889
14966
  open_prs_in_graphite: false,
14890
14967
  open_links_in_desktop_app: false,
14891
14968
  port_forwarding: false,
14969
+ local_control: false,
14892
14970
  spotify_controls: false,
14893
14971
  appshot_shortcut: "command",
14894
14972
  appshot_destination: "automatic",
@@ -19537,7 +19615,7 @@ var VOICE_WAVEFORM = {
19537
19615
  };
19538
19616
 
19539
19617
  // ../shared/src/e2b.ts
19540
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-11-v4";
19618
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-11-v6";
19541
19619
 
19542
19620
  // ../shared/src/e2b-retry.ts
19543
19621
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -21988,6 +22066,7 @@ export {
21988
22066
  DESKTOP_STREAM_PORT,
21989
22067
  DEVICES_DIR,
21990
22068
  DEVICE_SCREEN_FILE_SUFFIX,
22069
+ LOCAL_CONTROL_FILE_PREFIX,
21991
22070
  GIT_CREDENTIAL_HELPER_FILENAME,
21992
22071
  GITHUB_CREDENTIAL_REFRESH_PATH,
21993
22072
  GITLAB_CREDENTIAL_REFRESH_PATH,
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  AspClient
6
- } from "./chunk-MBKXXNBY.js";
6
+ } from "./chunk-CZWLDQGX.js";
7
7
  import {
8
8
  ASTER_BASE_URL,
9
9
  ASTER_PROVIDER,
@@ -15,7 +15,7 @@ import {
15
15
  isRecord,
16
16
  readOllamaAuthEnv,
17
17
  readOpenAICompatibleAuthEnv
18
- } from "./chunk-LF5H4WKL.js";
18
+ } from "./chunk-34WRZFGY.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -6,7 +6,7 @@ import {
6
6
  getOriginDefaultBranch,
7
7
  monolithRequest,
8
8
  runGitCommand
9
- } from "./chunk-YXCKKNQQ.js";
9
+ } from "./chunk-GTSY6K43.js";
10
10
  import {
11
11
  extractCommandProtectionCommandText,
12
12
  findCommandProtectionGitLookups,
@@ -15,7 +15,7 @@ import {
15
15
  findScoutRepoWriteSignals,
16
16
  parseCommandProtectionRequest,
17
17
  withE2BRetry
18
- } from "./chunk-LF5H4WKL.js";
18
+ } from "./chunk-34WRZFGY.js";
19
19
 
20
20
  // src/services/command-protection-service.ts
21
21
  import { readFile, stat } from "fs/promises";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-LF5H4WKL.js";
8
+ } from "./chunk-34WRZFGY.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  execFileAsync
6
- } from "./chunk-6ZBLFVDT.js";
6
+ } from "./chunk-HWGDTBWL.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-LF5H4WKL.js";
9
+ } from "./chunk-34WRZFGY.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
240
240
  if (method === "foundry") return "azure";
241
241
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
242
242
  }
243
- var ENGINE_PACKAGE_VERSION = "0.1.1484";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1486";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -11,15 +11,15 @@ import {
11
11
  resolveDiffBase,
12
12
  runGitCommand,
13
13
  setAgentCredentialSnapshot
14
- } from "./chunk-YXCKKNQQ.js";
14
+ } from "./chunk-GTSY6K43.js";
15
15
  import {
16
16
  AppServerProcess,
17
17
  buildCodexAgentEnv
18
- } from "./chunk-MBKXXNBY.js";
18
+ } from "./chunk-CZWLDQGX.js";
19
19
  import {
20
20
  SUBPROCESS_MAX_BUFFER,
21
21
  execFileAsync
22
- } from "./chunk-6ZBLFVDT.js";
22
+ } from "./chunk-HWGDTBWL.js";
23
23
  import {
24
24
  isRecord
25
25
  } from "./chunk-UZSNFLDQ.js";
@@ -57,7 +57,7 @@ import {
57
57
  resolveOpenAICompatibleModelsUrl,
58
58
  splitMothershipInstructions,
59
59
  withTimeout
60
- } from "./chunk-LF5H4WKL.js";
60
+ } from "./chunk-34WRZFGY.js";
61
61
 
62
62
  // src/managers/codex-token-manager.ts
63
63
  import { promises as fs } from "fs";
@@ -320,7 +320,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
320
320
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
321
321
  await this.applyCredentialsResponse(data);
322
322
  setAgentCredentialSnapshot("codex", data);
323
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-2HK7QT32.js");
323
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-PVY7COYZ.js");
324
324
  await restartCodexAspHostIfRunning2();
325
325
  });
326
326
  await this.start(true);
@@ -342,7 +342,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
342
342
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
343
343
  await this.applyCredentialsResponse(data);
344
344
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
345
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-2HK7QT32.js");
345
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-PVY7COYZ.js");
346
346
  await restartCodexAspHostIfRunning2();
347
347
  }
348
348
  setAgentCredentialSnapshot("codex", data);
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-6ZBLFVDT.js";
7
+ } from "./chunk-HWGDTBWL.js";
8
8
  import {
9
9
  isRecord as isRecord2
10
10
  } from "./chunk-UZSNFLDQ.js";
@@ -21,7 +21,7 @@ import {
21
21
  provisionedDeviceSchema,
22
22
  readReplicasRuntimeEnv,
23
23
  serializePosixEnvFile
24
- } from "./chunk-LF5H4WKL.js";
24
+ } from "./chunk-34WRZFGY.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  HOOK_EXEC_MAX_BUFFER_BYTES
6
- } from "./chunk-LF5H4WKL.js";
6
+ } from "./chunk-34WRZFGY.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  evaluateCommandProtection
6
- } from "./chunk-AVLTHEIN.js";
7
- import "./chunk-YXCKKNQQ.js";
8
- import "./chunk-6ZBLFVDT.js";
6
+ } from "./chunk-7N44Y2BW.js";
7
+ import "./chunk-GTSY6K43.js";
8
+ import "./chunk-HWGDTBWL.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-LF5H4WKL.js";
12
+ import "./chunk-34WRZFGY.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -14,12 +14,12 @@ import {
14
14
  recoverCompletedTurn,
15
15
  spawnMuseMsp,
16
16
  startMuseSession
17
- } from "./chunk-EV5BB5TU.js";
17
+ } from "./chunk-724RBJ3S.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-MBKXXNBY.js";
22
- import "./chunk-6ZBLFVDT.js";
21
+ } from "./chunk-CZWLDQGX.js";
22
+ import "./chunk-HWGDTBWL.js";
23
23
  import {
24
24
  AGENT,
25
25
  OPENCODE_GO_PROVIDER,
@@ -29,7 +29,7 @@ import {
29
29
  headlessAgentUsagePath,
30
30
  isRecord,
31
31
  withTimeout
32
- } from "./chunk-LF5H4WKL.js";
32
+ } from "./chunk-34WRZFGY.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  evaluateCommandProtection,
28
28
  extractToolCommand,
29
29
  reportCommandProtectionBlock
30
- } from "./chunk-AVLTHEIN.js";
30
+ } from "./chunk-7N44Y2BW.js";
31
31
  import {
32
32
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
33
33
  AGENT_MESSAGE_DELTA_METHOD,
@@ -65,10 +65,10 @@ import {
65
65
  spawnMuseMsp,
66
66
  startMuseSession,
67
67
  uuidV7
68
- } from "./chunk-EV5BB5TU.js";
68
+ } from "./chunk-724RBJ3S.js";
69
69
  import {
70
70
  publishedPullRequestUrls
71
- } from "./chunk-5NWZPFQW.js";
71
+ } from "./chunk-BELDILBB.js";
72
72
  import {
73
73
  ACCOUNT_RATE_LIMITS_READ_METHOD,
74
74
  AsyncLock,
@@ -143,7 +143,7 @@ import {
143
143
  timestampFromSeconds,
144
144
  upsertCredentialFileLines,
145
145
  writeSecureCredentialFile
146
- } from "./chunk-QZ43VWR7.js";
146
+ } from "./chunk-G4ELW4DF.js";
147
147
  import {
148
148
  ENGINE_ENV,
149
149
  UNQUOTED_PATHS_CONFIG,
@@ -154,15 +154,15 @@ import {
154
154
  resolveDiffBase,
155
155
  setAgentCredentialSnapshot,
156
156
  setLinearSessionId
157
- } from "./chunk-YXCKKNQQ.js";
157
+ } from "./chunk-GTSY6K43.js";
158
158
  import {
159
159
  getCodexModelProvider
160
- } from "./chunk-MBKXXNBY.js";
160
+ } from "./chunk-CZWLDQGX.js";
161
161
  import {
162
162
  SUBPROCESS_MAX_BUFFER,
163
163
  execAsync,
164
164
  execFileAsync
165
- } from "./chunk-6ZBLFVDT.js";
165
+ } from "./chunk-HWGDTBWL.js";
166
166
  import {
167
167
  isRecord as isRecord2
168
168
  } from "./chunk-UZSNFLDQ.js";
@@ -237,6 +237,7 @@ import {
237
237
  InFlightMap,
238
238
  LEARNED_SKILLS_MANIFEST_PATH,
239
239
  LEARNED_SKILL_DIR_PREFIX,
240
+ LOCAL_CONTROL_FILE_PREFIX,
240
241
  MAX_CANVAS_FILE_BYTES,
241
242
  MAX_CANVAS_PREVIEW_BYTES,
242
243
  MAX_CODEX_GOAL_OBJECTIVE_CHARS,
@@ -442,7 +443,7 @@ import {
442
443
  workspaceTokenRequestSchema,
443
444
  workspaceTokenResponseSchema,
444
445
  wrapInTag
445
- } from "./chunk-LF5H4WKL.js";
446
+ } from "./chunk-34WRZFGY.js";
446
447
  import {
447
448
  cloneMcpConfig,
448
449
  ensureCompatibilityImports,
@@ -11021,7 +11022,8 @@ async function startDeviceRelays(names, paths, signal) {
11021
11022
  }
11022
11023
 
11023
11024
  // src/services/device-service.ts
11024
- import { mkdir as mkdir7, rm as rm3, writeFile as writeFile4 } from "fs/promises";
11025
+ import { readdirSync } from "fs";
11026
+ import { mkdir as mkdir7, readdir as readdir2, rm as rm3, writeFile as writeFile4 } from "fs/promises";
11025
11027
  import { join as join8 } from "path";
11026
11028
  var DEVICES_DIR2 = join8(ENGINE_ENV.HOME_DIR, DEVICES_DIR);
11027
11029
  var TAILSCALED_UNIT = "replicas-tailscaled";
@@ -11076,7 +11078,8 @@ async function joinTailnet(authKey, workspaceId, signal) {
11076
11078
  }
11077
11079
  async function connectDevices(signal) {
11078
11080
  const { REPLICAS_ENV_DEVICES: devices, TS_AUTHKEY: authKey, REPLICAS_WORKSPACE_ID: workspaceId } = ENGINE_ENV;
11079
- await rm3(DEVICES_DIR2, { recursive: true, force: true });
11081
+ const stale = (await readdir2(DEVICES_DIR2).catch(() => [])).filter((entry) => !entry.startsWith(LOCAL_CONTROL_FILE_PREFIX));
11082
+ await Promise.all(stale.map((entry) => rm3(join8(DEVICES_DIR2, entry), { recursive: true, force: true })));
11080
11083
  const tailnetKey = devices.some((device) => device.host !== null) ? authKey : void 0;
11081
11084
  if (!tailnetKey) await execFileAsync("sudo", ["systemctl", "stop", TAILSCALED_UNIT], { signal }).catch(() => void 0);
11082
11085
  if (devices.length === 0) return;
@@ -11107,6 +11110,21 @@ function devicesInstruction() {
11107
11110
  ...screens.length > 0 ? [`To see and control the screen of ${screens.join(", ")}, run \`replicas computer screen <name>\`: it shows on this desktop, where the other \`replicas computer\` commands drive it. Prefer \`ssh\` when a command does the job.`] : []
11108
11111
  ].join(" ");
11109
11112
  }
11113
+ function localControlInstruction() {
11114
+ let entries;
11115
+ try {
11116
+ entries = readdirSync(DEVICES_DIR2);
11117
+ } catch {
11118
+ return void 0;
11119
+ }
11120
+ const computers = entries.flatMap((entry) => entry.startsWith(LOCAL_CONTROL_FILE_PREFIX) && entry.endsWith(".conf") ? [`\`${entry.slice(LOCAL_CONTROL_FILE_PREFIX.length, -".conf".length)}\``] : []);
11121
+ if (computers.length === 0) return void 0;
11122
+ return [
11123
+ `The user turned on local control, so you can run commands on their own computer through the Replicas desktop app running there: ${computers.join(", ")}. Use \`ssh <name> '<command>'\`, \`scp\` and \`rsync\` as usual. Commands run as the user in their home directory with their login shell and no terminal, output streams back as it is produced, and a command stops if the connection drops.`,
11124
+ "It is a personal machine with the user's files and accounts: change only what the task needs, and ask before anything destructive or hard to undo.",
11125
+ 'It works only while the desktop app is running there with local control on. If `ssh` closes straight away, such as "Connection closed by UNKNOWN port 65535", the app isn\'t running or local control is off: tell the user and ask them to open it. If a command gets "Operation not permitted" on the user\'s files, macOS is blocking the app: ask the user to allow Replicas under System Settings \u2192 Privacy & Security \u2192 Full Disk Access.'
11126
+ ].join(" ");
11127
+ }
11110
11128
 
11111
11129
  // src/services/chat/chat-service.ts
11112
11130
  import { statSync as statSync4 } from "fs";
@@ -11351,7 +11369,7 @@ import {
11351
11369
  } from "@anthropic-ai/claude-agent-sdk";
11352
11370
  import { randomUUID as randomUUID3 } from "crypto";
11353
11371
  import { dirname as dirname3, join as join11 } from "path";
11354
- import { mkdir as mkdir8, readdir as readdir3, readFile as readFile7 } from "fs/promises";
11372
+ import { mkdir as mkdir8, readdir as readdir4, readFile as readFile7 } from "fs/promises";
11355
11373
  import { homedir as homedir7 } from "os";
11356
11374
 
11357
11375
  // src/utils/linear-converter.ts
@@ -12656,6 +12674,7 @@ ${note}` };
12656
12674
  const repositorySystemPromptInstruction = this.getRepositorySystemPromptInstruction();
12657
12675
  const environmentInstruction = this.getEnvironmentSystemPromptInstruction();
12658
12676
  const deviceInstruction = devicesInstruction();
12677
+ const localControlGuidance = localControlInstruction();
12659
12678
  const enginePortProtectionInstruction = this.getEnginePortProtectionInstruction();
12660
12679
  const memoryInstruction = includeMemory ? this.buildMemoryInstruction() : void 0;
12661
12680
  const parts = [];
@@ -12673,6 +12692,9 @@ ${note}` };
12673
12692
  if (deviceInstruction) {
12674
12693
  parts.push(deviceInstruction);
12675
12694
  }
12695
+ if (localControlGuidance) {
12696
+ parts.push(localControlGuidance);
12697
+ }
12676
12698
  if (repositorySystemPromptInstruction) {
12677
12699
  parts.push(repositorySystemPromptInstruction);
12678
12700
  }
@@ -12929,7 +12951,7 @@ var PullRequestCheckService = class {
12929
12951
  var pullRequestCheckService = new PullRequestCheckService();
12930
12952
 
12931
12953
  // src/services/skill-registry-service.ts
12932
- import { readFile as readFile6, readdir as readdir2, stat } from "fs/promises";
12954
+ import { readFile as readFile6, readdir as readdir3, stat } from "fs/promises";
12933
12955
  import { dirname as dirname2, isAbsolute, join as join10, relative, resolve } from "path";
12934
12956
  var REGISTRY_ROOT_DIR = ".replicas/skill-registries";
12935
12957
  var REGISTRY_MANIFEST = "manifest.json";
@@ -13123,7 +13145,7 @@ function uniqueStandaloneSkills(skills) {
13123
13145
  }
13124
13146
  async function safeReadDir(path7) {
13125
13147
  try {
13126
- return await readdir2(path7, { withFileTypes: true });
13148
+ return await readdir3(path7, { withFileTypes: true });
13127
13149
  } catch (error) {
13128
13150
  if (isNotFoundError(error)) return [];
13129
13151
  throw error;
@@ -14055,7 +14077,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
14055
14077
  async forwardWorkflowAgentTranscripts(taskId) {
14056
14078
  const workflow = this.workflowTranscripts.get(taskId);
14057
14079
  if (!workflow || this.ambientTaskIds.has(taskId)) return;
14058
- for (const file of await readdir3(workflow.dir).catch(() => [])) {
14080
+ for (const file of await readdir4(workflow.dir).catch(() => [])) {
14059
14081
  const agentId = /^agent-(.+)\.jsonl$/.exec(file)?.[1];
14060
14082
  if (!agentId) continue;
14061
14083
  const offset = workflow.offsets.get(file) ?? 0;
@@ -16604,7 +16626,7 @@ ${text.slice(-24e3)}`
16604
16626
  };
16605
16627
 
16606
16628
  // src/managers/cursor-manager.ts
16607
- import { mkdir as mkdir11, readFile as readFile9, readdir as readdir4 } from "fs/promises";
16629
+ import { mkdir as mkdir11, readFile as readFile9, readdir as readdir5 } from "fs/promises";
16608
16630
  import { basename as basename2, dirname as dirname5, extname, join as join14 } from "path";
16609
16631
  import { Agent as CursorAgent2, AuthenticationError, CursorSdkError } from "@cursor/sdk";
16610
16632
 
@@ -16737,7 +16759,7 @@ function extractCursorCommandDescription(content) {
16737
16759
  async function listCursorCommandsInDirectory(directory) {
16738
16760
  let entries;
16739
16761
  try {
16740
- entries = await readdir4(directory, { withFileTypes: true });
16762
+ entries = await readdir5(directory, { withFileTypes: true });
16741
16763
  } catch (error) {
16742
16764
  if (isRecord2(error) && error.code === "ENOENT") return [];
16743
16765
  console.warn("[CursorManager] Failed to read slash command directory:", error);
@@ -41134,7 +41156,7 @@ async function probeMcpEndpoint(url3) {
41134
41156
  }
41135
41157
 
41136
41158
  // ../node_modules/.bun/pi-mcp-adapter@2.32.1+f2da34192be1730e/node_modules/pi-mcp-adapter/npx-resolver.ts
41137
- import { existsSync as existsSync9, readFileSync as readFileSync2, realpathSync, readdirSync, statSync as statSync2, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync2, openSync, readSync, closeSync, unlinkSync } from "fs";
41159
+ import { existsSync as existsSync9, readFileSync as readFileSync2, realpathSync, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync2, openSync, readSync, closeSync, unlinkSync } from "fs";
41138
41160
  import { join as join16, dirname as dirname8, extname as extname2, resolve as resolve2, sep } from "path";
41139
41161
 
41140
41162
  // ../node_modules/.bun/pi-mcp-adapter@2.32.1+f2da34192be1730e/node_modules/pi-mcp-adapter/abort.ts
@@ -41431,7 +41453,7 @@ function findCachedPackageDir(cacheDir, packageName, exactVersion) {
41431
41453
  const npxDir = join16(cacheDir, "_npx");
41432
41454
  if (!existsSync9(npxDir)) return null;
41433
41455
  const packagePathParts = packageName.startsWith("@") ? packageName.split("/") : [packageName];
41434
- const candidates = readdirSync(npxDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => {
41456
+ const candidates = readdirSync2(npxDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => {
41435
41457
  const full = join16(npxDir, entry.name);
41436
41458
  const mtime = safeStatMtime(full);
41437
41459
  return { name: entry.name, mtime };
@@ -59533,11 +59555,11 @@ import {
59533
59555
  appendFile as appendFile4,
59534
59556
  mkdir as mkdir17,
59535
59557
  readFile as readFile13,
59536
- readdir as readdir5,
59558
+ readdir as readdir6,
59537
59559
  rename as rename2,
59538
59560
  unlink
59539
59561
  } from "fs/promises";
59540
- import { existsSync as existsSync14, readFileSync as readFileSync5, readdirSync as readdirSync2 } from "fs";
59562
+ import { existsSync as existsSync14, readFileSync as readFileSync5, readdirSync as readdirSync3 } from "fs";
59541
59563
  import { join as join24 } from "path";
59542
59564
  var MAX_FAILED_RECORDS = 500;
59543
59565
  var FLUSH_DEBOUNCE_MS = 15e3;
@@ -59586,7 +59608,7 @@ var AnalyticsRecordBuffer = class {
59586
59608
  }
59587
59609
  readStoredRecords() {
59588
59610
  if (!existsSync14(ENGINE_DIR)) return [];
59589
- return readdirSync2(ENGINE_DIR, { withFileTypes: true }).filter((entry) => entry.isFile() && this.storageNames.some(
59611
+ return readdirSync3(ENGINE_DIR, { withFileTypes: true }).filter((entry) => entry.isFile() && this.storageNames.some(
59590
59612
  (storageName) => entry.name === `${storageName}.jsonl` || entry.name.startsWith(`${storageName}.`) && (entry.name.endsWith(".jsonl") || entry.name.endsWith(`.jsonl${UPLOADED_SUFFIX}`))
59591
59613
  )).map(({ name }) => name).sort().flatMap((name) => this.parseRecords(readFileSync5(join24(ENGINE_DIR, name), "utf-8"))).map((record3) => {
59592
59614
  const recordId = this.options.getRecordId?.(record3);
@@ -59628,7 +59650,7 @@ var AnalyticsRecordBuffer = class {
59628
59650
  ).catch(() => {
59629
59651
  });
59630
59652
  }
59631
- const entries = await readdir5(ENGINE_DIR).catch(() => []);
59653
+ const entries = await readdir6(ENGINE_DIR).catch(() => []);
59632
59654
  let flushed = 0;
59633
59655
  let failed = 0;
59634
59656
  for (const entry of entries) {
@@ -60475,7 +60497,7 @@ var KeepAliveService = class _KeepAliveService {
60475
60497
  var keepAliveService = new KeepAliveService();
60476
60498
 
60477
60499
  // src/services/canvas-service.ts
60478
- import { readdir as readdir6, readFile as readFile15, stat as stat3 } from "fs/promises";
60500
+ import { readdir as readdir7, readFile as readFile15, stat as stat3 } from "fs/promises";
60479
60501
  import { homedir as homedir8 } from "os";
60480
60502
  import { join as join25 } from "path";
60481
60503
 
@@ -60545,7 +60567,7 @@ var CanvasService = class {
60545
60567
  if (!current) continue;
60546
60568
  let entries;
60547
60569
  try {
60548
- entries = await readdir6(current.directory, { withFileTypes: true });
60570
+ entries = await readdir7(current.directory, { withFileTypes: true });
60549
60571
  } catch {
60550
60572
  continue;
60551
60573
  }
@@ -60752,7 +60774,7 @@ async function reconcileCanvasItems(filenames) {
60752
60774
  // src/services/upload-chat-transcripts.ts
60753
60775
  import { createReadStream as createReadStream3 } from "fs";
60754
60776
  import { createHash as createHash8 } from "crypto";
60755
- import { readFile as readFile16, readdir as readdir7, stat as stat4 } from "fs/promises";
60777
+ import { readFile as readFile16, readdir as readdir8, stat as stat4 } from "fs/promises";
60756
60778
  import { basename as basename3, join as join27 } from "path";
60757
60779
 
60758
60780
  // src/services/chat/chat-senders.ts
@@ -60836,7 +60858,7 @@ async function flushAllChatTranscripts(chatsById = /* @__PURE__ */ new Map(), ca
60836
60858
  for (const dir of HISTORY_DIRS) {
60837
60859
  let entries;
60838
60860
  try {
60839
- entries = await readdir7(dir);
60861
+ entries = await readdir8(dir);
60840
60862
  } catch {
60841
60863
  continue;
60842
60864
  }
@@ -60983,7 +61005,7 @@ async function flushRepoState() {
60983
61005
 
60984
61006
  // src/services/upload-engine-logs.ts
60985
61007
  import { createReadStream as createReadStream4 } from "fs";
60986
- import { readdir as readdir8, stat as stat5 } from "fs/promises";
61008
+ import { readdir as readdir9, stat as stat5 } from "fs/promises";
60987
61009
  import { join as join28 } from "path";
60988
61010
  var MAX_ENGINE_LOG_FLUSH_SESSIONS = 10;
60989
61011
  var MAX_ENGINE_LOG_FLUSH_BYTES = 5 * 1024 * 1024;
@@ -60994,7 +61016,7 @@ async function flushAllEngineLogs() {
60994
61016
  let failed = 0;
60995
61017
  const deadline = Date.now() + ENGINE_LOG_FLUSH_TIMEOUT_MS;
60996
61018
  await runBeforeDeadline((signal) => engineLogger.flush(signal), deadline);
60997
- const files = await runBeforeDeadline(() => readdir8(LOG_DIR), deadline).catch(() => []);
61019
+ const files = await runBeforeDeadline(() => readdir9(LOG_DIR), deadline).catch(() => []);
60998
61020
  const currentFilename = engineLogger.sessionId ? `${engineLogger.sessionId}.log` : null;
60999
61021
  const filenames = files.filter((filename) => {
61000
61022
  if (!filename.endsWith(".log")) return false;
@@ -63870,7 +63892,7 @@ var RepoFileService = class {
63870
63892
  // src/v1-routes.ts
63871
63893
  import { Hono } from "hono";
63872
63894
  import { z as z6 } from "zod";
63873
- import { readdir as readdir10, stat as stat7, readFile as readFile22 } from "fs/promises";
63895
+ import { readdir as readdir11, stat as stat7, readFile as readFile22 } from "fs/promises";
63874
63896
  import { openAsBlob } from "fs";
63875
63897
  import { join as join35, resolve as resolve5 } from "path";
63876
63898
 
@@ -63881,7 +63903,7 @@ import { existsSync as existsSync16 } from "fs";
63881
63903
  import { join as join34 } from "path";
63882
63904
 
63883
63905
  // src/services/warm-hook-logs-service.ts
63884
- import { mkdir as mkdir20, readFile as readFile20, writeFile as writeFile9, readdir as readdir9, appendFile as appendFile6, unlink as unlink2 } from "fs/promises";
63906
+ import { mkdir as mkdir20, readFile as readFile20, writeFile as writeFile9, readdir as readdir10, appendFile as appendFile6, unlink as unlink2 } from "fs/promises";
63885
63907
  import { homedir as homedir11 } from "os";
63886
63908
  import { join as join33 } from "path";
63887
63909
  var LOGS_DIR2 = join33(homedir11(), ".replicas", "warm-hook-logs");
@@ -63917,7 +63939,7 @@ var WarmHookLogsService = class {
63917
63939
  async getAllLogs() {
63918
63940
  let files;
63919
63941
  try {
63920
- files = await readdir9(LOGS_DIR2);
63942
+ files = await readdir10(LOGS_DIR2);
63921
63943
  } catch (err) {
63922
63944
  if (err.code === "ENOENT") {
63923
63945
  return [];
@@ -65356,7 +65378,7 @@ data: ${JSON.stringify("Terminal session not found")}
65356
65378
  });
65357
65379
  app2.get("/logs", async (c) => {
65358
65380
  try {
65359
- const files = await readdir10(LOG_DIR).catch(() => []);
65381
+ const files = await readdir11(LOG_DIR).catch(() => []);
65360
65382
  const logFiles = files.filter((f) => f.endsWith(".log"));
65361
65383
  const sessions = await Promise.all(
65362
65384
  logFiles.map(async (filename) => {
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  publishedPullRequestUrls
6
- } from "./chunk-5NWZPFQW.js";
6
+ } from "./chunk-BELDILBB.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-LF5H4WKL.js";
12
+ } from "./chunk-34WRZFGY.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -11,7 +11,7 @@ import {
11
11
  spawnSubagentRequestSchema,
12
12
  subagentResponseSchema,
13
13
  waitSubagentRequestSchema
14
- } from "./chunk-LF5H4WKL.js";
14
+ } from "./chunk-34WRZFGY.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1484",
3
+ "version": "0.1.1486",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",