@rubytech/create-realagent-code 0.1.256 → 0.1.257
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/plugins/business-assistant/PLUGIN.md +1 -1
- package/payload/platform/plugins/business-assistant/references/document-management.md +1 -1
- package/payload/platform/plugins/business-assistant/references/invoicing.md +2 -2
- package/payload/platform/plugins/business-assistant/references/quoting.md +1 -1
- package/payload/server/server.js +12 -11
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ Load the relevant reference when the task requires it:
|
|
|
55
55
|
- **Triage & escalation** → `references/escalation.md` — urgency classification (RED/AMBER/GREEN), customer handoff protocol, voice IVR handling
|
|
56
56
|
- **Scheduling & briefings** → `references/scheduling.md` — booking protocol, geographic clustering, travel time estimation, morning briefings, holiday mode, GPS integration
|
|
57
57
|
- **Quotes** → `references/quoting.md` — photo-to-quote, formatting, follow-up timings
|
|
58
|
-
- **Invoices & payment** → `references/invoicing.md` — HTML invoice creation, PDF generation via `
|
|
58
|
+
- **Invoices & payment** → `references/invoicing.md` — HTML invoice creation, PDF generation via `browser-navigate` + `browser-pdf-save`, sending, payment chase protocol
|
|
59
59
|
- **Customer records** → `references/crm.md` — contact record management, `contact_lookup`/`contact_update` usage, pipeline tracking, when to create/update records
|
|
60
60
|
- **Document filing** → `references/document-management.md` — dual-scope filing system, naming conventions, folder structure for customer-facing vs internal documents
|
|
61
61
|
- **Task & session management** → `references/task-management.md` — task lifecycle, session naming, cross-session progress tracking
|
|
@@ -72,7 +72,7 @@ Required structure:
|
|
|
72
72
|
1. Verify the customer's contact record exists (`contact_lookup`)
|
|
73
73
|
2. Create the appropriate directory if it doesn't exist (the `memory_write` tool creates parent directories automatically)
|
|
74
74
|
3. Write the document (HTML for invoices/quotes that need PDF conversion, markdown for simpler documents)
|
|
75
|
-
4. For HTML documents:
|
|
75
|
+
4. For HTML documents: `browser-navigate` to the file (`file://` + absolute path), then `browser-pdf-save` to an absolute `.pdf` path alongside the HTML. The renderer honours the document's `@media print`/`@page` CSS and prints backgrounds; confirm the reported byte count is non-zero before treating the PDF as done.
|
|
76
76
|
5. Update the contact record status via `contact_update`
|
|
77
77
|
|
|
78
78
|
## Sending Documents
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
```
|
|
19
19
|
Use the template below. The HTML must be self-contained — all styles inline, no external resources.
|
|
20
20
|
|
|
21
|
-
4. **
|
|
22
|
-
|
|
21
|
+
4. **Render to PDF:**
|
|
22
|
+
`browser-navigate` to the HTML file (`file://` + the absolute memory path), then call `browser-pdf-save` with an absolute output path alongside the HTML — same name, `.pdf` extension. `browser-pdf-save` renders the current page through Chromium's print pipeline: it honours the template's `@media print`/`@page` CSS and prints backgrounds, so the print styles in the template below are load-bearing. The tool reports `Saved PDF to <path> (<bytes>)`; confirm a non-zero byte count before presenting the file.
|
|
23
23
|
|
|
24
24
|
5. **Present the PDF to the business owner immediately.**
|
|
25
25
|
Do not just announce the file exists — deliver it. Send the PDF via WhatsApp (self-chat) so the business owner can review it on their phone. Include a summary:
|
|
@@ -45,7 +45,7 @@ Payment terms: [from memory, default "on completion"]
|
|
|
45
45
|
Any questions, just reply to this message!
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
For formal PDF quotes, use the same workflow as invoicing — write HTML,
|
|
48
|
+
For formal PDF quotes, use the same workflow as invoicing — write HTML, `browser-navigate` to it, render with `browser-pdf-save`, then send as attachment. See `references/invoicing.md` for the PDF workflow.
|
|
49
49
|
|
|
50
50
|
## Quote Follow-Up
|
|
51
51
|
|
package/payload/server/server.js
CHANGED
|
@@ -11602,16 +11602,17 @@ function readUsersFile() {
|
|
|
11602
11602
|
if (!raw) return [];
|
|
11603
11603
|
return JSON.parse(raw);
|
|
11604
11604
|
}
|
|
11605
|
-
function checkAuthStatus() {
|
|
11605
|
+
async function checkAuthStatus() {
|
|
11606
|
+
let status;
|
|
11606
11607
|
try {
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
return true;
|
|
11612
|
-
} catch {
|
|
11613
|
-
return false;
|
|
11608
|
+
status = (await ensureAuth()).status;
|
|
11609
|
+
} catch (err) {
|
|
11610
|
+
console.error(`[onboarding-auth] ensureAuth threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
11611
|
+
status = "error";
|
|
11614
11612
|
}
|
|
11613
|
+
const authenticated = status === "ok" || status === "expiring";
|
|
11614
|
+
console.log(`[onboarding-auth] poll status=${status} authenticated=${authenticated}`);
|
|
11615
|
+
return authenticated;
|
|
11615
11616
|
}
|
|
11616
11617
|
async function waitForAuthPage(timeoutMs = 2e4) {
|
|
11617
11618
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -11628,8 +11629,8 @@ async function waitForAuthPage(timeoutMs = 2e4) {
|
|
|
11628
11629
|
return false;
|
|
11629
11630
|
}
|
|
11630
11631
|
var app4 = new Hono();
|
|
11631
|
-
app4.get("/claude-auth", (c) => {
|
|
11632
|
-
return c.json({ authenticated: checkAuthStatus() });
|
|
11632
|
+
app4.get("/claude-auth", async (c) => {
|
|
11633
|
+
return c.json({ authenticated: await checkAuthStatus() });
|
|
11633
11634
|
});
|
|
11634
11635
|
app4.post("/claude-auth", async (c) => {
|
|
11635
11636
|
let body = {};
|
|
@@ -11650,7 +11651,7 @@ app4.post("/claude-auth", async (c) => {
|
|
|
11650
11651
|
return c.json({ logged_out: true });
|
|
11651
11652
|
}
|
|
11652
11653
|
if (body.action === "wait") {
|
|
11653
|
-
const authenticated = checkAuthStatus();
|
|
11654
|
+
const authenticated = await checkAuthStatus();
|
|
11654
11655
|
return c.json({ completed: authenticated, authenticated });
|
|
11655
11656
|
}
|
|
11656
11657
|
if (body.action === "launch-browser") {
|