@witbitz/sdk 0.0.0-stage → 4.4.0

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.
Files changed (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -2
  3. package/a2aCore.js +221 -0
  4. package/a2aShared.js +27 -0
  5. package/accountErase.js +228 -0
  6. package/accountIndexDoc.js +122 -0
  7. package/accountOwner.js +59 -0
  8. package/accountRecord.js +90 -0
  9. package/accountScope.js +114 -0
  10. package/accountSeal.js +42 -0
  11. package/accountStores.js +173 -0
  12. package/acctV2App.js +619 -0
  13. package/acctV2Check.js +29 -0
  14. package/acctV2Client.js +382 -0
  15. package/acctV2Keys.js +43 -0
  16. package/acctV2Legacy.js +14 -0
  17. package/acctV2Switch.js +80 -0
  18. package/acctV2UiCore.js +857 -0
  19. package/acctV2WebAuthn.js +61 -0
  20. package/acctV2Wire.js +59 -0
  21. package/address.js +42 -0
  22. package/agentDoorTools.js +28 -0
  23. package/attestedBox.js +30 -0
  24. package/attestedRooms.js +78 -0
  25. package/awsKey.js +98 -0
  26. package/backupRecord.js +106 -0
  27. package/backupVault.js +97 -0
  28. package/blocks.js +115 -0
  29. package/blocksPush.js +64 -0
  30. package/browseSeal.js +103 -0
  31. package/cbor.js +225 -0
  32. package/changePush.js +75 -0
  33. package/chatLock.js +165 -0
  34. package/chatLockSw.js +13 -0
  35. package/cloudDeviceBuilds.js +11 -0
  36. package/cloudDevicePins.js +33 -0
  37. package/cloudDeviceSeal.js +53 -0
  38. package/codeAttachments.js +100 -0
  39. package/codeBrowse.js +224 -0
  40. package/codeCache.js +149 -0
  41. package/codeCloud.js +650 -0
  42. package/codeCloudKeys.js +112 -0
  43. package/codeCommands.js +167 -0
  44. package/codeComputers.js +389 -0
  45. package/codeEgress.js +123 -0
  46. package/codeFilesRoutes.js +17 -0
  47. package/codeFolders.js +116 -0
  48. package/codeHistory.js +76 -0
  49. package/codeLanguage.js +54 -0
  50. package/codeMkdir.js +8 -0
  51. package/codeModes.js +59 -0
  52. package/codeOrphanKeys.js +42 -0
  53. package/codeOutputs.js +141 -0
  54. package/codeProgress.js +54 -0
  55. package/codeRelay.js +505 -0
  56. package/codeSent.js +68 -0
  57. package/codeSentinel.js +86 -0
  58. package/codeSubagents.js +107 -0
  59. package/codeTransport.js +317 -0
  60. package/codeUndo.js +48 -0
  61. package/compress.js +24 -0
  62. package/config.js +11 -0
  63. package/connCatalog.js +164 -0
  64. package/connDisp.js +76 -0
  65. package/connOtherWays.js +74 -0
  66. package/connPending.js +16 -0
  67. package/connWrap.js +53 -0
  68. package/connectionEntry.js +89 -0
  69. package/connections.js +561 -0
  70. package/credits.js +30 -0
  71. package/csAttest.js +112 -0
  72. package/decrypt.html +384 -0
  73. package/deviceAttest.js +527 -0
  74. package/deviceCall.js +54 -0
  75. package/deviceKeyCore.js +41 -0
  76. package/deviceSeal.js +59 -0
  77. package/e2ee.js +323 -0
  78. package/eat.js +103 -0
  79. package/emailFork.js +275 -0
  80. package/emailSignIn.js +81 -0
  81. package/emptySpaces.js +111 -0
  82. package/encSource.js +55 -0
  83. package/enclaveAccept.js +214 -0
  84. package/enclaveClaim.js +241 -0
  85. package/enclaveRoute.js +102 -0
  86. package/enclaveSnapshotMerge.js +44 -0
  87. package/entrySig.js +165 -0
  88. package/env.js +73 -0
  89. package/eraseFile.js +58 -0
  90. package/followImage.js +86 -0
  91. package/healNames.js +45 -0
  92. package/idb.js +113 -0
  93. package/idbSeal.js +119 -0
  94. package/indexGone.js +12 -0
  95. package/invite.js +51 -0
  96. package/inviteEnroll.js +67 -0
  97. package/inviteSend.js +68 -0
  98. package/jobAgents.js +87 -0
  99. package/keptMerge.js +91 -0
  100. package/l1-worker-src.js +2 -0
  101. package/l1-worker.js +894 -0
  102. package/laneAssociation.js +68 -0
  103. package/laneConfig.js +58 -0
  104. package/laneLinkCore.js +177 -0
  105. package/ledgerView.js +64 -0
  106. package/manifest.json +239 -0
  107. package/mcpRecommended.js +25 -0
  108. package/memberChange.js +125 -0
  109. package/mirrorBatch.js +47 -0
  110. package/mkseal.js +101 -0
  111. package/nativePush.js +153 -0
  112. package/nitroVerify.js +220 -0
  113. package/noble-p256.js +27 -0
  114. package/notice.js +116 -0
  115. package/notifKey.js +58 -0
  116. package/offlineBundle.js +62 -0
  117. package/ohttp.js +177 -0
  118. package/opRouting.js +10 -0
  119. package/opencodeWire.js +282 -0
  120. package/oprf.js +70 -0
  121. package/ownAgentLink.js +96 -0
  122. package/ownerPolicy.js +117 -0
  123. package/package.json +273 -4
  124. package/pdfOptions.js +13 -0
  125. package/pdfText.js +107 -0
  126. package/pdfjs.mjs +28 -0
  127. package/pdfjs.worker.mjs +28 -0
  128. package/pollVerdict.js +33 -0
  129. package/prefetchPoll.js +60 -0
  130. package/protectedLocal.js +426 -0
  131. package/pushCore.js +42 -0
  132. package/recovery.js +107 -0
  133. package/regions.js +42 -0
  134. package/removedMessage.js +11 -0
  135. package/renameRefusal.js +9 -0
  136. package/replyQuote.js +34 -0
  137. package/reqEnvelope.js +126 -0
  138. package/roomDefaultPrefs.js +76 -0
  139. package/roomDelete.js +109 -0
  140. package/roomEmbed.js +111 -0
  141. package/roomName.js +177 -0
  142. package/roomPass.js +256 -0
  143. package/roomRoster.js +305 -0
  144. package/roomSettings.js +61 -0
  145. package/roomState.js +58 -0
  146. package/roomStreamClient.js +115 -0
  147. package/rosterCount.js +52 -0
  148. package/rosterHash.js +13 -0
  149. package/rowSchema.js +113 -0
  150. package/safeMedia.js +116 -0
  151. package/safeMediaPins.js +17 -0
  152. package/schedulesDoc.js +78 -0
  153. package/sdkA2A.js +524 -0
  154. package/sdkAccount.js +483 -0
  155. package/sdkAccountDoc.js +89 -0
  156. package/sdkAccountSections.js +332 -0
  157. package/sdkAgui.js +141 -0
  158. package/sdkAttest.js +34 -0
  159. package/sdkBackup.js +507 -0
  160. package/sdkBackupV2.js +630 -0
  161. package/sdkBrowserPrivate.js +28 -0
  162. package/sdkBuilds.js +208 -0
  163. package/sdkCloudDevice.js +221 -0
  164. package/sdkComputers.js +1009 -0
  165. package/sdkDictation.js +232 -0
  166. package/sdkErase.js +288 -0
  167. package/sdkExports.js +71 -0
  168. package/sdkInvitations.js +34 -0
  169. package/sdkKeptAgent.js +188 -0
  170. package/sdkLaneLink.js +205 -0
  171. package/sdkPlan.js +96 -0
  172. package/sdkProtect.js +228 -0
  173. package/sdkRedact.js +36 -0
  174. package/sdkRekey.js +340 -0
  175. package/sdkReport.js +68 -0
  176. package/sdkSafeMedia.js +255 -0
  177. package/sdkSchedules.js +39 -0
  178. package/sdkSpeech.js +71 -0
  179. package/sdkTemporaryRooms.js +123 -0
  180. package/sdkTurn.js +117 -0
  181. package/sdkVault.js +180 -0
  182. package/sealShare.js +18 -0
  183. package/sealedNames.js +64 -0
  184. package/sealedReceipt.js +17 -0
  185. package/sentinelRelease.js +155 -0
  186. package/shamir.js +85 -0
  187. package/sharedViews.js +52 -0
  188. package/sheetChrome.js +450 -0
  189. package/siri.js +278 -0
  190. package/spaceClient.js +1429 -0
  191. package/spaceConfig.js +81 -0
  192. package/spaceEmailGate.js +813 -0
  193. package/spaceExport.js +125 -0
  194. package/spaceFork.js +216 -0
  195. package/spaceLock.js +358 -0
  196. package/spacePasskey.js +180 -0
  197. package/spaceTemplates.js +99 -0
  198. package/speechOut.js +102 -0
  199. package/splitKeyClient.js +90 -0
  200. package/store.js +656 -0
  201. package/streamHint.js +36 -0
  202. package/sttCloud.js +220 -0
  203. package/sttWorklet.js +38 -0
  204. package/sw-notif-core.js +540 -0
  205. package/tempList.js +48 -0
  206. package/tinfoilVerifier.js +78 -0
  207. package/toolBooks.js +31 -0
  208. package/toolRules.js +52 -0
  209. package/turnCerts.js +254 -0
  210. package/turnFeed.js +58 -0
  211. package/turnVerdict.js +37 -0
  212. package/usageReceipts.js +176 -0
  213. package/usageSummary.js +90 -0
  214. package/util.js +181 -0
  215. package/vault-core.js +2326 -0
  216. package/vault-kit.mjs +354 -0
  217. package/vault-screens.js +261 -0
  218. package/vaultAtRest.js +208 -0
  219. package/vaultCoreLock.js +111 -0
  220. package/vaultCorePush.js +140 -0
  221. package/vaultDeviceKey.js +95 -0
  222. package/vaultEnclaveHandoff.js +114 -0
  223. package/vaultKeep.js +287 -0
  224. package/vaultSealedStore.js +77 -0
  225. package/vaultWorkerHost.js +117 -0
  226. package/vcWorker.js +34 -0
  227. package/voiceAttest.js +50 -0
  228. package/voiceCert.js +51 -0
  229. package/witbitz-admin.d.ts +135 -0
  230. package/witbitz-admin.js +529 -0
  231. package/witbitz-admin.mjs +1460 -0
  232. package/witbitz-sdk.d.ts +1197 -0
  233. package/witbitz-sdk.js +4258 -0
  234. package/workerClient.js +16 -0
  235. package/workerLiveness.js +21 -0
  236. package/x509.js +218 -0
package/connCatalog.js ADDED
@@ -0,0 +1,164 @@
1
+ // connCatalog.js — the services Connections offers (the owner, 2026-10-14: Grok Bot's connector catalog; "We should just take it?").
2
+ // Every address passed the Sentinel's own MCP sign-in steps (infra/cloud-computer/sentinel/mcpAuth.mjs: discover → self-register
3
+ // → consent page; tools/conn-catalog/probe.mjs) or answers without a sign-in. Entries marked `src: 'cursor'` take their address,
4
+ // description and logo from github.com/cursor/plugins third_party/* (MIT, © 2026 Cursor — see icons/services/NOTICE).
5
+ // Five long descriptions are shortened to one line (Trello, Plaud, beehiiv, PostHog, TinyFish). The rest are ours; their marks are in serviceIcons.js (Simple Icons, CC0) or a letter tile.
6
+ // Witbitz's Google Calendar app as filed with the Sentinel (tools/file-oauth-provider.mjs) — '' until filed (the row stays hidden)
7
+ export const GCAL_PROVIDER = 'prov_XE5FdiPdAx881HKs'
8
+ export const CATALOG = [
9
+ // AN AGENT YOU SEND JOBS TO, not a service you sign in to (the owner, 2026-10-15: "Doesn't grokbot have a connector like
10
+ // other connectors?" → "Yes"). Grok Bot takes MCP servers but offers none; what starts a run from outside is a routine's
11
+ // trigger "When this webhook receives a request": an Endpoint https://grok.com/webhook/automation/<id> and a Signing
12
+ // secret whsec_… — a SIGNED webhook (docs/signed-webhooks.md). Attached through grokRoutine.js; each call is approved.
13
+ { name: "Grok Bot", kind: "webhook", host: "grok.com", desc: "Send a job to one of your Grok Bot routines — you approve each one.", cat: "Agents", png: "/icons/services/grok-bot.png" },
14
+ // CLAUDE CODE (the owner, 2026-10-21: "Let's do Claude code"): the same kind as Grok Bot — a scheduled task's API trigger
15
+ // (a bearer webhook on api.anthropic.com) takes the job, the run reports back through this Space's MCP address. The card and
16
+ // what the room keeps come from jobAgents.js (docs/job-agents.md).
17
+ { name: "Claude Code", kind: "webhook", host: "api.anthropic.com", desc: "Send a job to a Claude Code task in Anthropic's cloud — you approve each one.", cat: "Agents", png: "/icons/services/claude-code.png" },
18
+ // AN AGENT THAT COMES TO YOU (the owner, 2026-10-15: "add a muse ai connector like we did for grokbot"). Meta's Muse takes
19
+ // custom MCP connectors (streamable HTTP, a bearer key) but nothing can start a Muse task from outside — no webhook, no
20
+ // public API (docs/outside-agents.md). So it is ONE way: Muse reaches a Space's private assistant through the Sentinel's
21
+ // MCP door (message_member / get_reply), and a recurring Muse task asks that assistant for work. Set up by connectionsSheet.js openMuse.
22
+ { name: "Muse", kind: "agent", host: "meta.ai", desc: "Let Meta's Muse work with this Space's assistant — it asks for jobs and sends back the results.", cat: "Agents", png: "/icons/services/muse.png" },
23
+ // OpenAI's Dots (the owner, 2026-10-15: "OpenAI new dots bot" → "Do a"): a ChatGPT custom MCP server (name + URL, the key in
24
+ // it). One way for now, as Muse; ChatGPT's MCP Events could push it jobs later (a Sentinel cycle).
25
+ { name: "Dots", kind: "agent", host: "chatgpt.com", desc: "Let your OpenAI dot work with this Space's assistant — it asks for jobs and sends back the results.", cat: "Agents", png: "/icons/services/dots.png" },
26
+ { name: "Context7", url: "https://mcp.context7.com/mcp", desc: "Up-to-date docs for code libraries.", cat: "Engineering", png: "/icons/services/context7.png" },
27
+ { name: "GitHub", url: "https://api.githubcopilot.com/mcp/", desc: "Repositories, issues and pull requests.", cat: "Engineering", registered: true },
28
+ { name: "Hugging Face", url: "https://huggingface.co/mcp", desc: "Models, datasets and Spaces.", cat: "Engineering" },
29
+ { name: "Jam", url: "https://mcp.jam.dev/mcp", desc: "Bug reports with console and network logs.", cat: "Engineering", png: "/icons/services/jam.png" },
30
+ { name: "Linear", url: "https://mcp.linear.app/mcp", desc: "Issues, projects and cycles.", cat: "Engineering" },
31
+ { name: "Neon", url: "https://mcp.neon.tech/mcp", desc: "Postgres databases and branches.", cat: "Engineering", png: "/icons/services/neon.png" },
32
+ { name: "Sentry", url: "https://mcp.sentry.dev/mcp", desc: "Errors, issues and releases.", cat: "Engineering" },
33
+ { name: "Statsig", url: "https://api.statsig.com/v3/mcp", desc: "Inspect and manage feature gates, experiments, dynamic configs, and metrics.", cat: "Engineering", png: "/icons/services/statsig.png", src: "cursor" },
34
+ { name: "Supabase", url: "https://mcp.supabase.com/mcp", desc: "Databases, tables and edge functions.", cat: "Engineering" },
35
+ { name: "Airtable", url: "https://mcp.airtable.com/mcp", desc: "Bases, tables and records.", cat: "Productivity" },
36
+ { name: "Atlassian", url: "https://mcp.atlassian.com/v1/mcp", desc: "Jira issues and Confluence pages.", cat: "Productivity" },
37
+ { name: "Basecamp", url: "https://mcp.basecamp.com/mcp", desc: "Projects, to-dos and messages.", cat: "Productivity" },
38
+ { name: "ClickUp", url: "https://mcp.clickup.com/mcp", desc: "Tasks, docs and spaces.", cat: "Productivity" },
39
+ { name: "Jotform", url: "https://mcp.jotform.com", desc: "Create and edit forms, then read submissions.", cat: "Productivity", png: "/icons/services/jotform.png", src: "cursor" },
40
+ { name: "monday.com", url: "https://mcp.monday.com/mcp", desc: "Boards, items and updates.", cat: "Productivity", png: "/icons/services/monday.png" },
41
+ { name: "Todoist", url: "https://ai.todoist.net/mcp", desc: "Create, find, and complete tasks and projects.", cat: "Productivity", png: "/icons/services/todoist.png", src: "cursor" },
42
+ { name: "Trello", url: "https://mcp.trello.com/v1", desc: "Boards, lists and cards: create, move and complete, with checklists and due dates.", cat: "Productivity", png: "/icons/services/trello.png", src: "cursor" },
43
+ { name: "Zapier", url: "https://mcp.zapier.com/api/mcp/mcp", desc: "Actions across thousands of apps.", cat: "Productivity" },
44
+ { name: "Coda", url: "https://docs.superhuman.com/apis/mcp", desc: "Search docs, read pages, and update tables.", cat: "Documents", png: "/icons/services/coda.png", src: "cursor" },
45
+ { name: "Craft", url: "https://mcp.craft.do/my/mcp", desc: "Search, create, and update documents and daily notes.", cat: "Documents", png: "/icons/services/craft.png", src: "cursor" },
46
+ { name: "Guru", url: "https://mcp.api.getguru.com/mcp", desc: "Search company knowledge and draft verified answers.", cat: "Documents", png: "/icons/services/guru.png", src: "cursor" },
47
+ { name: "Mem", url: "https://mcp.mem.ai/mcp", desc: "Capture, search, and organize notes and collections.", cat: "Documents", png: "/icons/services/mem.png", src: "cursor" },
48
+ { name: "Notion", url: "https://mcp.notion.com/mcp", desc: "Search, read and write pages.", cat: "Documents" },
49
+ { name: "Readwise", url: "https://mcp2.readwise.io/mcp", desc: "Search highlights and Reader documents, save articles.", cat: "Documents", png: "/icons/services/readwise.png", src: "cursor" },
50
+ { name: "Canva", url: "https://mcp.canva.com/mcp", desc: "Designs, templates and exports.", cat: "Design" },
51
+ { name: "Excalidraw", url: "https://mcp.excalidraw.com/mcp", desc: "Hand-drawn diagrams and sketches.", cat: "Design" },
52
+ { name: "Miro", url: "https://mcp.miro.com/", desc: "Boards, diagrams and sticky notes.", cat: "Design" },
53
+ { name: "Webflow", url: "https://mcp.webflow.com/sse", desc: "Sites, pages and CMS items.", cat: "Design" },
54
+ { name: "Wix", url: "https://mcp.wix.com/mcp", desc: "Sites, stores and bookings.", cat: "Design" },
55
+ { name: "Circleback", url: "https://circleback.ai/api/mcp", desc: "Search meetings, transcripts, action items, and emails.", cat: "Meetings", png: "/icons/services/circleback.png", src: "cursor" },
56
+ { name: "Fathom", url: "https://api.fathom.ai/mcp", desc: "Search meetings and pull transcripts and summaries.", cat: "Meetings", png: "/icons/services/fathom.png", src: "cursor" },
57
+ { name: "Fireflies", url: "https://api.fireflies.ai/mcp", desc: "Search meeting transcripts, summaries, and action items.", cat: "Meetings", png: "/icons/services/fireflies.png", src: "cursor" },
58
+ { name: "Granola", url: "https://mcp.granola.ai/mcp", desc: "Your meeting notes and transcripts.", cat: "Meetings", png: "/icons/services/granola.png" },
59
+ { name: "Otter.ai", url: "https://mcp.otter.ai/mcp", desc: "Search meeting history and pull full transcripts.", cat: "Meetings", png: "/icons/services/otter.png", src: "cursor" },
60
+ { name: "Plaud", url: "https://mcp.plaud.ai/mcp", desc: "Your Plaud recordings: transcripts with speakers, summaries and action items.", cat: "Meetings", png: "/icons/services/plaud.png", src: "cursor" },
61
+ { name: "Read AI", url: "https://api.read.ai/mcp", desc: "Meeting summaries and transcripts.", cat: "Meetings", png: "/icons/services/readai.png" },
62
+ { name: "Calendly", url: "https://mcp.calendly.com/", desc: "Check availability and book, cancel, or reschedule.", cat: "Scheduling", png: "/icons/services/calendly.png", src: "cursor" },
63
+ { name: "Amplemarket", url: "https://mcp.amplemarket.com/mcp", desc: "Search people and companies, enrich leads, run sequences.", cat: "Sales", png: "/icons/services/amplemarket.png", src: "cursor" },
64
+ { name: "Attio", url: "https://mcp.attio.com/mcp", desc: "Search and update CRM records, lists, notes, and tasks.", cat: "Sales", png: "/icons/services/attio.png", src: "cursor" },
65
+ { name: "Clay", url: "https://api.clay.com/v3/mcp", desc: "Enrich people and companies, run AI research agents.", cat: "Sales", png: "/icons/services/clay.png", src: "cursor" },
66
+ { name: "Gong", url: "https://mcp.gong.io/mcp", desc: "Pull account summaries, deal insights, and call briefs.", cat: "Sales", png: "/icons/services/gong.png", src: "cursor" },
67
+ { name: "HubSpot", url: "https://mcp.hubspot.com/", desc: "Contacts, companies, deals and tickets in your CRM.", cat: "Sales", registered: true },
68
+ { name: "Hunter", url: "https://mcp.hunter.io/mcp", desc: "Find and verify emails, discover companies, and save leads.", cat: "Sales", png: "/icons/services/hunter.png", src: "cursor" },
69
+ { name: "Juicebox", url: "https://mcp.juicebox.ai/v1", desc: "Query recruiting analytics, shortlists, and sourcing agents.", cat: "Sales", png: "/icons/services/juicebox.png", src: "cursor" },
70
+ { name: "Outreach", url: "https://api.outreach.io/mcp", desc: "Search sequences, prospects, and Kaia meetings.", cat: "Sales", png: "/icons/services/outreach.png", src: "cursor" },
71
+ { name: "beehiiv", url: "https://mcp.beehiiv.com/mcp", desc: "Your newsletter: posts, subscribers, segments and performance.", cat: "Marketing", png: "/icons/services/beehiiv.png", src: "cursor" },
72
+ { name: "Customer.io", url: "https://mcp.customer.io/mcp", desc: "Build campaigns, manage segments, and query people.", cat: "Marketing", png: "/icons/services/customer-io.png", src: "cursor" },
73
+ { name: "Klaviyo", url: "https://mcp.klaviyo.com/mcp", desc: "Manage profiles, segments, campaigns, and flows.", cat: "Marketing", png: "/icons/services/klaviyo.png", src: "cursor" },
74
+ { name: "MailerLite", url: "https://mcp.mailerlite.com/mcp", desc: "Manage subscribers, groups, campaigns, and automations.", cat: "Marketing", png: "/icons/services/mailerlite.png", src: "cursor" },
75
+ { name: "Meltwater", url: "https://api.meltwater.com/v2/mcp", desc: "Search media and social mentions and pull analytics.", cat: "Marketing", png: "/icons/services/meltwater.png", src: "cursor" },
76
+ { name: "Profound", url: "https://mcp.tryprofound.com/mcp", desc: "Track AI visibility, sentiment, and citations.", cat: "Marketing", png: "/icons/services/profound.png", src: "cursor" },
77
+ { name: "Plain", url: "https://mcp.plain.com/mcp", desc: "Support threads, customers and help articles.", cat: "Customer support", png: "/icons/services/plain.png" },
78
+ { name: "Amplitude", url: "https://mcp.amplitude.com/mcp", desc: "Product analytics and charts.", cat: "Data analytics", png: "/icons/services/amplitude.png" },
79
+ { name: "PostHog", url: "https://mcp.posthog.com/mcp", desc: "Product analytics and SQL, feature flags, experiments, errors and replays.", cat: "Data analytics", png: "/icons/services/posthog-mcp.png", src: "cursor" },
80
+ { name: "Similarweb", url: "https://mcp.similarweb.com", desc: "Analyze website traffic, audiences, and competitors.", cat: "Data analytics", png: "/icons/services/similarweb.png", src: "cursor" },
81
+ { name: "Ashby", url: "https://mcp.ashbyhq.com/mcp/v1", desc: "Search candidates, prep interviews, and manage pipeline tasks.", cat: "Hiring", png: "/icons/services/ashby.png", src: "cursor" },
82
+ { name: "Greenhouse", url: "https://mcp.us.greenhouse.io/mcp", desc: "Search candidates, jobs, and applications, and review scorecards in Greenhouse Recruiting.", cat: "Hiring", png: "/icons/services/greenhouse.png", src: "cursor" },
83
+ { name: "Workable", url: "https://mcp.workable.com/mcp", desc: "Search candidates, move pipelines, and manage HR records.", cat: "Hiring", png: "/icons/services/workable.png", src: "cursor" },
84
+ { name: "Brex", url: "https://api.brex.com/mcp", desc: "Query expenses, receipts, bills, cards, and travel.", cat: "Finance", png: "/icons/services/brex.png", src: "cursor" },
85
+ { name: "Daloopa", url: "https://mcp.daloopa.com/server/mcp", desc: "Pull source-linked fundamentals, KPIs, filings, and prices.", cat: "Finance", png: "/icons/services/daloopa.png", src: "cursor" },
86
+ { name: "Interactive Brokers", url: "https://api.ibkr.com/v1/api/mcp-public", desc: "Review positions, balances, P&L, and draft trade instructions.", cat: "Finance", png: "/icons/services/interactive-brokers.png", src: "cursor" },
87
+ { name: "PayPal", url: "https://mcp.paypal.com/mcp", desc: "Orders, invoices and payments.", cat: "Finance" },
88
+ { name: "Robinhood", url: "https://agent.robinhood.com/mcp/trading", desc: "View portfolios, positions, orders, watchlists, and market data, and trade in a Robinhood Agentic account.", cat: "Finance", png: "/icons/services/robinhood.png", src: "cursor" },
89
+ { name: "S&P Global", url: "https://kfinance.kensho.com/integrations/mcp", desc: "Query S&P Capital IQ financials, prices, and transcripts.", cat: "Finance", png: "/icons/services/sp-global.png", src: "cursor" },
90
+ { name: "Stripe", url: "https://mcp.stripe.com/", desc: "Payments, customers and invoices.", cat: "Finance" },
91
+ { name: "Webull", url: "https://api.webull.com/mcp", desc: "View accounts, positions, orders, watchlists, and market data.", cat: "Finance", png: "/icons/services/webull.png", src: "cursor" },
92
+ { name: "Ahrefs", url: "https://api.ahrefs.com/mcp/mcp", desc: "Research keywords, backlinks, rankings, and site health.", cat: "Research", png: "/icons/services/ahrefs.png", src: "cursor" },
93
+ { name: "Cloudflare Docs", url: "https://docs.mcp.cloudflare.com/mcp", desc: "Cloudflare’s developer documentation.", cat: "Research" },
94
+ { name: "Exa", url: "https://mcp.exa.ai/mcp", desc: "Web search and page contents.", cat: "Research", png: "/icons/services/exa.png" },
95
+ { name: "TinyFish", url: "https://agent.tinyfish.ai/mcp", desc: "Web automations, search and clean page content in remote browsers.", cat: "Research", png: "/icons/services/tinyfish.png", src: "cursor" },
96
+ // FROM GROK BOT'S PLUGIN MARKETPLACE (github.com/xai-org/plugin-marketplace, read 2026-11-16; the owner: "look at grokbot opensource
97
+ // connections - update our connections and add missing ones"): each address passed tools/conn-catalog/probe.mjs's sign-in steps
98
+ // that day (GoDaddy answers without one — domain suggestions and availability only). Descriptions are ours; no logos copied.
99
+ // Left out: the 13 that register no outside app (HubSpot, Zoom, Google's, X, DocuSign, Shopify…), the 22 that refuse Witbitz's
100
+ // registration (Figma, Vercel, Netlify, Railway, Intercom, Square…), Stable (its tools need the person's own API key), TikTok Ads
101
+ // (no sign-in method), and every address behind Cursor's or Grok's own gateway. Navan was removed: it now refuses registration.
102
+ { name: "Axiom", url: "https://mcp.axiom.co/mcp", desc: "Logs and metrics: queries, dashboards and monitors.", cat: "Engineering", png: "/icons/services/axiom.png" },
103
+ { name: "Clerk", url: "https://mcp.clerk.com/mcp", desc: "Your app's users, organizations and sign-in.", cat: "Engineering" },
104
+ { name: "Cloudflare", url: "https://mcp.cloudflare.com/mcp", desc: "Workers, DNS and your Cloudflare account.", cat: "Engineering" },
105
+ { name: "Expo", url: "https://mcp.expo.dev/mcp", desc: "Build, test and ship iOS and Android apps.", cat: "Engineering" },
106
+ { name: "GoDaddy", url: "https://api.godaddy.com/v1/domains/mcp", desc: "Domain name ideas and whether a name is free.", cat: "Engineering" },
107
+ { name: "Pi Security", url: "https://mcp.pi.security/mcp", desc: "Security findings, posture and how to fix them.", cat: "Engineering", png: "/icons/services/pi-security.png" },
108
+ { name: "RingCentral Team Messaging", url: "https://mcp.labs.ringcentral.com/ringex/v1.1.0/team-chat", desc: "Team chats and messages in RingCentral.", cat: "Productivity", png: "/icons/services/ringcentral-team-messaging.png" },
109
+ { name: "Framer", url: "https://mcp.framer.com/mcp", desc: "Pages and content of a Framer website.", cat: "Design" },
110
+ { name: "HTML/CSS to Image", url: "https://mcp.hcti.io", desc: "Turn HTML or a web page into an image or a PDF.", cat: "Design", png: "/icons/services/html-css-to-image.png" },
111
+ { name: "VideoGen", url: "https://mcp.videogen.io/mcp", desc: "Make a video from text, images or a script.", cat: "Design", png: "/icons/services/videogen.png" },
112
+ { name: "Cal.com", url: "https://mcp.cal.com/mcp", desc: "Availability, bookings and event types.", cat: "Scheduling" },
113
+ // GOOGLE CALENDAR (2026-11-23, docs/google-calendar-verification.md): Google's own Calendar MCP server takes no self-registered
114
+ // app — Witbitz files its own client (project witbitz-spaces-calendar, scope calendar.events alone) with the Sentinel, and the
115
+ // sign-in comes back through the broker's callback (connections.js mcpRedirectFor). Until Google verifies the client, only its
116
+ // test users can sign in.
117
+ // ⛔ OUT OF THE CATALOG until Google makes the Calendar MCP server generally available (2026-11-23): it answers only projects in
118
+ // the Workspace Developer Preview Program, which takes only Workspace-domain accounts, and its terms keep preview features out of
119
+ // public apps. Everything else is in place (the filed client, st51, the broker's callback) — put this line back then:
120
+ // { name: "Google Calendar", url: "https://calendarmcp.googleapis.com/mcp/v1", desc: "Read your events and, when you approve, add or change them.", cat: "Scheduling", registered: true },
121
+ // GOOGLE CALENDAR ON GOOGLE'S REGULAR CALENDAR API (2026-11-23; owner: "it did not sync automatically" → this): kind 'oauth' = the
122
+ // Sentinel's own Google sign-in (custody.mjs oauthStart: offline access, a refresh token it renews itself) with Witbitz's app filed
123
+ // under `tenant` as `provider`; the connection reaches `host`. Reads run without asking, a change is a card (connSpaces readsAutoFor).
124
+ { name: "Google Calendar", kind: "oauth", tenant: "t_815e94f68944437592310c0b80861cd9", provider: GCAL_PROVIDER, host: "www.googleapis.com", reads: "auto", desc: "Read your events and, when you approve, add or change them.", cat: "Scheduling" },
125
+ { name: "Helena", url: "https://agent.enrichlabs.ai/api/mcp", desc: "An AI marketer for SEO, ads, social and email campaigns.", cat: "Marketing", png: "/icons/services/helena.png" },
126
+ { name: "Omneky", url: "https://mcp.omneky.com/mcp", desc: "Ad campaigns, their results and new creatives.", cat: "Marketing", png: "/icons/services/omneky.png" },
127
+ { name: "Quo", url: "https://mcp.quo.com/mcp", desc: "Business texts, calls and contacts.", cat: "Customer support", png: "/icons/services/quo.png" },
128
+ { name: "RingCentral Phone", url: "https://mcp.labs.ringcentral.com/ringex/phone", desc: "Calls, voicemail and texts in RingCentral.", cat: "Customer support", png: "/icons/services/ringcentral-phone.png" },
129
+ { name: "Finary", url: "https://public-api.finary.com/mcp", desc: "Your investments, accounts and net worth.", cat: "Finance", png: "/icons/services/finary.png" },
130
+ { name: "Gusto", url: "https://mcp.api.gusto.com/", desc: "Payroll, employees and benefits.", cat: "Finance" },
131
+ { name: "Firecrawl", url: "https://mcp.firecrawl.dev/v2/mcp-oauth", desc: "Scrape, crawl and search websites as clean text.", cat: "Research", png: "/icons/services/firecrawl.png" },
132
+ { name: "Octen", url: "https://mcp.octen.ai/mcp", desc: "Web and news search, and page extraction.", cat: "Research", png: "/icons/services/octen.png" },
133
+ { name: "Tavily", url: "https://mcp.tavily.com/mcp", desc: "Web search, page extraction and research.", cat: "Research", png: "/icons/services/tavily.png" },
134
+ // SINCE STANDING SENTINEL st33 (2026-11-16): Netlify (its client id is a 447-character token — the Sentinel took 400 at most) and
135
+ // the services that refuse a web app's self-registration but take the app as its OWN client (client ID metadata documents —
136
+ // /mcp-client.json). Vercel signed in end to end on the owner's phone; Railway, Typeform and Upwork showed their consent page.
137
+ { name: "Netlify", url: "https://mcp.netlify.com/mcp", desc: "Sites, deploys and build logs.", cat: "Engineering" },
138
+ { name: "Railway", url: "https://mcp.railway.com", desc: "Services, deployments and logs.", cat: "Engineering" },
139
+ { name: "Vercel", url: "https://mcp.vercel.com", desc: "Deployments, build logs and domains.", cat: "Engineering" },
140
+ { name: "Typeform", url: "https://api.typeform.com/mcp", desc: "Forms and their responses.", cat: "Productivity" },
141
+ { name: "Upwork", url: "https://mcp.upwork.com/mcp", desc: "Jobs, proposals and contracts.", cat: "Hiring" },
142
+ // FROM THE MONTHLY CHECK (2026-11-16, owner: "yes"): eight that newly pass the sign-in steps, from Cursor's plugins and Grok Bot's
143
+ // marketplace; their marks found by the same check (tools/conn-catalog/icons.mjs). Descriptions are ours.
144
+ { name: "Mixpanel", url: "https://mcp.mixpanel.com/mcp", desc: "Events, funnels, retention and dashboards.", cat: "Data analytics" },
145
+ { name: "Metricool", url: "https://ai.metricool.com/mcp", desc: "Plan and publish social posts, and their results.", cat: "Marketing", png: "/icons/services/metricool.png" },
146
+ { name: "Squarespace", url: "https://mcp.squarespace.com/mcp", desc: "Business name ideas and domains: availability and price.", cat: "Design" },
147
+ { name: "Runta", url: "https://mcp.runta.com/mcp", desc: "Run lasting agent runtimes: ports, checkpoints and images.", cat: "Engineering", png: "/icons/services/runta.png" },
148
+ { name: "OnePay", url: "https://mcp.onepay.com", desc: "Balances and spending across your OnePay accounts.", cat: "Finance", png: "/icons/services/onepay.png" },
149
+ { name: "Questrade", url: "https://mcp.questrade.com/v1/brokerage/mcp", desc: "Your portfolio and live market data.", cat: "Finance", png: "/icons/services/questrade.png" },
150
+ { name: "Engine", url: "https://mcp.engine.com/mcp", desc: "Find and book hotels, change or cancel stays.", cat: "Travel", png: "/icons/services/engine.png" },
151
+ { name: "Eight Sleep", url: "https://public-api.8slp.net/mcp", desc: "Your sleep scores and your Pod's temperature.", cat: "Health" },
152
+ { name: "AgentMail", url: "https://mcp.agentmail.to/mcp", desc: "Email inboxes for your assistant.", cat: "Email", png: "/icons/services/agentmail.png" },
153
+ // GMAIL BY FORWARDING (the owner, 2026-11-21: Nylas's verified Google app — the only way to read Gmail without Google's yearly
154
+ // assessment — was "too expensive" → "lets do this forward connector to gmail"). Not a sign-in: Gmail forwards what the person
155
+ // chooses to the Space's own address (Witbitz Mail, mailShare.js — received and sealed in the Sentinel). kind 'mail': no MCP address;
156
+ // connectionsSheet.js opens the Space's Mail card with Gmail's steps. (Reading through Nylas is built and kept: nylas.mjs.)
157
+ { name: "Gmail", kind: "mail", host: "mail.google.com", desc: "Forward the mail you choose into a Space of your own — the assistant reads it when you ask.", cat: "Email" },
158
+ ]
159
+ export const CATEGORY_ORDER = ["Agents", "Engineering", "Productivity", "Documents", "Design", "Meetings", "Scheduling", "Sales", "Marketing", "Customer support", "Data analytics", "Hiring", "Finance", "Travel", "Health", "Research", "Email"]
160
+
161
+ // A connection made through Witbitz's own sign-in to a service's API (kind 'oauth', the Sentinel's provider) whose entry says its reads
162
+ // run without asking (Google Calendar): a room keeps `reads: 'auto'` on it (connSpaces entryFor; agent/connectionTools.mjs readsRunAlone).
163
+ export const readsAutoFor = (c) => !!c && c.provider === 'oauth2' && CATALOG.some((x) => x.kind === 'oauth' && x.host === c.host && x.reads === 'auto')
164
+
package/connDisp.js ADDED
@@ -0,0 +1,76 @@
1
+ // connDisp.js — A CONNECTION'S LABEL, SEALED TO THE PERSON'S OWN DEVICES (Sentinel step 2; docs/standing-sentinel.md § Step 2;
2
+ // the owner, 2026-11-07: "Yes"). The standing Sentinel keeps what it must act on (the secret, the host, the limits) and, until
3
+ // now, also what it only SHOWS back: the name the person gave a connection. Now every grant also carries `disp` — that name
4
+ // sealed under a key only the account's devices derive, which the Sentinel stores and hands back on credlist but cannot open.
5
+ // Once every record carries one, the Sentinel stops keeping the readable label (its own later image).
6
+ //
7
+ // THE KEY: AES-256-GCM from the account's backup master — HKDF(master, salt "witbitz-sentinel-display-v1", info
8
+ // "sentinel-display"), the same on every device of the account, as the erase key is (sdkErase.js eraseKeyOf). SYMMETRIC on
9
+ // purpose: only the person's devices seal and open these. (The design's P-256 "display box" is for step 2's other part — the
10
+ // Sentinel sealing delivered A2A history TO the person — and gets its own key when that is built; a browser cannot derive a
11
+ // P-256 pair deterministically from a secret.)
12
+ //
13
+ // THE FORMAT: "d1." + b64url(iv) + "." + b64url(ciphertext), AAD = "witbitz-disp v1\n" + the connection's id — a sealed name
14
+ // opens only on the record it was made for (the Sentinel cannot move one onto another connection). Inside: { v: 1, label }.
15
+ // Pure: no storage, no DOM — the app, the hosted vault and the SDK all use it.
16
+
17
+ const enc = new TextEncoder(), dec = new TextDecoder()
18
+ const SALT = enc.encode('witbitz-sentinel-display-v1'), INFO = enc.encode('sentinel-display')
19
+ const PREFIX = 'd1.'
20
+ export const DISP_MAX = 8192 // the Sentinel's limit (custody.mjs)
21
+
22
+ const b64u = (u8) => { let s = ''; for (const b of u8) s += String.fromCharCode(b); return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') }
23
+ const ub64 = (s) => { const t = String(s).replace(/-/g, '+').replace(/_/g, '/'); const p = t + '='.repeat((4 - (t.length % 4)) % 4); const bin = atob(p); const u = new Uint8Array(bin.length); for (let i = 0; i < bin.length; i++) u[i] = bin.charCodeAt(i); return u }
24
+ const bytesOf = (m) => (m instanceof Uint8Array ? m : (typeof m === 'string' && m ? ub64(m) : null))
25
+ const aadOf = (id) => enc.encode('witbitz-disp v1\n' + String(id || ''))
26
+
27
+ /** The 32 raw bytes of the display key, from the backup master (Uint8Array, or base64 / base64url text). null without one. */
28
+ export async function dispRawOf (master) {
29
+ const m = bytesOf(master)
30
+ if (!m || m.length < 16) return null
31
+ const km = await crypto.subtle.importKey('raw', m, 'HKDF', false, ['deriveBits'])
32
+ return new Uint8Array(await crypto.subtle.deriveBits({ name: 'HKDF', hash: 'SHA-256', salt: SALT, info: INFO }, km, 256))
33
+ }
34
+
35
+ /** A non-extractable AES-GCM key from the raw bytes (what the hosted vault hands its frame). null for anything else. */
36
+ export async function dispKeyFromRaw (raw) {
37
+ const r = bytesOf(raw)
38
+ if (!r || r.length !== 32) return null
39
+ return crypto.subtle.importKey('raw', r, 'AES-GCM', false, ['encrypt', 'decrypt'])
40
+ }
41
+
42
+ /** The display key straight from the master. */
43
+ export async function dispKeyOf (master) { const raw = await dispRawOf(master); return raw ? dispKeyFromRaw(raw) : null }
44
+
45
+ /** Seal { label } for connection `id` → the `disp` string ('' when it cannot be made or would not fit). */
46
+ export async function sealDisp (key, id, { label = '' } = {}) {
47
+ if (!key || !id) return ''
48
+ const iv = crypto.getRandomValues(new Uint8Array(12))
49
+ const ct = new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv, additionalData: aadOf(id) }, key, enc.encode(JSON.stringify({ v: 1, label: String(label || '').slice(0, 200) }))))
50
+ const out = PREFIX + b64u(iv) + '.' + b64u(ct)
51
+ return out.length <= DISP_MAX ? out : ''
52
+ }
53
+
54
+ /** Open a `disp` made for connection `id` → { label } or null (another account's key, another connection, tampered, unknown form). */
55
+ export async function openDisp (key, id, disp) {
56
+ if (!key || !id || typeof disp !== 'string' || !disp.startsWith(PREFIX)) return null
57
+ const parts = disp.slice(PREFIX.length).split('.')
58
+ if (parts.length !== 2) return null
59
+ try {
60
+ const pt = await crypto.subtle.decrypt({ name: 'AES-GCM', iv: ub64(parts[0]), additionalData: aadOf(id) }, key, ub64(parts[1]))
61
+ const o = JSON.parse(dec.decode(pt))
62
+ return o && o.v === 1 && typeof o.label === 'string' ? { label: o.label } : null
63
+ } catch { return null }
64
+ }
65
+
66
+ /** A credlist answer with each sealed name opened: `label` = the person's own name when its `disp` opens, else what the
67
+ * Sentinel holds (a record made before step 2, or by a sign-in the Sentinel finished). `disp` is left out of the result. */
68
+ export async function withDisplay (list, key) {
69
+ if (!Array.isArray(list)) return []
70
+ return Promise.all(list.map(async (c) => {
71
+ if (!c || typeof c !== 'object') return c
72
+ const { disp, ...rest } = c
73
+ const o = key && disp ? await openDisp(key, c.id, disp) : null
74
+ return o && o.label ? { ...rest, label: o.label, labelSealed: true } : rest
75
+ }))
76
+ }
@@ -0,0 +1,74 @@
1
+ import { parseMcpUrl } from './connections.js'
2
+
3
+ // connOtherWays.js — the Connections card's "other ways to connect" (an MCP server by its address, a service's own API key): WHERE they
4
+ // show and what a typed address means. Pure — the card (connectionsSheet.js renderConnList) draws what these decide.
5
+ // The owner, 2026-11-26: "placed in almost unreachable place" — the section was the last, under the whole catalog, and a search that did
6
+ // not match its own name hid it (a server not in the catalog — Zoom before its approval — had no way in).
7
+
8
+ /** An MCP server's address typed or pasted in the search box → its https URL, else ''. A bare host (mcp.zoom.us/…) gets https://;
9
+ * anything but https on a dotted host is not an address here (the MCP form refuses it anyway). */
10
+ export function typedMcpUrl (raw) {
11
+ try {
12
+ const { host, path } = parseMcpUrl(raw)
13
+ return 'https://' + host + path
14
+ } catch { return '' }
15
+ }
16
+
17
+ /** Which of the other ways to show, and under what heading → { title, rows } (rows: a subset of `all`, in order).
18
+ * Not searching: all, as "Other ways to connect" (placed right after the person's own connections). Searching: the ones whose name
19
+ * or line matches; when NOTHING on the card matched, all of them, as "Not listed? Connect it another way" — never a dead end. */
20
+ export function otherWaysRows ({ all, matches, searching, anythingElse }) {
21
+ if (!searching) return { title: 'Other ways to connect', rows: all }
22
+ const hit = all.filter(matches)
23
+ if (hit.length) return { title: 'Other ways to connect', rows: hit }
24
+ return anythingElse ? { title: '', rows: [] } : { title: 'Not listed? Connect it another way', rows: all }
25
+ }
26
+
27
+ /** Read connection IDs only. An unreadable private assistant makes a negative result inconclusive. */
28
+ export async function readConnectionUse(room, assistants, read, { verifiedOnly = false } = {}) {
29
+ const ids = new Set(), locations = new Map()
30
+ let incomplete = false
31
+ for (const id of new Set([room, ...assistants])) {
32
+ let cfg
33
+ try { cfg = await read(id) } catch { cfg = null }
34
+ if (!cfg || typeof cfg !== 'object' || cfg.error || cfg.gated || (cfg.status && cfg.status !== 200)) {
35
+ incomplete = true
36
+ continue
37
+ }
38
+ if (id === room && verifiedOnly && cfg.admission !== 'email') return { ids, locations, incomplete, eligible: false }
39
+ for (const c of Array.isArray(cfg.connections) ? cfg.connections : []) if (typeof c?.id === 'string') {
40
+ ids.add(c.id)
41
+ if (!locations.has(c.id)) locations.set(c.id, [])
42
+ locations.get(c.id).push(id)
43
+ }
44
+ }
45
+ return { ids, locations, incomplete, eligible: true }
46
+ }
47
+
48
+ export async function spacesUsingConnection(id, rooms, read) {
49
+ if (typeof id !== 'string' || !id.trim()) throw Object.assign(new Error('a connection ID is required'), { code: 'invalid_argument' })
50
+ const uses = [], unreadable = []
51
+ const lanes = new Map()
52
+ for (const row of rooms) if (row.shared) {
53
+ if (!lanes.has(row.shared)) lanes.set(row.shared, [])
54
+ lanes.get(row.shared).push(row.room)
55
+ }
56
+ const rows = rooms.filter(r => r.room && !r.shared && r.kind !== 'lane' && !r.room.startsWith('tmp-'))
57
+ for (let i = 0; i < rows.length; i += 6) {
58
+ const batch = rows.slice(i, i + 6)
59
+ const results = await Promise.all(batch.map(r => readConnectionUse(r.room, lanes.get(r.room) || [], read, { verifiedOnly: true })))
60
+ results.forEach(({ ids, incomplete }, index) => {
61
+ const { room } = batch[index]
62
+ if (ids.has(id)) uses.push(room)
63
+ if (incomplete) unreadable.push(room)
64
+ })
65
+ }
66
+ return { rooms: uses, unreadable, incomplete: unreadable.length > 0 }
67
+ }
68
+
69
+ export function grantStatus(grant, account, known) {
70
+ if (known?.has(grant.id)) return 'connected'
71
+ if (!grant.account || !account) return 'unknown'
72
+ if (grant.account !== account) return 'other_member'
73
+ return known ? 'detached' : 'unknown'
74
+ }
package/connPending.js ADDED
@@ -0,0 +1,16 @@
1
+ // connPending.js — A CALL KEY WHOSE GRANT ANSWER WAS LOST (state machines pass 9, N#7), the rule both keepers use: the regular app's
2
+ // page (connections.js postWithPendingKey, connectionsSheet.js) and, in the hosted app, the VAULT, which mints and keeps the key
3
+ // itself (vaultConnKeys.js mint). A leaf: no DOM, no storage.
4
+
5
+ export const PENDING_MS = 86_400_000 // a day: older, the grant is taken as never filed
6
+
7
+ /** The pending keys the account's list now shows (and this keeper holds no key for) → adopt; older than a day → dropped. Pure. */
8
+ export function adoptPendingKeys (pending, listedIds, haveKeys, now = Date.now()) {
9
+ const listed = new Set(listedIds || []), adopt = [], left = {}
10
+ for (const [id, rec] of Object.entries(pending || {})) {
11
+ if (!rec || typeof rec.callKey !== 'string' || !(now - (Number(rec.at) || 0) < PENDING_MS)) continue
12
+ if (listed.has(id)) { if (!(haveKeys && haveKeys[id])) { const { at: _a, ...k } = rec; adopt.push([id, k]) } continue }
13
+ left[id] = rec
14
+ }
15
+ return { adopt, pending: left }
16
+ }
package/connWrap.js ADDED
@@ -0,0 +1,53 @@
1
+ // connWrap.js — MOVE 3 of the Sentinel's per-account keys (docs/standing-sentinel.md § The two open pieces; owner, 2026-11-18:
2
+ // "Do it"). A connection the Sentinel still holds in the OLD form keeps its callKey beside its secret, so the Sentinel's data key
3
+ // opens it with no caller present. It is locked under the callKey the first time a caller brings that key — and a connection no
4
+ // room ever spends never meets one. So a device that holds the key presents it: the same proof and the same sealed key a call
5
+ // makes (agent/sentinelRelay.mjs credCall), over the wrap's own request, and the Sentinel locks it without calling the service.
6
+ // The callKey lives where it lives: the regular app's page, the hosted app's VAULT (it answers `proofOf` itself — vaultConnKeys.js
7
+ // connWrapProof — so the key never enters the frame), the SDK's store. Pure: WebCrypto only.
8
+ import { sealTo } from './sealShare.js'
9
+
10
+ /** The request a wrap's proof is over (custody.mjs WRAP_REQUEST): never one a call could make. */
11
+ export const WRAP_REQUEST = '{"wrap":1}'
12
+ const enc = new TextEncoder()
13
+ const b64 = (u8) => btoa(String.fromCharCode(...new Uint8Array(u8)))
14
+ const unb64 = (s) => Uint8Array.from(atob(String(s)), (c) => c.charCodeAt(0))
15
+
16
+ /** The proof (HMAC(callKey, nonce ‖ "\n" ‖ sha256(request))) and the callKey sealed to the attested share key, for THIS wrap. */
17
+ export async function wrapProof({ callKey, nonce, key }) {
18
+ const reqHash = new Uint8Array(await crypto.subtle.digest('SHA-256', enc.encode(WRAP_REQUEST)))
19
+ const hk = await crypto.subtle.importKey('raw', unb64(callKey), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])
20
+ const msg = new Uint8Array([...enc.encode(String(nonce) + '\n'), ...reqHash])
21
+ const [mac, keySealed] = await Promise.all([ // one hop each on WebKit, run together (webkit-webcrypto-await-per-call)
22
+ crypto.subtle.sign('HMAC', hk, msg).then(b64),
23
+ sealTo(key, crypto.getRandomValues(new Uint8Array(16)), { v: 1, callKey, nonce, reqHash: b64(reqHash) }),
24
+ ])
25
+ return { mac, keySealed }
26
+ }
27
+
28
+ /**
29
+ * Lock every listed connection the Sentinel marks `locked: false` whose key can be reached here.
30
+ * @param {object} o
31
+ * @param {(body) => Promise<object>} o.post — the Space client's sentinel post ({ op:'sentinel', sentinel, ...auth })
32
+ * @param {Array<{ id, locked? }>} o.list — credlist's connections (an older Sentinel marks none: nothing is asked)
33
+ * @param {() => Promise<{ key: CryptoKey, spki?: Uint8Array }>} o.attest — the standing Sentinel, attested (connections.js)
34
+ * @param {(id, nonce, key, spki) => Promise<{ mac, keySealed } | null>} o.proofOf — null: this device does not hold its key
35
+ * → { locked, failed, skipped } — never throws for one connection.
36
+ */
37
+ export async function lockConnections({ post, auth = {}, list, attest, proofOf }) {
38
+ const out = { locked: 0, failed: 0, skipped: 0 }
39
+ const todo = (Array.isArray(list) ? list : []).filter((c) => c && typeof c.id === 'string' && c.locked === false)
40
+ if (!todo.length) return out
41
+ const att = await attest()
42
+ for (const c of todo) {
43
+ try {
44
+ const n = await post({ op: 'sentinel', sentinel: { mode: 'crednonce' }, ...auth })
45
+ if (!n || typeof n.nonce !== 'string') { out.failed++; continue }
46
+ const p = await proofOf(c.id, n.nonce, att.key, att.spki)
47
+ if (!p) { out.skipped++; continue }
48
+ const r = await post({ op: 'sentinel', sentinel: { mode: 'credwrap', connection: c.id, nonce: n.nonce, mac: p.mac, request: WRAP_REQUEST, keySealed: p.keySealed }, ...auth })
49
+ if (r && r.ok && r.locked) out.locked++; else out.failed++
50
+ } catch { out.failed++ }
51
+ }
52
+ return out
53
+ }
@@ -0,0 +1,89 @@
1
+ // connectionEntry.js — what a ROOM keeps about a connection (its sealed config), bounded: never a secret; for an MCP
2
+ // server, the tools the members chose and which of them run without asking (docs/mcp-connections.md § 5).
3
+ // Shared by spaceClient.setConfig (the write) and the Connections sheet (what it shows), so the two cannot disagree.
4
+
5
+ export const MCP_TOOLS_PER_SERVER = 40 // = agent/connectionTools.mjs MCP_TOOLS_PER_SERVER (the server drops the rest)
6
+ const TOOL_NAME = /^[A-Za-z0-9_.-]{1,64}$/
7
+ const isObj = (v) => v && typeof v === 'object' && !Array.isArray(v)
8
+
9
+ /** One tool as the room keeps it: name, title, description, input schema (≤ 8 KB), the server's read-only claim. */
10
+ export function roomTool(t) {
11
+ if (!isObj(t) || !TOOL_NAME.test(String(t.name || ''))) return null
12
+ const schema = isObj(t.inputSchema) && JSON.stringify(t.inputSchema).length <= 8192 ? t.inputSchema : { type: 'object', properties: {} }
13
+ return { name: String(t.name), title: String(t.title || '').slice(0, 120), description: String(t.description || '').slice(0, 1000), inputSchema: schema, readOnly: t.readOnly === true }
14
+ }
15
+
16
+ // AN AGENT THAT TAKES JOBS (jobAgents.js, docs/job-agents.md): where a job goes in the request and the fixed headers every
17
+ // call carries. Kept only on a webhook connection. The credential headers can never be named here — the Sentinel drops them
18
+ // anyway (custody.mjs CALLER_HEADER_DROP). ≡ agent/connectionTools.mjs jobOf (a test holds them equal).
19
+ const JOB_FIELD = /^[A-Za-z_][A-Za-z0-9_]{0,23}$/, JOB_HEADER = /^[a-z0-9][a-z0-9-]{0,39}$/
20
+ export const JOB_HEADER_DROP = new Set(['authorization', 'cookie', 'host', 'connection', 'content-length', 'transfer-encoding', 'x-api-key', 'webhook-id', 'webhook-timestamp', 'webhook-signature'])
21
+ export function roomJob(j) {
22
+ if (!isObj(j)) return null
23
+ const headers = {}
24
+ for (const [k, v] of Object.entries(isObj(j.headers) ? j.headers : {}).slice(0, 6)) {
25
+ const lk = String(k).toLowerCase()
26
+ if (JOB_HEADER.test(lk) && !JOB_HEADER_DROP.has(lk) && !lk.startsWith('x-witbitz-') && typeof v === 'string' && v.length <= 200 && !/[\r\n]/.test(v)) headers[lk] = v
27
+ }
28
+ return { field: JOB_FIELD.test(String(j.field || '')) ? String(j.field) : 'text', headers }
29
+ }
30
+
31
+ /** A connection entry → its bounded form, or null. `mcp` is kept only with at least one tool. */
32
+ export function roomConnection(x) {
33
+ if (!isObj(x) || !x.id || !x.account || !x.callKey) return null
34
+ const out = { account: String(x.account), id: String(x.id), callKey: String(x.callKey), label: String(x.label || '').slice(0, 80), host: String(x.host || '') }
35
+ if (typeof x.webhook === 'string' && /^\/[^\s?#]{1,199}$/.test(x.webhook)) out.webhook = x.webhook // a signed webhook's one path, so the assistant can name it (docs/signed-webhooks.md)
36
+ if (out.webhook && isObj(x.job)) out.job = roomJob(x.job) // an agent that takes jobs (jobAgents.js)
37
+ if (isObj(x.mcp) && Array.isArray(x.mcp.tools)) {
38
+ const tools = x.mcp.tools.map(roomTool).filter(Boolean).slice(0, MCP_TOOLS_PER_SERVER)
39
+ const names = new Set(tools.map((t) => t.name))
40
+ if (tools.length) {
41
+ out.mcp = {
42
+ tools,
43
+ auto: (Array.isArray(x.mcp.auto) ? x.mcp.auto.map(String) : []).filter((n) => names.has(n)),
44
+ ...(x.mcp.own === true ? { own: true } : {}),
45
+ ...(Number.isFinite(x.mcp.listedAt) ? { listedAt: x.mcp.listedAt } : {}),
46
+ // THE TOOL BOOK (agent/toolBook.mjs): the tools' descriptions and schemas, stored once in the room — the entry keeps names
47
+ ...(isObj(x.mcp.book) && /^i_[A-Za-z0-9_-]{8,64}$/.test(String(x.mcp.book.ref || '')) && /^[0-9a-f]{64}$/.test(String(x.mcp.book.sha256 || '')) ? { book: { ref: x.mcp.book.ref, sha256: x.mcp.book.sha256 } } : {}),
48
+ }
49
+ }
50
+ }
51
+ // reads run without asking (agent/connectionTools.mjs readsRunAlone): a GET through it runs in the turn; every other call is a card
52
+ if (x.reads === 'auto' && !out.mcp) out.reads = 'auto'
53
+ return out
54
+ }
55
+
56
+ /** The room's current list + a DECLARATIVE patch ({ add } | { remove } | { update: { id, mcp } } | a whole list). */
57
+ export function applyConnectionsPatch(cur, c) {
58
+ const list = Array.isArray(cur) ? cur : []
59
+ const v = c == null ? null
60
+ : Array.isArray(c) ? c
61
+ : c.add ? [...list.filter((x) => x && x.id !== c.add.id), c.add]
62
+ : c.remove ? list.filter((x) => x && x.id !== c.remove)
63
+ : c.update && c.update.id ? list.map((x) => (x && x.id === c.update.id ? { ...x, ...('mcp' in c.update ? { mcp: c.update.mcp } : {}), ...('reads' in c.update ? { reads: c.update.reads } : {}) } : x))
64
+ : list
65
+ return v == null ? undefined : v.map(roomConnection).filter(Boolean).slice(0, 32)
66
+ }
67
+
68
+ // The name the model calls an MCP tool by — `<label>__<tool>`. ≡ agent/connectionTools.mjs mcpToolName (a test holds them
69
+ // equal), so a card and the typing line can say which server and tool a proposed call is for.
70
+ const slug = (s, n) => String(s || '').toLowerCase().normalize('NFKD').replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '').slice(0, n)
71
+ export function mcpToolName(conn, tool) {
72
+ const left = slug(conn.label || conn.host || conn.id, 24) || 'server'
73
+ return `${left}__${slug(tool, 64 - left.length - 2) || 'tool'}`
74
+ }
75
+ /** A proposed action's type → { conn, tool } for the room's MCP connections, or null. */
76
+ export function mcpToolFor(connections, type) {
77
+ if (typeof type !== 'string' || !type.includes('__')) return null
78
+ for (const c of Array.isArray(connections) ? connections : []) {
79
+ if (!c || !c.mcp || !Array.isArray(c.mcp.tools)) continue
80
+ const t = c.mcp.tools.find((x) => x && mcpToolName(c, x.name) === type)
81
+ if (t) return { conn: c, tool: t }
82
+ }
83
+ return null
84
+ }
85
+ /** A call's arguments as short lines a person can read: "title: Fix the login bug". */
86
+ export function argLines(args, { max = 8, len = 160 } = {}) {
87
+ if (!args || typeof args !== 'object') return []
88
+ return Object.entries(args).slice(0, max).map(([k, v]) => { const s = typeof v === 'string' ? v : JSON.stringify(v); return `${k}: ${s.length > len ? s.slice(0, len) + '…' : s}` })
89
+ }