Repository navigation
Expand file tree
/
Copy pathbuilder-connect-dialog.html
More file actions
104 lines (101 loc) · 6.32 KB
/
Copy pathbuilder-connect-dialog.html
File metadata and controls
104 lines (101 loc) · 6.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<div class="phoenix-builder-connect modal">
<div class="modal-header">
<h1 class="dialog-title">Phoenix Builder MCP</h1>
<ul class="nav nav-tabs no-focus" style="margin-bottom: 0;">
<li class="active"><a href="#builder-settings" data-toggle="tab">Settings</a></li>
<li><a href="#builder-logs" data-toggle="tab">Console Logs</a></li>
{{#mcpOverrideFile}}
<li><a href="#builder-prod" data-toggle="tab">Production</a></li>
{{/mcpOverrideFile}}
</ul>
</div>
<div class="modal-body tab-content">
<div id="builder-settings" class="tab-pane active">
<p class="dialog-message">Connect to the Phoenix Builder MCP server for automated testing with Claude Code.</p>
<div style="margin-bottom: 10px; padding: 6px 10px; background: var(--list-highlight-bg); border-radius: 4px;">
<span style="font-weight: bold;">Instance:</span>
<code style="margin-left: 4px;">{{instanceName}}</code>
</div>
<div style="margin-bottom: 10px;">
<label>
<input type="checkbox" class="builder-enable" {{#enabled}}checked{{/enabled}}>
Enable Connection
</label>
</div>
<div style="margin-bottom: 10px;">
<label>WebSocket URL</label>
<input type="text" class="builder-url" value="{{url}}" style="width: 100%; margin-top: 4px;">
</div>
<div style="margin-bottom: 10px;">
<span class="builder-status" style="font-weight: bold;">
{{#connected}}
<span style="color: green;">● Connected</span>
{{/connected}}
{{^connected}}
<span style="color: red;">● Disconnected</span>
{{/connected}}
</span>
</div>
<details style="margin-top: 10px; padding: 8px; border: 1px solid var(--item-border-color); border-radius: 4px;">
<summary style="cursor: pointer; font-weight: bold;">Claude Code Configuration</summary>
<p style="margin-top: 8px;">Add the following to your Claude Code MCP settings (.claude/settings.json):</p>
<pre class="builder-config-code" style="padding: 8px; border: 1px solid var(--item-border-color); border-radius: 4px; overflow-x: auto; font-size: 12px; cursor: pointer;" title="Click to copy">{
"mcpServers": {
"phoenix-builder": {
"command": "node",
"args": ["<path-to-phoenix>/phoenix-builder-mcp/index.js"],
"env": {
"PHOENIX_DESKTOP_PATH": "<path-to-phoenix-desktop>"
}
}
}
}</pre>
<p style="font-size: 12px; opacity: 0.7;">
Replace <code><path-to-phoenix></code> and <code><path-to-phoenix-desktop></code> with actual paths. Restart Claude Code after adding the config.
</p>
</details>
</div>
<div id="builder-logs" class="tab-pane">
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px;">
<span class="builder-log-count" style="font-size: 12px; opacity: 0.7;">0 entries</span>
<button class="btn btn-small builder-log-refresh" style="margin-left: auto;">Refresh</button>
</div>
<div class="builder-log-container" style="overflow-y: auto; max-height: 350px; font-family: monospace; font-size: 12px; border: 1px solid var(--item-border-color); border-radius: 4px; padding: 4px;">
<span style="opacity: 0.5;">No logs captured yet.</span>
</div>
</div>
{{#mcpOverrideFile}}
<div id="builder-prod" class="tab-pane">
<p class="dialog-message">
MCP is off in production builds. To instrument one, a machine admin drops a dated
permission in a root owned folder — being able to write there is what proves an
admin allowed it. It is a date, not a switch, so a permission cannot be left on by
accident: it works on that day only.
</p>
<p style="font-weight: bold; margin-bottom: 4px;">1. Grant it (click to copy, then run in a terminal)</p>
<pre class="builder-config-code" style="padding: 8px; border: 1px solid var(--item-border-color); border-radius: 4px; overflow-x: auto; font-size: 12px; cursor: pointer; white-space: pre-wrap; word-break: break-all;" title="Click to copy">{{mcpGrantCommand}}</pre>
<p style="font-size: 12px; opacity: 0.7; margin-top: 4px;">
Writes <code>{{mcpOverrideFile}}</code> with today's date, <code>{{mcpToday}}</code>.
Re-run it on any day you want to instrument again.
</p>
<p style="font-weight: bold; margin-bottom: 4px; margin-top: 12px;">2. Restart the production app twice</p>
<p style="font-size: 12px; opacity: 0.7; margin-top: 0;">
Nothing else to switch on — the file is the permission, and the app picks it up
by itself. Boot reads no files, to keep startup quick, so it consults a cached copy of
the date: the first start after step 1 caches it, the second acts on it. Removing the
file clears the cache the same way, one start later.
</p>
<p style="font-weight: bold; margin-bottom: 4px; margin-top: 12px;">Revoking</p>
<pre class="builder-config-code" style="padding: 8px; border: 1px solid var(--item-border-color); border-radius: 4px; overflow-x: auto; font-size: 12px; cursor: pointer; white-space: pre-wrap; word-break: break-all;" title="Click to copy">{{mcpRevokeCommand}}</pre>
<p style="font-size: 12px; opacity: 0.7; margin-top: 4px;">
It also lapses on its own at midnight. While anything is connected the production
window shows a red <b>Remote Controlled</b> badge in its status bar.
</p>
</div>
{{/mcpOverrideFile}}
</div>
<div class="modal-footer">
<button class="dialog-button btn primary" data-button-id="ok">Done</button>
<button class="dialog-button btn left" data-button-id="cancel">Cancel</button>
</div>
</div>