forge-openclaw-plugin 0.3.0 → 0.3.1

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 (119) hide show
  1. package/dist/assets/{activity-page-DPPiiyLO.js → activity-page-DRRbpVK-.js} +1 -1
  2. package/dist/assets/{ai-surface-workspace-B_fV9C4s.js → ai-surface-workspace-DJPt-OaW.js} +1 -1
  3. package/dist/assets/{atlas-panel-BPTJyMcI.js → atlas-panel-G3wGxjYf.js} +1 -1
  4. package/dist/assets/{calendar-page-D4DcRQv7.js → calendar-page-y8G1ige8.js} +1 -1
  5. package/dist/assets/{calendar-rules-Cl_xMrBn.js → calendar-rules-CRhXqGQu.js} +1 -1
  6. package/dist/assets/{calendar-week-toolbar-BARSOEO9.js → calendar-week-toolbar-CWSK5hJl.js} +1 -1
  7. package/dist/assets/{companion-sync-lab-page-COFYDI3w.js → companion-sync-lab-page-kEgOF3c6.js} +1 -1
  8. package/dist/assets/daily-metrics-dashboard-BJjUIZVA.js +1 -0
  9. package/dist/assets/{entity-note-count-link-BX93WYgh.js → entity-note-count-link-ef3ZOpKM.js} +1 -1
  10. package/dist/assets/{entity-notes-surface-CBlKc-x-.js → entity-notes-surface-CaCjjUaq.js} +1 -1
  11. package/dist/assets/{execution-board-Dh41UeKR.js → execution-board-RRWm2srb.js} +1 -1
  12. package/dist/assets/{faceted-token-search-BgxYH_gW.js → faceted-token-search-CZmtyJTT.js} +1 -1
  13. package/dist/assets/{flagship-signal-deck-bolzzK8q.js → flagship-signal-deck-DxRfmfpN.js} +1 -1
  14. package/dist/assets/{floating-action-menu-C5H-Wr2B.js → floating-action-menu-cKjNsPYD.js} +1 -1
  15. package/dist/assets/{goal-detail-page-CQeFnGDJ.js → goal-detail-page-BgQlK7yT.js} +1 -1
  16. package/dist/assets/{goals-page-BTg9crEK.js → goals-page-Cz2i3pVy.js} +1 -1
  17. package/dist/assets/{habits-page-C4vqk346.js → habits-page-BmEmWCGv.js} +1 -1
  18. package/dist/assets/index-Bcem7l5u.css +1 -0
  19. package/dist/assets/{index-By3tQxiE.js → index-QJkjKYzZ.js} +2 -2
  20. package/dist/assets/{insight-flow-dialog-JPYCsTKI.js → insight-flow-dialog-CdYMHwMP.js} +1 -1
  21. package/dist/assets/{insights-page-CFhVMlVL.js → insights-page-DHG-o9P_.js} +1 -1
  22. package/dist/assets/{kanban-page-DC3IDsnh.js → kanban-page-C6S_fJRc.js} +1 -1
  23. package/dist/assets/{knowledge-graph-page-DucyRYTZ.js → knowledge-graph-page-juA9QCy0.js} +1 -1
  24. package/dist/assets/{life-force-page-UrXfxaSO.js → life-force-page-ChTIA4mV.js} +1 -1
  25. package/dist/assets/{life-force-workspace-BhPNH7ad.js → life-force-workspace-sszLD-Yn.js} +1 -1
  26. package/dist/assets/{metric-tile-DtRPjN4V.js → metric-tile-B-tDTcBt.js} +1 -1
  27. package/dist/assets/{movement-page-DCIdTQEN.js → movement-page-Dx3T3HrG.js} +1 -1
  28. package/dist/assets/{note-markdown-CepDxj3v.js → note-markdown-CCyyE85h.js} +1 -1
  29. package/dist/assets/{note-tags-input-BXYaDkOr.js → note-tags-input-BS14YXHn.js} +1 -1
  30. package/dist/assets/{notes-page-Bl1LlCLo.js → notes-page-D3yGl8TN.js} +1 -1
  31. package/dist/assets/{open-in-graph-button-C263zl5l.js → open-in-graph-button-CMjJZX7G.js} +1 -1
  32. package/dist/assets/{orbit-map-Cb_AJyIj.js → orbit-map-v2Pv9RU_.js} +1 -1
  33. package/dist/assets/{overview-page-C2yLity7.js → overview-page-DSOpBpHf.js} +1 -1
  34. package/dist/assets/{page-hero-5RTqAI88.js → page-hero-CONuJu5J.js} +1 -1
  35. package/dist/assets/{pill-cluster-CBrrtZBm.js → pill-cluster-W2fY48OM.js} +1 -1
  36. package/dist/assets/{preference-entity-handoff-button-BQzg2J4k.js → preference-entity-handoff-button-CKDxCnbl.js} +1 -1
  37. package/dist/assets/{preferences-page-DekYF-Yz.js → preferences-page-Br3zrLlH.js} +1 -1
  38. package/dist/assets/{project-collections-BVXB8PPF.js → project-collections-NBwk6yV-.js} +1 -1
  39. package/dist/assets/{project-detail-page-CQlrLEn9.js → project-detail-page-BIU9_TRN.js} +1 -1
  40. package/dist/assets/{project-management-hierarchy-page--mzM_zRE.js → project-management-hierarchy-page-C2H620xD.js} +1 -1
  41. package/dist/assets/{project-management-section-nav-DQl0qRWy.js → project-management-section-nav-DRPVS1Eh.js} +1 -1
  42. package/dist/assets/{projects-page-Dr_0NdVP.js → projects-page-w7a_L2-z.js} +1 -1
  43. package/dist/assets/{psyche-behaviors-page-DOUaCWON.js → psyche-behaviors-page-Dt4CMC-q.js} +1 -1
  44. package/dist/assets/{psyche-flashcards-page-BA84fO_X.js → psyche-flashcards-page-rXz06dqO.js} +1 -1
  45. package/dist/assets/{psyche-goal-map-page-DpXAg1Vf.js → psyche-goal-map-page-BCcD6Jkl.js} +1 -1
  46. package/dist/assets/{psyche-graph-BxcbAbXt.js → psyche-graph-CXlAj4ED.js} +1 -1
  47. package/dist/assets/psyche-metrics-page-B1otiir6.js +1 -0
  48. package/dist/assets/{psyche-mode-guide-page-CBlIS5N_.js → psyche-mode-guide-page-C6AdVIAv.js} +1 -1
  49. package/dist/assets/{psyche-modes-page-DE6KDK_1.js → psyche-modes-page-DoUqz2mR.js} +1 -1
  50. package/dist/assets/psyche-page-BJNLQn8W.js +1 -0
  51. package/dist/assets/{psyche-patterns-page-DbCNRuww.js → psyche-patterns-page-CzpMSAPu.js} +1 -1
  52. package/dist/assets/{psyche-questionnaire-builder-page-DnraDj1H.js → psyche-questionnaire-builder-page-DjzatGVZ.js} +1 -1
  53. package/dist/assets/{psyche-questionnaire-detail-page-DQ6zNQkk.js → psyche-questionnaire-detail-page-B0Qfowfg.js} +1 -1
  54. package/dist/assets/{psyche-questionnaire-run-detail-page-BGrOIX0B.js → psyche-questionnaire-run-detail-page-B2dNj4jJ.js} +1 -1
  55. package/dist/assets/{psyche-questionnaire-run-page-Bg3BhBHb.js → psyche-questionnaire-run-page-DyD9Ui-g.js} +1 -1
  56. package/dist/assets/{psyche-questionnaires-page-BEreTNjG.js → psyche-questionnaires-page-BxfKcoi3.js} +1 -1
  57. package/dist/assets/{psyche-report-detail-page-Br9KlJBG.js → psyche-report-detail-page-Ci14mNUK.js} +1 -1
  58. package/dist/assets/{psyche-reports-page-Bk6QpAEF.js → psyche-reports-page-ALhNueiV.js} +1 -1
  59. package/dist/assets/{psyche-schemas-beliefs-page-Db8d2ga7.js → psyche-schemas-beliefs-page-C0P2Vw6-.js} +1 -1
  60. package/dist/assets/{psyche-screen-time-page-NazHUAkT.js → psyche-screen-time-page-BYnaT3cb.js} +1 -1
  61. package/dist/assets/{psyche-self-observation-page-H6FToucM.js → psyche-self-observation-page-eM9vpwIB.js} +1 -1
  62. package/dist/assets/{psyche-values-page-DqM382-6.js → psyche-values-page-BqrGIDok.js} +1 -1
  63. package/dist/assets/{report-chain-fields-nW4zndrM.js → report-chain-fields-CbkT7WOO.js} +1 -1
  64. package/dist/assets/{rewards-page-C-tZVnIK.js → rewards-page-DpAJ8IxE.js} +1 -1
  65. package/dist/assets/{scheduling-rules-editor-DGF-044c.js → scheduling-rules-editor-BUGnZJ0g.js} +1 -1
  66. package/dist/assets/{schema-badge-57AJ3FY-.js → schema-badge-CLAA4p-b.js} +1 -1
  67. package/dist/assets/{select-menu-mfaklv7r.js → select-menu-Cqs5t3ng.js} +1 -1
  68. package/dist/assets/{settings-agents-page-CPJeeYg0.js → settings-agents-page-pmkVrOO8.js} +1 -1
  69. package/dist/assets/{settings-bin-page-D3eX5aNf.js → settings-bin-page-BwtLrweW.js} +1 -1
  70. package/dist/assets/{settings-calendar-page-Bgx8NIsP.js → settings-calendar-page-BBjAMOCf.js} +1 -1
  71. package/dist/assets/{settings-data-page-BuMSUjpp.js → settings-data-page-Bqy5SukM.js} +1 -1
  72. package/dist/assets/{settings-logs-page-CHb2GNUM.js → settings-logs-page-8khtrf4T.js} +1 -1
  73. package/dist/assets/{settings-mobile-page-ClUvXhJg.js → settings-mobile-page-BcyRjEU_.js} +1 -1
  74. package/dist/assets/{settings-models-page-njK6D7zc.js → settings-models-page-DlSnO9WX.js} +1 -1
  75. package/dist/assets/{settings-page-Dm--cx6B.js → settings-page-CyBQ2qcB.js} +1 -1
  76. package/dist/assets/{settings-rewards-page-3aShLM3A.js → settings-rewards-page-BBX2WtVM.js} +1 -1
  77. package/dist/assets/{settings-section-nav-BWox23Qv.js → settings-section-nav-Co0AaDG-.js} +1 -1
  78. package/dist/assets/{settings-users-page-D-hEPpgQ.js → settings-users-page-JSnfFFPu.js} +1 -1
  79. package/dist/assets/{settings-wiki-page-CC-rOtDm.js → settings-wiki-page--nT23Fdy.js} +1 -1
  80. package/dist/assets/{sleep-page-Cm_Ei2w1.js → sleep-page-CGMi3MtV.js} +1 -1
  81. package/dist/assets/{sports-page-CqSI-j-H.js → sports-page-Kv5bBoLr.js} +1 -1
  82. package/dist/assets/{strategies-page-BuJ4zLLv.js → strategies-page-Br7RdUJO.js} +1 -1
  83. package/dist/assets/{strategy-detail-page-CLmy0jbW.js → strategy-detail-page-CBWXjUhC.js} +1 -1
  84. package/dist/assets/{strategy-dialog-DnJix1ys.js → strategy-dialog-BTwkaSxI.js} +1 -1
  85. package/dist/assets/{surface-DRNu5Fpz.js → surface-CyWI7e1R.js} +1 -1
  86. package/dist/assets/{task-detail-page-DTnNjW33.js → task-detail-page-Qis9354n.js} +1 -1
  87. package/dist/assets/{timebox-planning-dialog-DckIr1K4.js → timebox-planning-dialog-DB8snOBD.js} +1 -1
  88. package/dist/assets/{today-page-Cgk4HBPK.js → today-page-D9A5PU0S.js} +1 -1
  89. package/dist/assets/{training-load-page-C-7iINaB.js → training-load-page-Bpd4DQAh.js} +1 -1
  90. package/dist/assets/vitals-page-CVYC-4RG.js +1 -0
  91. package/dist/assets/{weekly-review-page-DFmuzzig.js → weekly-review-page-BP7N3fNB.js} +1 -1
  92. package/dist/assets/{weight-loss-page-CWtgeuti.js → weight-loss-page-_fX3N1UK.js} +1 -1
  93. package/dist/assets/{wiki-article-markdown-BkQg8Hne.js → wiki-article-markdown-Bi02AsVt.js} +1 -1
  94. package/dist/assets/{wiki-editor-page-BYKcdX5I.js → wiki-editor-page-OZf9l4Tg.js} +1 -1
  95. package/dist/assets/{wiki-ingest-history-page-D_p4myw1.js → wiki-ingest-history-page-CzeNSL7N.js} +1 -1
  96. package/dist/assets/{wiki-ingest-modal-C-CidueO.js → wiki-ingest-modal-Ig_xnyc6.js} +1 -1
  97. package/dist/assets/wiki-page-B4xuNgY4.js +1 -0
  98. package/dist/assets/{workbench-flow-page-Q3r2IJty.js → workbench-flow-page-BhRJCALC.js} +1 -1
  99. package/dist/assets/{workbench-page-BFfWMGm6.js → workbench-page-DxVs2AOY.js} +1 -1
  100. package/dist/assets/{workout-detail-page-DeDyz1Kk.js → workout-detail-page-D4wfkE98.js} +1 -1
  101. package/dist/index.html +2 -2
  102. package/dist/server/server/migrations/069_psyche_devrage_cumulative_rage.sql +5 -0
  103. package/dist/server/server/src/app.js +3 -2
  104. package/dist/server/server/src/openapi.js +48 -8
  105. package/dist/server/server/src/psyche-types.js +18 -4
  106. package/dist/server/server/src/services/devrage-scanner.js +115 -10
  107. package/dist/server/server/src/services/devrage.js +61 -11
  108. package/openclaw.plugin.json +1 -1
  109. package/package.json +1 -1
  110. package/server/migrations/069_psyche_devrage_cumulative_rage.sql +5 -0
  111. package/skills/forge-openclaw/SKILL.md +7 -0
  112. package/skills/forge-openclaw/entity_conversation_playbooks.md +23 -0
  113. package/skills/forge-openclaw/psyche_entity_playbooks.md +32 -0
  114. package/dist/assets/daily-metrics-dashboard-BNGQlJkQ.js +0 -1
  115. package/dist/assets/index-BAXYM89v.css +0 -1
  116. package/dist/assets/psyche-metrics-page-D8JQEoOl.js +0 -1
  117. package/dist/assets/psyche-page-Dkh7R2Dc.js +0 -1
  118. package/dist/assets/vitals-page-CqE4bYMf.js +0 -1
  119. package/dist/assets/wiki-page-DYpg9ZEO.js +0 -1
