@rubytech/create-maxy-code 0.1.472 → 0.1.474
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/dist/__tests__/google-client-id-env.test.js +15 -12
- package/dist/index.js +6 -29
- package/dist/port-resolution.js +5 -5
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -0
- package/payload/platform/docs/superpowers/plans/2026-07-18-ledger-write-path-fix.md +109 -0
- package/payload/platform/lib/ledger-core/dist/reconcile.d.ts +7 -0
- package/payload/platform/lib/ledger-core/dist/reconcile.d.ts.map +1 -1
- package/payload/platform/lib/ledger-core/dist/reconcile.js +5 -2
- package/payload/platform/lib/ledger-core/dist/reconcile.js.map +1 -1
- package/payload/platform/lib/ledger-core/src/__tests__/reconcile.test.ts +20 -0
- package/payload/platform/lib/ledger-core/src/reconcile.ts +12 -2
- package/payload/platform/neo4j/schema.cypher +4 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +37 -14
- package/payload/platform/plugins/docs/references/admin-ui.md +1 -1
- package/payload/platform/plugins/docs/references/google-guide.md +20 -9
- package/payload/platform/plugins/docs/references/ledger.md +9 -1
- package/payload/platform/plugins/docs/references/troubleshooting.md +4 -0
- package/payload/platform/plugins/docs/references/voice-mirror-guide.md +2 -2
- package/payload/platform/plugins/google/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/google/PLUGIN.md +28 -14
- package/payload/platform/plugins/google/mcp/dist/__tests__/account-register.test.js +79 -28
- package/payload/platform/plugins/google/mcp/dist/__tests__/account-register.test.js.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.d.ts +2 -0
- package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.d.ts.map +1 -0
- package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.js +54 -0
- package/payload/platform/plugins/google/mcp/dist/__tests__/boot.test.js.map +1 -0
- package/payload/platform/plugins/google/mcp/dist/__tests__/google-client.test.js +26 -1
- package/payload/platform/plugins/google/mcp/dist/__tests__/google-client.test.js.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/__tests__/index-registration.test.js +3 -2
- package/payload/platform/plugins/google/mcp/dist/__tests__/index-registration.test.js.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/index.d.ts +9 -5
- package/payload/platform/plugins/google/mcp/dist/index.d.ts.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/index.js +38 -37
- package/payload/platform/plugins/google/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/lib/google-client.d.ts +10 -7
- package/payload/platform/plugins/google/mcp/dist/lib/google-client.d.ts.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/lib/google-client.js +25 -13
- package/payload/platform/plugins/google/mcp/dist/lib/google-client.js.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/tools/account-register.d.ts +58 -17
- package/payload/platform/plugins/google/mcp/dist/tools/account-register.d.ts.map +1 -1
- package/payload/platform/plugins/google/mcp/dist/tools/account-register.js +143 -37
- package/payload/platform/plugins/google/mcp/dist/tools/account-register.js.map +1 -1
- package/payload/platform/plugins/google/references/auth.md +264 -362
- package/payload/platform/plugins/ledger/PLUGIN.md +13 -1
- package/payload/platform/plugins/ledger/mcp/dist/index.js +23 -15
- package/payload/platform/plugins/ledger/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/read.d.ts +11 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/read.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/read.js +20 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/read.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/types.d.ts +14 -11
- package/payload/platform/plugins/ledger/mcp/dist/lib/types.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/types.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.d.ts +12 -0
- package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.d.ts.map +1 -0
- package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.js +50 -0
- package/payload/platform/plugins/ledger/mcp/dist/lib/write-rejects.js.map +1 -0
- package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.d.ts +5 -5
- package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.js +11 -11
- package/payload/platform/plugins/ledger/mcp/dist/tools/cash-record.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.d.ts +7 -2
- package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.js +9 -3
- package/payload/platform/plugins/ledger/mcp/dist/tools/invoice-record.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.d.ts +7 -0
- package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.js +3 -4
- package/payload/platform/plugins/ledger/mcp/dist/tools/payment-record.js.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.d.ts +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.d.ts.map +1 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.js +4 -1
- package/payload/platform/plugins/ledger/mcp/dist/tools/reconcile.js.map +1 -1
- package/payload/platform/plugins/voice-mirror/PLUGIN.md +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/index.js +3 -3
- package/payload/platform/plugins/voice-mirror/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.d.ts +14 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.d.ts.map +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.js +15 -0
- package/payload/platform/plugins/voice-mirror/mcp/dist/lib/voice-corpus.js.map +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.d.ts.map +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js +3 -1
- package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js.map +1 -1
- package/payload/platform/plugins/voice-mirror/mcp/scripts/smoke.mjs +51 -4
- package/payload/platform/plugins/voice-mirror/skills/voice-mirror/SKILL.md +4 -0
- package/payload/platform/scripts/backfill-task-ids.sh +206 -0
- package/payload/platform/services/claude-session-manager/dist/activity-rows.d.ts +27 -2
- package/payload/platform/services/claude-session-manager/dist/activity-rows.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/activity-rows.js +33 -2
- package/payload/platform/services/claude-session-manager/dist/activity-rows.js.map +1 -1
- 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 +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +3 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/{chunk-BSTIQX52.js → chunk-Y6V45R6M.js} +1 -12
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/activity.html +6 -6
- package/payload/server/public/assets/{AdminLoginScreens-BfamGqS7.js → AdminLoginScreens-B44KbEuC.js} +1 -1
- package/payload/server/public/assets/{AdminShell-5nHOAzXO.js → AdminShell-BjxV2qkb.js} +2 -2
- package/payload/server/public/assets/{Checkbox-CD6aHwac.js → Checkbox-DSeZNGNA.js} +1 -1
- package/payload/server/public/assets/activity-CdipMTDp.js +1 -0
- package/payload/server/public/assets/{admin-Cpcw_YE-.js → admin-B4LpTCur.js} +1 -1
- package/payload/server/public/assets/{browser-0znOwk1W.js → browser-CEFvaWwI.js} +1 -1
- package/payload/server/public/assets/{calendar-CykigHdg.js → calendar-B3zo6V34.js} +1 -1
- package/payload/server/public/assets/chat-5tJdo9i_.js +1 -0
- package/payload/server/public/assets/chevron-left-BJllrPBj.js +1 -0
- package/payload/server/public/assets/data-Du79EgR-.js +1 -0
- package/payload/server/public/assets/{graph-JV5_xF3V.js → graph-RaOrnSf2.js} +1 -1
- package/payload/server/public/assets/{graph-labels-DPYORjBH.js → graph-labels-GlTEIYJj.js} +1 -1
- package/payload/server/public/assets/{maximize-2-8vKr3h21.js → maximize-2-CHDa8p5h.js} +1 -1
- package/payload/server/public/assets/{operator-Liul1QEq.js → operator-DtqHY4jV.js} +1 -1
- package/payload/server/public/assets/{page-CYRA87CB.js → page-CkhFj8GQ.js} +1 -1
- package/payload/server/public/assets/{page-Cg7B1RQx.js → page-DxnWgPtd.js} +1 -1
- package/payload/server/public/assets/{public-B4HMtpjt.js → public-D5TUfQ3I.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-sz5IQSnr.js → rotate-ccw-BJjVAQQY.js} +1 -1
- package/payload/server/public/assets/tasks-CM9pYYG1.js +1 -0
- package/payload/server/public/assets/{time-entry-format-CSuCexpM.js → time-entry-format-C5RYEYjM.js} +1 -1
- package/payload/server/public/assets/{triangle-alert-ClS81-CU.js → triangle-alert-DLfIsuo_.js} +1 -1
- package/payload/server/public/assets/{useCopyFeedback-Cn6YgeNx.js → useCopyFeedback-7yKeiAzV.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-BaD-ZZRk.js → useSelectionMode-CWlh6AEq.js} +1 -1
- package/payload/server/public/assets/{useSubAccountSwitcher-CNZL3PKn.css → useSubAccountSwitcher-B2n9QPVI.css} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-BOzHrDAU.js → useVoiceRecorder-j3ZArZ2H.js} +1 -1
- package/payload/server/public/browser.html +5 -5
- package/payload/server/public/calendar.html +6 -6
- package/payload/server/public/chat.html +12 -12
- package/payload/server/public/data.html +11 -11
- package/payload/server/public/graph.html +11 -11
- package/payload/server/public/index.html +14 -14
- package/payload/server/public/operator.html +14 -14
- package/payload/server/public/public.html +12 -12
- package/payload/server/public/tasks.html +5 -5
- package/payload/server/server.js +1837 -1695
- package/payload/server/public/assets/activity-Dj2nJzPw.js +0 -1
- package/payload/server/public/assets/chat-DIOJZ411.js +0 -1
- package/payload/server/public/assets/chevron-left-Cq7UvOI0.js +0 -1
- package/payload/server/public/assets/data-lHgqlhmu.js +0 -1
- package/payload/server/public/assets/tasks-D9oYgEzs.js +0 -1
- /package/payload/server/public/assets/{useSubAccountSwitcher-CvjWJSGv.js → useSubAccountSwitcher-CBlKgwms.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-TPjIAO9U.js";import{D as t,S as n,T as r,_ as i,d as a,g as o,r as s,w as c}from"./useSubAccountSwitcher-CvjWJSGv.js";import{t as l,y as u}from"./AdminShell-5nHOAzXO.js";import"./useSelectionMode-BaD-ZZRk.js";import{t as d}from"./triangle-alert-ClS81-CU.js";var f=i(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),p=i(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),m=r(),h=e(t(),1),g=n(),_=`maxy-admin-session-key`;function v(e){switch(e.costUnavailable){case`metering-failed`:return`Cost could not be calculated: ${e.meteringError??`the transcript could not be read`}`;case`model-not-priced`:return`No published price for this model, so cost cannot be estimated.`;case`no-transcript`:return`This session has no transcript yet, so there is nothing to cost.`;default:return}}var y=[{key:`accountId`,label:`Account`,numeric:!1,help:`The business this session belongs to. "untagged" means the session records no account.`},{key:`title`,label:`Session`,numeric:!1,help:`The conversation name, or its short id when it has none yet.`},{key:`model`,label:`Model`,numeric:!1,help:`The model that answered the most recent turn.`},{key:`status`,label:`Status`,numeric:!1,help:`What the process is doing right now.`},{key:`ageMs`,label:`Age`,numeric:!0,help:`How long ago this conversation started.`},{key:`idleMs`,label:`Idle`,numeric:!0,help:`Time since the last message. A long idle on a live session is memory being held for nothing.`},{key:`turnCount`,label:`Turns`,numeric:!0,help:`Messages exchanged. A trailing + means the count is a minimum — the conversation is too long to count exactly.`},{key:`rssKb`,label:`RSS`,numeric:!0,help:`Memory held by this session and all its helper processes together.`},{key:`cpuPct`,label:`CPU`,numeric:!0,help:`Share of one processor core used since the last reading. Can exceed 100% because a session runs many processes at once.`},{key:`usedTokens`,label:`Tokens`,numeric:!0,help:`Size of the conversation the model currently reads back on every turn.`},{key:`costGbp`,label:`Cost`,numeric:!0,help:`Estimated spend on this conversation so far, at published prices for its model.`}],b=[`idleMs`,`turnCount`,`rssKb`,`cpuPct`];function x(e,t){let n=t?.[e];return n&&n.trim()!==``?n:e.slice(0,8)}var S=`—`;function C(e){if(e===null||!Number.isFinite(e)||e<0)return S;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function w(e){return e===null||!Number.isFinite(e)?S:`${Math.round(e/1024)} MB`}function T(e){return e===null||!Number.isFinite(e)?S:`${e.toFixed(1)}%`}function E(e){return e===null||!Number.isFinite(e)?S:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function D(e){return e===null||!Number.isFinite(e)?S:`£${e.toFixed(2)}`}function O(e,t,n,r){let i=e[n],a=t[n];return i===null&&a===null?0:i===null?1:a===null?-1:typeof i==`number`&&typeof a==`number`?(i-a)*r:String(i).localeCompare(String(a))*r}function k({adminFetch:e}){let[t,n]=(0,h.useState)(null),[r,i]=(0,h.useState)(null),[s,c]=(0,h.useState)(!1),[l,u]=(0,h.useState)(`cpuPct`),[m,_]=(0,h.useState)(-1),k=(0,h.useRef)(!1),A=(0,h.useCallback)(async()=>{if(!k.current){k.current=!0;try{let t=await e(`/api/admin/activity`);if(t.status===403){i(`This view is available to the house account only.`),c(!0);return}if(!t.ok){i(`The session manager did not answer (status ${t.status}).`),c(!0);return}n(await t.json()),i(null)}catch(e){i(e instanceof Error?e.message:String(e))}finally{c(!0),k.current=!1}}},[e]);(0,h.useEffect)(()=>{A();let e=setInterval(()=>void A(),15e3);return()=>clearInterval(e)},[A]);let j=(0,h.useMemo)(()=>t?[...t.rows].sort((e,t)=>O(e,t,l,m)):[],[t,l,m]),M=e=>{e===l?_(e=>e===1?-1:1):(u(e),_(-1))};if(!s)return(0,g.jsxs)(`div`,{className:`activity-loading`,children:[(0,g.jsx)(a,{size:18,className:`spin`}),` Loading…`]});if(r)return(0,g.jsx)(`div`,{className:`activity-empty`,children:r});if(!t)return(0,g.jsx)(`div`,{className:`activity-empty`,children:`No response.`});let{accounts:N,census:P,censusAgeMs:F}=t,I=N.onDisk!==null&&N.onDisk>N.valid;return(0,g.jsxs)(`div`,{className:`activity-body`,children:[(0,g.jsxs)(`div`,{className:`activity-head`,children:[(0,g.jsxs)(`span`,{className:`activity-title`,children:[(0,g.jsx)(o,{size:16}),` Live sessions`]}),(0,g.jsxs)(`span`,{className:`activity-meta`,children:[j.length,` live · `,N.valid,` accounts`,N.untaggedCount>0?` · ${N.untaggedCount} untagged`:``]})]}),(0,g.jsx)(`div`,{className:`activity-census`,children:P===null?`No census collected yet, so memory and CPU are unavailable.`:`Census taken ${C(F)} ago · ${P.cpuNull} of ${P.live} without a CPU reading`}),I&&(0,g.jsxs)(`div`,{className:`activity-warning`,children:[(0,g.jsx)(d,{size:14}),` `,N.onDisk,` account folders on disk but only`,` `,N.valid,` are readable. Sessions belonging to the rest cannot be attributed.`]}),j.length===0?(0,g.jsx)(`div`,{className:`activity-empty`,children:`No sessions are running.`}):(0,g.jsx)(`div`,{className:`activity-scroll`,children:(0,g.jsxs)(`table`,{className:`activity-table`,children:[(0,g.jsx)(`thead`,{children:(0,g.jsx)(`tr`,{children:y.map(e=>(0,g.jsx)(`th`,{className:e.numeric?`activity-th activity-num`:`activity-th`,title:e.help,children:(0,g.jsxs)(`button`,{type:`button`,className:`activity-sort`,onClick:()=>M(e.key),children:[e.label,l===e.key&&(m===1?(0,g.jsx)(p,{size:11}):(0,g.jsx)(f,{size:11}))]})},e.key))})}),(0,g.jsx)(`tbody`,{children:j.map(e=>(0,g.jsxs)(`tr`,{className:`activity-row`,children:[(0,g.jsx)(`td`,{className:`activity-td`,title:e.accountId??void 0,children:e.accountId===null?(0,g.jsx)(`span`,{className:`activity-untagged`,title:`This session records no account, so it cannot be attributed to a business.`,children:`untagged`}):x(e.accountId,N.names)}),(0,g.jsx)(`td`,{className:`activity-td`,children:e.title??e.sessionId.slice(0,8)}),(0,g.jsx)(`td`,{className:`activity-td`,children:e.model??S}),(0,g.jsx)(`td`,{className:`activity-td`,children:e.status??S}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:C(e.ageMs)}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:C(e.idleMs)}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:e.turnCount===null?S:`${e.turnCount}${e.turnCountCapped?`+`:``}`}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:w(e.rssKb)}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:T(e.cpuPct)}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,children:E(e.usedTokens)}),(0,g.jsx)(`td`,{className:`activity-td activity-num`,title:v(e),children:D(e.costGbp)})]},e.sessionId))})]})}),j.length>0&&(0,g.jsxs)(`dl`,{className:`activity-legend`,children:[b.map(e=>{let t=y.find(t=>t.key===e);return(0,g.jsxs)(`div`,{className:`activity-legend-item`,children:[(0,g.jsx)(`dt`,{className:`activity-legend-term`,children:t.label}),(0,g.jsx)(`dd`,{className:`activity-legend-def`,children:t.help})]},e)}),(0,g.jsxs)(`div`,{className:`activity-legend-item`,children:[(0,g.jsx)(`dt`,{className:`activity-legend-term`,children:S}),(0,g.jsx)(`dd`,{className:`activity-legend-def`,children:`Not measured. It does not mean zero — hover the cell for the reason where one exists.`})]})]})]})}function A({cacheKey:e}){let{adminFetch:t}=c({initialCacheKey:e,surface:`activity`});return(0,g.jsx)(k,{adminFetch:t})}function j(){let[e,t]=(0,h.useState)(null),[n,r]=(0,h.useState)(!1),[i,o]=(0,h.useState)(void 0),[c,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(null),[m,v]=(0,h.useState)(null),[y,b]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(_)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(_)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&d(e.sessionId??null),p(e.role??null),v(e.userName===void 0?null:e.userName),b(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let x=(0,h.useCallback)(()=>{try{sessionStorage.removeItem(_)}catch{}window.location.href=`/`},[]),[S,C]=(0,h.useState)(!1),w=(0,h.useCallback)(async()=>{C(!0);try{let e=await u();if(e){try{sessionStorage.removeItem(_)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,g.jsx)(s,{cacheKey:e,surface:`activity`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=activity`);try{sessionStorage.removeItem(_)}catch{}window.location.href=`/`},children:(0,g.jsx)(l,{cacheKey:e,businessName:i,sessionId:c,onLogout:x,onDisconnect:w,disconnecting:S,userName:m,userAvatar:y,role:f,children:(0,g.jsx)(A,{cacheKey:e})})}):(0,g.jsx)(`div`,{className:`activity-page`,children:(0,g.jsxs)(`div`,{className:`activity-empty`,children:[(0,g.jsx)(`p`,{children:`You are not signed in.`}),(0,g.jsxs)(`p`,{children:[`Open the `,(0,g.jsx)(`a`,{href:`/`,className:`activity-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,g.jsx)(`div`,{className:`activity-page`,children:(0,g.jsxs)(`div`,{className:`activity-loading`,children:[(0,g.jsx)(a,{size:18,className:`spin`}),` Loading…`]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(j,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,T as t}from"./useSubAccountSwitcher-CvjWJSGv.js";import"./useVoiceRecorder-BOzHrDAU.js";import"./AdminShell-5nHOAzXO.js";import{n}from"./page-Cg7B1RQx.js";import"./useCopyFeedback-Cn6YgeNx.js";import"./useSelectionMode-BaD-ZZRk.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./useSubAccountSwitcher-CvjWJSGv.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,T as t}from"./useSubAccountSwitcher-CvjWJSGv.js";import"./useVoiceRecorder-BOzHrDAU.js";import{t as n}from"./page-CYRA87CB.js";import"./useSelectionMode-BaD-ZZRk.js";import"./graph-labels-DPYORjBH.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-TPjIAO9U.js";import{D as t,S as n,T as r,_ as i,a,d as o,h as s,l as c,n as l,r as u,s as d,t as f,w as p}from"./useSubAccountSwitcher-CvjWJSGv.js";import{n as m,t as h}from"./time-entry-format-CSuCexpM.js";import{t as g}from"./rotate-ccw-sz5IQSnr.js";var _=i(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=i(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),y=r(),b=e(t(),1);function x(e=3e4){let[t,n]=(0,b.useState)(()=>Date.now());return(0,b.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function S(e,t){let n=new Map,r=(e,t,r)=>{let i=n.get(e)??{openCount:0,totalSeconds:0};i.totalSeconds+=t,r&&(i.openCount+=1),n.set(e,i)};for(let t of e)t.clientName&&r(t.clientName,t.secondsLogged,!0);for(let e of t)e.clientName&&r(e.clientName,e.secondsLogged,!1);let i=[...n.entries()].map(([e,t])=>({name:e,openCount:t.openCount,totalSeconds:t.totalSeconds}));return i.sort((e,t)=>t.openCount-e.openCount||e.name.localeCompare(t.name)),C(e,i),i}function C(e,t){let n=t.reduce((e,t)=>e+t.openCount,0),r=e.filter(e=>!e.clientName).length,i=n+r===e.length;return i||console.warn(`[tasks-clients] reconcile-mismatch assigned=${n} unassigned=${r} openTotal=${e.length}`),i}var w=n();function T(e){let t=[];return e.clientName&&t.push(e.clientName),e.propertyAddress&&t.push(e.propertyAddress),e.fee!=null&&t.push(`£${e.fee}`),t.join(` · `)}function E(e){return[e.clientName,e.propertyAddress].filter(Boolean).join(` · `)}function D(e,t){if(e.running&&e.runningStartedAt){let n=Date.parse(e.runningStartedAt);if(Number.isFinite(n))return e.secondsLogged+Math.max(0,(t-n)/1e3)}return e.secondsLogged}function O({clients:e,onSelect:t}){return(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Clients`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[e.length,` total`]})]}),e.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No clients yet.`}),e.map(e=>(0,w.jsx)(`button`,{className:`tasks-row tasks-client-row`,onClick:()=>t(e.name),children:(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),(0,w.jsxs)(`div`,{className:`tasks-row-sub`,children:[e.openCount,` open · `,h(e.totalSeconds),` logged`]})]})},e.name))]})}function k({adminFetch:e}){let[t,n]=(0,b.useState)({open:[],completed:[]}),[r,i]=(0,b.useState)(!1),[l,u]=(0,b.useState)(!1),f=(0,b.useRef)(!1),p=(0,b.useRef)(``),y=x(1e3),[C,k]=(0,b.useState)(`open`),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),[P,F]=(0,b.useState)(``),I=(0,b.useMemo)(()=>S(t.open,t.completed),[t]),L=(0,b.useCallback)(e=>{j(e),k(`open`)},[]);(0,b.useEffect)(()=>{A&&!I.some(e=>e.name===A)&&j(null)},[I,A]);let R=A?t.open.filter(e=>e.clientName===A||e.running):t.open,z=A?t.completed.filter(e=>e.clientName===A):t.completed,B=(0,b.useCallback)(async()=>{let t=await e(`/api/admin/tasks-list`);t.ok&&n(await t.json()),i(!0)},[e]);(0,b.useEffect)(()=>{B()},[B]);let V=(0,b.useCallback)(async(t,n,r)=>{if(!f.current){f.current=!0,u(!0);try{await e(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({taskId:n,...r})}),await B()}finally{f.current=!1,u(!1)}}},[e,B]),H=(0,b.useCallback)(e=>{let t=String(Math.round(e.secondsLogged/60));p.current=t,N(e.taskId),F(t)},[]),U=(0,b.useCallback)(()=>{N(null),F(``)},[]),W=(0,b.useCallback)(async e=>{let t=P.trim(),n=Number(t);if(!(t===``||!Number.isInteger(n)||n<0)){if(t===p.current){U();return}N(null),F(``),await V(`/api/admin/task-time-adjust`,e,{newSeconds:n*60})}},[P,V,U]),G=(0,b.useCallback)(e=>{V(`/api/admin/task-time-adjust`,e,{newSeconds:0})},[V]);if(!r)return(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(o,{size:18,className:`spin`}),` Loading…`]});let K=e=>M===e.taskId?(0,w.jsxs)(`div`,{className:`tasks-edit`,children:[(0,w.jsx)(`input`,{className:`tasks-edit-input`,type:`number`,min:0,step:1,"aria-label":`Logged minutes`,value:P,onChange:e=>F(e.target.value)}),(0,w.jsx)(`span`,{className:`tasks-edit-unit`,children:`min`}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void W(e.taskId),children:[(0,w.jsx)(s,{size:14}),` Save`]}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,onClick:U,children:[(0,w.jsx)(a,{size:14}),` Cancel`]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Edit time`,disabled:l||e.running,title:e.running?`Stop the timer before editing time`:void 0,onClick:()=>H(e),children:(0,w.jsx)(c,{size:14})}),(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Reset time`,disabled:l||e.running,title:e.running?`Stop the timer before resetting time`:void 0,onClick:()=>G(e.taskId),children:(0,w.jsx)(g,{size:14})})]});return(0,w.jsxs)(`div`,{className:`tasks-body`,children:[(0,w.jsxs)(`div`,{className:`tasks-tabs`,children:[(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`open`?`tasks-tab-active`:``}`,onClick:()=>k(`open`),children:[`Open `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.open.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`completed`?`tasks-tab-active`:``}`,onClick:()=>k(`completed`),children:[`Completed `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.completed.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`clients`?`tasks-tab-active`:``}`,onClick:()=>k(`clients`),children:[`Clients `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:I.length})]})]}),C===`clients`?(0,w.jsx)(O,{clients:I,onSelect:L}):(0,w.jsxs)(w.Fragment,{children:[A&&(0,w.jsxs)(`div`,{className:`tasks-filter-banner`,children:[(0,w.jsxs)(`span`,{children:[`Showing `,A]}),(0,w.jsx)(`button`,{className:`tasks-filter-clear`,onClick:()=>j(null),children:`Clear`})]}),C===`open`?(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Open tasks`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[R.length,` to do`]})]}),R.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No open tasks.`}),R.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row`,children:[(0,w.jsx)(`button`,{className:`tasks-check`,"aria-label":`Mark complete`,disabled:l||e.running,title:e.running?`Stop the timer before completing`:void 0,onClick:()=>void V(`/api/admin/task-complete`,e.taskId),children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),T(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:T(e)})]}),(0,w.jsx)(`div`,{className:`tasks-row-elapsed`,children:h(D(e,y))}),K(e),M===e.taskId?null:e.running?(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-stop`,e.taskId),children:[(0,w.jsx)(d,{size:14}),` Stop`]}):(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-start`,e.taskId),children:[(0,w.jsx)(m,{size:14}),` Start`]})]},e.taskId))]}):(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Completed`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[z.length,` done`]})]}),z.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`Nothing completed yet.`}),z.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row tasks-row-done`,children:[(0,w.jsx)(`span`,{className:`tasks-check tasks-check-done`,children:(0,w.jsx)(_,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),E(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:E(e)})]}),(0,w.jsxs)(`div`,{className:`tasks-row-elapsed`,children:[h(e.secondsLogged),e.fee==null?``:` · £${e.fee}`]}),K(e)]},e.taskId))]})]})]})}function A({cacheKey:e}){let{adminFetch:t,cacheKey:n}=p({initialCacheKey:e,surface:`tasks`}),{subAccounts:r,activeAccountId:i,switching:a,switchAccount:o}=f(n),s=(0,b.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,w.jsxs)(`main`,{className:`tasks-main`,children:[(0,w.jsx)(l,{variant:`operator`,onNavigate:(0,b.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:s,onDisconnect:async()=>!0,disconnecting:!1,cacheKey:n,subAccounts:r,activeAccountId:i,switchingAccount:a,onSwitchAccount:o}),(0,w.jsx)(k,{adminFetch:t})]})}function j(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,w.jsx)(u,{cacheKey:e,surface:`tasks`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=tasks`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,w.jsx)(`div`,{className:`tasks-page tasks-page-full`,children:(0,w.jsx)(A,{cacheKey:e})})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-empty`,children:[(0,w.jsx)(`p`,{children:`You are not signed in.`}),(0,w.jsxs)(`p`,{children:[`Open the `,(0,w.jsx)(`a`,{href:`/`,className:`tasks-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,w.jsx)(j,{}));
|
|
File without changes
|