Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 31 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
with:
node-version: '22'
cache: npm
- name: Cache Windows packaging tools
if: matrix.os == 'windows-latest'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/electron-builder-cache
key: electron-builder-windows-${{ hashFiles('package-lock.json') }}
restore-keys: electron-builder-windows-
- run: npm ci --ignore-scripts
if: matrix.os != 'windows-latest'
- run: npm ci
Expand All @@ -31,10 +38,32 @@ jobs:
- run: npm test
- name: Package unsigned Windows app
if: matrix.os == 'windows-latest'
run: npm run package:win:app
shell: pwsh
env:
ELECTRON_BUILDER_CACHE: ${{ runner.temp }}/electron-builder-cache
run: |
for ($attempt = 1; $attempt -le 3; $attempt++) {
npm run package:win:app
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -eq 3) { exit $LASTEXITCODE }
Write-Host "Packaging failed; retrying ($attempt/3)..."
if ($attempt -eq 2) { $env:DEBUG = 'electron-builder' }
Start-Sleep -Seconds (10 * $attempt)
}
- name: Build unsigned Windows test installer
if: matrix.os == 'windows-latest'
run: npm run package:win:unsigned
shell: pwsh
env:
ELECTRON_BUILDER_CACHE: ${{ runner.temp }}/electron-builder-cache
run: |
for ($attempt = 1; $attempt -le 3; $attempt++) {
npm run package:win:unsigned
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -eq 3) { exit $LASTEXITCODE }
Write-Host "Packaging failed; retrying ($attempt/3)..."
if ($attempt -eq 2) { $env:DEBUG = 'electron-builder' }
Start-Sleep -Seconds (10 * $attempt)
}
- name: Stage Windows test installer
if: matrix.os == 'windows-latest'
shell: pwsh
Expand Down
5 changes: 5 additions & 0 deletions .projectroom/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ product:
summary: Show the number of configured services, tools, servers, APIs, suites, data sources and declared variable names, plus product content counts, in the expanded navigation.
status: done
relatedComponents: [product-spec, web]
- id: explorer-deduplication
title: Show each explorer integration once
summary: Merge linked CLI and MCP discoveries into their registered entries, and normalize OpenAPI spec paths before showing additional local files.
status: done
relatedComponents: [web]
- id: evidence-based-onboarding
title: Evidence-based onboarding progress
summary: Count only detected sections, keep configured entries separate from hands-on verification, review paths, commands and environment names, and make the agent inspect before writing.
Expand Down
4 changes: 2 additions & 2 deletions desktop/api-explorer.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ function listApiSources(root, config) {
if (item.spec) try { spec = readSpec(root, item.spec); } catch (cause) { error = cause.message; }
return { ...item, id: `yaml:${item.id}`, source: '.projectroom/project.yaml', linked: true, operations: spec?.operations || [], specTitle: spec?.title || '', specVersion: spec?.version || '', error };
});
const linkedPaths = new Set((config.workspace?.apiSources || []).map(item => item.spec).filter(Boolean));
return [...configured, ...discoverSpecs(root).filter(item => !linkedPaths.has(item.spec)).map(item => ({ ...item, linked: false, baseUrl: '' }))];
const linkedPaths = new Set((config.workspace?.apiSources || []).map(item => item.spec).filter(Boolean).map(spec => path.resolve(root, spec)));
return [...configured, ...discoverSpecs(root).filter(item => !linkedPaths.has(path.resolve(root, item.spec))).map(item => ({ ...item, linked: false, baseUrl: '' }))];
}
function editDocument(root) {
const base = fs.realpathSync(root);
Expand Down
21 changes: 20 additions & 1 deletion desktop/mcp-explorer.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ function substitute(value, environment) {
return String(value).replace(/\$\{([A-Z][A-Z0-9_]*)\}/g, (_match, name) => environment[name] || '');
}

function serverTarget(root, item) {
if (item.builtIn) return null;
if (item.transport === 'stdio') {
if (!item.command) return null;
return JSON.stringify(['stdio', path.resolve(root, item.cwd || '.'), item.command, item.args || []]);
}
if (!item.url) return null;
try { return JSON.stringify([item.transport, new URL(item.url).href]); }
catch { return null; }
}

class McpExplorer {
constructor(options) { this.options = options; this.active = new Map(); }
discover() {
Expand All @@ -81,8 +92,16 @@ class McpExplorer {
list() {
const linked = new Map((this.options.getConfig()?.workspace?.mcpServers || []).filter(item => item.linkedFrom).map(item => [item.linkedFrom, item.id]));
const root = this.options.getRoot();
const candidates = this.discover();
const registered = new Map(candidates.filter(item => item.source === '.projectroom/project.yaml')
.map(item => [serverTarget(root, item), item.id.slice(5)]).filter(([target]) => target));
for (const item of candidates) {
if (item.builtIn || item.source === '.projectroom/project.yaml' || linked.has(item.id)) continue;
const match = registered.get(serverTarget(root, item));
if (match) linked.set(item.id, match);
}
const revision = root ? sourceRevision(root) : null;
return this.discover().map(item => ({ ...publicCandidate(item, name => !!this.options.getEnvironment(name)),
return candidates.map(item => ({ ...publicCandidate(item, name => !!this.options.getEnvironment(name)),
connected: this.active.has(item.id), linkedId: linked.get(item.id) || null,
buildIdentity: this.active.get(item.id)?.buildIdentity || (item.transport === 'stdio' && !item.builtIn && item.build?.file ? readBuildIdentity(root, item, revision) : null) }));
}
Expand Down
5 changes: 5 additions & 0 deletions dist/.projectroom/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ product:
summary: Show the number of configured services, tools, servers, APIs, suites, data sources and declared variable names, plus product content counts, in the expanded navigation.
status: done
relatedComponents: [product-spec, web]
- id: explorer-deduplication
title: Show each explorer integration once
summary: Merge linked CLI and MCP discoveries into their registered entries, and normalize OpenAPI spec paths before showing additional local files.
status: done
relatedComponents: [web]
- id: evidence-based-onboarding
title: Evidence-based onboarding progress
summary: Count only detected sections, keep configured entries separate from hands-on verification, review paths, commands and environment names, and make the agent inspect before writing.
Expand Down
8 changes: 5 additions & 3 deletions dist/cli-explorer-ui.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/docs/product/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ The Backlog combines repository-backed local issues with Spec Kit features, bug

## MCP Explorer

The catalog shows a client setting only when it is not already linked to a YAML registration. Matching uses transport plus the complete command or URL; different arguments and endpoints remain separate.

The desktop's immediate MCP inventory reads project client configuration and `workspace.mcpServers`; it does not claim to infer every server from arbitrary source code. The optional setup prompt passes a repository-specific guide to the user's coding agent. That agent must complete the guide's source-audit matrix for product context, services, HTTP APIs, MCP servers, CLI tools, tests, data and runtime evidence. It traces wrappers and hidden subcommands, makes a second source pass before reporting absence, and reconciles any existing YAML against source. This catches a local `stdio` MCP server exposed only as a CLI subcommand. The first-phase report separates verified implementations from uncertain candidates, names source evidence, environment variable names and access scope, and waits for review. A server requiring a separate read-only key must not receive an owner credential. Registration does not connect or invoke it; the user tests the server in MCP Explorer deliberately.

The source audit improves setup completeness but is not a universal protocol importer or a runtime test. MCP Explorer supports local `stdio`, Streamable HTTP and legacy SSE with manual connection; custom transports need an adapter. It labels project registrations separately from coding-tool client settings, which can point to external servers. API Explorer uses existing OpenAPI 3.x documents, an explicitly loaded OpenAPI path on a registered API, or manually entered HTTP paths and supports none, Bearer, API key and public-client OAuth; GraphQL, gRPC, multipart uploads, cookie/Basic/mTLS and confidential OAuth clients have no dedicated request flow. CLI Explorer discovers common package, Python, Cargo, Go and executable entry points; unbuilt package targets are visible but cannot be run until built. Individual subcommands and safe arguments still need source review or explicit help. Test Explorer can discover Node and Rust cases in supported forms; other runners need explicit test commands. Data Explorer handles PostgreSQL, MySQL/MariaDB, SQLite and local files, not every database or event stream. Foreground services and explicitly modeled detached lifecycles are operable; the CPU/memory collector does not measure containers after a detached launch. The agent should mark these limits as unsupported or manual rather than fabricate an integration.

## API Explorer

A project OpenAPI file already named in `workspace.apiSources` appears only as the registered API, including when the relative path uses a `./` prefix.

Project-local OpenAPI 3.x files are scanned read-only and listed beside HTTP APIs declared in `workspace.apiSources`. The file remains the source of truth for endpoint paths and summaries; the repository YAML stores only its relative path, clean base URL and public authentication metadata. Alternatively, `specPath` identifies a dynamically served OpenAPI document on the registered API. The user must click **Load OpenAPI**; the main process fetches from that API's origin without redirects or authentication headers, with a timeout and 2 MB limit. An API can be registered without a spec and tested with a manually entered relative path. The main process performs a request only after the user clicks Send, checks that the target stays on the selected origin, blocks redirects, applies a timeout and bounds the response preview. It resolves Bearer and API-key values from the local project `.env`. Public-client OAuth uses PKCE and a loopback callback; access and refresh tokens are encrypted outside the repository with macOS secure storage. Activity records only request metadata, without headers, query values, body or response content. The included Hello Workspace has a matching OpenAPI document for its real health and notes endpoints.

## MCP Explorer
Expand Down
2 changes: 2 additions & 0 deletions dist/docs/product/command-tools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CLI Explorer

An entry point already linked to a registered YAML tool appears only once, under the registered tool. Catalog counts reflect distinct tools rather than both discovery and registration.

CLI Explorer follows the same browse and inspect layout as MCP Explorer. The left catalog lists **Discovered locally** entry points found by reading the open repository: `package.json` `bin` entries, Python project scripts, Cargo binaries, Go `cmd/*/main.go` and `examples/*/main.go` programs, and executable CLI files. A package CLI whose declared `dist/` or `build/` target is absent is labeled **Build required**; it cannot be run, linked or queried for help until that target exists. This scan does not run candidates. It is intentionally bounded and may miss custom build systems; ordinary package scripts and tests are not automatically treated as product CLIs. **In .projectroom/project.yaml** lists registered `commandTool` components. Select either type to inspect it on the right.

Select a discovered entry to see its source file and exact command. **Read help** explicitly starts the command with `--help`, `-h`, or `help` and shows the real output, including a parsed synopsis, paired short and long flags, common subcommand lists and positional arguments where recognizable. Parsed commands and options become suggestions in Explore. The full original output stays visible because CLI help has no universal machine-readable format. A program can have side effects even while printing help; Project Room never requests it automatically. Discovery does not prove that the CLI is safe or fully documented.
Expand Down
2 changes: 1 addition & 1 deletion dist/mcp-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
let message = '';
const safe = value => escapeHtml(value == null ? '' : String(value));
const selected = () => servers.find(item => item.id === selectedId);
const projectServers = async () => (await pv.listMcpServers()).filter(item => !item.builtIn);
const projectServers = async () => (await pv.listMcpServers()).filter(item => !item.builtIn && !item.linkedId);
const editable = item => !!item && item.id.startsWith('yaml:');
const activeItems = () => detail ? ({ tools: detail.tools, resources: detail.resources, templates: detail.resourceTemplates, prompts: detail.prompts })[selectedKind] || [] : [];
const activeItem = () => activeItems().find(item => (item.name || item.uri || item.uriTemplate) === selectedName);
Expand Down
9 changes: 9 additions & 0 deletions dist/projectroom.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
"web"
]
},
{
"id": "explorer-deduplication",
"title": "Show each explorer integration once",
"summary": "Merge linked CLI and MCP discoveries into their registered entries, and normalize OpenAPI spec paths before showing additional local files.",
"status": "done",
"relatedComponents": [
"web"
]
},
{
"id": "evidence-based-onboarding",
"title": "Evidence-based onboarding progress",
Expand Down
4 changes: 3 additions & 1 deletion dist/v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ async function commandDiscover(force = false) {
const found = await pv.discoverCliTools();
if (root === projectRoot) {
commandCandidates = found;
if (commandCandidateId && !found.some(item => item.id === commandCandidateId)) commandCandidateId = null;
const selected = found.find(item => item.id === commandCandidateId);
if (selected?.linkedId) { commandSelectedId = selected.linkedId; commandCandidateId = null; }
else if (commandCandidateId && !selected) commandCandidateId = null;
}
} catch (error) { if (root === projectRoot) commandCandidatesError = error.message; }
finally {
Expand Down
Loading
Loading