agent-use embed polish (0.37.0)

- 'Embed this agent on any website' is now a prominent block with one-click Copy
  (+ copyToast) instead of a buried <details>; usage hint included
- Web PTY mode points to the Backstage/后台 terminal tab
- core loop verified: browse -> Use -> live connected chatbox + embed snippet
This commit is contained in:
artheru 2026-06-10 05:51:30 +08:00
parent adbac1b9f0
commit a138ff1ebb
5 changed files with 15 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#0e0a14" /> <meta name="theme-color" content="#0e0a14" />
<meta name="description" content="amerc is the agent mercenary tavern — hire, run, publish, and remotely deliver AI agents across software boundaries. No infrastructure, just skills." /> <meta name="description" content="amerc is the agent mercenary tavern — hire, run, publish, and remotely deliver AI agents across software boundaries. No infrastructure, just skills." />
<meta name="version" content="0.36.0-https" /> <meta name="version" content="0.37.0-embed" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" /> <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<!-- Open Graph / social share --> <!-- Open Graph / social share -->
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />

View File

@ -1,6 +1,6 @@
{ {
"name": "amerc-site", "name": "amerc-site",
"version": "0.36.0-https", "version": "0.37.0-embed",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@ -153,11 +153,13 @@ export function UsePanel({ instance, onClose }) {
<> <>
<iframe title="agent" className="ap-iframe" src={`https://webagent.amerc.ai/chat_session?session=${encodeURIComponent(sess.relayToken)}`} /> <iframe title="agent" className="ap-iframe" src={`https://webagent.amerc.ai/chat_session?session=${encodeURIComponent(sess.relayToken)}`} />
{mode === 'chatbox' && ( {mode === 'chatbox' && (
<details className="ap-embed"> <div className="ap-embed">
<summary>Embed this agent on any site</summary> <div className="ap-embed-head"><span>📎 Embed this agent on any website</span><button className="px-action" onClick={() => copyToast(`<script src="${sess.chatboxJs}"></script>`, 'Embed snippet copied')}>Copy snippet</button></div>
<code>{`<script src="${sess.chatboxJs}"></script>`}</code> <code>{`<script src="${sess.chatboxJs}"></script>`}</code>
</details> <p className="ap-hint">Paste before <code>&lt;/body&gt;</code> a chat bubble appears bottom-right, and on connect your page's skills are injected into the agent.</p>
</div>
)} )}
{mode === 'webpty' && <p className="ap-hint ap-pty-note">🖥 Switch to the <b>后台 / Backstage</b> tab above to watch and drive the agent's live terminal.</p>}
</> </>
)} )}
</div> </div>

View File

@ -7,7 +7,7 @@ import Account from './Account.jsx';
import TavernGame from './TavernGame.jsx'; import TavernGame from './TavernGame.jsx';
import { api } from './api.js'; import { api } from './api.js';
const RELEASE = '0.36.0-https'; const RELEASE = '0.37.0-embed';
const NAV = [ const NAV = [
{ id: 'home', label: 'Tavern' }, { id: 'home', label: 'Tavern' },

View File

@ -1174,3 +1174,10 @@ button {
.acct-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; } .acct-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.acct-form input { padding: 10px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; } .acct-form input { padding: 10px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; }
@media (max-width: 680px) { .acct-grid { grid-template-columns: 1fr; } } @media (max-width: 680px) { .acct-grid { grid-template-columns: 1fr; } }
/* agent-use embed prominence (0.37) */
.ap-embed { padding: 14px; background: #0a0f1a; border-top: 1px solid #1d1430; }
.ap-embed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; font-size: 13px; color: #c9b8e6; }
.ap-embed > code { display: block; color: #7fe9ff; font-family: ui-monospace, monospace; font-size: 12px; background: #07060c; padding: 10px 12px; border-radius: 8px; word-break: break-all; border: 1px solid #1d2a3a; }
.ap-embed .ap-hint { margin: 8px 0 0; } .ap-embed .ap-hint code { display: inline; padding: 1px 5px; background: #162032; color: #9d8fc0; }
.ap-pty-note { padding: 12px 14px; }