agentix-cli 0.116.0 → 0.118.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.
- package/README.md +5 -5
- package/dist/{App-7Z2PWARZ.js → App-XMSNIAU6.js} +2 -2
- package/dist/{ChatApp-GFAIRLGZ.js → ChatApp-BFYTIQF3.js} +2 -2
- package/dist/{agent-LXLZGVW3.js → agent-E6W5VBYH.js} +2 -2
- package/dist/{board-dashboard-CPCSSVZE.js → board-dashboard-D5FQZKO4.js} +215 -101
- package/dist/board-dashboard-D5FQZKO4.js.map +1 -0
- package/dist/chunk-23SQSUBI.js +3 -0
- package/dist/chunk-23SQSUBI.js.map +1 -0
- package/dist/{chunk-UUMNP47Q.js → chunk-2G227TF3.js} +2 -2
- package/dist/{chunk-JLCJVPRC.js → chunk-4PQREYBU.js} +2 -2
- package/dist/{chunk-4FU4BFCH.js → chunk-5NTWGUSJ.js} +3 -3
- package/dist/chunk-5NTWGUSJ.js.map +1 -0
- package/dist/{chunk-6LCP6SVR.js → chunk-5PR6DZYW.js} +3 -3
- package/dist/chunk-5PR6DZYW.js.map +1 -0
- package/dist/{chunk-HOY2GIKV.js → chunk-5UFIHT66.js} +2 -2
- package/dist/{chunk-AWQIUI7N.js → chunk-6PC4EZ4P.js} +2 -2
- package/dist/chunk-AD4QZZVN.js +8 -0
- package/dist/{failure-candidates-PBPF45GN.js.map → chunk-AD4QZZVN.js.map} +1 -1
- package/dist/chunk-B6OXEIOF.js +126 -0
- package/dist/chunk-B6OXEIOF.js.map +1 -0
- package/dist/chunk-BDJWN3PL.js +4 -0
- package/dist/chunk-BDJWN3PL.js.map +1 -0
- package/dist/{chunk-7IF3LXAU.js → chunk-FSXWNVGL.js} +2 -2
- package/dist/{chunk-YMNQYODO.js → chunk-FTZCNID3.js} +2 -2
- package/dist/{chunk-S56ZGAFM.js → chunk-GJKYOEDE.js} +2 -2
- package/dist/{chunk-KI4CIUVJ.js → chunk-HK7TU5NX.js} +2 -2
- package/dist/chunk-IMLLHT7U.js +54 -0
- package/dist/chunk-IMLLHT7U.js.map +1 -0
- package/dist/chunk-IOYRRGK7.js +2 -0
- package/dist/chunk-IOYRRGK7.js.map +1 -0
- package/dist/{chunk-R277UDDQ.js → chunk-IVCFXLAR.js} +2 -2
- package/dist/{chunk-WRICEAR6.js → chunk-NDPU6AX2.js} +2 -2
- package/dist/{chunk-ELWKTURG.js → chunk-NG677JHW.js} +8 -8
- package/dist/chunk-NG677JHW.js.map +1 -0
- package/dist/{chunk-CCL73Z2P.js → chunk-PVQPXZHE.js} +58 -58
- package/dist/{chunk-CCL73Z2P.js.map → chunk-PVQPXZHE.js.map} +1 -1
- package/dist/{chunk-B65YTB3T.js → chunk-RJBRYUKU.js} +2 -2
- package/dist/{chunk-QLWGLRT5.js → chunk-TJ7IUHC7.js} +2 -2
- package/dist/{chunk-HSYNOMM2.js → chunk-U46G24CD.js} +2 -2
- package/dist/{chunk-CKYSGX54.js → chunk-V4PVGEWI.js} +196 -197
- package/dist/chunk-V4PVGEWI.js.map +1 -0
- package/dist/chunk-WCXXXAHV.js +3 -0
- package/dist/{chunk-DMHQIACQ.js.map → chunk-WCXXXAHV.js.map} +1 -1
- package/dist/chunk-XGOBZCYC.js +2 -0
- package/dist/chunk-XGOBZCYC.js.map +1 -0
- package/dist/{chunk-IEZ6OYFJ.js → chunk-ZDWE47LM.js} +8 -8
- package/dist/chunk-ZDWE47LM.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/{client-CU5GNTKR.js → client-TSYZXEH7.js} +2 -2
- package/dist/{config-ITVBNUWW.js → config-QAE3LNFQ.js} +2 -2
- package/dist/config-mutator-WRQ7MFQL.js +2 -0
- package/dist/{doctor-MLD3XCYE.js → doctor-PVLVKLRA.js} +2 -2
- package/dist/failure-candidates-JNGUVBDG.js +2 -0
- package/dist/{grants-BRAVOGBP.js → grants-V2ZNLWSJ.js} +2 -2
- package/dist/index.d.ts +107 -3
- package/dist/index.js +1 -1
- package/dist/program-ZYG3YPH2.js +721 -0
- package/dist/program-ZYG3YPH2.js.map +1 -0
- package/dist/{promote-JMJPWZI7.js → promote-IRBBEXGG.js} +2 -2
- package/dist/push-bridge-325SXDGN.js +2 -0
- package/dist/{query-QGPVKGYY.js → query-NAU7J34H.js} +2 -2
- package/dist/{registry-PZNC5XYT.js → registry-I5PXGCO6.js} +2 -2
- package/dist/{request-planner-M4IKDZBU.js → request-planner-CRG3OGGG.js} +2 -2
- package/dist/{review-candidates-6DNRBJZ6.js → review-candidates-HAP7P6SH.js} +2 -2
- package/dist/{routing-7NSB6O2S.js → routing-G33LLOTF.js} +2 -2
- package/dist/schedule-tool-IP7ZCQKI.js +2 -0
- package/dist/scheduler-QXLPYSNJ.js +2 -0
- package/dist/{seat-ZRCUQCUP.js → seat-IJN7NETF.js} +2 -2
- package/dist/{select-OLNLTEBR.js → select-D7AZ2XZF.js} +2 -2
- package/dist/{set-enabled-LG3ESZDC.js → set-enabled-5YSDIQXU.js} +2 -2
- package/dist/{surface-usage-HCJTUS6Z.js → surface-usage-WSY4SHHL.js} +2 -2
- package/dist/{tool-RBXRPIBV.js → tool-GQIQWHWB.js} +2 -2
- package/dist/{tool-S6U42ULD.js → tool-XADSW6NL.js} +2 -2
- package/dist/wiki-PPX3HYXW.js +2 -0
- package/dist/wiki-PPX3HYXW.js.map +1 -0
- package/package.json +1 -1
- package/dist/board-dashboard-CPCSSVZE.js.map +0 -1
- package/dist/chunk-4FU4BFCH.js.map +0 -1
- package/dist/chunk-6LCP6SVR.js.map +0 -1
- package/dist/chunk-BRL3UPFW.js +0 -2
- package/dist/chunk-BRL3UPFW.js.map +0 -1
- package/dist/chunk-CKYSGX54.js.map +0 -1
- package/dist/chunk-DMHQIACQ.js +0 -3
- package/dist/chunk-EKOVLUKH.js +0 -2
- package/dist/chunk-EKOVLUKH.js.map +0 -1
- package/dist/chunk-ELWKTURG.js.map +0 -1
- package/dist/chunk-FBEMUCBO.js +0 -54
- package/dist/chunk-FBEMUCBO.js.map +0 -1
- package/dist/chunk-IEZ6OYFJ.js.map +0 -1
- package/dist/chunk-J3SIOMDL.js +0 -126
- package/dist/chunk-J3SIOMDL.js.map +0 -1
- package/dist/chunk-JIT5GPTX.js +0 -4
- package/dist/chunk-JIT5GPTX.js.map +0 -1
- package/dist/chunk-Y3CZE54A.js +0 -2
- package/dist/chunk-Y3CZE54A.js.map +0 -1
- package/dist/config-mutator-5YRHHA2I.js +0 -2
- package/dist/failure-candidates-PBPF45GN.js +0 -8
- package/dist/program-IBOVOVZI.js +0 -703
- package/dist/program-IBOVOVZI.js.map +0 -1
- package/dist/push-bridge-IFUQLIMF.js +0 -2
- package/dist/schedule-tool-ZP7H55EL.js +0 -2
- package/dist/scheduler-XV5UQQYH.js +0 -2
- package/dist/wiki-XKQN5CWR.js +0 -2
- /package/dist/{App-7Z2PWARZ.js.map → App-XMSNIAU6.js.map} +0 -0
- /package/dist/{ChatApp-GFAIRLGZ.js.map → ChatApp-BFYTIQF3.js.map} +0 -0
- /package/dist/{agent-LXLZGVW3.js.map → agent-E6W5VBYH.js.map} +0 -0
- /package/dist/{chunk-UUMNP47Q.js.map → chunk-2G227TF3.js.map} +0 -0
- /package/dist/{chunk-JLCJVPRC.js.map → chunk-4PQREYBU.js.map} +0 -0
- /package/dist/{chunk-HOY2GIKV.js.map → chunk-5UFIHT66.js.map} +0 -0
- /package/dist/{chunk-AWQIUI7N.js.map → chunk-6PC4EZ4P.js.map} +0 -0
- /package/dist/{chunk-7IF3LXAU.js.map → chunk-FSXWNVGL.js.map} +0 -0
- /package/dist/{chunk-YMNQYODO.js.map → chunk-FTZCNID3.js.map} +0 -0
- /package/dist/{chunk-S56ZGAFM.js.map → chunk-GJKYOEDE.js.map} +0 -0
- /package/dist/{chunk-KI4CIUVJ.js.map → chunk-HK7TU5NX.js.map} +0 -0
- /package/dist/{chunk-R277UDDQ.js.map → chunk-IVCFXLAR.js.map} +0 -0
- /package/dist/{chunk-WRICEAR6.js.map → chunk-NDPU6AX2.js.map} +0 -0
- /package/dist/{chunk-B65YTB3T.js.map → chunk-RJBRYUKU.js.map} +0 -0
- /package/dist/{chunk-QLWGLRT5.js.map → chunk-TJ7IUHC7.js.map} +0 -0
- /package/dist/{chunk-HSYNOMM2.js.map → chunk-U46G24CD.js.map} +0 -0
- /package/dist/{client-CU5GNTKR.js.map → client-TSYZXEH7.js.map} +0 -0
- /package/dist/{config-ITVBNUWW.js.map → config-QAE3LNFQ.js.map} +0 -0
- /package/dist/{config-mutator-5YRHHA2I.js.map → config-mutator-WRQ7MFQL.js.map} +0 -0
- /package/dist/{doctor-MLD3XCYE.js.map → doctor-PVLVKLRA.js.map} +0 -0
- /package/dist/{grants-BRAVOGBP.js.map → failure-candidates-JNGUVBDG.js.map} +0 -0
- /package/dist/{promote-JMJPWZI7.js.map → grants-V2ZNLWSJ.js.map} +0 -0
- /package/dist/{push-bridge-IFUQLIMF.js.map → promote-IRBBEXGG.js.map} +0 -0
- /package/dist/{query-QGPVKGYY.js.map → push-bridge-325SXDGN.js.map} +0 -0
- /package/dist/{registry-PZNC5XYT.js.map → query-NAU7J34H.js.map} +0 -0
- /package/dist/{routing-7NSB6O2S.js.map → registry-I5PXGCO6.js.map} +0 -0
- /package/dist/{request-planner-M4IKDZBU.js.map → request-planner-CRG3OGGG.js.map} +0 -0
- /package/dist/{review-candidates-6DNRBJZ6.js.map → review-candidates-HAP7P6SH.js.map} +0 -0
- /package/dist/{schedule-tool-ZP7H55EL.js.map → routing-G33LLOTF.js.map} +0 -0
- /package/dist/{scheduler-XV5UQQYH.js.map → schedule-tool-IP7ZCQKI.js.map} +0 -0
- /package/dist/{seat-ZRCUQCUP.js.map → scheduler-QXLPYSNJ.js.map} +0 -0
- /package/dist/{surface-usage-HCJTUS6Z.js.map → seat-IJN7NETF.js.map} +0 -0
- /package/dist/{select-OLNLTEBR.js.map → select-D7AZ2XZF.js.map} +0 -0
- /package/dist/{set-enabled-LG3ESZDC.js.map → set-enabled-5YSDIQXU.js.map} +0 -0
- /package/dist/{wiki-XKQN5CWR.js.map → surface-usage-WSY4SHHL.js.map} +0 -0
- /package/dist/{tool-RBXRPIBV.js.map → tool-GQIQWHWB.js.map} +0 -0
- /package/dist/{tool-S6U42ULD.js.map → tool-XADSW6NL.js.map} +0 -0
package/dist/chunk-BRL3UPFW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as g,g as d}from"./chunk-DMHQIACQ.js";import{a as m}from"./chunk-GRMCAO3Q.js";var A=/^[A-Za-z0-9._-]{1,64}$/,y=/^[A-Za-z0-9_-]{1,64}$/,P=100,S=1e3,E=6e4,R=15*6e4;function u(s){return(s.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"node").slice(0,64)}function $(s,t,n){let a=/^bearer /i.test(s)?s.slice(7).trim():"",e="Phones paired with another computer need that computer's own peer token: give it a token in mesh.peers on both computers.";if(!a||n&&a===n)return{error:e};let p=new Set(t.filter(i=>i.token===a).map(i=>u(i.name)));if(p.size===0)return{error:e};if(p.size>1)return{error:`Several mesh.peers entries share this token (${[...p].join(", ")}). Give each computer its own token.`};let[r]=p,o=t.filter(i=>i.token!==a&&u(i.name)===r).map(i=>i.name);return o.length?{error:`mesh.peers names ${o.map(i=>`"${i}"`).join(", ")} too close to this computer's name: rename one so they differ in letters or digits.`}:{origin:r}}function C(s){return new Set(s.map(t=>u(t.name)))}function j(s,t,n,a){let e=s&&typeof s=="object"?s:{};if("error"in t)return{status:403,body:{error:t.error}};let p=t.origin;if(!A.test(p))return{status:403,body:{error:"this peer's name can't be used as a notification origin"}};if(!n)return{status:503,body:{error:a??"Notifications are not set up on the computer that sends them."}};if(e.op==="roster"){if(!Array.isArray(e.active)||e.active.length>S||!e.active.every(l=>typeof l=="string"&&y.test(l)))return{status:400,body:{error:"active must be a list of device ids"}};let h=n.store();return h?{status:200,body:{ok:!0,removed:h.pruneOrigin(p,e.active)}}:{status:503,body:{error:n.reason??"the database is unavailable"}}}if(e.op!=="app")return{status:400,body:{error:"op must be app or roster"}};let r=e.call&&typeof e.call=="object"?e.call:{},o=r.device&&typeof r.device=="object"?r.device:{},i=typeof r.path=="string"?r.path:"",c=r.method==="GET"||r.method==="POST"?r.method:"";if(!g(i)||!c)return{status:404,body:{error:"not found"}};if(typeof o.id!="string"||!y.test(o.id))return{status:400,body:{error:"device.id is required"}};let v=typeof o.name=="string"&&o.name.trim()?o.name.trim():o.id,b=r.body&&typeof r.body=="object"&&!Array.isArray(r.body)?r.body:{};return d({path:i,method:c,body:b,device:{id:m(p,o.id),name:k(`${v} (${p})`,P)}},n)}var f=class{constructor(t){this.deps=t}lastKey=null;lastSentAt=0;failing=!1;async tick(){let t=(this.deps.now??Date.now)(),n;try{n=[...new Set(this.deps.active())].sort()}catch(e){return this.deps.log?.(`push: phone list not read, not sent this time: ${e?.message??e}`),!1}let a=n.join(",");if(a===this.lastKey&&t-this.lastSentAt<R)return!1;try{return await this.deps.send(n),this.lastKey=a,this.lastSentAt=t,this.failing&&this.deps.log?.("push: phone list sent to the push host again"),this.failing=!1,!0}catch(e){return this.failing||this.deps.log?.(`push: phone list not sent to the push host, retrying every minute: ${e?.message??e}`),this.failing=!0,!1}}};function k(s,t){let n=[...s];return n.length>t?n.slice(0,t-1).join("")+"\u2026":s}export{E as a,R as b,u as c,$ as d,C as e,j as f,f as g};
|
|
2
|
-
//# sourceMappingURL=chunk-BRL3UPFW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/daemon/push-bridge.ts"],"sourcesContent":["import { isAppPushPath, runAppPush, type AppPushCall, type AppPushDeps, type AppPushResult } from \"./app-push\"\nimport { remoteDeviceId } from \"@/channels/push\"\nimport type { PushStore } from \"@/channels/push-store\"\n\n// --- Push bridge: phones paired with a relaying node (#711) ---\n//\n// Push has one host per mesh: the node that holds the VAPID keys and the\n// subscriptions table. A node with channels.push.relayTo forwards outbound\n// pushes to it (PushRelayAdapter); this module covers the other direction,\n// for a phone paired with that relaying node:\n//\n// phone → relay dashboard /api/app/push* (device token checked there)\n// → relay daemon POST /push/app (loopback)\n// → host daemon POST /push/app (the relay's peer token)\n// → runAppPush on the host's table, device id \"<origin>:<tok_…>\"\n//\n// The host never takes the origin from the request: it is the name of the\n// mesh.peers entry whose token the caller presented (pushBridgeCaller). A\n// caller holding only MESH_TOKEN, which every node accepts, names no node\n// and is refused, so one node can't subscribe, read or prune under\n// another's name.\n//\n// The relay also sends its roster of active token ids (\"roster\" op). The\n// host drops that node's rows whose phone is no longer in it, so\n// `agentx app revoke` on the relay stops the phone's notifications at the\n// next sync, as it does for a phone paired with the host.\n//\n// Every answer is { status, body }: the phone-app status and JSON, wrapped\n// so a relay can tell them apart from a transport failure.\n\n/** What a relay sends to the host's POST /push/app. */\nexport type PushBridgeRequest =\n | { op: \"app\"; origin: string; call: AppPushCall }\n | { op: \"roster\"; origin: string; active: string[] }\n\nconst ORIGIN = /^[A-Za-z0-9._-]{1,64}$/\nconst DEVICE_ID = /^[A-Za-z0-9_-]{1,64}$/\nconst MAX_NAME = 100\nconst MAX_ROSTER = 1000\n\n/** How often a relay checks its roster, and the longest it goes without\n * sending one even when nothing changed (the host may have restarted\n * from a backup, or missed a send while down). */\nexport const ROSTER_CHECK_MS = 60_000\nexport const ROSTER_RESEND_MS = 15 * 60_000\n\n/** This node's name as a relay origin: letters, digits, dot, dash and\n * underscore, so it can't contain the \":\" that scopes a device id. */\nexport function pushOrigin(nodeName: string): string {\n return (nodeName.replace(/[^A-Za-z0-9._-]+/g, \"-\").replace(/^-+|-+$/g, \"\") || \"node\").slice(0, 64)\n}\n\n/** Who is calling, on the host: the origin of the mesh.peers entry whose\n * token the caller presented, or why the call can't be tied to one. */\nexport type PushBridgeCaller = { origin: string } | { error: string }\n\nexport function pushBridgeCaller(\n authorization: string,\n peers: ReadonlyArray<{ name: string; token?: string }>,\n meshToken?: string,\n): PushBridgeCaller {\n const token = /^bearer /i.test(authorization) ? authorization.slice(7).trim() : \"\"\n const needs = \"Phones paired with another computer need that computer's own peer token: give it a token in mesh.peers on both computers.\"\n // MESH_TOKEN is shared by the whole mesh, so it says nothing about who sent it.\n if (!token || (meshToken && token === meshToken)) return { error: needs }\n const origins = new Set(peers.filter((p) => p.token === token).map((p) => pushOrigin(p.name)))\n if (origins.size === 0) return { error: needs }\n if (origins.size > 1) return { error: `Several mesh.peers entries share this token (${[...origins].join(\", \")}). Give each computer its own token.` }\n const [origin] = origins\n // Two peers whose names map to one origin would share, and prune, each\n // other's phones (\"my mac\" and \"my-mac\").\n const clash = peers.filter((p) => p.token !== token && pushOrigin(p.name) === origin).map((p) => p.name)\n if (clash.length) return { error: `mesh.peers names ${clash.map((n) => `\"${n}\"`).join(\", \")} too close to this computer's name: rename one so they differ in letters or digits.` }\n return { origin }\n}\n\n/** The origins of the configured peers, for checking a scoped device id on\n * the host: a row whose node left mesh.peers is no longer delivered. */\nexport function peerOrigins(peers: ReadonlyArray<{ name: string }>): Set<string> {\n return new Set(peers.map((p) => pushOrigin(p.name)))\n}\n\n/** On the host: answers one bridged request from `caller` (pushBridgeCaller).\n * `deps` is null when this node is not sending pushes itself; `reason`\n * then says why. An `origin` in the request itself is ignored. */\nexport function handlePushBridge(raw: unknown, caller: PushBridgeCaller, deps: (AppPushDeps & { store: () => PushStore | null }) | null, reason?: string): AppPushResult {\n const req = (raw && typeof raw === \"object\" ? raw : {}) as Record<string, any>\n if (\"error\" in caller) return { status: 403, body: { error: caller.error } }\n const origin = caller.origin\n if (!ORIGIN.test(origin)) return { status: 403, body: { error: \"this peer's name can't be used as a notification origin\" } }\n if (!deps) return { status: 503, body: { error: reason ?? \"Notifications are not set up on the computer that sends them.\" } }\n\n if (req.op === \"roster\") {\n if (!Array.isArray(req.active) || req.active.length > MAX_ROSTER || !req.active.every((id: unknown) => typeof id === \"string\" && DEVICE_ID.test(id))) {\n return { status: 400, body: { error: \"active must be a list of device ids\" } }\n }\n const store = deps.store()\n if (!store) return { status: 503, body: { error: deps.reason ?? \"the database is unavailable\" } }\n return { status: 200, body: { ok: true, removed: store.pruneOrigin(origin, req.active) } }\n }\n\n if (req.op !== \"app\") return { status: 400, body: { error: \"op must be app or roster\" } }\n const call = (req.call && typeof req.call === \"object\" ? req.call : {}) as Record<string, any>\n const device = (call.device && typeof call.device === \"object\" ? call.device : {}) as Record<string, any>\n const path = typeof call.path === \"string\" ? call.path : \"\"\n const method = call.method === \"GET\" || call.method === \"POST\" ? call.method : \"\"\n if (!isAppPushPath(path) || !method) return { status: 404, body: { error: \"not found\" } }\n if (typeof device.id !== \"string\" || !DEVICE_ID.test(device.id)) return { status: 400, body: { error: \"device.id is required\" } }\n const name = typeof device.name === \"string\" && device.name.trim() ? device.name.trim() : device.id\n const body = call.body && typeof call.body === \"object\" && !Array.isArray(call.body) ? call.body : {}\n return runAppPush({\n path,\n method,\n body,\n // The relay's name goes with the phone's, so `agentx app devices` and\n // the host's logs say where the phone is paired.\n device: { id: remoteDeviceId(origin, device.id), name: clip(`${name} (${origin})`, MAX_NAME) },\n }, deps)\n}\n\n/** On a relay: sends the roster of active token ids when it changed, or\n * every ROSTER_RESEND_MS. A failed send is retried at the next tick. */\nexport class PushRosterSync {\n private lastKey: string | null = null\n private lastSentAt = 0\n private failing = false\n\n constructor(private deps: {\n active: () => string[]\n send: (active: string[]) => Promise<unknown>\n now?: () => number\n log?: (...args: unknown[]) => void\n }) {}\n\n async tick(): Promise<boolean> {\n const now = (this.deps.now ?? Date.now)()\n let active: string[]\n try {\n active = [...new Set(this.deps.active())].sort()\n } catch (e: any) {\n // A torn or failed read of the phone list: sending nothing keeps the\n // host's rows; sending [] would unsubscribe every phone paired here.\n this.deps.log?.(`push: phone list not read, not sent this time: ${e?.message ?? e}`)\n return false\n }\n const key = active.join(\",\")\n if (key === this.lastKey && now - this.lastSentAt < ROSTER_RESEND_MS) return false\n try {\n await this.deps.send(active)\n this.lastKey = key\n this.lastSentAt = now\n if (this.failing) this.deps.log?.(\"push: phone list sent to the push host again\")\n this.failing = false\n return true\n } catch (e: any) {\n // Once per outage, not every minute.\n if (!this.failing) this.deps.log?.(`push: phone list not sent to the push host, retrying every minute: ${e?.message ?? e}`)\n this.failing = true\n return false\n }\n }\n}\n\nfunction clip(s: string, max: number): string {\n const chars = [...s]\n return chars.length > max ? chars.slice(0, max - 1).join(\"\") + \"…\" : s\n}\n"],"mappings":"uFAmCA,IAAMA,EAAS,yBACTC,EAAY,wBACZC,EAAW,IACXC,EAAa,IAKNC,EAAkB,IAClBC,EAAmB,GAAK,IAI9B,SAASC,EAAWC,EAA0B,CACnD,OAAQA,EAAS,QAAQ,oBAAqB,GAAG,EAAE,QAAQ,WAAY,EAAE,GAAK,QAAQ,MAAM,EAAG,EAAE,CACnG,CAMO,SAASC,EACdC,EACAC,EACAC,EACkB,CAClB,IAAMC,EAAQ,YAAY,KAAKH,CAAa,EAAIA,EAAc,MAAM,CAAC,EAAE,KAAK,EAAI,GAC1EI,EAAQ,4HAEd,GAAI,CAACD,GAAUD,GAAaC,IAAUD,EAAY,MAAO,CAAE,MAAOE,CAAM,EACxE,IAAMC,EAAU,IAAI,IAAIJ,EAAM,OAAQK,GAAMA,EAAE,QAAUH,CAAK,EAAE,IAAKG,GAAMT,EAAWS,EAAE,IAAI,CAAC,CAAC,EAC7F,GAAID,EAAQ,OAAS,EAAG,MAAO,CAAE,MAAOD,CAAM,EAC9C,GAAIC,EAAQ,KAAO,EAAG,MAAO,CAAE,MAAO,gDAAgD,CAAC,GAAGA,CAAO,EAAE,KAAK,IAAI,uCAAwC,EACpJ,GAAM,CAACE,CAAM,EAAIF,EAGXG,EAAQP,EAAM,OAAQK,GAAMA,EAAE,QAAUH,GAASN,EAAWS,EAAE,IAAI,IAAMC,CAAM,EAAE,IAAKD,GAAMA,EAAE,IAAI,EACvG,OAAIE,EAAM,OAAe,CAAE,MAAO,oBAAoBA,EAAM,IAAKC,GAAM,IAAIA,IAAI,EAAE,KAAK,IAAI,sFAAuF,EAC1K,CAAE,OAAAF,CAAO,CAClB,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AO,GAC7E,GAAI,CACF,aAAM,KAAK,KAAK,KAAKmC,CAAM,EAC3B,KAAK,QAAUC,EACf,KAAK,WAAaF,EACd,KAAK,SAAS,KAAK,KAAK,MAAM,8CAA8C,EAChF,KAAK,QAAU,GACR,EACT,OAAS,EAAP,CAEA,OAAK,KAAK,SAAS,KAAK,KAAK,MAAM,sEAAsE,GAAG,SAAW,GAAG,EAC1H,KAAK,QAAU,GACR,EACT,CACF,CACF,EAEA,SAASF,EAAK,EAAWK,EAAqB,CAC5C,IAAMC,EAAQ,CAAC,GAAG,CAAC,EACnB,OAAOA,EAAM,OAASD,EAAMC,EAAM,MAAM,EAAGD,EAAM,CAAC,EAAE,KAAK,EAAE,EAAI,SAAM,CACvE","names":["ORIGIN","DEVICE_ID","MAX_NAME","MAX_ROSTER","ROSTER_CHECK_MS","ROSTER_RESEND_MS","pushOrigin","nodeName","pushBridgeCaller","authorization","peers","meshToken","token","needs","origins","p","origin","clash","n","peerOrigins","handlePushBridge","raw","caller","deps","reason","req","id","store","call","device","path","method","isAppPushPath","name","body","runAppPush","remoteDeviceId","clip","PushRosterSync","now","active","key","max","chars"]}
|