`xcrun simctl getenv` silently truncates return values at 127 bytes.
The code was reading with `simctl getenv` but writing with
`simctl spawn ... launchctl setenv`, causing each ensureEnv() cycle to
read a truncated value, fail to recognize the truncated argent path
fragments, preserve them, and append a fresh bootstrap — corrupting
the variable and clobbering third-party dylibs like SimCam.
Fix:
- Read via `simctl spawn <udid> launchctl getenv` (same store, no limit)
- Restore fs.existsSync guard to strip truncated/stale entries while
keeping third-party dylibs that exist on disk (e.g. SimCam)
- Bump mcp version to 0.4.4
* fix: detect project root via .argent dir instead of git
Flow tools previously shelled out to 'git rev-parse --show-toplevel' to
locate the project root, which failed outside git repos and pulled flows
from the wrong place in nested worktrees. Walk up from cwd looking for
an existing .argent/ directory; fall back to cwd so the first
flow-start-recording still creates it in place.
* fix: skip $HOME when walking up for .argent/
The MCP launcher stores its own state in ~/.argent/ (logs, tool-server
pid). Without this guard, running any flow tool from anywhere under
$HOME — but outside a real project with its own .argent/ — would stop
at the home directory and treat it as the project root, mixing personal
MCP state with flow files.
* revert: restore getGitRoot in flow-utils
The walk-up .argent approach is fundamentally broken because the
tool-server is a singleton daemon — its process.cwd() is not the
calling project's cwd. Reverting both 882ed4c and 83e6ae6 so the
next commit can replace the resolution with an AsyncLocalStorage
context populated from an X-Argent-Project-Root header sent by the
argent mcp proxy.
This reverts commit 882ed4c.
This reverts commit 83e6ae6.
* feat: resolve project root via AsyncLocalStorage from mcp proxy header
The tool-server is a singleton daemon shared by every MCP client,
so its process.cwd() is never the calling project's cwd. The git-
root and walk-up heuristics both ran inside the daemon and silently
returned the wrong directory.
Shift the source of truth: the argent mcp proxy is per-client, so
it IS in the client's workspace. Stamp process.cwd() on every POST
to the tool-server as X-Argent-Project-Root, run invokeTool inside
an AsyncLocalStorage scope, and expose requireProjectRoot() to any
tool that needs it. Missing/malformed headers surface a clear error
from the getter instead of silently defaulting to the daemon's cwd.
- packages/mcp/src/mcp-server.ts: callTool sends the header
- packages/tool-server/src/request-context.ts: ALS module
- packages/tool-server/src/http.ts: extract header, wrap invokeTool
- packages/tool-server/src/tools/flows/flow-utils.ts: requireProjectRoot
- packages/tool-server/test/http-project-root.test.ts: integration tests
covering present/missing/empty/malformed header, unicode roundtrip,
non-flow tools bypassing the getter, and concurrent-request isolation
* refactor: profiler tools resolve project root via requireProjectRoot
Drop the project_root input parameter from react-profiler-analyze
and react-profiler-component-source. Both now pull the root from
the AsyncLocalStorage context stamped by the argent mcp proxy,
matching flow-utils.
Second caller for requireProjectRoot so the mechanism is exercised
beyond flows. If the ALS approach turns out flaky, these two tools
break in the same way as the flow tools and fail loudly with the
same clear error message.
Update the profiler skill doc to drop the project_root arg since
agents no longer pass it.
* test: stress-test AsyncLocalStorage projectRoot mechanism
Four comprehensive test files generated by a parallel swarm audit of
the new request-context.ts / requireProjectRoot() approach, covering
every realistic way it could break.
- test/als-propagation.test.ts — 15 tests documenting what Node's
AsyncLocalStorage actually does under every async boundary the
tool-server uses. Split into SAFE baselines (Promise chains,
microtasks, timers, streams, synchronous EventEmitter emits,
concurrent frames) and LATENT TRAPS (listeners fired outside
an active frame, worker_threads, child_process). Serves as the
authoritative reference for "can I read projectRoot here?".
- test/als-nested-invocation.test.ts — 10 tests proving propagation
through registry.invokeTool nesting: two-level, deep (A→B→C→D→E),
mixed sync/async, parallel fan-out, cross-request isolation,
flow-execute style loops, error mid-chain, long chains, explicit
runWithContext re-entry overrides.
- test/als-http-edge-cases.test.ts — HTTP boundary stress tests:
malformed percent-encoding, null-byte injection, header case
variants, duplicate headers, unicode round-trip, abort mid-flight,
relative/Windows/URL-shaped paths.
- test/als-state-contamination.test.ts — adversarial audit that
surfaced two PRE-EXISTING P0 bugs the ALS fix does NOT solve:
* activeFlowName module-level singleton in flow-utils.ts
leaks between concurrent projects on a shared daemon
* profilerPathsCache in react-profiler-session.ts is keyed
only by Metro port, not projectRoot — two projects sharing
port 8081 see each other's cached profiler sessions
Both are documented via it.fails() so vitest passes today; the
day a fix lands the it.fails flips to an alert and the test
becomes a regression guard.
449/449 tool-server tests pass.
* revert: drop AsyncLocalStorage project-root approach
Reverts the ALS-based project root resolution because the approach
isn't working well in practice. Restores the previous getGitRoot
implementation in flow-utils, the project_root input parameter on
the profiler tools, and the skill doc that describes it.
Reverts:
- 3932eb5 test: stress-test AsyncLocalStorage projectRoot mechanism
- 5398cbc refactor: profiler tools resolve project root via requireProjectRoot
- b7ae895 feat: resolve project root via AsyncLocalStorage from mcp proxy header
A follow-up commit adds clearer error handling around the git call
so the agent gets a useful message when the tool-server's cwd isn't
inside a git repo.
* fix: clearer error when getGitRoot fails outside a git repo
Wrap the `git rev-parse --show-toplevel` call in getGitRoot so that
the failure surfaces a useful message to the agent instead of the
raw child_process stderr. The tool-server daemon's cwd is not the
calling project's cwd, so if the daemon happens to be launched
outside any git repository the git command fails with a terse
"fatal: not a git repository" that tells the agent nothing about
what to do next.
The new error reports the daemon's cwd, explains that flows are
anchored to a git root, and points the user at `git init`.
* refactor: require project_root as a flow tool parameter
The tool-server is a singleton daemon — its process.cwd() is never
the calling project's cwd, so flow-utils cannot infer the project
root on its own. Instead of guessing via git or walking the
filesystem, ask the calling agent directly: every flow tool now
takes project_root as a required parameter and the agent supplies
the absolute path it is working in.
This matches the existing pattern used by react-profiler-analyze,
react-profiler-component-source, and gather-workspace-data, all of
which already accept an agent-provided project/workspace path.
Changes:
- flow-utils.ts: drop getGitRoot/execFile; getFlowsDir and
getFlowPath become pure functions that take projectRoot; throw
on non-absolute paths at the boundary.
- flow-start-recording, flow-add-step, flow-add-echo,
flow-finish-recording, flow-read-prerequisite, flow-execute:
add project_root to each zod schema and plumb it through.
- argent-create-flow SKILL.md: document project_root on every
example tool call; note that it must be passed every time.
- flow-tools.test.ts: remove the flow-utils vi.mock (no longer
needed) and pass project_root: tmpDir on every call; add a
regression test rejecting relative project_root.
* prettier
* cleanup skill
* refactor: store project_root on flow-start-recording, not on every tool
The tool-server cannot infer the calling project's working directory
on its own. The agent now provides it once — as project_root on
flow-start-recording, which stores it alongside activeFlowName in
module state. All other flow tools (flow-add-step, flow-add-echo,
flow-finish-recording, flow-execute, flow-read-prerequisite) read
the stored value and require no project_root parameter.
This matches the existing "active flow" pattern: just as flow name
is tracked automatically after flow-start-recording, so is the
project root.
* feat: require project_root on flow-execute and flow-read-prerequisite
These tools are independent entry points that may be called without a
prior recording session (e.g. after daemon restart), so they cannot
rely on module state set by flow-start-recording. Adding project_root
as an explicit parameter mirrors the pattern already used by
flow-start-recording and react-profiler-analyze.
* fix: make requireActiveProjectRoot error message tool-agnostic
The previous message pointed only at flow-start-recording, but the
check is now reached from flow-execute and flow-read-prerequisite as
well.
* refactor: store flows in .argent/flows/ instead of .argent/
Keeps the .argent/ directory clean for other argent-related artifacts
and groups flow files under a dedicated subdirectory.
* style: prettier --write
- download-native-binaries.sh now requires an explicit release tag (e.g.
argent-v0.4.3) and fails fast with a clear error if the release doesn't
exist in argent-private-releases
- publish.yml is now manual-only (workflow_dispatch) with a ref input
(branch/tag/SHA); derives the binaries tag as argent-{ref} and checks
out the repo at that ref
- publish.yml now targets npm (registry.npmjs.org + NPM_TOKEN) instead
of GitHub Packages
- download:native-binaries npm script auto-derives the tag from
packages/mcp/package.json version for local pack:mcp usage
process.exit() is synchronous and does not flush Node's WriteStream
buffer when stdout is a pipe. For large outputs like the ~61 KB
tool manifest from `-t`, the tail was being truncated, causing
`argent init` to fail with "Unterminated string in JSON" when
parsing the child's output in getAvailableToolIds.
* Reapply "feat: enhance React profiler session handling with device ID support"
This reverts commit 2bf25cb950.
* Reapply "refactor: remove device-related fields from React profiler session"
This reverts commit badf127411.
* Reapply "refactor: unify device ID handling across debugger and profiler tools, make device_id required, not optional"
This reverts commit c6f1fd7578.
* format: run format
* refactor: enforce device ID requirement in JsRuntimeDebugger and ReactProfilerSession blueprints
* feat: add appName and deviceName to React profiler session and related tools
* fix: update React profiler session output to reflect accurate field names for runtime and project details
* skills: enhance skills for Metro debugger and React profiler tools to clarify device_id usage and connection diagnostics
* format: run format
* test: update NetworkInspector integration tests to include mock-device in service resolutions
* feat: enhance error handling in registry and tool server blueprints
* test: add tests for error handling in registry and tool server blueprints
* refactor: streamline exception detail formatting in CDP client
* format: run format
* add `getAllTools` + tests
* add minimap hints
* cleanup - don't use hardcoded filename
* make cli depend on tool server
* cleanup gemini function - will be used as template for further work
* add allowlist logic
* move codex config type to types section
* add package module and exports to tool server
* revert package changes
* make tool server a CLI
* make the tool server start with `start` command
* add tool printing command
* use CLI tools getter inside mcp configs
* remove artifacts
* add help to help menu
* revert artifacts
* remove redundant null getters
* add codex tests
* fix: correct inaccurate tool documentation in skills
- Remove fabricated JWT token parameter references from simulator-interact
(simulator-server and screenshot don't accept JWT params)
- Remove "setting breakpoints, pausing JS execution" from metro-debugger
description (these tools were removed)
- Document that debugger-inspect-element uses logical pixel coordinates,
not normalized 0-1 (metro-debugger + app-workflow)
- Fix restart-app description from "Reinstall or reconnect to Metro" to
accurate "Terminate and relaunch by bundle ID"
- Fix react-profiler-analyze meta field references — meta is embedded in
the markdown report, not a structured return field
- Fix step cross-references in profiler skill (Step 4→3, Step 2→1)
- Remove fabricated level/limit params from debugger-log-registry docs
in diagnostic-tools.md (only port param exists)
- Remove reference to non-existent debugger-console-listen
* fix: add LOW severity documentation fixes
- Add missing default values for gesture tool durationMs (all 300ms)
- Add default angle: 0 for gesture-pinch
- Document keyboard delayMs param (default 50ms)
- Document screenshot scale range (0.01-1.0)
- Add appSwitch and actionButton to button tool summary
- Fix UUID→UDID typo in app-workflow
- Add missing required udid param to launch-app, restart-app, open-url,
reinstall-app in app-workflow tables
- Remove stale "breakpoints, stepping" references from app-workflow
(metro-debugger no longer has these capabilities)
- Document that includeSkipped applies to debugger-inspect-element too
- Add missing return fields to debugger-connect and debugger-status
- Document sample_interval_us param for react-profiler-start
- Document template_path param for ios-profiler-start
- Fix ios-profiler section numbering (was 2,4,5,6 → now 2,3,4,5)
* fix: remove fabricated license/activation note from simulator-interact
The note claimed screenshots require a Pro license and referenced
activate-sso/activate-license-key tools — neither exists in the
tool-server.
---------
Co-authored-by: Filip131311 <Filip.kaminski@swmansion.com>
Replace `tap`/`swipe` with `gesture-tap`/`gesture-swipe` in
argent-test-ui-flow code examples, and remove reference to
non-existent `debugger-console-listen` in argent-react-native-app-workflow.
* refactor: rewrite the `argent` main rule
* fix: minor skills and tool description updates
* feat: add "use when" for CI
---------
Co-authored-by: Filip131311 <Filip.kaminski@swmansion.com>
* feat: first implementation integration of ax-service for enhanced accessibility support
* feat: enhance ax-service with automation enablement and daemon management
* feat: export ensureAutomationEnabled function for improved accessibility automation in simulator server
* feat: add new build scripts for native development and update binary files
* feat: enhance describe tool to support native-devtools fallback and introduce DescribeResult interface
* chore: bump version to 0.4.1
* chore: bump argent-private to main; list ax-service in LICENSE
- Point packages/argent-private at current main and set submodule branch.
- Declare packages/native-devtools-ios/bin/ax-service as proprietary alongside simulator-server and dylibs.
Made-with: Cursor
* docs: document ax-service as proprietary across LICENSE and README
- Extend root README and CONTRIBUTING requirements (mcp README syncs from root at build).
- List bin/ax-service in @swmansion/argent and native-devtools-ios LICENSE.
- Assert ax-service is present and executable in publish workflow.
Made-with: Cursor
---------
Co-authored-by: Filip131311 <Filip.kaminski@swmansion.com>
* chore: update README to improve branding and layout
* chore: update README to include responsive banner images and fix minor text typo
* chore: update README to enhance banner image responsiveness and adjust layout
* feat: adjust banner image display
* feat: merge changes
* fix: update README with absolute image URLs and correct text typo; add new banner images
Unblocks internal releases while npm private publishing is unavailable for the org by switching the publish workflow back to GitHub Packages.
Made-with: Cursor
Bootstraps the first restricted npm release from GitHub Actions, which cannot complete interactive 2FA, and aligns the package version with the planned 0.4.0 tag.
Made-with: Cursor
* chore: Update subproject commit for argent-private and refresh native devtools binaries with fixes for ios26
* chore: Update subproject commit for argent-private and refresh native devtools binaries
* fix: prime native devtools during simulator boot (#89)
Wait for full simulator boot and resolve the NativeDevtools service before boot-simulator returns so immediate launches cannot beat the watcher. Add a focused regression test for both fresh boots and already-booted simulators.
Made-with: Cursor
---------
Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
* feat: update README and MCP documentation with new capabilities and installation instructions; add banner and placeholder images.
* chore: remove outdated badge section from README files in root and MCP packages
* chore: add horizontal rule to README files in root and MCP packages for improved visual separation
* chore: update README files in root and MCP packages to include detailed information about Software Mansion and its services
* chore: update logo links in README files for root and MCP packages to reflect new branding
* chore: update banner image to align with new branding
* chore: update installation command in README to reflect correct usage
* chore: replace placeholder image in README files with a GIF for improved visual appeal
* chore: update placeholder GIF to enhance visual consistency across assets
* chore: adjust image width in README files for consistent presentation
* chore: reposition placeholder GIF in README files for improved layout consistency
* chore: update installation command in README files to ensure consistency across documentation
* chore: update README files to use absolute image URLs and synchronize content between root and MCP README
* chore: remove MCP README.md file and update .gitignore to track README.md
* chore: update README.md for clarity and consistency in naming conventions
* switch to NPM private registry for @swmansion/argent publishing
* switch publish workflow, constants, and test to npmjs.org registry
* revert publish.yml — deprecated workflow