@@ -77,6 +77,9 @@ Forge correctly, and gather only the structure that still matters.
77
77
  genuinely structural.
78
78
  - For review requests, ask what practical question they want the read to answer before
79
79
  you ask for more scope.
80
+ - For review-first requests, do not ask write-shaped questions until the read has
81
+ answered the user's practical question. Only ask for write details after the result
82
+ points to a concrete save, correction, link, run, enrichment, or publish action.
80
83
  - For meaning-bearing updates, especially in Psyche-adjacent work, briefly say what
81
84
  feels newly true before you ask for the one structural detail that still changes the
82
85
  save.
@@ -184,6 +187,26 @@ worked.
184
187
  write at all. Do not widen into a new taxonomy choice unless the read made the
185
188
  container genuinely ambiguous.
186
189
 
190
+ ## Review-before-write checkpoint
191
+
192
+ Use this when the user asks to review, guide, inspect, compare, or understand before
193
+ changing anything. The read is part of the help, not a pretext for a new form.
194
+
195
+ - Ask only for the scope that changes the read: the record, owner, timeframe,
196
+ comparison target, movement span, weekday, flow, run, node, or published output.
197
+ - Use the correct read posture first: shared batch search or read hints for normal
198
+ entities, wiki/calendar dedicated reads for specialized CRUD, read-model routes for
199
+ overviews, and Movement, Life Force, or Workbench dedicated reads for those domain
200
+ surfaces.
201
+ - After the read, answer the practical question in plain language before asking for
202
+ any write detail.
203
+ - If the answer does not create a concrete next action, close cleanly. Do not ask
204
+ whether to save, update, link, enrich, run, or publish just to keep the conversation
205
+ going.
206
+ - If the read does create a next action, ask only the one detail that changes that
207
+ action: the exact correction, target record, link, weekday-template change,
208
+ overlay span, node result, run scope, or published-output preservation need.
209
+
187
210
  ## Psyche and memory routing
