paperclip/doc
Michael Nguyen 60ee13a0f7
feat: allow operator UI snippets on Cloud instances (#13168)
Adds an optional Cloud-only HTML snippet so operators can load Plain’s
standard chat bubble. **6 files, 16 implementation lines added; 102
additions including tests and docs.**

## Thinking Path

> - Paperclip serves Cloud and self-hosted users.
> - Closed beta users need a way to report problems.
> - Plain provides a ready-made chat widget.
> - Cloud operators can load it through a generic deployment setting.
> - Self-hosted instances ignore that setting.

## Linked Issues or Issue Description

**Subsystem affected**

Server-served UI HTML.

**Problem or motivation**

Enable a chat bubble in Cloud without adding a support feature to the
React app.

**Proposed solution**

Insert trusted `PAPERCLIP_CLOUD_UI_SNIPPET` HTML before `</body>` when
the existing Cloud-managed predicate is true. The setting is off by
default. Related Cloud-gated integration: #12190.

## What Changed

Review the [final
diff](https://github.com/paperclipai/paperclip/pull/13168/files) in this
order:

1. `server/src/cloud-ui-snippet.ts`: the eight-line Cloud gate and HTML
insertion.
2. `server/src/static-index-html.ts` and `server/src/app.ts`: apply it
to static root/index, SPA routes, and Vite HTML.
3. Two test files and `doc/cloud-ui-snippet.md`: boundary checks and
setup instructions.

React UI, customer identity, and database behavior are unchanged. The
existing feedback flag remains. Plain chat is anonymous; no Paperclip
name, email, or organization is supplied.

## Verification

- **Greptile: 5/5**, no actionable findings, reviewed commit
`04bb44515`.
- **[CI
passed](https://github.com/paperclipai/paperclip/actions/runs/34535763243)**,
including build, typecheck, server tests, and end-to-end tests.
- Local: six focused tests, full typecheck, and build passed. The full
local suite has not produced a final result; CI is the completed full
verification.
- Staging deployment and live chat testing remain to be done.

### Staging setup

Set **one server environment variable**, `PAPERCLIP_CLOUD_UI_SNIPPET`,
to:

```html
<script>
(function(d) {
  var script = d.createElement('script');
  script.src = 'https://chat.cdn-plain.com/index.js';
  script.onload = function() {
    Plain.init({ appId: 'liveChatApp_01M26J213F6RR53YRARZVAFCZZ' });
  };
  d.head.appendChild(script);
})(document);
</script>
```

This is the public staging app ID. **No API key or signing secret is
needed.** Deploy to staging and restart the app with this setting. Test
`/`, `/index.html`, and an organization dashboard; send a message and
confirm a support reply returns. Production rollout is separate.

[Plain embed docs](https://www.plain.com/docs/product/channels/chat) ·
[Configuration and
rollback](04bb445151/doc/cloud-ui-snippet.md)

## Risks

Only trusted operators should set this value. The HTML is public and
scripts execute in the app origin; do not include secrets or
user-provided HTML. Plain owns the anonymous browser session, with no
Paperclip account-switch integration. To roll back, unset the variable,
restart, and refresh open tabs.

## Model Used

OpenAI Codex (GPT-6), with repository inspection and code execution.
Exact runtime model identifier and context size are not exposed in this
session.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change and contains no internal
Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-10 15:30:36 -07:00
..
architecture feat(runner): add managed provider backends (#12699) 2026-09-02 00:48:30 -05:00
assets fix: make task recovery durable and preserve current requests (#13075) 2026-09-09 09:14:25 -05:00
connections feat: review connection actions from tasks (#13063) 2026-09-08 19:37:13 -05:00
design fix: make task recovery durable and preserve current requests (#13075) 2026-09-09 09:14:25 -05:00
experimental feat(server): configure shared workspace concurrency (#10759) 2026-08-03 14:25:05 -05:00
logs Improve CLI API parity coverage (#6626) 2026-06-02 17:13:29 -07:00
plans feat: add experimental native chat connectors (#13038) 2026-09-10 10:06:45 -05:00
plugins fix(heartbeat): block runs on a stuck sandbox plugin and re-enable errored bundled plugins at boot (#12957) 2026-09-08 09:00:10 -07:00
pr/5429 Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
screenshots feat(mcp) [split 7/8]: activate Apps and gateway UI (#9562) 2026-07-14 15:40:08 -05:00
spec feat(adapters): confine local coding processes (#9504) 2026-07-14 11:01:19 -05:00
testing feat: simplify agent onboarding and configuration (#13011) 2026-09-08 14:22:32 -05:00
AGENT-ARTIFACTS.md feat: add experimental native chat connectors (#13038) 2026-09-10 10:06:45 -05:00
AGENTCOMPANIES_SPEC_INVENTORY.md Add routine support to recurring task portability 2026-03-23 16:57:38 -05:00
CHANNELS.md feat(cli): add 'paperclipai channels' to show release lanes and the current one (#11210) 2026-08-11 08:47:32 -07:00
CLI.md feat: add experimental native chat connectors (#13038) 2026-09-10 10:06:45 -05:00
CLIPHUB.md refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
DATABASE.md feat: add experimental native chat connectors (#13038) 2026-09-10 10:06:45 -05:00
DEPLOYMENT-MODES.md fix(security): harden privileged server boundaries (#12776) 2026-09-03 14:15:32 -05:00
DEVELOPING.md fix(workspaces): preserve dependency provisioning failures (#13093) 2026-09-09 10:14:58 -05:00
DOCKER.md feat(connections): add managed external MCP connectors (#12346) 2026-08-29 12:08:34 -05:00
GOAL.md [codex] Refresh docs and agent skills (#4693) 2026-04-28 16:12:03 -05:00
HERMES_GATEWAY_ONBOARDING.md fix(security): route paperclipai CLI guidance through safe npx form (CWE-78) (#11400) 2026-08-14 22:11:16 -07:00
HERMES_GATEWAY_SMOKE.md [codex] Add built-in Hermes adapters (#8543) 2026-06-26 16:04:58 -05:00
INSTALLING.md fix(adapters): prevent engine fallback and preserve usable runtime defaults (#13105) 2026-09-09 13:27:24 -05:00
LOW-TRUST-PRESETS.md docs(execution-semantics): define routable blocking and watchdog restoration (#10094) 2026-07-27 19:10:28 -05:00
MCP-ACCESS-GOVERNANCE.md feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
MCP-DEMO-SCRIPT.md feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
MCP-RUNTIME-OPERATIONS.md feat(apps): consolidate connector management (#12684) 2026-09-01 14:55:35 -05:00
OPENCLAW_ONBOARDING.md Introduce bind presets for deployment setup 2026-04-11 07:09:07 -05:00
PRODUCT.md feat(skills): open-by-default company skill policy and core UX (#9564) 2026-07-15 11:42:40 -05:00
PUBLISHING.md feat(release): bootstrap new npm packages with a placeholder publish (#11757) 2026-08-19 19:38:17 -07:00
README-draft.md docs: add README, draft README, and adapter logo assets 2026-03-02 10:31:59 -06:00
RELEASE-AUTOMATION-SETUP.md feat(release): add human-gated beta channel with stable soak enforcement (#11008) 2026-08-10 16:52:59 -07:00
RELEASE-CHECKLIST.md feat(release): draft stable notes at beta publish, read them from master at promotion (#11567) 2026-08-17 20:47:23 -07:00
RELEASE-NOTES-mcp-access-governance.md feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
RELEASING.md feat(release): draft stable notes at beta publish, read them from master at promotion (#11567) 2026-08-17 20:47:23 -07:00
SECRETS-AWS-PROVIDER.md feat(secrets): add user-specific runtime secrets (#8825) 2026-07-05 05:58:20 -05:00
SPEC-implementation.md fix(adapters): prevent engine fallback and preserve usable runtime defaults (#13105) 2026-09-09 13:27:24 -05:00
SPEC.md fix(adapters): prevent engine fallback and preserve usable runtime defaults (#13105) 2026-09-09 13:27:24 -05:00
TASK-WATCHDOG.md fix(interactions): authorize resolvers consistently (#11376) 2026-08-16 13:46:50 -05:00
TASKS-mcp.md Add product spec and MCP task interface docs 2026-02-16 19:07:30 -06:00
TASKS.md Add task management data model spec 2026-02-16 14:25:00 -06:00
TELEMETRY_WORKFLOW.md Add telemetry proposal extractor (#9544) 2026-07-13 23:47:27 -07:00
UNTRUSTED-PR-REVIEW.md chore(docker): improve base image and organize docker files 2026-04-01 11:36:27 +00:00
acp-run-lifecycle.md refactor: disambiguate the Telemetry and Observability data paths (#12128) 2026-08-24 16:42:33 -07:00
cloud-ui-snippet.md feat: allow operator UI snippets on Cloud instances (#13168) 2026-09-10 15:30:36 -07:00
composer-stop.md fix: verify ACP Stop and preserve safe continuation (#13119) 2026-09-09 22:06:06 -05:00
connection-intents.md fix(connections): keep task context through Cloud enrollment and OAuth (#13098) 2026-09-09 10:55:11 -05:00
execution-github-identity.md feat: add experimental native chat connectors (#13038) 2026-09-10 10:06:45 -05:00
execution-semantics.md fix: verify ACP Stop and preserve safe continuation (#13119) 2026-09-09 22:06:06 -05:00
memory-landscape.md chore: improve worktree tooling and security docs 2026-04-10 22:26:30 -05:00
observability.md feat(adapter-utils): carry binary bodies and attachment routes over the HTTP/2 sandbox bridge (#12923) 2026-09-08 14:18:12 -07:00
preview-release-artifacts.md Build isolated preview artifacts for exact-source deployments (#13041) 2026-09-08 09:21:58 -05:00
project-repositories.md feat(projects): select multiple GitHub source repositories (#13010) 2026-09-08 08:21:28 -05:00
run-log-events.md fix(codex): correct startup trust, history reads, and resume usage (#13110) 2026-09-09 15:35:18 -05:00
runner-api-tools.md feat(runner): add guarded API search and call fallback (#13003) 2026-09-07 14:14:43 -05:00