@rubytech/create-maxy-code 0.1.347 → 0.1.349
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/lib/graph-style/dist/index.d.ts +1 -1
- package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-style/dist/index.js +20 -12
- package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-style/src/__tests__/parity.test.ts +9 -9
- package/payload/platform/lib/graph-style/src/index.ts +20 -12
- package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-write/dist/index.js +3 -2
- package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-write/src/index.ts +3 -2
- package/payload/platform/neo4j/schema.cypher +110 -31
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +1 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +36 -3
- package/payload/platform/plugins/docs/references/calendar-booking.md +1 -1
- package/payload/platform/plugins/docs/references/joblogic.md +28 -0
- package/payload/platform/plugins/docs/references/memory-guide.md +1 -1
- package/payload/platform/plugins/joblogic/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/joblogic/PLUGIN.md +182 -0
- package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/index.js +193 -0
- package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/index.js +229 -0
- package/payload/platform/plugins/joblogic/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts +31 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js +78 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts +35 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js +106 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts +8 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js +41 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts +21 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js +47 -0
- package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js.map +1 -0
- package/payload/platform/plugins/joblogic/mcp/package.json +10 -0
- package/payload/platform/plugins/joblogic/skills/joblogic/SKILL.md +32 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js +28 -22
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js +8 -4
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js +39 -10
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js +1 -1
- package/payload/platform/plugins/memory/references/schema-construction.md +152 -57
- package/payload/platform/plugins/memory/references/schema-trades.md +22 -24
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +46 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-GELNKMk6.js → AdminLoginScreens-BEzoTk56.js} +1 -1
- package/payload/server/public/assets/{AdminShell-C_KsjYH6.js → AdminShell-BG7YD4UO.js} +1 -1
- package/payload/server/public/assets/{Checkbox-iE6iVP7-.js → Checkbox-CvTFOczj.js} +1 -1
- package/payload/server/public/assets/{OperatorConversations-C4Cx814-.css → OperatorConversations-CnP9Y6g2.css} +1 -1
- package/payload/server/public/assets/OperatorConversations-DU8CqO-z.js +9 -0
- package/payload/server/public/assets/{admin-Ci2tLhyx.js → admin-Bhxa1HOy.js} +1 -1
- package/payload/server/public/assets/{browser-9dxtgr6y.js → browser-BAQFuyma.js} +1 -1
- package/payload/server/public/assets/calendar-sSr6zUjW.js +1 -0
- package/payload/server/public/assets/chat-ZH4Fsyu0.js +1 -0
- package/payload/server/public/assets/{data-BpTErRH6.js → data-CH6GNBO3.js} +1 -1
- package/payload/server/public/assets/{graph-DfQblprL.js → graph-DbGjFYPS.js} +1 -1
- package/payload/server/public/assets/graph-labels-IGIEr-uc.js +1 -0
- package/payload/server/public/assets/{operator-CHSf3dma.js → operator-Ba5afDyM.js} +1 -1
- package/payload/server/public/assets/{page-uweci4TA.js → page-D7uwMUOy.js} +1 -1
- package/payload/server/public/assets/{public-ZdqJjwT3.js → public-DikYWzOd.js} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +4 -4
- package/payload/server/public/chat.html +5 -5
- package/payload/server/public/data.html +4 -4
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +6 -6
- package/payload/server/public/operator.html +7 -7
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +32 -15
- package/payload/server/public/assets/OperatorConversations-DAPefQEH.js +0 -9
- package/payload/server/public/assets/calendar-BmwMyHcQ.js +0 -1
- package/payload/server/public/assets/chat-CnG7zUb7.js +0 -1
- package/payload/server/public/assets/graph-labels-Bjyky6oK.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-architecture
|
|
3
3
|
description: Use when grounding any documented-surface claim about what Maxy ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
|
|
4
|
-
content-hash: sha256:
|
|
4
|
+
content-hash: sha256:33a6a5683cd3a9f34b0fcbd1d108c7fe20aece1d7d64ecc6da321ff0a8742f08
|
|
5
5
|
brand: maxy-code
|
|
6
6
|
product-name: Maxy
|
|
7
7
|
---
|
|
@@ -1556,7 +1556,7 @@ Every node also carries a provenance stamp — which agent wrote it, in which se
|
|
|
1556
1556
|
|
|
1557
1557
|
## Vertical schemas
|
|
1558
1558
|
|
|
1559
|
-
On top of the base graph, each brand boots one optional **vertical** — an extra set of entity types tailored to a trade. The vertical is named by `brand.json#vertical` and defined in a `schema-<name>.md` reference; the memory plugin loads it at startup and validates every write against base + the active vertical. Real Agent boots `schema-estate-agent` (Listing, Property, Viewing, Offer). SiteDesk boots `schema-construction`, which adds the
|
|
1559
|
+
On top of the base graph, each brand boots one optional **vertical** — an extra set of entity types tailored to a trade. The vertical is named by `brand.json#vertical` and defined in a `schema-<name>.md` reference; the memory plugin loads it at startup and validates every write against base + the active vertical. Real Agent boots `schema-estate-agent` (Listing, Property, Viewing, Offer). SiteDesk boots `schema-construction`, the canonical JobLogic-derived field-service ontology, which adds the service-delivery entities — `Job`, `Customer`, `Site`, `Asset`, `Visit`, `Quote`, `QuoteLine`, `Valuation`, `VariationNote`, `JobCost`, `Part`, `PurchaseOrder`, `Invoice`, `InboundInvoice`, `PpmContract`, `WhatsAppGroup` (with `Engineer` and `Supplier` as additional labels on `Person`/`Organization`) — grounded in real builder job folders so a job's customer, site, quote, valuations, variations, costs, and received supplier invoices all hang off one `Job` node. The default Maxy brand boots no vertical (base graph only).
|
|
1560
1560
|
|
|
1561
1561
|
## Public-facing summaries for customer-readable subjects
|
|
1562
1562
|
|
|
@@ -1880,6 +1880,39 @@ A QuickBooks connection goes stale if it sits unused for about 100 days, or if y
|
|
|
1880
1880
|
|
|
1881
1881
|
Switching your Intuit app from sandbox to production requires passing Intuit's own production security review. That is between you and Intuit; it is not something the agent does for you.
|
|
1882
1882
|
|
|
1883
|
+
---
|
|
1884
|
+
# JobLogic
|
|
1885
|
+
Source: https://docs.getmaxy.com/joblogic.md
|
|
1886
|
+
|
|
1887
|
+
# JobLogic
|
|
1888
|
+
|
|
1889
|
+
Connect JobLogic, the field-service management system, so the agent can read and update your jobs end to end — customers, sites, jobs, engineers, visits, quotes, invoices, assets, and timesheets — over JobLogic's REST API.
|
|
1890
|
+
|
|
1891
|
+
This connector is built for one team that already runs JobLogic as its system of record. Your field staff send a voice note or message to Maxy from the field; Maxy works out what they mean and makes the JobLogic update for them. Your staff never touch the JobLogic API themselves, so only Maxy's own connection talks to JobLogic.
|
|
1892
|
+
|
|
1893
|
+
## What you do once
|
|
1894
|
+
|
|
1895
|
+
**1. Ask JobLogic for API access.** Raise a ticket with JobLogic Support for API credentials. Ask for a test (UAT) account first, then production. They give you a client ID, a client secret, and your company tenant id.
|
|
1896
|
+
|
|
1897
|
+
**2. Whitelist your connection.** JobLogic only accepts API calls from network addresses you have registered with them. Maxy makes its calls from the machine it runs on, so that machine's public address is the one to register. If the machine moves between networks its address can change, so either run it from one place with a stable address, send its traffic through a fixed address, or ask JobLogic whether production needs this at all. If the address is not registered, calls are refused and the agent will tell you the connection was blocked.
|
|
1898
|
+
|
|
1899
|
+
**3. Hand the keys to the agent.** Tell the agent your client ID, secret, tenant id, and whether they are test or production. The agent stores them on your install only and never repeats them back.
|
|
1900
|
+
|
|
1901
|
+
## What the agent does after that
|
|
1902
|
+
|
|
1903
|
+
Everything else is automatic. The agent keeps the connection alive on its own, refreshing access behind the scenes, and can:
|
|
1904
|
+
|
|
1905
|
+
- **Read** anything — "what jobs are open for this site", "show this engineer's visits this week", "list unpaid invoices".
|
|
1906
|
+
- **Write** from a field instruction — create or reschedule a visit, log labour and materials against a job, set a job's status, approve a quote, raise an invoice, add a note or a photo to a job.
|
|
1907
|
+
|
|
1908
|
+
Because JobLogic's credential belongs to the company rather than to a person, the agent stamps each update with the engineer who reported it. You give the agent a list that maps each staff member's phone number to their JobLogic engineer record once, and it does the rest.
|
|
1909
|
+
|
|
1910
|
+
Each create carries a safety key, so if a message is retried or a reply goes missing the same instruction never creates a duplicate record.
|
|
1911
|
+
|
|
1912
|
+
## Testing
|
|
1913
|
+
|
|
1914
|
+
Do all your testing against the JobLogic test (UAT) environment first. Switch to production only once the test environment behaves the way you expect and your production keys and whitelisting are in place.
|
|
1915
|
+
|
|
1883
1916
|
---
|
|
1884
1917
|
# Calendar and Booking
|
|
1885
1918
|
Source: https://docs.getmaxy.com/calendar-booking.md
|
|
@@ -1898,7 +1931,7 @@ Open `/calendar` on your Maxy address (the same sign-in as the dashboard). It sh
|
|
|
1898
1931
|
|
|
1899
1932
|
Use **Today** and the arrows to move around, and the view buttons to switch. The calendar reads everything time-bound in your graph: meetings imported from a calendar export or created by a booking, appointments Maxy schedules for you in chat, and tasks that have a due date (shown on their day).
|
|
1900
1933
|
|
|
1901
|
-
Click any entry to open its details: the full title, time, location, and who is attending, with each attendee on its own line (name, and email beneath it). For a booked meeting you can also edit its title, time, or location, or delete it, and the grid updates straight away. You can **Download** a booked meeting as a calendar file (`.ics`) to add it to Apple, Google, or Outlook calendars;
|
|
1934
|
+
Click any entry to open its details: the full title, time, location, and who is attending, with each attendee on its own line (name, and email beneath it). For a booked meeting you can also edit its title, time, or location, or delete it, and the grid updates straight away. You can **Download** a booked meeting as a calendar file (`.ics`) to add it to Apple, Google, or Outlook calendars; when the meeting has attendees, Download asks whether to include them in the file before it saves, and a meeting with no attendees downloads straight away. The private note is never written into the downloaded file, since the file can travel outside your admin. In the edit view you can add an attendee (give a name, an email, or both) and remove one; adding someone who is already a contact reuses that contact rather than making a duplicate, and removing them takes them off the meeting but keeps the contact. The edit view also has a private note for that meeting, a place for your own reminders that only you and your team ever see; it never appears on the public booking page or anywhere outside your admin. Appointments Maxy schedules and due-dated tasks are shown for detail only and are changed where they are created, not here. New meetings are still made by a booking or by asking Maxy in chat, not from the calendar.
|
|
1902
1935
|
|
|
1903
1936
|
Everything on the calendar comes from records the rest of Maxy already uses, scoped to your account.
|
|
1904
1937
|
|
|
@@ -12,7 +12,7 @@ Open `/calendar` on your Maxy address (the same sign-in as the dashboard). It sh
|
|
|
12
12
|
|
|
13
13
|
Use **Today** and the arrows to move around, and the view buttons to switch. The calendar reads everything time-bound in your graph: meetings imported from a calendar export or created by a booking, appointments Maxy schedules for you in chat, and tasks that have a due date (shown on their day).
|
|
14
14
|
|
|
15
|
-
Click any entry to open its details: the full title, time, location, and who is attending, with each attendee on its own line (name, and email beneath it). For a booked meeting you can also edit its title, time, or location, or delete it, and the grid updates straight away. You can **Download** a booked meeting as a calendar file (`.ics`) to add it to Apple, Google, or Outlook calendars;
|
|
15
|
+
Click any entry to open its details: the full title, time, location, and who is attending, with each attendee on its own line (name, and email beneath it). For a booked meeting you can also edit its title, time, or location, or delete it, and the grid updates straight away. You can **Download** a booked meeting as a calendar file (`.ics`) to add it to Apple, Google, or Outlook calendars; when the meeting has attendees, Download asks whether to include them in the file before it saves, and a meeting with no attendees downloads straight away. The private note is never written into the downloaded file, since the file can travel outside your admin. In the edit view you can add an attendee (give a name, an email, or both) and remove one; adding someone who is already a contact reuses that contact rather than making a duplicate, and removing them takes them off the meeting but keeps the contact. The edit view also has a private note for that meeting, a place for your own reminders that only you and your team ever see; it never appears on the public booking page or anywhere outside your admin. Appointments Maxy schedules and due-dated tasks are shown for detail only and are changed where they are created, not here. New meetings are still made by a booking or by asking Maxy in chat, not from the calendar.
|
|
16
16
|
|
|
17
17
|
Everything on the calendar comes from records the rest of Maxy already uses, scoped to your account.
|
|
18
18
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# JobLogic
|
|
2
|
+
|
|
3
|
+
Connect JobLogic, the field-service management system, so the agent can read and update your jobs end to end — customers, sites, jobs, engineers, visits, quotes, invoices, assets, and timesheets — over JobLogic's REST API.
|
|
4
|
+
|
|
5
|
+
This connector is built for one team that already runs JobLogic as its system of record. Your field staff send a voice note or message to {{productName}} from the field; {{productName}} works out what they mean and makes the JobLogic update for them. Your staff never touch the JobLogic API themselves, so only {{productName}}'s own connection talks to JobLogic.
|
|
6
|
+
|
|
7
|
+
## What you do once
|
|
8
|
+
|
|
9
|
+
**1. Ask JobLogic for API access.** Raise a ticket with JobLogic Support for API credentials. Ask for a test (UAT) account first, then production. They give you a client ID, a client secret, and your company tenant id.
|
|
10
|
+
|
|
11
|
+
**2. Whitelist your connection.** JobLogic only accepts API calls from network addresses you have registered with them. {{productName}} makes its calls from the machine it runs on, so that machine's public address is the one to register. If the machine moves between networks its address can change, so either run it from one place with a stable address, send its traffic through a fixed address, or ask JobLogic whether production needs this at all. If the address is not registered, calls are refused and the agent will tell you the connection was blocked.
|
|
12
|
+
|
|
13
|
+
**3. Hand the keys to the agent.** Tell the agent your client ID, secret, tenant id, and whether they are test or production. The agent stores them on your install only and never repeats them back.
|
|
14
|
+
|
|
15
|
+
## What the agent does after that
|
|
16
|
+
|
|
17
|
+
Everything else is automatic. The agent keeps the connection alive on its own, refreshing access behind the scenes, and can:
|
|
18
|
+
|
|
19
|
+
- **Read** anything — "what jobs are open for this site", "show this engineer's visits this week", "list unpaid invoices".
|
|
20
|
+
- **Write** from a field instruction — create or reschedule a visit, log labour and materials against a job, set a job's status, approve a quote, raise an invoice, add a note or a photo to a job.
|
|
21
|
+
|
|
22
|
+
Because JobLogic's credential belongs to the company rather than to a person, the agent stamps each update with the engineer who reported it. You give the agent a list that maps each staff member's phone number to their JobLogic engineer record once, and it does the rest.
|
|
23
|
+
|
|
24
|
+
Each create carries a safety key, so if a message is retried or a reply goes missing the same instruction never creates a duplicate record.
|
|
25
|
+
|
|
26
|
+
## Testing
|
|
27
|
+
|
|
28
|
+
Do all your testing against the JobLogic test (UAT) environment first. Switch to production only once the test environment behaves the way you expect and your production keys and whitelisting are in place.
|
|
@@ -144,7 +144,7 @@ Every node also carries a provenance stamp — which agent wrote it, in which se
|
|
|
144
144
|
|
|
145
145
|
## Vertical schemas
|
|
146
146
|
|
|
147
|
-
On top of the base graph, each brand boots one optional **vertical** — an extra set of entity types tailored to a trade. The vertical is named by `brand.json#vertical` and defined in a `schema-<name>.md` reference; the memory plugin loads it at startup and validates every write against base + the active vertical. Real Agent boots `schema-estate-agent` (Listing, Property, Viewing, Offer). SiteDesk boots `schema-construction`, which adds the
|
|
147
|
+
On top of the base graph, each brand boots one optional **vertical** — an extra set of entity types tailored to a trade. The vertical is named by `brand.json#vertical` and defined in a `schema-<name>.md` reference; the memory plugin loads it at startup and validates every write against base + the active vertical. Real Agent boots `schema-estate-agent` (Listing, Property, Viewing, Offer). SiteDesk boots `schema-construction`, the canonical JobLogic-derived field-service ontology, which adds the service-delivery entities — `Job`, `Customer`, `Site`, `Asset`, `Visit`, `Quote`, `QuoteLine`, `Valuation`, `VariationNote`, `JobCost`, `Part`, `PurchaseOrder`, `Invoice`, `InboundInvoice`, `PpmContract`, `WhatsAppGroup` (with `Engineer` and `Supplier` as additional labels on `Person`/`Organization`) — grounded in real builder job folders so a job's customer, site, quote, valuations, variations, costs, and received supplier invoices all hang off one `Job` node. The default Maxy brand boots no vertical (base graph only).
|
|
148
148
|
|
|
149
149
|
## Public-facing summaries for customer-readable subjects
|
|
150
150
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "joblogic",
|
|
3
|
+
"description": "JobLogic field-service connector (bespoke, one account) — OAuth client_credentials, tenant-scoped read/write across the job lifecycle.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Rubytech LLC"
|
|
7
|
+
},
|
|
8
|
+
"mcpServers": {
|
|
9
|
+
"joblogic": {
|
|
10
|
+
"type": "stdio",
|
|
11
|
+
"command": "node",
|
|
12
|
+
"args": [
|
|
13
|
+
"${CLAUDE_PLUGIN_ROOT}/lib/mcp-spawn-tee/index.js",
|
|
14
|
+
"${CLAUDE_PLUGIN_ROOT}/mcp/dist/index.js"
|
|
15
|
+
],
|
|
16
|
+
"env": {
|
|
17
|
+
"MCP_SPAWN_TEE_NAME": "joblogic"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: joblogic
|
|
3
|
+
description: "JobLogic field-service connector (bespoke, one account) — OAuth client_credentials, tenant-scoped read/write across the job lifecycle."
|
|
4
|
+
tools:
|
|
5
|
+
- name: joblogic-credentials-set
|
|
6
|
+
publicAllowlist: false
|
|
7
|
+
adminAllowlist: true
|
|
8
|
+
- name: joblogic-connection-status
|
|
9
|
+
publicAllowlist: false
|
|
10
|
+
adminAllowlist: true
|
|
11
|
+
- name: joblogic-engineer-map-set
|
|
12
|
+
publicAllowlist: false
|
|
13
|
+
adminAllowlist: true
|
|
14
|
+
- name: joblogic-engineer-map-list
|
|
15
|
+
publicAllowlist: false
|
|
16
|
+
adminAllowlist: true
|
|
17
|
+
- name: joblogic-customer-list
|
|
18
|
+
publicAllowlist: false
|
|
19
|
+
adminAllowlist: true
|
|
20
|
+
- name: joblogic-customer-get
|
|
21
|
+
publicAllowlist: false
|
|
22
|
+
adminAllowlist: true
|
|
23
|
+
- name: joblogic-customer-create
|
|
24
|
+
publicAllowlist: false
|
|
25
|
+
adminAllowlist: true
|
|
26
|
+
- name: joblogic-customer-update
|
|
27
|
+
publicAllowlist: false
|
|
28
|
+
adminAllowlist: true
|
|
29
|
+
- name: joblogic-site-list
|
|
30
|
+
publicAllowlist: false
|
|
31
|
+
adminAllowlist: true
|
|
32
|
+
- name: joblogic-site-get
|
|
33
|
+
publicAllowlist: false
|
|
34
|
+
adminAllowlist: true
|
|
35
|
+
- name: joblogic-site-create
|
|
36
|
+
publicAllowlist: false
|
|
37
|
+
adminAllowlist: true
|
|
38
|
+
- name: joblogic-site-update
|
|
39
|
+
publicAllowlist: false
|
|
40
|
+
adminAllowlist: true
|
|
41
|
+
- name: joblogic-job-list
|
|
42
|
+
publicAllowlist: false
|
|
43
|
+
adminAllowlist: true
|
|
44
|
+
- name: joblogic-job-get
|
|
45
|
+
publicAllowlist: false
|
|
46
|
+
adminAllowlist: true
|
|
47
|
+
- name: joblogic-job-create
|
|
48
|
+
publicAllowlist: false
|
|
49
|
+
adminAllowlist: true
|
|
50
|
+
- name: joblogic-job-update
|
|
51
|
+
publicAllowlist: false
|
|
52
|
+
adminAllowlist: true
|
|
53
|
+
- name: joblogic-job-set-status
|
|
54
|
+
publicAllowlist: false
|
|
55
|
+
adminAllowlist: true
|
|
56
|
+
- name: joblogic-job-approve
|
|
57
|
+
publicAllowlist: false
|
|
58
|
+
adminAllowlist: true
|
|
59
|
+
- name: joblogic-engineer-list
|
|
60
|
+
publicAllowlist: false
|
|
61
|
+
adminAllowlist: true
|
|
62
|
+
- name: joblogic-engineer-get
|
|
63
|
+
publicAllowlist: false
|
|
64
|
+
adminAllowlist: true
|
|
65
|
+
- name: joblogic-visit-search-planner
|
|
66
|
+
publicAllowlist: false
|
|
67
|
+
adminAllowlist: true
|
|
68
|
+
- name: joblogic-visit-get
|
|
69
|
+
publicAllowlist: false
|
|
70
|
+
adminAllowlist: true
|
|
71
|
+
- name: joblogic-visit-create
|
|
72
|
+
publicAllowlist: false
|
|
73
|
+
adminAllowlist: true
|
|
74
|
+
- name: joblogic-visit-update
|
|
75
|
+
publicAllowlist: false
|
|
76
|
+
adminAllowlist: true
|
|
77
|
+
- name: joblogic-visit-deploy
|
|
78
|
+
publicAllowlist: false
|
|
79
|
+
adminAllowlist: true
|
|
80
|
+
- name: joblogic-visit-cancel
|
|
81
|
+
publicAllowlist: false
|
|
82
|
+
adminAllowlist: true
|
|
83
|
+
- name: joblogic-quote-list
|
|
84
|
+
publicAllowlist: false
|
|
85
|
+
adminAllowlist: true
|
|
86
|
+
- name: joblogic-quote-get
|
|
87
|
+
publicAllowlist: false
|
|
88
|
+
adminAllowlist: true
|
|
89
|
+
- name: joblogic-quote-create
|
|
90
|
+
publicAllowlist: false
|
|
91
|
+
adminAllowlist: true
|
|
92
|
+
- name: joblogic-quote-approve
|
|
93
|
+
publicAllowlist: false
|
|
94
|
+
adminAllowlist: true
|
|
95
|
+
- name: joblogic-invoice-list
|
|
96
|
+
publicAllowlist: false
|
|
97
|
+
adminAllowlist: true
|
|
98
|
+
- name: joblogic-invoice-get
|
|
99
|
+
publicAllowlist: false
|
|
100
|
+
adminAllowlist: true
|
|
101
|
+
- name: joblogic-invoice-create
|
|
102
|
+
publicAllowlist: false
|
|
103
|
+
adminAllowlist: true
|
|
104
|
+
- name: joblogic-invoice-payment-create
|
|
105
|
+
publicAllowlist: false
|
|
106
|
+
adminAllowlist: true
|
|
107
|
+
- name: joblogic-asset-list
|
|
108
|
+
publicAllowlist: false
|
|
109
|
+
adminAllowlist: true
|
|
110
|
+
- name: joblogic-asset-get
|
|
111
|
+
publicAllowlist: false
|
|
112
|
+
adminAllowlist: true
|
|
113
|
+
- name: joblogic-asset-create
|
|
114
|
+
publicAllowlist: false
|
|
115
|
+
adminAllowlist: true
|
|
116
|
+
- name: joblogic-asset-update
|
|
117
|
+
publicAllowlist: false
|
|
118
|
+
adminAllowlist: true
|
|
119
|
+
- name: joblogic-timesheet-list
|
|
120
|
+
publicAllowlist: false
|
|
121
|
+
adminAllowlist: true
|
|
122
|
+
- name: joblogic-timesheet-create
|
|
123
|
+
publicAllowlist: false
|
|
124
|
+
adminAllowlist: true
|
|
125
|
+
- name: joblogic-timesheet-update
|
|
126
|
+
publicAllowlist: false
|
|
127
|
+
adminAllowlist: true
|
|
128
|
+
- name: joblogic-jobcost-create
|
|
129
|
+
publicAllowlist: false
|
|
130
|
+
adminAllowlist: true
|
|
131
|
+
- name: joblogic-jobcost-update
|
|
132
|
+
publicAllowlist: false
|
|
133
|
+
adminAllowlist: true
|
|
134
|
+
- name: joblogic-note-create
|
|
135
|
+
publicAllowlist: false
|
|
136
|
+
adminAllowlist: true
|
|
137
|
+
- name: joblogic-attachment-url-generate
|
|
138
|
+
publicAllowlist: false
|
|
139
|
+
adminAllowlist: true
|
|
140
|
+
skills:
|
|
141
|
+
- skills/joblogic/SKILL.md
|
|
142
|
+
metadata: {"platform":{"optional":true,"pluginKey":"joblogic"}}
|
|
143
|
+
mcp:
|
|
144
|
+
command: node
|
|
145
|
+
args:
|
|
146
|
+
- ${PLATFORM_ROOT}/lib/mcp-spawn-tee/dist/index.js
|
|
147
|
+
- ${PLATFORM_ROOT}/plugins/joblogic/mcp/dist/index.js
|
|
148
|
+
env:
|
|
149
|
+
MCP_SPAWN_TEE_NAME: joblogic
|
|
150
|
+
LOG_DIR: ${LOG_DIR}
|
|
151
|
+
PLATFORM_ROOT: ${PLATFORM_ROOT}
|
|
152
|
+
ACCOUNT_ID: ${ACCOUNT_ID}
|
|
153
|
+
SESSION_ID: ${SESSION_ID}
|
|
154
|
+
mcp-manifest: auto
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
# JobLogic
|
|
158
|
+
|
|
159
|
+
Connects to JobLogic, a cloud field-service management system (REST/JSON, OAuth 2.0). This is a bespoke connector for one account: it ships inert and does nothing on any other install, gated per-account by the account's `enabledPlugins` plus the presence of credentials in that account's secrets file. It is not part of any brand bundle.
|
|
160
|
+
|
|
161
|
+
The intended use: field staff send a voice note or message to this install; the agent interprets it and makes the JobLogic write. Staff never call the API themselves, so only this install's outbound IP touches JobLogic.
|
|
162
|
+
|
|
163
|
+
## Capabilities
|
|
164
|
+
|
|
165
|
+
- **joblogic-credentials-set** — store the OAuth client_credentials (client id + secret), company tenant id, and environment (uat or production).
|
|
166
|
+
- **joblogic-connection-status** — acquire a token and confirm the environment, tenant, and source-IP whitelisting work.
|
|
167
|
+
- **joblogic-engineer-map-set / -list** — map sender phone numbers to JobLogic engineer ids for write attribution.
|
|
168
|
+
- **Reads** — list/get/search across customers, sites, jobs, engineers, visits (planner), quotes, invoices, assets, and timesheets.
|
|
169
|
+
- **Writes** — create and update those records, plus lifecycle transitions: set a job status, approve a job or quote, deploy or cancel a visit, log job-cost lines, raise an invoice, record a payment, add a note or generate an attachment upload URL.
|
|
170
|
+
|
|
171
|
+
## Authorization and idempotency
|
|
172
|
+
|
|
173
|
+
A write is authorized by the person who messaged the install requesting it; the agent does not add a second confirmation step. Every create takes an idempotency key, so a retry or a lost response never creates a duplicate record.
|
|
174
|
+
|
|
175
|
+
## Setup
|
|
176
|
+
|
|
177
|
+
Connecting JobLogic runs through the `joblogic` skill (`skills/joblogic/SKILL.md`): the operator raises a JobLogic Support ticket, whitelists the install's outbound IP, and hands over the credentials. Use UAT for all testing before switching to production.
|
|
178
|
+
|
|
179
|
+
## Credentials and isolation
|
|
180
|
+
|
|
181
|
+
Credentials live only in this account's secrets directory (`secrets/joblogic.json`, mode `0600`), inside the brand-isolated install. The bearer token is acquired on demand from the client credentials and refreshed automatically before it expires.
|
|
182
|
+
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* MCP spawn-tee — in-process stderr capture + lifecycle observability.
|
|
5
|
+
*
|
|
6
|
+
* Claude Code spawns each MCP server itself; the platform never holds a
|
|
7
|
+
* ChildProcess handle. This shim sits between Claude Code and the real MCP
|
|
8
|
+
* server: Claude Code runs `node <this> <real-entry>`, and the shim runs the
|
|
9
|
+
* real entry IN ITS OWN PROCESS via dynamic import() — one node runtime, not
|
|
10
|
+
* two. Before importing, it replaces process.stderr.write with a tee so every
|
|
11
|
+
* stderr byte the server writes is mirrored to the log sinks; stdin and stdout
|
|
12
|
+
* (the JSON-RPC channel) are never touched.
|
|
13
|
+
*
|
|
14
|
+
* Claude Code CLI → shim (this file) = node running <real-entry> in-process
|
|
15
|
+
* stdin/stdout : untouched (JSON-RPC channel)
|
|
16
|
+
* stderr : process.stderr.write teed → per-date + per-session + passthrough
|
|
17
|
+
*
|
|
18
|
+
* Destinations (Task 706) — unchanged:
|
|
19
|
+
* - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` — per-date raw (back-compat;
|
|
20
|
+
* the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
|
|
21
|
+
* - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
|
|
22
|
+
* lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
|
|
23
|
+
* spawn) — then the per-date file is the fallback.
|
|
24
|
+
* - `server.log` via the loopback log-ingest route — best-effort mirror of
|
|
25
|
+
* the [mcp-helper] lifecycle lines.
|
|
26
|
+
*
|
|
27
|
+
* Lifecycle lines, correlation key `session=<id8> server=<name>` — unchanged:
|
|
28
|
+
* [mcp-helper] op=spawn ... pid= entry=
|
|
29
|
+
* [mcp-helper] op=boot ... head=<first stderr bytes>
|
|
30
|
+
* [mcp-helper] op=exit ... code= signal= lifetimeMs= stderr-tail=
|
|
31
|
+
*
|
|
32
|
+
* Process model (Task 989): the shim IS the server's process. op=exit fires
|
|
33
|
+
* from process.on("exit"), so it covers a normal exit, a non-zero exit, an
|
|
34
|
+
* uncaught throw (code 1), and a catchable-signal exit (SIGTERM/SIGINT/SIGHUP,
|
|
35
|
+
* whose handlers record the signal name). An external SIGKILL is uncatchable
|
|
36
|
+
* and leaves no op=exit line — the per-session stderr tail already on disk and
|
|
37
|
+
* Claude Code's own transport-drop are the evidence for that death mode.
|
|
38
|
+
*
|
|
39
|
+
* The shim never writes to fd 1 (stdout) — that is the JSON-RPC channel.
|
|
40
|
+
*/
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
const node_fs_1 = require("node:fs");
|
|
43
|
+
const node_path_1 = require("node:path");
|
|
44
|
+
const node_url_1 = require("node:url");
|
|
45
|
+
const SERVER_NAME = process.env.MCP_SPAWN_TEE_NAME ?? "unknown";
|
|
46
|
+
const LOG_DIR = process.env.LOG_DIR;
|
|
47
|
+
const SESSION_ID = process.env.SESSION_ID;
|
|
48
|
+
const PLATFORM_PORT = process.env.PLATFORM_PORT;
|
|
49
|
+
const ENTRY = process.argv[2];
|
|
50
|
+
const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
|
|
51
|
+
const spawnStamp = Date.now();
|
|
52
|
+
// Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
|
|
53
|
+
// spawn) → undefined, and the per-date file is the fallback.
|
|
54
|
+
const perSessionPath = LOG_DIR && SESSION_ID
|
|
55
|
+
? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
|
|
56
|
+
: undefined;
|
|
57
|
+
const perDatePath = LOG_DIR
|
|
58
|
+
? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
|
|
59
|
+
: undefined;
|
|
60
|
+
// Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
|
|
61
|
+
// grow the buffer without bound.
|
|
62
|
+
const TAIL_CAP = 2048;
|
|
63
|
+
let stderrTail = "";
|
|
64
|
+
let bootEmitted = false;
|
|
65
|
+
let exitEmitted = false;
|
|
66
|
+
let exitSignal;
|
|
67
|
+
// The real stderr writer, captured before the tee replaces it. Lifecycle lines
|
|
68
|
+
// and stderr passthrough both go through this so they are never re-teed into
|
|
69
|
+
// the per-date sink nor recursed back into the patched writer.
|
|
70
|
+
const rawStderrWrite = process.stderr.write.bind(process.stderr);
|
|
71
|
+
// LOG_DIR is created once, lazily, on the first successful append — not per
|
|
72
|
+
// chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
|
|
73
|
+
// mkdirSync would be two syscalls per log line for nothing.
|
|
74
|
+
let logDirReady = false;
|
|
75
|
+
function appendSafe(path, data) {
|
|
76
|
+
if (!path || !LOG_DIR)
|
|
77
|
+
return;
|
|
78
|
+
try {
|
|
79
|
+
if (!logDirReady) {
|
|
80
|
+
(0, node_fs_1.mkdirSync)(LOG_DIR, { recursive: true });
|
|
81
|
+
logDirReady = true;
|
|
82
|
+
}
|
|
83
|
+
(0, node_fs_1.appendFileSync)(path, data);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
/* unwritable destination — never mask primary output */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Best-effort mirror of a lifecycle line to server.log via the loopback
|
|
90
|
+
// log-ingest route. Fire-and-forget: the per-session file is authoritative, so
|
|
91
|
+
// a dropped POST loses nothing. On the "exit" event the loop is stopping, so
|
|
92
|
+
// the op=exit mirror may not flush — the per-session line, written sync, holds.
|
|
93
|
+
function postToServerLog(suffix, level) {
|
|
94
|
+
if (!PLATFORM_PORT)
|
|
95
|
+
return;
|
|
96
|
+
try {
|
|
97
|
+
const ctrl = new AbortController();
|
|
98
|
+
const t = setTimeout(() => ctrl.abort(), 500);
|
|
99
|
+
t.unref?.(); // never let the abort timer keep the shim's event loop alive
|
|
100
|
+
void fetch(`http://127.0.0.1:${PLATFORM_PORT}/api/admin/log-ingest`, {
|
|
101
|
+
method: "POST",
|
|
102
|
+
headers: { "content-type": "application/json" },
|
|
103
|
+
body: JSON.stringify({ tag: "mcp-helper", level, line: suffix }),
|
|
104
|
+
signal: ctrl.signal,
|
|
105
|
+
}).then(() => clearTimeout(t)).catch(() => clearTimeout(t));
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
/* fetch threw synchronously — best-effort only */
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Emit one [mcp-helper] lifecycle line: authoritative per-session file (sync,
|
|
112
|
+
// survives process.exit), the shim's own stderr via the RAW writer (journald /
|
|
113
|
+
// Claude Code visibility, never re-teed), and a best-effort server.log mirror.
|
|
114
|
+
// `suffix` is the line body after the tag and carries no newline (the
|
|
115
|
+
// log-ingest route rejects newlines).
|
|
116
|
+
function emitLifecycle(suffix, level) {
|
|
117
|
+
const line = `[mcp-helper] ${suffix}\n`;
|
|
118
|
+
appendSafe(perSessionPath, line);
|
|
119
|
+
try {
|
|
120
|
+
rawStderrWrite(line);
|
|
121
|
+
}
|
|
122
|
+
catch { /* stderr closed */ }
|
|
123
|
+
postToServerLog(suffix, level);
|
|
124
|
+
}
|
|
125
|
+
if (!ENTRY) {
|
|
126
|
+
emitLifecycle(`op=error session=${SESSION_ID8} server=${SERVER_NAME} reason="no entry given (argv[2] missing)"`, "error");
|
|
127
|
+
process.exit(2);
|
|
128
|
+
}
|
|
129
|
+
// Replace process.stderr.write with a tee: mirror every server stderr byte to
|
|
130
|
+
// the per-date and per-session sinks, keep a rolling tail for op=exit, emit
|
|
131
|
+
// op=boot on the first bytes, then pass the write through to the real stderr.
|
|
132
|
+
const teeWrite = ((...args) => {
|
|
133
|
+
const chunk = args[0];
|
|
134
|
+
appendSafe(perDatePath, chunk); // per-date raw (back-compat)
|
|
135
|
+
appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
|
|
136
|
+
const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
137
|
+
stderrTail = (stderrTail + text).slice(-TAIL_CAP);
|
|
138
|
+
if (!bootEmitted) {
|
|
139
|
+
bootEmitted = true;
|
|
140
|
+
const head = text.split("\n")[0].slice(0, 200);
|
|
141
|
+
emitLifecycle(`op=boot session=${SESSION_ID8} server=${SERVER_NAME} head=${JSON.stringify(head)}`, "info");
|
|
142
|
+
}
|
|
143
|
+
return rawStderrWrite(...args); // passthrough
|
|
144
|
+
});
|
|
145
|
+
process.stderr.write = teeWrite;
|
|
146
|
+
// Catchable-signal handling. The shim drives the exit ONLY when it is the sole
|
|
147
|
+
// listener for the signal — i.e. the imported entry installed no handler of its
|
|
148
|
+
// own. In that case it records the signal (so op=exit carries signal=<sig>) and
|
|
149
|
+
// exits with 128+signum, mirroring the prior wrapper's exit-status convention.
|
|
150
|
+
//
|
|
151
|
+
// When the entry DID install a handler, the shim defers entirely and records
|
|
152
|
+
// nothing: the entry's handler decides the exit code, and op=exit reflects that
|
|
153
|
+
// exit verbatim. This matches the prior two-process model, where a child that
|
|
154
|
+
// caught the signal and exited cleanly was observed as code=0 signal=— (a clean
|
|
155
|
+
// self-exit), not as a signal death. Setting exitSignal here unconditionally
|
|
156
|
+
// would mislabel every graceful signal-driven shutdown as a signal kill.
|
|
157
|
+
function onSignal(sig, code) {
|
|
158
|
+
return () => {
|
|
159
|
+
if (process.listenerCount(sig) === 1) {
|
|
160
|
+
exitSignal = sig;
|
|
161
|
+
process.exit(code);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
process.on("SIGTERM", onSignal("SIGTERM", 143));
|
|
166
|
+
process.on("SIGINT", onSignal("SIGINT", 130));
|
|
167
|
+
process.on("SIGHUP", onSignal("SIGHUP", 129));
|
|
168
|
+
// op=exit, emitted once from the process "exit" event. Sync-only — the loop is
|
|
169
|
+
// stopping. When a catchable signal caused the exit, report code=— signal=<sig>
|
|
170
|
+
// to match the prior wrapper's format; otherwise code=<exit code> signal=—.
|
|
171
|
+
process.on("exit", (code) => {
|
|
172
|
+
if (exitEmitted)
|
|
173
|
+
return;
|
|
174
|
+
exitEmitted = true;
|
|
175
|
+
const lifetimeMs = Date.now() - spawnStamp;
|
|
176
|
+
const tail = stderrTail.slice(-200);
|
|
177
|
+
const codeField = exitSignal ? "—" : String(code);
|
|
178
|
+
const level = exitSignal || code !== 0 ? "error" : "info";
|
|
179
|
+
emitLifecycle(`op=exit session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} ` +
|
|
180
|
+
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
|
+
});
|
|
182
|
+
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
|
+
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
|
+
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
186
|
+
// op=exit handler is suppressed on this path so op=error stays the sole record.
|
|
187
|
+
import((0, node_url_1.pathToFileURL)(ENTRY).href).catch((err) => {
|
|
188
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
189
|
+
exitEmitted = true;
|
|
190
|
+
emitLifecycle(`op=error session=${SESSION_ID8} server=${SERVER_NAME} reason=${JSON.stringify(`import error: ${msg}`)}`, "error");
|
|
191
|
+
process.exit(127);
|
|
192
|
+
});
|
|
193
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|