chore(brand): rename the product to ReplyPier
The upstream project name is gone from code, assets, docs and build
output: brand strings, domains (replypier.site and its app/api/docs/help
subdomains), env prefixes, image and network names, the widget's public
JS API (window.ReplyPier, replypierId/BaseUrl/Config/Token), CSS tokens
(--rp-*), file and directory names, and the WordPress plugin package.
- widget loader is now webclient/replypier.min.js; both bundles rebuilt
from source (backend/assets/widget.{js,css}, frontend/public/webclient)
- NOTICE, llms.txt, CONTRIBUTING, HELP_CENTER_INFRA and config.dev.js
rewritten rather than string-swapped; the demo config no longer ships
the previous vendor's Firebase/Razorpay/Google keys
- new migration replypier_ai_model_001 adds REPLYPIER to the managed
AIModelType and rewrites pre-rename rows
- local compose project, database, role and volume renamed; LOCAL_DEPLOY
documents carrying the old local data over
This commit is contained in:
1 parent
ff0a09f0e5
commit
54b949b392
1156 files changed
+7292
-7147
No files matched your search
@@ -1,11 +1,11 @@
|
||||
// A pretend customer website with the ChatterMate widget embedded the way the
|
||||
// A pretend customer website with the ReplyPier widget embedded the way the
|
||||
// dashboard's install snippet does it. Everything about the embed comes from the
|
||||
// query string:
|
||||
//
|
||||
// http://127.0.0.1:13000/?widget=<id>
|
||||
// &config=<json> → window.chattermateConfig (launcher, position, trigger, …)
|
||||
// &token=<jwt> → window.chattermateToken (token-authenticated widgets)
|
||||
// &trigger=1 → adds a page button with data-chattermate-open
|
||||
// &config=<json> → window.replypierConfig (launcher, position, trigger, …)
|
||||
// &token=<jwt> → window.replypierToken (token-authenticated widgets)
|
||||
// &trigger=1 → adds a page button with data-replypier-open
|
||||
// &snippet=iframe → the dashboard's iframe snippet instead of the script
|
||||
//
|
||||
// It has to be a real server on 127.0.0.1: Chrome's Local Network Access check
|
||||
@@ -23,7 +23,7 @@ function arg(name: string, fallback: string): string {
|
||||
|
||||
const port = Number(arg('port', '13000'))
|
||||
const apiUrl = arg('api', 'http://127.0.0.1:18000/api/v1')
|
||||
const loaderUrl = arg('loader', 'http://127.0.0.1:15173/webclient/chattermate.min.js')
|
||||
const loaderUrl = arg('loader', 'http://127.0.0.1:15173/webclient/replypier.min.js')
|
||||
|
||||
interface Embed {
|
||||
widgetId: string
|
||||
@@ -36,7 +36,7 @@ interface Embed {
|
||||
/** The dashboard's iframe snippet (AgentWidgetTab), classed so the page object finds it. */
|
||||
function iframeSnippet(widgetId: string): string {
|
||||
const src = `${apiUrl}/widgets/${encodeURIComponent(widgetId)}/data`
|
||||
return `<iframe class="chattermate-iframe" src="${src}" width="100%" height="600" frameborder="0" title="AI Assistant" allow="clipboard-write"></iframe>`
|
||||
return `<iframe class="replypier-iframe" src="${src}" width="100%" height="600" frameborder="0" title="AI Assistant" allow="clipboard-write"></iframe>`
|
||||
}
|
||||
|
||||
function page(embed: Embed): string {
|
||||
@@ -51,18 +51,18 @@ function page(embed: Embed): string {
|
||||
</html>`
|
||||
}
|
||||
const globals = [
|
||||
`window.chattermateId = ${JSON.stringify(embed.widgetId)};`,
|
||||
`window.chattermateBaseUrl = ${JSON.stringify(apiUrl)};`,
|
||||
`window.replypierId = ${JSON.stringify(embed.widgetId)};`,
|
||||
`window.replypierBaseUrl = ${JSON.stringify(apiUrl)};`,
|
||||
// config arrives as JSON text; parse it here so a malformed value fails the request, not the page.
|
||||
embed.config ? `window.chattermateConfig = ${JSON.stringify(JSON.parse(embed.config))};` : '',
|
||||
embed.token ? `window.chattermateToken = ${JSON.stringify(embed.token)};` : '',
|
||||
embed.config ? `window.replypierConfig = ${JSON.stringify(JSON.parse(embed.config))};` : '',
|
||||
embed.token ? `window.replypierToken = ${JSON.stringify(embed.token)};` : '',
|
||||
].filter(Boolean).join('\n ')
|
||||
return `<!doctype html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Acme Store</title></head>
|
||||
<body>
|
||||
<h1>Acme Store</h1>
|
||||
${embed.trigger ? '<button type="button" data-chattermate-open>Chat with us</button>' : ''}
|
||||
${embed.trigger ? '<button type="button" data-replypier-open>Chat with us</button>' : ''}
|
||||
<script>
|
||||
${globals}
|
||||
</script>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// Meta tokens `…:app=<id>.<secret>:…` were issued by the customer's own Meta
|
||||
// app: GET /app answers that id and checks
|
||||
// appsecret_proof against that secret (any
|
||||
// other token is ChatterMate's app)
|
||||
// other token is ReplyPier's app)
|
||||
// Meta POST /<number> {webhook_configuration} verifies the override callback the way
|
||||
// Meta does — a GET with hub.verify_token
|
||||
// that must echo hub.challenge — before
|
||||
@@ -188,13 +188,13 @@ function graphError(message: string, code = 100): Answer {
|
||||
return { status: 400, body: { error: { message, type: 'OAuthException', code, fbtrace_id: 'e2e' } } }
|
||||
}
|
||||
|
||||
/** ChatterMate's own Meta app; its secret mirrors META_APP_SECRET in .env.e2e. */
|
||||
const CHATTERMATE_APP = { id: 'e2e-chattermate-app', secret: 'e2e-meta-app-secret' }
|
||||
/** ReplyPier's own Meta app; its secret mirrors META_APP_SECRET in .env.e2e. */
|
||||
const REPLYPIER_APP = { id: 'e2e-replypier-app', secret: 'e2e-meta-app-secret' }
|
||||
|
||||
/** The Meta app that issued a token. */
|
||||
function appOf(token: string): { id: string; secret: string } {
|
||||
const match = /:app=([^.:]+)\.([^:]+)/.exec(token)
|
||||
return match ? { id: match[1], secret: match[2] } : CHATTERMATE_APP
|
||||
return match ? { id: match[1], secret: match[2] } : REPLYPIER_APP
|
||||
}
|
||||
|
||||
/** Meta checks an override callback before taking it: the GET must echo the challenge. */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// replies keyed by a `[[e2e:<id>]]` marker in its agent's instructions or by the
|
||||
// agent's unique name — so parallel tests in one org never see each other's script.
|
||||
//
|
||||
// It speaks only what ChatterMate uses: non-streaming /v1/chat/completions, with or
|
||||
// It speaks only what ReplyPier uses: non-streaming /v1/chat/completions, with or
|
||||
// without a strict json_schema response_format (ChatAgent's ChatResponse), and tool
|
||||
// calls. Anything else fails loudly instead of returning something plausible.
|
||||
//
|
||||
@@ -245,7 +245,7 @@ async function route(req: IncomingMessage, res: ServerResponse) {
|
||||
throw new HttpError(401, 'Incorrect API key provided.')
|
||||
}
|
||||
const body = (await readJson(req)) as ChatRequest
|
||||
if (body.stream) throw new HttpError(400, 'the e2e fake LLM does not stream — ChatterMate never asks it to; if it does now, extend services/fake-llm')
|
||||
if (body.stream) throw new HttpError(400, 'the e2e fake LLM does not stream — ReplyPier never asks it to; if it does now, extend services/fake-llm')
|
||||
if (!Array.isArray(body.messages)) throw new HttpError(400, 'messages[] is required')
|
||||
return send(res, 200, await answer(body, req.headers.authorization ?? ''))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user