188
211
 
189
212
  Self-observation is not the default container for psychological material. Use it only
@@ -197,6 +197,38 @@ material without a usable formulation.
197
197
  - Do not make the user supply every interpretation alone. If the sequence is clear
198
198
  enough, do the formulation work in plain language and invite correction.
199
199
 
200
+ ## Hypothesis Timing Checkpoint
201
+
202
+ Use this before asking a second or third deepening question. The point is not to sound
203
+ insightful; the point is to help the user test a formulation that their own example
204
+ already supports.
205
+
206
+ Offer a hypothesis now when:
207
+
208
+ - the user has given one concrete episode, body cue, belief sentence, behavior, or
209
+ mode voice
210
+ - the same material is appearing in two nearby forms and another question would make
211
+ the user do all of the formulation work alone
212
+ - you can point to evidence in the user's words and name one function, prediction,
213
+ protection, payoff, relief, or cost
214
+ - the hypothesis would change the record shape, wording, links, or next action rather
215
+ than merely adding empathic color
216
+
217
+ Do not offer a hypothesis yet when:
218
+
219
+ - no concrete moment is visible and you would be inventing from an abstraction
220
+ - the user asked for a direct mechanical save and the wording is already accurate
221
+ enough to store
222
+ - the user seems flooded, unsafe, or too activated to evaluate an interpretation; first
223
+ contain, ground, or ask for immediate support needs
224
+ - the only available interpretation would be a diagnosis-like label, origin story,
225
+ trauma explanation, or certainty claim
226
+
227
+ After the hypothesis, ask exactly one correction question. If the user accepts or
228
+ corrects it, bridge toward the record shape. If the user rejects it without offering a
229
+ replacement, ask for one contrast that would disconfirm the hypothesis instead of
230
+ offering another theory.
231
+
200
232
  ## Hypothesis Wording Shape
