Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
ddf106e
fix(ai-native): localize ACP chat input placeholder
lulusir May 19, 2026
570be42
docs: update ACP refactor design to use @agentclientprotocol/sdk
lulusir May 20, 2026
89997e5
docs: add ACP Node layer refactor implementation plan
lulusir May 20, 2026
8b4023c
fix(plan): address code review findings for ACP Node SDK refactor plan
lulusir May 20, 2026
660fde1
fix(plan): correct OpenSumi RPC architecture description — single WS,…
lulusir May 20, 2026
d20cf71
fix(plan): rework AcpThread to use DI factory instead of manual new
lulusir May 20, 2026
9532dd8
feat(ai-native): add AcpThread entity with process lifecycle, SDK con…
lulusir May 20, 2026
e945ddc
fix(ai-native): align AcpThread with spec — entry types, events, and API
lulusir May 20, 2026
17caef2
feat(ai-native): add AcpThreadFactory DI provider for creating thread…
lulusir May 20, 2026
4386921
refactor(ai-native): align handler interfaces with ACP Node SDK refac…
lulusir May 20, 2026
00263d9
feat(ai-native): restructure permission system for multi-session ACP …
lulusir May 20, 2026
faabcad
feat(ai-native): rewrite AcpAgentService with thread pool pattern
lulusir May 20, 2026
d0f025d
fix(acp): pass sessionId to requestPermission in agent-request handler
lulusir May 20, 2026
6b26af2
refactor(ai-native): wire PermissionRoutingService into AcpThread and…
lulusir May 20, 2026
99b81db
fix(ai-native): use agent-generated sessionId in AcpAgentService.crea…
lulusir May 20, 2026
aba8fd4
feat(ai-native): add missing session methods to AcpThread
lulusir May 21, 2026
8be6197
refactor(ai-native): remove AcpCliClientService and CliAgentProcessMa…
lulusir May 21, 2026
79e62c9
refactor(ai-native): move notification-to-AgentUpdate mapping from Ac…
lulusir May 21, 2026
54bd6d8
docs: add implementation plan for AcpThread full delegation
lulusir May 21, 2026
8cb4248
fix(ai-native): delegate setSessionMode to AcpThread instead of log-only
lulusir May 21, 2026
7cff924
fix(ai-native): add error handling to setSessionMode delegation
lulusir May 21, 2026
c50ca9b
feat(ai-native): add loadSessionOrNew with fallback to new session
lulusir May 21, 2026
55980c7
fix(ai-native): proper cleanup on loadSessionOrNew failure
lulusir May 21, 2026
efe6bf6
feat(ai-native): add setSessionConfigOption delegation to AcpThread
lulusir May 21, 2026
7366fa9
fix(ai-native): add error handling to setSessionConfigOption delegation
lulusir May 21, 2026
b90b459
feat(ai-native): add fork/resume/close/setSessionModel delegation to …
lulusir May 21, 2026
240783b
fix(ai-native): add error handling to unstable session methods
lulusir May 21, 2026
007f25e
feat(ai-native): add proxy methods for new AcpAgentService session op…
lulusir May 21, 2026
8ffb241
fix(ai-native): delegate listSessions to all active threads and dedup…
lulusir May 21, 2026
7f9336c
refactor(ai-native): remove as any from listSessions, use proper Sess…
lulusir May 21, 2026
65804f2
fix(ai-native): preserve nextCursor in listSessions for single-thread…
lulusir May 21, 2026
0767130
feat(ai-native): add cwd getter to AcpThread and include cwd in log s…
lulusir May 21, 2026
c94804c
fix(ai-native): pass cwd to listSessions in AcpCliBackService
lulusir May 21, 2026
a1e0947
fix(ai-native): show loaded session messages instead of welcome page
lulusir May 21, 2026
e1629c0
fix(ai-native): only trigger slash dropdown when / is first non-white…
lulusir May 21, 2026
5ea8c23
fix(ai-native): fix type mismatches in resumeSession and setSessionCo…
lulusir May 21, 2026
dc2f0d4
fix(ai-native): register sessions in PermissionRoutingService and uni…
lulusir May 22, 2026
5e4eda4
docs: add design spec for session-bound permission dialogs
lulusir May 22, 2026
fde5050
docs: add implementation plan for session-bound permission dialogs
lulusir May 22, 2026
3842be1
feat(ai-native): add active session tracking to AcpPermissionBridgeSe…
lulusir May 22, 2026
b7ebaf8
feat(ai-native): add session-scoped dialog retrieval to PermissionDia…
lulusir May 22, 2026
39237f0
feat(ai-native): filter permission dialogs by active session
lulusir May 22, 2026
fba2c57
feat(ai-native): notify permission bridge on session switch
lulusir May 22, 2026
fc1913e
fix(ai-native): extract prefix helper and notify bridge in clearSessi…
lulusir May 22, 2026
6031c43
test(ai-native): add session-bound permission dialog tests
lulusir May 22, 2026
bf7af9c
fix(ai-native): address review feedback for session-bound permission …
lulusir May 22, 2026
af08b17
feat(ai-native): add ThreadStatus and IChatThreadStatus types
lulusir May 22, 2026
0f3b422
fix(ai-native): clear session dialogs when session is deleted
lulusir May 22, 2026
3c65dcf
feat(ai-native): inject threadStatus into AgentUpdate stream
lulusir May 22, 2026
43cc145
feat(ai-native): emit IChatThreadStatus in RPC response stream
lulusir May 22, 2026
56b534e
feat(ai-native): add threadStatus state and onThreadStatusChange even…
lulusir May 22, 2026
51de1ca
feat(ai-native): render thread status icons in ACP chat history
lulusir May 22, 2026
cc5c56f
feat(ai-native): handle IChatThreadStatus in AcpChatAgent
lulusir May 22, 2026
7f0131e
feat(ai-native): subscribe to threadStatus changes in chat history
lulusir May 22, 2026
8b9c24f
docs: add acceptance test cases for session-bound permission dialogs
lulusir May 22, 2026
77d7155
fix(ai-native): lazy-resolve RPC client to fix 'No active RPC client'…
lulusir May 22, 2026
550a7fb
fix(ai-native): move PermissionRoutingService to backServices to fix …
lulusir May 22, 2026
38e3354
fix(ai-native): bridge RPC client across parent/child injector scopes…
lulusir May 22, 2026
2d3cae4
fix(ai-native): fix compilation errors and add WebMCP test mock fix
lulusir May 22, 2026
503df7b
fix(ai-native): fix thread status not showing in chat history and per…
lulusir May 24, 2026
e38e658
docs(superpowers): add dev-loop skill design spec
lulusir May 25, 2026
5bb362c
docs(superpowers): add dev-loop skill implementation plan
lulusir May 25, 2026
3d90b63
test(bdd): migrate CDP/WebMCP scenarios from specs to test/bdd
lulusir May 25, 2026
55c2b91
refactor(skills): merge cdp-webmcp-bridge into verification-scenarios
lulusir May 25, 2026
ae6d4fa
feat(skills): add dev-loop orchestrator skill
lulusir May 25, 2026
ff87beb
fix(skills): address code review findings for dev-loop skill
lulusir May 25, 2026
8e9b9b7
fix(skills): address final review blocking issues
lulusir May 25, 2026
4ce6474
fix(acp): unify thread status icons with spinning animation for worki…
lulusir May 25, 2026
68595e1
docs(superpowers): add background permission notification design spec
lulusir May 26, 2026
8f69431
feat(acp): add pending permission index to bridge service
lulusir May 26, 2026
d20791d
feat(acp): register nodePath and agents preference schema entries
lulusir May 26, 2026
9b09063
fix(acp): extract cleanupPendingIndex and add defensive event fire
lulusir May 26, 2026
4baa4f0
style(acp): add pending permission badge styles
lulusir May 26, 2026
4a70eb3
feat(acp): add agentId and nodePath to thread interfaces, remove debu…
lulusir May 26, 2026
f7a1790
feat(acp): render pending permission icon and badge in AcpChatHistory
lulusir May 26, 2026
d4461f7
fix(acp): use correct CSS variable for pending permission key icon
lulusir May 26, 2026
9918289
feat(acp): implement buildAcpAgentProcessConfig browser pure function
lulusir May 26, 2026
e1f7fac
feat(acp): sync pending permission icon/badge to ChatHistory.acp
lulusir May 26, 2026
a3525d9
feat(acp): implement resolveAgentSpawnConfig node pure function
lulusir May 26, 2026
e35c76b
feat(acp): wire pending permission badge into chat view header
lulusir May 26, 2026
f77ddf6
fix(acp): replace startProcess with resolveAgentSpawnConfig, clean de…
lulusir May 26, 2026
4fdc89f
feat(acp): pass agentId and nodePath through AcpThreadRuntimeConfig
lulusir May 26, 2026
050eeaf
fix(acp): remove unused pendingPermissionBadge from base ChatHistory …
lulusir May 26, 2026
7ee51b2
feat(acp): wire buildAcpAgentProcessConfig into DefaultACPConfigProvider
lulusir May 26, 2026
2cdc4a9
feat(acp): complete pending permission badge on base ChatHistory
lulusir May 26, 2026
8de6865
feat(acp): complete ACP v2 implementation - path config, test fixes, …
lulusir May 26, 2026
eeaeb4e
docs: add ACP WebMCP groups design spec
lulusir May 26, 2026
43b402f
docs: address review feedback on ACP WebMCP groups design
lulusir May 26, 2026
ba1035e
docs: add ACP WebMCP groups implementation plan
lulusir May 26, 2026
ffee9cc
feat(acp): background session permission notification in history list
lulusir May 26, 2026
9b82ab0
feat(acp): add WebMCP group types and RPC interface definitions
lulusir May 27, 2026
4009e79
feat(acp): add shared WebMCP utility helpers
lulusir May 27, 2026
29abb9b
feat(acp): add browser-side WebMCP group registry
lulusir May 27, 2026
ab70145
feat(acp): add WebMCP RPC bridge services (browser + node)
lulusir May 27, 2026
b7309db
feat(acp): add Node-side WebMCP extension method handler
lulusir May 27, 2026
076b7b1
feat(acp): hook WebMCP handler into AcpThread extMethod and add capab…
lulusir May 27, 2026
45e4bd0
feat(acp): wire up DI registration for WebMCP group services
lulusir May 27, 2026
4151d96
feat(acp): add file WebMCP group definition
lulusir May 27, 2026
551bd4c
feat(acp): add terminal WebMCP group definition
lulusir May 27, 2026
9e0455a
feat(acp): add editor WebMCP group definition
lulusir May 27, 2026
837ad7b
feat(acp): register file, terminal, editor WebMCP groups in contribution
lulusir May 27, 2026
252a930
test(acp): add AcpWebMcpHandler unit tests
lulusir May 27, 2026
81d407a
fix(acp): resolve compilation errors in WebMCP groups implementation
lulusir May 27, 2026
afea8a7
fix(ai-native): preserve ACP error messages
lulusir May 27, 2026
9f018d9
fix(acp): use lazy initialization for WebMCP handler to fix RPC timin…
lulusir May 27, 2026
87d4141
feat: pass MCP servers into ACP sessions
lulusir May 27, 2026
97c61d4
feat(acp): enhance WebMCP handler with tool details and improve RPC r…
lulusir May 27, 2026
3e0ee6e
chore: remove outdated superpowers plans/specs and refine WebMCP handler
lulusir May 27, 2026
eac4e59
fix(acp): correct chat history pending icon, active highlight, and it…
lulusir May 28, 2026
b47f61b
feat(ai-native): expose WebMCP tools via MCP server
lulusir May 28, 2026
fd93236
fix: stabilize ACP session state handling
lulusir May 29, 2026
1e7ee6b
refactor(acp): consolidate WebMCP on HTTP MCP and stabilize sessions
lulusir May 29, 2026
89998d2
fix(ai-native): harden ACP MCP capability fallback
lulusir May 29, 2026
e082f2a
feat: add WebMCP exposure switch
lulusir May 29, 2026
7494569
refactor: preserve acp session notifications
lulusir May 29, 2026
40959b1
fix(ai-native): recycle ACP threads by LRU
lulusir May 29, 2026
dfcb3a2
fix(ai-native): preserve ACP history titles
lulusir May 30, 2026
10d273d
test: add WebMCP contract red tests
lulusir May 30, 2026
0bce443
fix(ai-native): stabilize acp chat history sessions
lulusir Jun 1, 2026
055f414
feat(ai-native): expand ACP chat input
lulusir Jun 1, 2026
cc8abf6
fix(ai-native): hide ACP chat clear header action
lulusir Jun 1, 2026
c6fdee0
feat(ai-native): add agentic panel layout
lulusir Jun 1, 2026
ef52876
feat(ai-native): add ACP agentic history rail
lulusir Jun 1, 2026
e01da78
test(ai-native): cover agentic layout split resizing
lulusir Jun 1, 2026
3bc0cef
feat(ai-native): support ACP session config controls
lulusir Jun 1, 2026
3ccb23d
feat(ai-native): improve ACP session state handling
lulusir Jun 1, 2026
652064c
fix: isolate ai layout state profiles
lulusir Jun 2, 2026
75a4a71
fix: restore ai chat layout visibility
lulusir Jun 2, 2026
fd7115c
fix: open ai chat after layout switch
lulusir Jun 2, 2026
780b391
fix: refresh tabbar resize handle on layout switch
lulusir Jun 2, 2026
e436239
fix: restore ai chat after agentic layout toggle
lulusir Jun 2, 2026
bd56bdb
chore: add acp chat diagnostics
lulusir Jun 2, 2026
6aaea3e
feat: handle acp session state updates
lulusir Jun 3, 2026
e993939
feat(ai-native): collapse agentic chat history
lulusir Jun 3, 2026
ee46e7c
fix: sort acp chat history by creation time
lulusir Jun 3, 2026
90228ad
chore: commit remaining acp workspace changes
lulusir Jun 3, 2026
835da45
docs: remove obsolete acp notes
lulusir Jun 3, 2026
d8b1426
test: provide webcrypto in jest node setup
lulusir Jun 4, 2026
9b22956
test: remove acp layout switch playwright test
lulusir Jun 4, 2026
bf569fe
fix: update webmcp tool names and chat agent tests
lulusir Jun 4, 2026
ca92635
fix: dedupe WebMCP model context tools
lulusir Jun 4, 2026
18e9ae5
fix: prevent duplicate webmcp model context tools
lulusir Jun 4, 2026
b52d863
feat: configure ACP thread pool size
lulusir Jun 4, 2026
3615e73
fix(file-service): handle watcher process startup failures
lulusir Jun 5, 2026
fce482a
revert: file-service watcher startup handling
lulusir Jun 5, 2026
f72759a
feat(ai-native): unify built-in MCP management
lulusir Jun 5, 2026
5e9fd2e
chore(ai-native): simplify WebMCP usage hint
lulusir Jun 5, 2026
c05778e
feat(ai-native): defer ACP session creation until first send
lulusir Jun 5, 2026
201358d
fix(ai-native): tune classic chat panel sizing
lulusir Jun 5, 2026
5f6d1ba
test(ai-native): remove deprecated WebMCP modelContext adapter test
lulusir Jun 5, 2026
2abb88e
refactor(ai-native): simplify AcpChatViewWrapper initialization logic
lulusir Jun 5, 2026
a950391
chore(ai-native): remove unused .timeout_hint and .retry_button CSS
lulusir Jun 5, 2026
0d6d273
test: add ACP BDD scenarios
lulusir Jun 5, 2026
841b570
fix(ai-native): ignore blank ACP chat submits
lulusir Jun 5, 2026
a0948a1
chore: organize ACP BDD scenarios
lulusir Jun 5, 2026
46c4899
chore(test): move BDD evidence files to gitignored directory
lulusir Jun 5, 2026
e2c99ee
feat: agentic history add mcp
lulusir Jun 5, 2026
8b271a0
feat(ai-native): expose OpenSumi MCP connection
lulusir Jun 6, 2026
7795a70
fix(ai-native): restore agentic explorer panel width
lulusir Jun 7, 2026
303c1f6
fix(file-service): stabilize dev watcher startup
lulusir Jun 8, 2026
f7c29a4
feat(ai-native): eager session init and deduplicate concurrent sessio…
lulusir Jun 8, 2026
ca06494
feat(ai-native): sort ACP sessions newest-first and support WebMCP pr…
lulusir Jun 8, 2026
0bf6c79
fix(ai-native): restore classic chat panel size and enable resize for…
lulusir Jun 8, 2026
12f66bc
docs: update BDD scenarios for ACP v2 session init, sorting, and layo…
lulusir Jun 8, 2026
2ba44b3
fix(ai-native): pass isLatter argument to resizeHandle.getSize()
lulusir Jun 8, 2026
e0abde4
refactor(ai-native): bridge ACP browser RPC clients internally
lulusir Jun 8, 2026
0718330
fix: default ai native panel layout to classic
lulusir Jun 8, 2026
44b3418
ci: install libsecret-1-dev before yarn install on Linux
lulusir Jun 8, 2026
d1e1e27
fix(ai-native): decouple mcp config command constants
lulusir Jun 8, 2026
413e7c3
chore: restore non-ai-native test and watcher changes
lulusir Jun 8, 2026
8e3eb8c
ci: skip electron binary download in unit test CI
lulusir Jun 8, 2026
61cb853
fix(ai-native): render ACP plan and recover prompt errors
lulusir Jun 8, 2026
bbe3e5b
test: add BDD evidence reporting
lulusir Jun 8, 2026
92264f2
fix(ai-native): preserve ACP draft footer controls
lulusir Jun 9, 2026
14b3a6b
fix(ai-native): bootstrap ACP session metadata
lulusir Jun 9, 2026
fa7311f
fix(ai-native): refine ACP agentic chat behavior
lulusir Jun 9, 2026
3ce8cc6
test: stabilize mcp config ci checks
lulusir Jun 9, 2026
a39fa8b
fix(playwright): use fixture destructuring in ACP e2e tests
lulusir Jun 10, 2026
fad7db8
chore(ai-native): remove thread status debug logs
lulusir Jun 10, 2026
1f93d7b
chore(ai-native): rename agentic layout label
lulusir Jun 10, 2026
2ad34df
test: stabilize acp webmcp e2e setup
lulusir Jun 10, 2026
056ecb0
test: stabilize acp reasoning and debug e2e
lulusir Jun 10, 2026
7622c26
fix(playwright): stabilize ACP and debug E2E tests
lulusir Jun 11, 2026
3fd0a8e
fix(ai-native): stabilize agentic side entries
lulusir Jun 11, 2026
88c0661
test: add ACP long-stream BDD coverage
lulusir Jun 11, 2026
5887ed0
test: add agentic history coverage
lulusir Jun 11, 2026
71d6f15
test: harden ACP permission dialog BDD coverage
lulusir Jun 11, 2026
109d273
test: cover ACP failure recovery fixtures
lulusir Jun 11, 2026
057c762
fix(ai-native): load ACP history sessions for WebMCP list
lulusir Jun 11, 2026
d60d679
fix: handle ACP prompt disconnect recovery
lulusir Jun 11, 2026
577215e
test: stabilize agentic explorer visibility wait
lulusir Jun 12, 2026
f8569a3
fix(ai-native): expose full profile webmcp tools
lulusir Jun 12, 2026
96c484a
test(ai-native): add ACP fallback readiness fixture
lulusir Jun 12, 2026
71a5645
fix(ai-native): clear ACP context preview after send
lulusir Jun 12, 2026
f7c8c84
fix(ai-native): expose full-profile file mutation mcp tools
lulusir Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
tmp/**

packages/process/scripts
tools/electron/scripts
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-

- name: Install libsecret-1
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev

- name: Install
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: |
yarn install --immutable
yarn constraints
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,10 @@ tools/workspace
.ipynb_checkpoints

*.tsbuildinfo
.env
.env

# Claude Code
.claude/
.claudebak

.understand-anything/
110 changes: 110 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# OpenSumi Core Agent Guide

This file is the root-level guide for agents working in the OpenSumi core repository. Keep it stable, project-wide, and useful for long-term maintenance. Short-term feature context belongs in the appendix or in task-specific notes.

## Project Overview

- This repository is the `@opensumi/core` TypeScript monorepo for OpenSumi.
- Package management uses Yarn 4.4.1 with `nodeLinker: node-modules`; the required Node version is `>=18.12.0`.
- Workspaces are `packages/*`, `tools/dev-tool`, `tools/playwright`, and `tools/cli-engine`.
- Common entrypoints:
- `yarn install` installs dependencies.
- `yarn run init` performs the full clean/build initialization.
- `yarn start` starts the normal web IDE.
- `yarn start:e2e` starts the e2e profile.
- `yarn start:electron` starts the Electron profile.
- `yarn test` runs Jest with the repository defaults.
- `yarn test:ui` runs Playwright UI tests.
- Before starting local services, check common ports when relevant:

```bash
lsof -nP -iTCP:8080 -sTCP:LISTEN || true
lsof -nP -iTCP:8000 -sTCP:LISTEN || true
```

## Code Navigation

- Use CodeGraph for structural questions: symbol definitions, signatures, callers, callees, dependency impact, and unfamiliar module surveys.
- Use `rg` for literal text: log messages, comments, string constants, file names, and exact code fragments.
- Do not grep first when looking for a symbol by name if CodeGraph is available.
- When changing shared behavior, inspect both implementation and nearby tests before editing.
- For broad areas, prefer `codegraph_context` or `codegraph_explore` over a chain of narrow searches.

## Architecture Boundaries

- Respect the `browser`, `node`, and `common` split:
- `browser` code must not import `node` runtime modules.
- `node` code must not import `browser` runtime modules.
- `common` code must not depend on browser-only or node-only runtime modules.
- Preserve package boundaries under `packages/*`. Prefer public package exports and existing local APIs over deep imports unless the surrounding code already does so.
- Follow OpenSumi's contribution and dependency-injection patterns. Prefer existing contribution registries, services, symbols, and lifecycle hooks over ad hoc wiring.
- When changing public types, settings, commands, contribution contracts, or exported package APIs, check downstream references across the monorepo and update tests at the contract boundary.
- Keep UI changes consistent with existing OpenSumi components, layout services, tabbar behavior, and style conventions.

## Development Workflow

- Start with `git status --short`. This repository often has active local changes.
- Never revert or overwrite user changes unless explicitly requested.
- Keep edits narrowly scoped to the requested behavior. Avoid unrelated refactors, formatting churn, and metadata changes.
- Use `apply_patch` for manual tracked-file edits.
- Prefer repository scripts and local helper APIs over introducing new tooling.
- For structured data, use structured parsers or existing helpers instead of ad hoc string manipulation.
- Before finishing code changes, run `git diff --check` when practical.

## Build and Test Matrix

- TypeScript or shared API changes: choose the narrowest affected TypeScript reference or package-level typecheck that covers the files you touched. For cross-package contracts, use the relevant reference under `configs/ts/references/`.

```bash
yarn tsc --build <affected-ts-reference> --pretty false
```

- Package-specific build when touching package build output or package-level contracts: run the build for the workspace package you changed.

```bash
yarn workspace <affected-workspace> build
```

- Focused Jest tests are usually preferred over full-suite runs during iteration:

```bash
yarn test <path-to-test> --runInBand
yarn jest <path-to-test> --runInBand
```

- Use `--selectProjects jsdom` or `--runTestsByPath` for browser/jsdom tests when the Jest project selection matters.
- For layout, startup, browser integration, or real DOM behavior, validate with the running IDE or Playwright/CDP in addition to unit tests.
- For UI test coverage, use:

```bash
yarn test:ui
yarn test:ui-headful
yarn test:ui-report
```

- For BDD scenarios, read `test/bdd/README.md` first and run only the relevant scenario set unless the user asks for the full suite.
- If a full verification is too expensive or blocked, report the focused checks that ran and the remaining risk.

## Review Expectations

- For code reviews, lead with correctness issues, behavioral regressions, contract risks, and missing tests.
- Prefer concrete file/line references and describe the user-visible or integration impact.
- For cross-package changes, check API compatibility, import boundaries, and whether dependent packages need updated tests.
- For UI/layout reviews, check real runtime behavior, not just component snapshots.
- For protocol, MCP, WebMCP, or extension-facing changes, check naming stability, capability gating, backwards compatibility, and log/token safety.

## Current Focus Appendix

This appendix is for stable guidance that is still too area-specific for the main sections. Do not store short-term feature notes, temporary tool names, sprint priorities, or one-off validation shortcuts in the root `AGENTS.md`. Put those details in a nearby package-level `AGENTS.md`, `test/bdd/README.md`, protocol documentation, or task-specific notes instead.

### Protocol, MCP, and Extension-Facing Work

- Treat protocol types, contribution registries, BDD scenarios, and nearby package documentation as the source of truth for current capability names and behavior.
- Keep externally visible names stable unless the task explicitly changes the public contract. When changing them, update browser exposure, MCP exposure, tests, and documentation together.
- For security-sensitive integration points, verify capability gating, backwards compatibility, and log/token redaction.

### Layout and Runtime Validation

- For layout, startup, browser integration, or real DOM behavior, validate the relevant runtime profile rather than relying only on component snapshots.
- Choose the launch profile that actually enables the feature under test. If profiles differ, document which profile you used and what risk remains.
- For browser checks, wait until the IDE is fully loaded before judging layout or behavior.
9 changes: 9 additions & 0 deletions jest.setup.node.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
require('./jest.setup.base');

const nodeCrypto = require('crypto');

const { JSDOM, ResourceLoader } = require('jsdom');

if (!global.crypto || !global.crypto.getRandomValues || !global.crypto.subtle) {
Object.defineProperty(global, 'crypto', {
value: nodeCrypto.webcrypto,
configurable: true,
});
}

const resourceLoader = new ResourceLoader({
strictSSL: false,
userAgent: `Mozilla/5.0 (${
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
ACP_BDD_BACKEND_READY_FAILURE_QUERY_PARAM,
ACP_BDD_BACKEND_READY_FAILURE_QUERY_VALUE,
canUseAcpBddRuntimeFixture,
shouldForceAcpBackendReadinessFailure,
} from '../../src/browser/acp/acp-bdd-runtime-fixtures';

describe('ACP BDD runtime fixtures', () => {
it('only enables runtime fixture switches on loopback hosts', () => {
expect(canUseAcpBddRuntimeFixture('localhost')).toBe(true);
expect(canUseAcpBddRuntimeFixture('127.0.0.1')).toBe(true);
expect(canUseAcpBddRuntimeFixture('::1')).toBe(true);
expect(canUseAcpBddRuntimeFixture('[::1]')).toBe(true);
expect(canUseAcpBddRuntimeFixture('example.com')).toBe(false);
expect(canUseAcpBddRuntimeFixture(undefined)).toBe(false);
});

it('requires the aiNative test mode query and explicit readiness failure value', () => {
const enabledSearch = `?aiNative=true&${ACP_BDD_BACKEND_READY_FAILURE_QUERY_PARAM}=${ACP_BDD_BACKEND_READY_FAILURE_QUERY_VALUE}`;

expect(shouldForceAcpBackendReadinessFailure(enabledSearch, 'localhost')).toBe(true);
expect(shouldForceAcpBackendReadinessFailure(enabledSearch, 'example.com')).toBe(false);
expect(
shouldForceAcpBackendReadinessFailure(`?${ACP_BDD_BACKEND_READY_FAILURE_QUERY_PARAM}=reject`, 'localhost'),
).toBe(false);
expect(
shouldForceAcpBackendReadinessFailure(
`?aiNative=true&${ACP_BDD_BACKEND_READY_FAILURE_QUERY_PARAM}=false`,
'localhost',
),
).toBe(false);
});
});
Loading
Loading