201
233
 
202
234
  Use this when reflection alone would leave the user with warmth but no clearer
@@ -1 +0,0 @@
1
- import{bL as j,j as e,d0 as S,d1 as V,aI as L,d2 as P,d3 as T,d4 as R,aG as $,aX as z,r as v,cW as K,aK as F}from"./vendor-Dnkkx2co.js";import{R as O,P as B,O as A,C as W,T as G,D as I,a as E}from"./ui-C1iwpj2-.js";import{C as w,Z as c,c as u}from"./index-By3tQxiE.js";import{R as X,d as H,C as _,X as Y,Y as Z,b as q,T as J,B as Q,a as U}from"./charts-DFnEuIMB.js";function g(a){return a?new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"No date yet"}function ee(a,r){return r==="cumulative"?a.total??a.latest??a.maximum??a.average:a.latest??a.average??a.maximum??a.minimum}function o(a,r){if(r==null)return"No reading";const s=a.unit==="steps"||a.unit==="flights"||a.unit==="kcal"||a.unit==="min"||a.unit==="swears"||a.unit==="conversations"||a.unit==="messages"?0:(a.unit==="%",1);return`${r.toLocaleString(void 0,{maximumFractionDigits:s,minimumFractionDigits:s===0||r>=100?0:1})} ${a.unit}`}function k(a){return a.deltaValue==null?"No baseline yet":`${a.deltaValue>0?"+":""}${o(a,a.deltaValue)}`}function ae(a){return Math.round(a*10)/10}const p={fill:"var(--ui-ink-faint)",fontSize:11},se={stroke:"var(--ui-border-subtle)"},re="var(--ui-border-subtle)",te={stroke:"var(--ui-border-strong)",strokeWidth:1};function N(a,r){return ee(a,r)}function f(a){const r=a.days.map(s=>N(s,a.aggregation)).filter(s=>s!=null);return r.length===0?{minimum:null,average:null,maximum:null,count:0}:{minimum:Math.min(...r),average:r.reduce((s,i)=>s+i,0)/r.length,maximum:Math.max(...r),count:r.length}}function y(a){return new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ie({active:a,payload:r,label:s,metric:i}){var t;if(!a||!(r!=null&&r.length)||typeof s!="string")return null;const l=((t=r.find(n=>typeof n.value=="number"))==null?void 0:t.value)??null;return e.jsxs("div",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--surface-glass)] px-3 py-2 text-[var(--ui-ink-medium)] shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:y(s)}),e.jsx("div",{className:"mt-1 text-sm font-semibold text-[var(--ui-ink-strong)]",children:o(i,l)})]})}function D({metric:a,height:r=180,detailed:s=!1}){const i=v.useMemo(()=>f(a),[a]),l=v.useMemo(()=>a.days.map(d=>({dateKey:d.dateKey,value:N(d,a.aggregation),sampleCount:d.sampleCount})),[a]),t=l.map(d=>d.value).filter(d=>d!=null),n=t.length>0?Math.min(...t):0,h=t.length>0?Math.max(...t):1,b=Math.max((h-n)*.12,a.unit==="%"?2:1),M=x(a.category),m=`metric-gradient-${a.metric.replace(/[^a-z0-9]/gi,"-")}`;return t.length===0?e.jsx("div",{className:"flex items-center justify-center rounded-[22px] border border-dashed border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 text-center text-sm text-[var(--ui-ink-faint)]",style:{height:r},children:"Waiting for chart data"}):e.jsx("div",{className:c("overflow-hidden rounded-[22px] border bg-[var(--ui-surface-1)] p-3",M.ring),style:{height:r},children:e.jsx(X,{width:"100%",height:"100%",children:e.jsxs(H,{data:l,margin:{top:s?18:8,right:s?18:4,bottom:s?12:0,left:s?8:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:m,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:.55}),e.jsx("stop",{offset:"56%",stopColor:"var(--warning)",stopOpacity:.22}),e.jsx("stop",{offset:"100%",stopColor:"var(--warning)",stopOpacity:.02})]})}),e.jsx(_,{stroke:re,vertical:s}),e.jsx(Y,{dataKey:"dateKey",tickFormatter:y,minTickGap:s?22:34,tick:p,axisLine:se,tickLine:!1}),e.jsx(Z,{width:s?62:36,domain:[Math.max(0,n-b),h+b],tickFormatter:d=>o(a,Number(d)).replace(` ${a.unit}`,""),tick:p,axisLine:!1,tickLine:!1}),i.average!=null?e.jsx(q,{y:ae(i.average),stroke:"var(--ui-ink-faint)",strokeDasharray:"5 5",ifOverflow:"extendDomain"}):null,e.jsx(J,{cursor:te,content:e.jsx(ie,{metric:a})}),a.aggregation==="cumulative"?e.jsx(Q,{dataKey:"value",radius:[8,8,2,2],fill:`url(#${m})`,maxBarSize:s?34:20}):e.jsx(U,{type:"monotone",dataKey:"value",stroke:"var(--primary)",strokeWidth:s?3:2,fill:`url(#${m})`,dot:s?{r:3,fill:"var(--warning)"}:!1,activeDot:{r:5,fill:"var(--warning)"}})]})})})}function ne({metric:a,open:r,onOpenChange:s}){const i=f(a),l=x(a.category);return e.jsx(O,{open:r,onOpenChange:s,children:e.jsxs(B,{children:[e.jsx(A,{className:"fixed inset-0 z-50 bg-[var(--overlay)] backdrop-blur-xl"}),e.jsxs(W,{className:"fixed inset-3 z-[51] grid min-h-0 overflow-hidden rounded-[32px] border border-[var(--ui-border-subtle)] bg-[image:var(--ui-surface-modal)] shadow-[var(--ui-shadow-floating)] sm:inset-5",children:[e.jsxs(G,{className:"sr-only",children:[a.label," chart"]}),e.jsx(I,{className:"sr-only",children:"Full-screen time-series chart for the selected daily metric."}),e.jsxs("div",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-[var(--ui-border-subtle)] px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:[a.category," time series"]}),e.jsx("div",{className:"mt-1 break-words text-2xl font-semibold text-[var(--ui-ink-strong)] sm:text-3xl",children:a.label}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-[var(--ui-ink-soft)]",children:[e.jsx(u,{className:l.badge,children:a.aggregation}),e.jsxs(u,{tone:"meta",children:[a.coverageDays," tracked days"]}),e.jsxs(u,{tone:"meta",children:["latest ",g(a.latestDateKey)]})]})]}),e.jsx(E,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex size-11 items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]","aria-label":"Close metric chart",children:e.jsx(F,{className:"size-5"})})})]}),e.jsxs("div",{className:"grid min-h-0 gap-4 overflow-y-auto p-4 sm:p-6 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[e.jsx(D,{metric:a,height:560,detailed:!0}),e.jsx("div",{className:"grid content-start gap-3",children:[["Latest",a.latestValue],["Period min",i.minimum],["Period average",i.average],["Period max",i.maximum],["Baseline",a.baselineValue],["Delta",a.deltaValue]].map(([t,n])=>e.jsxs("div",{className:"rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:t}),e.jsx("div",{className:"mt-1 break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:o(a,typeof n=="number"?n:null)})]},String(t)))})]})]})]})]})})}function le(a){return a.deltaValue==null||a.deltaValue===0?"steady":a.deltaValue>0?"up":"down"}function x(a){switch(a){case"recovery":return{ring:"border-[var(--danger)]/20",badge:"bg-[var(--ui-danger-soft)] text-[var(--danger)]",glow:"from-[var(--ui-danger-soft)] via-[var(--ui-surface-2)] to-transparent"};case"cardio":return{ring:"border-[var(--info)]/24",badge:"bg-[var(--ui-info-soft)] text-[var(--info)]",glow:"from-[var(--ui-info-soft)] via-[var(--ui-surface-2)] to-transparent"};case"breathing":return{ring:"border-[var(--success)]/22",badge:"bg-[var(--ui-success-soft)] text-[var(--success)]",glow:"from-[var(--ui-success-soft)] via-[var(--ui-surface-2)] to-transparent"};case"composition":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};case"temperature":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};case"conversationTone":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};default:return{ring:"border-[var(--ui-border-subtle)]",badge:"bg-[var(--ui-accent-soft)] text-[var(--primary)]",glow:"from-[var(--ui-accent-soft)] via-[var(--ui-surface-2)] to-transparent"}}}function C(a){switch(a){case"restingHeartRate":case"walkingHeartRateAverage":case"heartRateRecoveryOneMinute":return z;case"heartRateVariabilitySDNN":case"vo2Max":return $;case"oxygenSaturation":case"respiratoryRate":return R;case"bodyMass":case"bodyFatPercentage":case"leanBodyMass":return T;case"stepCount":case"flightsClimbed":case"appleExerciseTime":return P;case"basalEnergyBurned":return L;case"swearingMessagePercent":return V;case"devrageSwearCount":return S;default:return j}}function me({title:a,description:r,metric:s,emptyDescription:i}){const l=s?C(s.metric):j,t=x(s?s.category:"default"),n=s?le(s):"steady";return e.jsxs(w,{className:c("relative overflow-hidden rounded-[28px] border bg-[var(--ui-surface-section)] p-5 shadow-[var(--card-shadow)]",t.ring),children:[e.jsx("div",{className:c("pointer-events-none absolute inset-0 bg-gradient-to-br opacity-90",t.glow)}),e.jsxs("div",{className:"relative grid gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid min-w-0 gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a}),e.jsx("div",{className:"break-words text-sm leading-6 text-[var(--ui-ink-soft)]",children:r})]}),e.jsx("div",{className:"shrink-0 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-[var(--ui-ink-medium)]",children:e.jsx(l,{className:"size-5"})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:s?o(s,s.latestValue):"No signal yet"}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-[var(--ui-ink-soft)]",children:[s?e.jsx(u,{className:t.badge,children:s.label}):null,s?e.jsx(u,{className:c("border-none",n==="up"?"bg-[var(--ui-success-soft)] text-[var(--success)]":n==="down"?"bg-[var(--ui-danger-soft)] text-[var(--danger)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]"),children:k(s)}):null,s?e.jsxs(u,{tone:"meta",children:[s.coverageDays," days tracked"]}):null]}),e.jsx("div",{className:"break-words text-xs text-[var(--ui-ink-faint)]",children:s?`Latest reading on ${g(s.latestDateKey)}`:i??"Forge will populate this card as soon as daily readings are available."})]})]})]})}function oe({metric:a}){const[r,s]=v.useState(!1),i=C(a.metric),l=x(a.category),t=a.days.at(-1),n=f(a);return e.jsxs(w,{className:c("overflow-hidden rounded-[28px] border bg-[var(--ui-surface-section)] p-5",l.ring),children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-4",children:[e.jsx("div",{className:"shrink-0 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-[var(--ui-ink-medium)]",children:e.jsx(i,{className:"size-5"})}),e.jsxs("div",{className:"grid min-w-0 gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a.category}),e.jsx("div",{className:"break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:a.label}),e.jsxs("div",{className:"text-sm text-[var(--ui-ink-soft)]",children:[a.coverageDays," tracked day",a.coverageDays===1?"":"s"]})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end",children:[e.jsx(u,{className:l.badge,children:a.aggregation}),e.jsxs("button",{type:"button",className:"inline-flex min-h-9 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-1.5 text-xs font-medium text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:()=>s(!0),children:[e.jsx(K,{className:"size-3.5"}),"Full screen"]})]})]}),e.jsxs("div",{className:"mt-5 grid gap-4 md:grid-cols-[minmax(0,0.95fr)_minmax(220px,1.05fr)]",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Latest"}),e.jsx("div",{className:"mt-1 break-words text-3xl font-semibold text-[var(--ui-ink-strong)]",children:o(a,a.latestValue)}),e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-soft)]",children:a.latestDateKey?`Latest reading on ${g(a.latestDateKey)}`:"Waiting for the first successful reading"})]}),e.jsxs("div",{className:"grid gap-2 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 text-sm text-[var(--ui-ink-medium)]",children:[e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:"Baseline"}),e.jsx("span",{className:"min-w-0 break-words text-right font-medium text-[var(--ui-ink-strong)]",children:o(a,a.baselineValue)})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:"Delta"}),e.jsx("span",{className:c("min-w-0 break-words text-right font-medium",a.deltaValue==null?"text-[var(--ui-ink-soft)]":a.deltaValue>0?"text-[var(--success)]":a.deltaValue<0?"text-[var(--danger)]":"text-[var(--ui-ink-strong)]"),children:k(a)})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:"Latest samples"}),e.jsx("span",{className:"min-w-0 break-words text-right font-medium text-[var(--ui-ink-strong)]",children:(t==null?void 0:t.sampleCount)??0})]})]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(D,{metric:a}),e.jsxs("div",{className:"grid gap-2 text-xs text-[var(--ui-ink-faint)] sm:grid-cols-3",children:[e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period min"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:o(a,n.minimum)})]}),e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period avg"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:o(a,n.average)})]}),e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period max"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:o(a,n.maximum)})]})]})]})]}),e.jsx(ne,{metric:a,open:r,onOpenChange:s})]})}function ve({groups:a}){return e.jsx("section",{className:"grid gap-5",children:a.map(r=>e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:r.category}),e.jsxs("div",{className:"mt-1 break-words text-2xl font-semibold text-[var(--ui-ink-strong)]",children:[r.metrics.length," signals in this lane"]})]}),e.jsxs(u,{className:x(r.category).badge,children:[r.coverageDays," days of coverage"]})]}),e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:r.metrics.map(s=>e.jsx(oe,{metric:s},s.metric))})]},r.category))})}export{ve as M,me as S,g as f,x as m};