forge-openclaw-plugin 0.2.108 → 0.2.110
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/assets/{activity-page-DWHZ8_sJ.js → activity-page-BdeoV3N4.js} +1 -1
- package/dist/assets/{ai-surface-workspace-DPygfyhc.js → ai-surface-workspace-BCbQUekv.js} +1 -1
- package/dist/assets/{atlas-panel-D261RUQF.js → atlas-panel-DTnRBOZx.js} +1 -1
- package/dist/assets/{calendar-page-BQbJkdPF.js → calendar-page-YDexXy_e.js} +1 -1
- package/dist/assets/{calendar-rules-BoFsuvZ8.js → calendar-rules-B_aOcMi3.js} +1 -1
- package/dist/assets/{calendar-week-toolbar-LetevPI7.js → calendar-week-toolbar-BTbIzq3e.js} +1 -1
- package/dist/assets/{companion-sync-lab-page-Bid-4B8W.js → companion-sync-lab-page-DKouMut9.js} +1 -1
- package/dist/assets/{daily-metrics-dashboard-CqnGJNeI.js → daily-metrics-dashboard-B3UCGG1t.js} +1 -1
- package/dist/assets/{entity-note-count-link-VMURwBMi.js → entity-note-count-link-DUxobQUt.js} +1 -1
- package/dist/assets/{entity-notes-surface-DGXcyNzo.js → entity-notes-surface-BdHBn8rx.js} +1 -1
- package/dist/assets/{execution-board-BGf6zZqJ.js → execution-board-R5-oyf-Z.js} +1 -1
- package/dist/assets/{faceted-token-search-CAsZrhZ4.js → faceted-token-search-DtO6OUwQ.js} +1 -1
- package/dist/assets/{flagship-signal-deck-DJsq3jn2.js → flagship-signal-deck-B9k46sWA.js} +1 -1
- package/dist/assets/{floating-action-menu-B3tQStUN.js → floating-action-menu-DBzfnJOx.js} +1 -1
- package/dist/assets/{goal-detail-page-DBs-9wpk.js → goal-detail-page-Mr_gnZ2l.js} +1 -1
- package/dist/assets/{goals-page-CPmhjsG-.js → goals-page-BG7FuqK1.js} +1 -1
- package/dist/assets/{habits-page-DkW8zT6_.js → habits-page-CGdaOqL3.js} +1 -1
- package/dist/assets/{index-BhkubYaC.js → index-BP9__l6C.js} +2 -2
- package/dist/assets/{insight-flow-dialog-BvgRjkPi.js → insight-flow-dialog-BUv06Vn-.js} +1 -1
- package/dist/assets/{insights-page-Dtij6pm5.js → insights-page-BgD1_1we.js} +1 -1
- package/dist/assets/{kanban-page-R1x5hUU-.js → kanban-page-DvZSN-Bi.js} +1 -1
- package/dist/assets/{knowledge-graph-page-BRBB5Vvz.js → knowledge-graph-page-BXWXtPvo.js} +1 -1
- package/dist/assets/{life-force-page-DGPWKM9I.js → life-force-page-CwjHvpzu.js} +1 -1
- package/dist/assets/{life-force-workspace-DoRIQoU_.js → life-force-workspace-Ct70SsNQ.js} +1 -1
- package/dist/assets/{metric-tile-NJiFcFxW.js → metric-tile-DCxLxNli.js} +1 -1
- package/dist/assets/{movement-page-Dk8aV737.js → movement-page-C06ebiYk.js} +1 -1
- package/dist/assets/{note-markdown-CZHjJDve.js → note-markdown-3wB52NOn.js} +1 -1
- package/dist/assets/{note-tags-input-DFpxZHPg.js → note-tags-input-Blg5Gqz_.js} +1 -1
- package/dist/assets/{notes-page-r3kymlqg.js → notes-page-CSkjizyK.js} +1 -1
- package/dist/assets/{open-in-graph-button-B_XHtHZD.js → open-in-graph-button-CDHxzS8B.js} +1 -1
- package/dist/assets/{orbit-map-C_xy4kYC.js → orbit-map-OV-GcUZl.js} +1 -1
- package/dist/assets/{overview-page-Dwg4uYe9.js → overview-page-Cw3pI34n.js} +1 -1
- package/dist/assets/{page-hero-DzEsy8i5.js → page-hero-DgnhI5es.js} +1 -1
- package/dist/assets/{pill-cluster-DcBUeEMT.js → pill-cluster-DIGkIvKN.js} +1 -1
- package/dist/assets/{preference-entity-handoff-button-BX2n07ob.js → preference-entity-handoff-button-LT_GBuqB.js} +1 -1
- package/dist/assets/{preferences-page-BSnwiWBt.js → preferences-page-Dkvz7nkU.js} +1 -1
- package/dist/assets/{project-collections-BR6YdlCZ.js → project-collections-BsAT8WYE.js} +1 -1
- package/dist/assets/{project-detail-page-DeYshcCb.js → project-detail-page-DsJUWg8k.js} +1 -1
- package/dist/assets/{project-management-hierarchy-page-Bhdt79Ea.js → project-management-hierarchy-page-CIy0wAp8.js} +1 -1
- package/dist/assets/{project-management-section-nav-DnXuWUfe.js → project-management-section-nav-ClB2S1FW.js} +1 -1
- package/dist/assets/{projects-page-BA9W0ZPk.js → projects-page-Da1bZLSH.js} +1 -1
- package/dist/assets/{psyche-behaviors-page-DpTj53GI.js → psyche-behaviors-page-D0uwf78o.js} +1 -1
- package/dist/assets/{psyche-flashcards-page-CV58hAJA.js → psyche-flashcards-page-e_qwwsOf.js} +1 -1
- package/dist/assets/{psyche-goal-map-page-C07CALFg.js → psyche-goal-map-page-BIY028Wx.js} +1 -1
- package/dist/assets/{psyche-graph-CP7mxfMP.js → psyche-graph-Y1UKALEm.js} +1 -1
- package/dist/assets/{psyche-metrics-page-CY8e9R0D.js → psyche-metrics-page-DDkGJzo_.js} +1 -1
- package/dist/assets/{psyche-mode-guide-page-DYt6AmHl.js → psyche-mode-guide-page-C7mD9uiv.js} +1 -1
- package/dist/assets/{psyche-modes-page-Dd77kTtJ.js → psyche-modes-page-RUdaOQWr.js} +1 -1
- package/dist/assets/{psyche-page-DNXZjIKp.js → psyche-page-D3FZy__c.js} +1 -1
- package/dist/assets/{psyche-patterns-page-DxGzpeT5.js → psyche-patterns-page-BSD35F41.js} +1 -1
- package/dist/assets/{psyche-questionnaire-builder-page-5EQctRHO.js → psyche-questionnaire-builder-page-BpgUTMgj.js} +1 -1
- package/dist/assets/{psyche-questionnaire-detail-page-W8nhUGAc.js → psyche-questionnaire-detail-page-DwjyjNhg.js} +1 -1
- package/dist/assets/{psyche-questionnaire-run-detail-page-DVwzSuqg.js → psyche-questionnaire-run-detail-page-mJ-DgeB-.js} +1 -1
- package/dist/assets/{psyche-questionnaire-run-page-BHResQgL.js → psyche-questionnaire-run-page-YuMBkH1G.js} +1 -1
- package/dist/assets/{psyche-questionnaires-page-DFTOXpyp.js → psyche-questionnaires-page-CNglToKh.js} +1 -1
- package/dist/assets/{psyche-report-detail-page-BqDE_tf7.js → psyche-report-detail-page-CV6tbLxz.js} +1 -1
- package/dist/assets/{psyche-reports-page-B75pDz0l.js → psyche-reports-page-BEOe8OPA.js} +1 -1
- package/dist/assets/{psyche-schemas-beliefs-page-BjSO4tYL.js → psyche-schemas-beliefs-page-KIRqmO8C.js} +1 -1
- package/dist/assets/{psyche-screen-time-page-B7lKf1g7.js → psyche-screen-time-page-DvXuwgU1.js} +1 -1
- package/dist/assets/{psyche-self-observation-page-C6RMThwc.js → psyche-self-observation-page-E6yDPBm1.js} +1 -1
- package/dist/assets/{psyche-values-page-1O158mIJ.js → psyche-values-page-CSLG7C6a.js} +1 -1
- package/dist/assets/{report-chain-fields-CyJ_VFY5.js → report-chain-fields-BYEp3tRr.js} +1 -1
- package/dist/assets/{rewards-page-sPlDYuVo.js → rewards-page-pAa_MIte.js} +1 -1
- package/dist/assets/{scheduling-rules-editor-DGgcBs1W.js → scheduling-rules-editor-BmGrjC9q.js} +1 -1
- package/dist/assets/{schema-badge-Do-YvNHm.js → schema-badge-IVJ4SoeC.js} +1 -1
- package/dist/assets/{select-menu-CAM7rMdO.js → select-menu-BE5AIdgO.js} +1 -1
- package/dist/assets/{settings-agents-page-BsZY71kz.js → settings-agents-page-hqI0IaNx.js} +1 -1
- package/dist/assets/{settings-bin-page-kB3jtHo_.js → settings-bin-page-2bPjFtZ3.js} +1 -1
- package/dist/assets/{settings-calendar-page-C-IGNk3_.js → settings-calendar-page-u_TfZJEh.js} +1 -1
- package/dist/assets/{settings-data-page-CFGSL9g3.js → settings-data-page-DSQ14F2i.js} +1 -1
- package/dist/assets/{settings-logs-page-C7e9FIN_.js → settings-logs-page-BU0CJhDM.js} +1 -1
- package/dist/assets/{settings-mobile-page-DzKeZQDM.js → settings-mobile-page-B1fQ61BB.js} +1 -1
- package/dist/assets/{settings-models-page-dFhaOV3E.js → settings-models-page-B0Dis_c_.js} +1 -1
- package/dist/assets/{settings-page-C0fSyYUx.js → settings-page-V4ibXIp9.js} +1 -1
- package/dist/assets/{settings-rewards-page-D-LuZHhv.js → settings-rewards-page-DeCGBNn5.js} +1 -1
- package/dist/assets/{settings-section-nav-kFFQSJEe.js → settings-section-nav-DV5umEkp.js} +1 -1
- package/dist/assets/{settings-users-page-CX797HPB.js → settings-users-page-BB8Dzd_P.js} +1 -1
- package/dist/assets/{settings-wiki-page-CWLAvcsf.js → settings-wiki-page-B0k0KRsU.js} +1 -1
- package/dist/assets/{sleep-page-QgBkKyk_.js → sleep-page-CPwUb-em.js} +1 -1
- package/dist/assets/{sports-page-C8tLMl7V.js → sports-page-Cl4vZVwh.js} +1 -1
- package/dist/assets/{strategies-page-CGgh-KXu.js → strategies-page-DhFXf-g3.js} +1 -1
- package/dist/assets/{strategy-detail-page-CnzqjjoD.js → strategy-detail-page-B2gotRKI.js} +1 -1
- package/dist/assets/{strategy-dialog-C6AThZ9L.js → strategy-dialog-DD1bbrRB.js} +1 -1
- package/dist/assets/{surface-CIDhCEsF.js → surface-98myBzix.js} +1 -1
- package/dist/assets/{task-detail-page-Dp0r_qZP.js → task-detail-page-nx4eQbMW.js} +1 -1
- package/dist/assets/{timebox-planning-dialog-B3uaSsWI.js → timebox-planning-dialog-DoZ9zUra.js} +1 -1
- package/dist/assets/{today-page-CTnMYrPi.js → today-page-7BH7Yne1.js} +1 -1
- package/dist/assets/{training-load-page-D0WB5_Tq.js → training-load-page-E82pNn1-.js} +1 -1
- package/dist/assets/{vitals-page-0vg8nqwj.js → vitals-page-D64WlwVv.js} +1 -1
- package/dist/assets/{weekly-review-page-CSSKlkbH.js → weekly-review-page-BkRxxm7Q.js} +1 -1
- package/dist/assets/weight-loss-page-DPbg7rTC.js +5 -0
- package/dist/assets/{wiki-article-markdown-CBFvfJx_.js → wiki-article-markdown-B0Q6082A.js} +1 -1
- package/dist/assets/{wiki-editor-page-CL1uxpih.js → wiki-editor-page-Tkb50wEA.js} +1 -1
- package/dist/assets/{wiki-ingest-history-page-XX8DeNCC.js → wiki-ingest-history-page-CcQzkZRr.js} +1 -1
- package/dist/assets/{wiki-ingest-modal-j-ftDmzp.js → wiki-ingest-modal-D6yft0Qb.js} +1 -1
- package/dist/assets/{wiki-page-B46TQYpy.js → wiki-page-DEND1jmD.js} +1 -1
- package/dist/assets/{workbench-flow-page-CicEuBKq.js → workbench-flow-page-CkNI03j_.js} +1 -1
- package/dist/assets/{workbench-page-tXezYLh_.js → workbench-page-W3zQpeWr.js} +1 -1
- package/dist/assets/{workout-detail-page-BTO5X0Of.js → workout-detail-page-BVSZv53z.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/server/server/src/app.js +2 -0
- package/dist/server/server/src/discovery-advertiser.js +5 -2
- package/dist/server/server/src/health-weight-loss.js +160 -10
- package/dist/server/server/src/services/devrage-scanner.js +948 -0
- package/dist/server/server/src/services/devrage.js +1 -1
- package/dist/server/src/lib/weight-loss-energy-model.js +64 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/forge-openclaw/SKILL.md +10 -0
- package/skills/forge-openclaw/entity_conversation_playbooks.md +33 -0
- package/skills/forge-openclaw/psyche_entity_playbooks.md +31 -0
- package/dist/assets/weight-loss-page-Dcr4wjjy.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as S,j as t,aF as le,ds as ce,aI as J,aG as Z,dt as ee,b3 as de,bl as ue}from"./vendor-Dnkkx2co.js";import{j as me,i as he,k as pe}from"./state-vCcAT5Hq.js";import{u as ke,ey as ge,aI as fe,bE as ye,dq as Ce,ez as be,E as ve,a8 as xe,B as j,eA as A,c as N,C as D,Z as P,W as re,eB as we}from"./index-BhkubYaC.js";import{P as Se}from"./page-hero-DzEsy8i5.js";import"./motion-Lt5B1XuE.js";import"./ui-C1iwpj2-.js";import"./forms-hB0SqEh-.js";import"./board-dIX6etHh.js";import"./graph-DDUZNRsO.js";const U=[{id:"xp_levels",label:"XP and level",trophyCount:8,unlockCount:4},{id:"streaks",label:"Streak and comeback",trophyCount:14,unlockCount:10},{id:"tasks",label:"Tasks and focus runs",trophyCount:14,unlockCount:4},{id:"projects",label:"Projects, goals, and strategy",trophyCount:14,unlockCount:4},{id:"wiki",label:"Wiki, notes, and knowledge graph",trophyCount:16,unlockCount:6},{id:"psyche",label:"Psyche",trophyCount:18,unlockCount:10},{id:"habits",label:"Habits, Life Force, and health",trophyCount:8,unlockCount:8},{id:"agents",label:"Agents and collaboration",trophyCount:4,unlockCount:2}],je=[1,2,3,5,7,14,21,30,45,60,90,180,365,730],Ae=[1,2,3,5,7,10,14,21,30,60];function e(r,l){return{metric:r,threshold:l}}function n(...r){return{allOf:r}}function $(r){return r.toLowerCase().replace(/['’]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Te(r,l){const u=(r+1)/l;return u>.82?"platinum":u>.55?"gold":u>.25?"silver":"bronze"}function _e(r){return r==="platinum"?"legendary":r==="gold"?"hard":r==="silver"?"standard":"intro"}function Ne(r){return r==="platinum"?"legendary":r==="gold"?"epic":r==="silver"?"rare":"common"}function Pe(r){return`item-${r.kind}-${$(r.category)}-${$(r.title)}`}function a(r,l,u,d,i,m){return{category:r,kind:"trophy",title:l,summary:i,requirement:u,requirementText:d,reward:`${l} trophy on the Forge shelf`}}function o(r,l,u,d,i,m,p){return{category:r,kind:"unlock",title:l,summary:m,requirement:d,requirementText:i,reward:`${l} cosmetic`,unlockType:u,rewardPayload:p}}const Re=[a("xp_levels","The First Heat",e("nonManualXp",5e3),"Earn 5,000 non-manual XP.","The first real furnace of work is hot enough to be noticed."),a("xp_levels","Bellows Graduate",e("nonManualXp",1e4),"Earn 10,000 non-manual XP.","Your reward ledger is no longer a spark; it is a system."),a("xp_levels","Iron Apprentice",e("nonManualXp",2e4),"Earn 20,000 non-manual XP.","You have repeated the work enough that the anvil knows your hand."),a("xp_levels","Steel Temper",e("nonManualXp",5e4),"Earn 50,000 non-manual XP.","Pressure has started to make the metal cleaner instead of louder."),a("xp_levels","Crown of Coals",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A visible crown for an invisible mountain of completed work."),a("xp_levels","Obsidian Master",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","The Forge Smith stops testing your seriousness and starts respecting it."),a("xp_levels","Star-Forge Adept",e("nonManualXp",5e5),"Earn 500,000 non-manual XP.","Your XP trail burns like a constellation across the operating system."),a("xp_levels","Mythic Smith",e("nonManualXp",1e6),"Earn 1,000,000 non-manual XP.","A ridiculous trophy for a ridiculous amount of lived execution.")],Fe=[o("xp_levels","Obsidian Smith","mascot_skin",e("nonManualXp",8e3),"Earn 8,000 non-manual XP.","A dramatic black-iron Forge Smith skin.",{mascotSkin:"obsidian-smith"}),o("xp_levels","Molten Progress Bar","hud_treatment",e("nonManualXp",25e3),"Earn 25,000 non-manual XP.","A bright molten XP fill for the level ring.",{hudTreatment:"molten-progress"}),o("xp_levels","Apex Level Frame","icon_frame",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A high-tier frame for level and trophy icons.",{iconFrame:"apex-level"}),o("xp_levels","Masterwork Glow","celebration_variant",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","A stronger forge-bell reveal for major unlocks.",{celebrationVariant:"masterwork-glow"})],Ee=[a("streaks","Spark Kept",e("longestStreakDays",1),"Play one qualifying day.","The first day is small, but the forge heard it."),a("streaks","Three-Day Furnace",e("longestStreakDays",3),"Reach a 3-day streak.","Three returns make the first shape of discipline."),a("streaks","Week-Fire",e("longestStreakDays",7),"Reach a 7-day streak.","Seven days changes the temperature of your life."),a("streaks","Twin-Week Bellows",e("longestStreakDays",14),"Reach a 14-day streak.","Two weeks of showing up makes the room expect you."),a("streaks","Cinder Discipline",e("longestStreakDays",21),"Reach a 21-day streak.","The fire is not accidental anymore."),a("streaks","Monthly Forge",e("longestStreakDays",30),"Reach a 30-day streak.","A full month of returns becomes a personal weather system."),a("streaks","Sixty-Day Flame",e("longestStreakDays",60),"Reach a 60-day streak.","The Smith grows stronger because you stopped disappearing."),a("streaks","Quarter-Anvil",e("longestStreakDays",90),"Reach a 90-day streak.","Ninety days is not motivation. It is architecture."),a("streaks","Half-Year Inferno",e("longestStreakDays",180),"Reach a 180-day streak.","The forge is now a season of your life."),a("streaks","Year of Steel",e("longestStreakDays",365),"Reach a 365-day streak.","A year of returns. The anvil has become a witness."),a("streaks","Comeback Hammer",e("comebackAfter7Count",1),"Return after 7+ missed days and complete a qualifying action.","You came back after the room went cold."),a("streaks","Repair Artist",e("comebackAfter7Count",3),"Complete 3 major comebacks.","Breaking the chain did not become breaking the story."),a("streaks","Rust Refuser",n(e("comebackAfter7Count",5),e("longestStreakDays",30)),"Complete 5 major comebacks and reach a 30-day streak.","You repeatedly turned absence into a new strike."),a("streaks","Relentless Return",n(e("comebackAfter7Count",8),e("longestStreakDays",90)),"Complete 8 major comebacks and reach a 90-day streak.","This trophy is for the part of you that keeps coming back.")],Ie=[o("streaks","Bronze Ember Flame","streak_effect",e("longestStreakDays",3),"Reach a 3-day streak.","A small ember around the streak HUD.",{streakEffect:"bronze-ember"}),o("streaks","Blue Forge-Fire","streak_effect",e("longestStreakDays",7),"Reach a 7-day streak.","A cool blue streak flame.",{streakEffect:"blue-forge-fire"}),o("streaks","Violet Arc Flame","streak_effect",e("longestStreakDays",21),"Reach a 21-day streak.","A sharper violet flame effect.",{streakEffect:"violet-arc"}),o("streaks","Molten Crown Fire","streak_effect",e("longestStreakDays",60),"Reach a 60-day streak.","A crown-like fire treatment for streaks.",{streakEffect:"molten-crown"}),o("streaks","Stern Pressure Pose","mascot_pose",e("comebackAfter7Count",1),"Complete a major comeback.","Unlocks the Smith's stern pressure pose.",{mascotPose:"stern-pressure"}),o("streaks","Comeback Pose","mascot_pose",e("comebackAfter7Count",2),"Complete 2 major comebacks.","Unlocks the Smith's comeback repair pose.",{mascotPose:"comeback"}),o("streaks","Awakening Forge Pose","mascot_pose",e("longestStreakDays",30),"Reach a 30-day streak.","Unlocks the forge awakening mascot pose.",{mascotPose:"awakening-forge"}),o("streaks","Yearfire Aura","streak_effect",e("longestStreakDays",365),"Reach a 365-day streak.","A huge aura for year-scale presence.",{streakEffect:"yearfire-aura"}),o("streaks","Old Foundry Shelf","trophy_shelf",e("longestStreakDays",90),"Reach a 90-day streak.","A warmer trophy shelf skin.",{trophyShelf:"old-foundry"}),o("streaks","Relentless Bell","celebration_variant",e("longestStreakDays",180),"Reach a 180-day streak.","A heavier celebration sound-and-spark treatment.",{celebrationVariant:"relentless-bell"})],Me=[a("tasks","First Strike",e("taskCompletionCount",25),"Complete 25 tasks.","A real task trail begins."),a("tasks","Clean Swing",n(e("taskCompletionCount",50),e("focusRunCount",10)),"Complete 50 tasks and 10 task runs.","Tasks and time-tracked execution start to converge."),a("tasks","Five Rivets",n(e("taskCompletionCount",75),e("taskCloseoutReportCount",5)),"Complete 75 tasks and 5 completion reports.","You are leaving proof behind, not just checkmarks."),a("tasks","Task Blade",n(e("taskCompletionCount",120),e("focusRunCount",25)),"Complete 120 tasks and 25 task runs.","A sharp blade forged out of repeated finishes."),a("tasks","Anvil Marathon",n(e("taskCompletionCount",300),e("focusRunCount",75)),"Complete 300 tasks and 75 task runs.","The long road achievement for serious execution."),a("tasks","Deep-Work Maul",e("creditedFocusMinutes",3e3),"Log 3,000 credited focus minutes.","The heavy hammer of deliberate time."),a("tasks","Planned Heat",e("plannedFocusRunCount",25),"Complete 25 planned task runs.","You planned the heat before striking the metal."),a("tasks","Closeout Scribe",e("taskCloseoutReportCount",25),"Write 25 task completion reports.","The Forge remembers what changed because you wrote it down."),a("tasks","Hundred-Hammer Road",e("taskCompletionCount",500),"Complete 500 tasks.","A road paved with finished work."),a("tasks","Timebox Knight",n(e("plannedFocusRunCount",75),e("creditedFocusMinutes",7500)),"Complete 75 planned runs and 7,500 focus minutes.","A trophy for time that obeyed the mission."),a("tasks","Backlog Breaker",e("taskCompletionCount",750),"Complete 750 tasks.","The backlog learned to fear your return."),a("tasks","Execution Monarch",n(e("taskCompletionCount",1e3),e("focusRunCount",200)),"Complete 1,000 tasks and 200 task runs.","A crown for turning vague intention into finished artifacts."),a("tasks","Forge Ledger Exact",e("taskCloseoutReportCount",100),"Write 100 task completion reports.","The most boring discipline becomes the most useful history."),a("tasks","The Hammer Does Not Blink",n(e("taskCompletionCount",1500),e("creditedFocusMinutes",15e3)),"Complete 1,500 tasks and 15,000 focus minutes.","For absurd consistency under real load.")],Ke=[o("tasks","Hammer Cursor","icon_frame",e("taskCompletionCount",75),"Complete 75 tasks.","A hammer-shaped action accent.",{iconFrame:"hammer-cursor"}),o("tasks","Focus Rail Glow","hud_treatment",e("focusRunCount",25),"Complete 25 task runs.","A task-run glow for compact HUDs.",{hudTreatment:"focus-rail-glow"}),o("tasks","Completion Burst","celebration_variant",e("taskCloseoutReportCount",25),"Write 25 completion reports.","A sharper task-completion burst.",{celebrationVariant:"completion-burst"}),o("tasks","Ember Knight","mascot_skin",e("taskCompletionCount",500),"Complete 500 tasks.","A molten-armored Forge Smith skin for execution mastery.",{mascotSkin:"ember-knight"})],$e=[a("projects","Aligned Spark",e("goalLinkedTaskCompletionCount",25),"Complete 25 goal-linked tasks.","Work starts pointing at something bigger."),a("projects","Goal Rivet",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",3)),"Complete 50 goal-linked tasks across 3 goals.","Several goals now have real rivets, not just titles."),a("projects","Strategist's Seal",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",5)),"Complete 50 goal-linked tasks across 5 goals.","A seal for strategy that survived contact with execution."),a("projects","Project Spine",n(e("projectLinkedTaskCompletionCount",100),e("activeProjectCount",5)),"Complete 100 project-linked tasks while maintaining 5 active projects.","The work has a spine across multiple initiatives."),a("projects","Strategy Weld",e("strategyCount",10),"Create 10 strategies.","You forged planning layers instead of improvising every day."),a("projects","Purpose Hammer",e("goalLinkedTaskCompletionCount",150),"Complete 150 goal-linked tasks.","The hammer keeps landing where your stated life points."),a("projects","Arc Builder",n(e("projectLinkedTaskCompletionCount",250),e("distinctGoalsWithCompletions",8)),"Complete 250 project-linked tasks across 8 goals.","Multiple arcs moved because you kept building."),a("projects","North-Star Foundry",n(e("goalLinkedTaskCompletionCount",300),e("strategyCount",20)),"Complete 300 goal-linked tasks and create 20 strategies.","The north star is no longer decorative."),a("projects","Project Finisher",e("projectCompletionCount",5),"Complete 5 projects.","Finished projects leave heavier evidence than active dreams."),a("projects","Life-Work Crown",n(e("projectCompletionCount",10),e("goalLinkedTaskCompletionCount",500)),"Complete 10 projects and 500 goal-linked tasks.","A crown for long arcs that actually closed."),a("projects","Portfolio Anvil",e("activeProjectCount",12),"Maintain 12 active projects.","A large operating portfolio, held without flattening."),a("projects","Tracer Bullet Guild",n(e("projectCompletionCount",15),e("strategyCount",35)),"Complete 15 projects and create 35 strategies.","Strategy and delivery joined hands repeatedly."),a("projects","Mountain Moved",e("goalLinkedTaskCompletionCount",1e3),"Complete 1,000 goal-linked tasks.","The trophy for moving a mountain one task at a time."),a("projects","The Work Had A Spine",n(e("projectCompletionCount",25),e("distinctGoalsWithCompletions",12)),"Complete 25 projects across 12 goals.","Your life map became execution history.")],Le=[o("projects","Goal Compass Frame","icon_frame",e("goalLinkedTaskCompletionCount",50),"Complete 50 goal-linked tasks.","A compass frame for aligned-work trophies.",{iconFrame:"goal-compass"}),o("projects","War-Room Iron Shelf","trophy_shelf",e("projectLinkedTaskCompletionCount",150),"Complete 150 project-linked tasks.","A darker tactical trophy shelf.",{trophyShelf:"war-room-iron"}),o("projects","North-Star HUD","hud_treatment",e("strategyCount",20),"Create 20 strategies.","A strategy-forward HUD treatment.",{hudTreatment:"north-star"}),o("projects","Foundry Compass Burst","celebration_variant",e("projectCompletionCount",10),"Complete 10 projects.","A compass-shaped major reveal.",{celebrationVariant:"foundry-compass"})],Ge=[a("wiki","First Inscription",e("wikiPageCount",50),"Create 50 wiki pages.","Knowledge has started to become an archive."),a("wiki","Memory Rivet",e("noteCount",100),"Create 100 notes.","The system remembers because you gave it material."),a("wiki","Archive Ember",n(e("wikiPageCount",150),e("wikiLinkCount",50)),"Create 150 wiki pages and 50 wiki links.","The archive starts connecting to itself."),a("wiki","Knowledge Anvil",n(e("wikiPageCount",250),e("wikiLinkCount",150)),"Create 250 wiki pages and 150 wiki links.","A serious anvil of memory and links."),a("wiki","Living Index",n(e("wikiPageWithSummaryCount",100),e("linkedWikiPageCount",100)),"Maintain 100 wiki pages with summaries and linked entities.","Pages now carry shape, summary, and relationships."),a("wiki","Black Library",n(e("wikiPageCount",500),e("wikiLinkCount",300)),"Create 500 wiki pages and 300 wiki links.","The great hard knowledge trophy."),a("wiki","Obsidian Index",n(e("wikiPageWithSummaryCount",250),e("wikiLinkCount",500)),"Maintain 250 summarized pages and 500 links.","The archive is no longer just big; it is navigable."),a("wiki","Graph Lantern",e("knowledgeGraphNodeCount",500),"Reach 500 Knowledge Graph nodes.","The graph has enough stars to navigate by."),a("wiki","Entity Weaver",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","Your memory connects to the operating system."),a("wiki","Codex Temper",n(e("wikiPageCount",750),e("wikiLinkCount",750)),"Create 750 wiki pages and 750 wiki links.","A codex tempered by breadth and connection."),a("wiki","Note Furnace",e("noteCount",500),"Create 500 notes.","Raw notes became a real furnace of evidence."),a("wiki","Archive Cartographer",n(e("wikiPageWithSummaryCount",400),e("linkedWikiPageCount",300)),"Maintain 400 summarized pages and 300 linked pages.","You mapped the archive enough that it can map you back."),a("wiki","The Shelf Breathes",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","The knowledge system feels alive at a glance."),a("wiki","Librarian of Coals",n(e("noteCount",1e3),e("wikiLinkCount",1e3)),"Create 1,000 notes and 1,000 wiki links.","A trophy for the long, quiet archive discipline."),a("wiki","Living Codex",n(e("wikiPageCount",1500),e("wikiPageWithSummaryCount",750),e("wikiLinkCount",1500)),"Create 1,500 pages, 750 summarized pages, and 1,500 links.","The living memory crown."),a("wiki","Memory Starfield",e("knowledgeGraphNodeCount",2e3),"Reach 2,000 Knowledge Graph nodes.","The graph becomes a sky.")],Oe=[o("wiki","Quiet Library Shelf","trophy_shelf",e("wikiPageCount",150),"Create 150 wiki pages.","A quiet library shelf skin.",{trophyShelf:"quiet-library"}),o("wiki","Rune Page Frame","icon_frame",e("wikiLinkCount",150),"Create 150 wiki links.","A runic frame for knowledge trophies.",{iconFrame:"rune-page"}),o("wiki","Scholar Glass HUD","hud_treatment",e("wikiPageWithSummaryCount",100),"Maintain 100 summarized wiki pages.","A glassy scholar HUD treatment.",{hudTreatment:"scholar-glass"}),o("wiki","Archive Sparks","celebration_variant",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","A page-flare reveal variant.",{celebrationVariant:"archive-sparks"}),o("wiki","Astral Archive Shelf","trophy_shelf",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","A cosmic trophy shelf for memory work.",{trophyShelf:"astral-archive"}),o("wiki","Reading Smith Pose","mascot_pose",e("wikiPageWithSummaryCount",250),"Maintain 250 summarized wiki pages.","Unlocks the Forge Smith reading pose.",{mascotPose:"reading"})],De=[a("psyche","Named Spark",e("psycheValueCount",5),"Create 5 Psyche values.","You named the values the forge should obey."),a("psyche","Pattern Tongs",e("behaviorPatternCount",5),"Create 5 behavior patterns.","The recurring loops are now held with tongs."),a("psyche","Belief Crucible",e("beliefEntryCount",5),"Create 5 belief entries.","Beliefs entered the fire where they can be worked."),a("psyche","Mode Lantern",e("modeProfileCount",3),"Create 3 mode profiles.","The inner cast has names and lantern light."),a("psyche","Trigger Witness",e("triggerReportCount",3),"Create 3 trigger reports.","You turned moments of activation into evidence."),a("psyche","Mode Cartographer",n(e("modeProfileCount",8),e("linkedModeProfileCount",8)),"Create 8 mode profiles, each linked to a value, behavior, or pattern.","A map of modes, not a pile of labels."),a("psyche","Trigger Alchemist",n(e("triggerReportRichCount",30),e("triggerReportCompletedCount",20)),"Complete 30 rich trigger reports and mark 20 reports beyond draft.","Activation was turned into material for change."),a("psyche","Pattern Breaker",n(e("behaviorPatternCount",20),e("behaviorPatternWithReplacementCount",10)),"Create 20 patterns and link 10 to replacement responses.","The old loops now have counter-moves."),a("psyche","Belief Temperer",n(e("beliefEntryCount",25),e("beliefFlexibleAlternativeCount",25)),"Create 25 beliefs with flexible alternatives.","Rigid beliefs were heated until they could bend."),a("psyche","Value Blade",n(e("psycheValueCount",10),e("goalLinkedTaskCompletionCount",100)),"Create 10 values and complete 100 goal-linked tasks.","Values and work started cutting in the same direction."),a("psyche","Shadow Temper",n(e("modeProfileCount",12),e("triggerReportRichCount",50)),"Create 12 modes and 50 rich trigger reports.","Shadow material became usable steel."),a("psyche","Inner Forge",n(e("psycheValueCount",12),e("behaviorPatternCount",25),e("beliefFlexibleAlternativeCount",30)),"Create 12 values, 25 patterns, and 30 flexible beliefs.","A full inner forge takes shape."),a("psyche","Schema Bell",e("questionnaireRunCount",40),"Complete 40 questionnaire runs.","Structured self-observation rang the bell repeatedly."),a("psyche","Mode Guide",e("modeGuideSessionCount",5),"Complete 5 mode guide sessions.","Guided mode work became an actual practice."),a("psyche","Repair Script",e("behaviorCount",10),"Create 10 Psyche behaviors.","Behaviors now carry repair plans, not just names."),a("psyche","Flexible Self",e("beliefFlexibleAlternativeCount",50),"Create 50 beliefs with flexible alternatives.","A trophy for not letting old beliefs remain iron cages."),a("psyche","Trigger Cartography",e("triggerReportRichCount",100),"Create 100 rich trigger reports.","The map of activation became detailed enough to steer by."),a("psyche","The Inner Council",n(e("modeProfileCount",20),e("behaviorCount",20),e("beliefFlexibleAlternativeCount",75)),"Create 20 modes, 20 behaviors, and 75 flexible beliefs.","The inner system became a council instead of noise.")],He=[o("psyche","Scholar Smith","mascot_skin",e("psycheValueCount",7),"Create 7 Psyche values.","A wise, bookish Forge Smith skin.",{mascotSkin:"scholar-smith"}),o("psyche","Wise Smith Pose","mascot_pose",e("modeProfileCount",3),"Create 3 mode profiles.","Unlocks the wise mentor pose.",{mascotPose:"wise"}),o("psyche","Reflection Frame","icon_frame",e("beliefEntryCount",10),"Create 10 belief entries.","A reflective frame for Psyche trophies.",{iconFrame:"reflection"}),o("psyche","Mode Lens HUD","hud_treatment",e("modeProfileCount",8),"Create 8 mode profiles.","A HUD tuned to Psyche work.",{hudTreatment:"mode-lens"}),o("psyche","Shadow Smith","mascot_skin",e("triggerReportRichCount",25),"Create 25 rich trigger reports.","A darker Smith skin for shadow work.",{mascotSkin:"shadow-smith"}),o("psyche","Arcane Metallurgist","mascot_skin",e("beliefFlexibleAlternativeCount",25),"Create 25 beliefs with flexible alternatives.","A rune-lit Smith skin for deep reflection.",{mascotSkin:"arcane-metallurgist"}),o("psyche","Inner-Fire Halo","streak_effect",e("psycheValueCount",10),"Create 10 Psyche values.","A halo-like flame for reflective momentum.",{streakEffect:"inner-fire-halo"}),o("psyche","Mode Lantern Reveal","celebration_variant",e("modeProfileCount",12),"Create 12 mode profiles.","A lantern reveal for Psyche unlocks.",{celebrationVariant:"mode-lantern"}),o("psyche","Therapist's Shelf","trophy_shelf",e("triggerReportRichCount",50),"Create 50 rich trigger reports.","A quiet shelf for inner-work trophies.",{trophyShelf:"therapist-shelf"}),o("psyche","Prismatic Crucible","celebration_variant",e("beliefFlexibleAlternativeCount",50),"Create 50 flexible belief alternatives.","A prismatic reveal for belief work.",{celebrationVariant:"prismatic-crucible"})],ze=[a("habits","Ritual Spark",e("habitAlignedCount",25),"Record 25 aligned habit check-ins.","Your recurring commitments have started to leave marks."),a("habits","Routine Rivet",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","The habit rail is no longer decorative."),a("habits","Habit Heat",n(e("habitAlignedCount",150),e("habitStreakMax",14)),"Record 150 aligned check-ins and a 14-day habit streak.","One behavior got hot enough to shape you."),a("habits","Ritual Iron",e("habitAlignedCount",365),"Record 365 aligned habit check-ins.","The hard habit trophy."),a("habits","Recovery Shield",e("recoveryEventCount",50),"Earn 50 recovery rewards.","Recovery was treated as part of the work."),a("habits","Life-Force Alloy",e("lifeForceSnapshotCount",100),"Record 100 Life Force day snapshots.","Energy accounting became a usable alloy."),a("habits","Sleep Temper",e("healthSleepSessionCount",120),"Import 120 sleep sessions.","Sleep became evidence, not a guess."),a("habits","Vitality Forge",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","Body data and execution entered the same forge.")],Be=[o("habits","Recovery Blue Flame","streak_effect",e("recoveryEventCount",20),"Earn 20 recovery rewards.","A cooler recovery flame.",{streakEffect:"recovery-blue"}),o("habits","Ritual Check Glow","hud_treatment",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","A habit-check glow for the HUD.",{hudTreatment:"ritual-check"}),o("habits","Storm Forger","mascot_skin",e("workoutSessionCount",50),"Import 50 workouts.","A storm-lit Smith skin for movement arcs.",{mascotSkin:"storm-forger"}),o("habits","Clockwork Smith","mascot_skin",e("habitAlignedCount",150),"Record 150 aligned habit check-ins.","A clockwork skin for ritual precision.",{mascotSkin:"clockwork-smith"}),o("habits","Vital Flame","streak_effect",e("healthSleepSessionCount",90),"Import 90 sleep sessions.","A vital-sign flame around streak indicators.",{streakEffect:"vital-flame"}),o("habits","Life-Force Frame","icon_frame",e("lifeForceSnapshotCount",100),"Record 100 Life Force snapshots.","An AP-inspired frame for body trophies.",{iconFrame:"life-force"}),o("habits","Steady-State Aura","streak_effect",e("habitStreakMax",60),"Reach a 60-day habit streak.","An aura for long stable rituals.",{streakEffect:"steady-state"}),o("habits","Celestial Smith","mascot_skin",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","A celestial skin for body stewardship.",{mascotSkin:"celestial-smith"})],We=[a("agents","Companion Spark",e("agentActionCount",5),"Record 5 agent actions.","The first sign of a working human-agent council."),a("agents","Bot Bellows",e("agentCompletedActionCount",20),"Complete 20 agent actions.","Agents are not just present; they are moving work."),a("agents","Council Spark",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","The collaboration trophy for meaningful assisted work."),a("agents","Guild Forge",n(e("agentCompletedActionCount",100),e("collaborationRewardCount",100)),"Complete 100 agent actions and earn 100 collaboration rewards.","The Forge has become a small guild.")],Ue=[o("agents","Guild Badge Frame","icon_frame",e("agentCompletedActionCount",20),"Complete 20 agent actions.","A guild frame for agent trophies.",{iconFrame:"guild-badge"}),o("agents","Council Sparks Reveal","celebration_variant",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","A council-sparks reveal for collaboration.",{celebrationVariant:"council-sparks"})],Ye=[...Re,...Fe,...Ee,...Ie,...Me,...Ke,...$e,...Le,...Ge,...Oe,...De,...He,...ze,...Be,...We,...Ue];function Xe(){let r=0,l=0,u=0;const d=new Map;return Ye.map(i=>{const m=U.find(L=>L.id===i.category);if(!m)throw new Error(`Unknown gamification category ${i.category}`);const p=d.get(i.category)??{trophy:0,unlock:0},x=p[i.kind];p[i.kind]+=1,d.set(i.category,p);const R=i.kind==="trophy"?m.trophyCount:m.unlockCount,v=Te(x,R),F=`${i.kind}-${$(i.category)}-${$(i.title)}`,w=i.kind==="trophy"?l++:u++;return{id:F,kind:i.kind,category:i.category,tier:v,difficulty:_e(v),hidden:i.hidden??!1,title:i.title,summary:i.summary,requirement:i.requirement,requirementText:i.requirementText,reward:i.reward,unlockType:i.kind==="unlock"?i.unlockType??"icon_frame":null,rewardPayload:i.kind==="unlock"?i.rewardPayload??{}:{trophyId:F},assetKey:Pe(i),sheetKey:`${i.kind==="trophy"?"trophies":"unlocks"}-r${Math.floor(w/10)+1}-c${w%10+1}`,rarity:Ne(v),sortOrder:r++}})}const y=Xe();function qe(){if(y.length!==144)throw new Error(`GAMIFICATION_CATALOG must contain exactly 144 items; found ${y.length}.`);const r=y.filter(d=>d.kind==="trophy").length,l=y.filter(d=>d.kind==="unlock").length;if(r!==96||l!==48)throw new Error(`GAMIFICATION_CATALOG must contain 96 trophies and 48 unlocks; found ${r}/${l}.`);for(const d of U){const i=y.filter(p=>p.category===d.id&&p.kind==="trophy").length,m=y.filter(p=>p.category===d.id&&p.kind==="unlock").length;if(i!==d.trophyCount||m!==d.unlockCount)throw new Error(`${d.id} expected ${d.trophyCount}/${d.unlockCount}, found ${i}/${m}.`)}if(new Set(y.map(d=>d.assetKey)).size!==y.length)throw new Error("Every trophy and unlock must have a unique asset key.")}qe();const te=U.map(r=>({id:r.id,label:r.label})),Ve=Array.from({length:30},(r,l)=>`mascot-state-${String(l+1).padStart(3,"0")}`),Qe=je.map((r,l)=>[r,`mascot-state-${String(17+l).padStart(3,"0")}`]),Je=Ae.map((r,l)=>[r,`mascot-state-${String(10-l).padStart(3,"0")}`]),z=Ve;if(z.length!==30)throw new Error(`GAMIFICATION_MASCOT_KEYS must contain exactly 30 mascot/state keys; found ${z.length}.`);function Ze(r){switch(r.category){case"xp_levels":return"#f59e0b";case"streaks":return"#fb923c";case"tasks":return"#f97316";case"projects":return"#38bdf8";case"wiki":return"#a78bfa";case"psyche":return"#8b5cf6";case"habits":return"#4ade80";case"agents":return"#22d3ee";default:return"#f59e0b"}}function et(r){return["cinematic stylized blacksmith game icon",r.category.replace(/_/g," "),r.kind,r.title,"obsidian iron, ember gold, cool violet and cyan steel highlights, no text"].join(", ")}const tt=Object.fromEntries(y.map(r=>[r.assetKey,{key:r.assetKey,role:"item",itemKind:r.kind,alt:`${r.title} ${r.kind} icon.`,dominantColor:Ze(r),tierFrame:r.tier,sourcePath:`gamification/source/themes/dark-fantasy/items/${r.assetKey}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/items/${r.assetKey}-{size}.webp`,sheetKey:r.sheetKey,prompt:et(r)}])),at=Object.fromEntries(z.map(r=>{const l=Number(r.replace("mascot-state-","")),u=l<=10,d=l>=17;return[r,{key:r,role:d||u?"streak":"mascot",alt:u?"The Forge Smith in a safe cold-forge absence state.":"The Forge Smith mascot in a dramatic blacksmith game-art pose.",dominantColor:u?"#64748b":d?"#fb923c":"#38bdf8",tierFrame:"none",sourcePath:`gamification/source/themes/dark-fantasy/mascots/${r}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/mascots/${r}-{size}.webp`,sheetKey:null,prompt:"dramatic Forge Smith blacksmith mascot, premium game art, no text, no watermark"}]}));({...tt,...at});function T(r){r.currentTarget.hidden=!0}const rt=["all","bronze","silver","gold","platinum"],st=[{id:"trophies",label:"Trophies"},{id:"unlocks",label:"Unlocks"},{id:"armory",label:"Mascot Armory"},{id:"streak",label:"Streak Forge"}],B={mascot_skin:{field:"selectedMascotSkin",payloadKey:"mascotSkin",label:"Mascot skin"},hud_treatment:{field:"selectedHudTreatment",payloadKey:"hudTreatment",label:"HUD treatment"},streak_effect:{field:"selectedStreakEffect",payloadKey:"streakEffect",label:"Streak flame"},trophy_shelf:{field:"selectedTrophyShelf",payloadKey:"trophyShelf",label:"Trophy shelf"},celebration_variant:{field:"selectedCelebrationVariant",payloadKey:"celebrationVariant",label:"Celebration"}};function se(r){switch(r){case"platinum":return"border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] bg-[var(--ui-accent-soft)] text-[var(--primary)]";case"gold":return"border-[color-mix(in_srgb,var(--warning)_32%,var(--ui-border-subtle)_68%)] bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]";case"silver":return"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";default:return"border-[color-mix(in_srgb,var(--warning)_26%,var(--ui-border-subtle)_74%)] bg-[var(--ui-warning-soft)] text-[var(--warning)]"}}const ae="min-w-0 overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4",H="min-w-0 overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",C="text-[var(--ui-ink-strong)]",b="text-[var(--ui-ink-soft)]",_="text-[var(--ui-ink-faint)]",W="bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";function ot(r){const l=r.unlockType?B[r.unlockType]:null,u=l?r.rewardPayload[l.payloadKey]:null;return typeof u=="string"?u:null}function nt({item:r,gamificationTheme:l,onSelect:u}){return t.jsxs("button",{type:"button",onClick:()=>u(r),className:P("group relative min-h-[19rem] overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 text-left shadow-[var(--ui-shadow-soft)] transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] hover:bg-[var(--ui-surface-hover)]",!r.unlocked&&"opacity-78"),children:[t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsx(N,{className:P("border",se(r.tier)),children:r.tier}),t.jsx(N,{className:W,children:r.unlocked?"earned":"locked"})]}),t.jsx("div",{className:"mt-3 grid place-items-center",children:t.jsx("img",{src:A(r.assetKey,512,l),alt:"",onError:T,className:P("size-36 object-contain drop-shadow-[var(--ui-shadow-soft)] transition group-hover:scale-[1.03]",!r.unlocked&&"grayscale")})}),t.jsxs("div",{className:"mt-3 min-w-0",children:[t.jsx("div",{className:`font-display text-lg ${C}`,children:r.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:r.unlocked?r.summary:r.requirementText})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:r.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[r.progressCurrent,"/",r.progressTarget]}),t.jsxs("span",{children:[r.progressPercent,"%"]})]})]})]})}function gt(){var X,q,V,Q;const r=ke(),l=ge(),u=me(),d=fe(),i=Array.isArray(r.selectedUserIds)?r.selectedUserIds:[],[m,p]=S.useState("trophies"),[x,R]=S.useState("all"),[v,F]=S.useState("all"),[w,L]=S.useState("all"),[G,oe]=S.useState(""),[k,E]=S.useState(null),I=he({queryKey:["forge-gamification-catalog",...i],queryFn:()=>we(i)}),M=ye(i),Y=pe({mutationFn:s=>be(s,i),onSuccess:async()=>{await Promise.all([u.invalidateQueries({queryKey:["forge-gamification-catalog"]}),u.invalidateQueries({queryKey:["forge-xp-metrics"]})]),d(Ce.util.invalidateTags(["Gamification"]))}}),g=(X=I.data)==null?void 0:X.catalog,O=(g==null?void 0:g.items)??[],ne=S.useMemo(()=>{const s=G.trim().toLowerCase();return O.filter(c=>m==="trophies"&&c.kind!=="trophy"||m==="unlocks"&&c.kind!=="unlock"||(m==="armory"||m==="streak")&&c.kind!=="unlock"||m==="armory"&&!c.unlockType||m==="streak"&&c.unlockType!=="streak_effect"||x!=="all"&&c.category!==x||v!=="all"&&c.tier!==v||w==="unlocked"&&!c.unlocked||w==="locked"&&c.unlocked?!1:s?`${c.title} ${c.summary} ${c.requirementText} ${c.reward}`.toLowerCase().includes(s):!0)},[x,O,G,w,m,v]),h=(g==null?void 0:g.equipment)??((q=M.data)==null?void 0:q.metrics.equipment)??null,ie=O.filter(s=>s.kind==="unlock"&&s.unlockType&&B[s.unlockType]);return I.isError?t.jsx(ve,{eyebrow:"Rewards",error:I.error,onRetry:()=>void I.refetch()}):t.jsxs("div",{className:"mx-auto grid w-full max-w-[1320px] gap-5",children:[t.jsx(Se,{title:"Trophy Hall",description:"Achievements are earned from real Forge behavior: tasks, runs, goals, wiki links, Psyche work, habits, Life Force, health, and collaboration.",badge:g?`${g.unlockedCount}/${g.totalCount} earned`:"Loading",actions:(V=M.data)!=null&&V.metrics?t.jsx(xe,{metrics:M.data.metrics.profile}):null}),t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.42fr)]",children:[t.jsxs("div",{className:ae,children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(s=>t.jsxs(j,{type:"button",variant:m===s.id?"primary":"secondary",size:"sm",onClick:()=>p(s.id),children:[s.id==="trophies"?t.jsx(le,{className:"size-4"}):null,s.id==="armory"?t.jsx(ce,{className:"size-4"}):null,s.id==="streak"?t.jsx(J,{className:"size-4"}):null,s.id==="unlocks"?t.jsx(Z,{className:"size-4"}):null,s.label]},s.id))}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap items-center gap-2",children:[["all","unlocked","locked"].map(s=>t.jsxs(j,{type:"button",variant:w===s?"primary":"secondary",size:"sm",onClick:()=>L(s),children:[s==="locked"?t.jsx(ee,{className:"size-4"}):null,s]},s)),t.jsxs("label",{className:`ml-auto flex min-h-10 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 text-sm ${b} sm:min-w-[16rem]`,children:[t.jsx(de,{className:`size-4 shrink-0 ${_}`}),t.jsx("input",{value:G,onChange:s=>oe(s.target.value),placeholder:"Search rewards",className:"min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] outline-none placeholder:text-[var(--ui-ink-faint)]"})]})]}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:[t.jsx(j,{type:"button",variant:x==="all"?"primary":"secondary",size:"sm",onClick:()=>R("all"),children:"all categories"}),te.map(s=>t.jsx(j,{type:"button",variant:x===s.id?"primary":"secondary",size:"sm",onClick:()=>R(s.id),children:s.label},s.id))]}),t.jsx("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:rt.map(s=>t.jsx(j,{type:"button",variant:v===s?"primary":"secondary",size:"sm",onClick:()=>F(s),children:s},s))})]}),t.jsxs("div",{className:ae,children:[t.jsxs("div",{className:`flex items-center gap-2 text-sm font-semibold ${C}`,children:[t.jsx(Z,{className:"size-4 text-[var(--tertiary)]"}),"Near completion"]}),((g==null?void 0:g.nextTargets)??[]).map(s=>t.jsxs("button",{type:"button",onClick:()=>E(s),className:"grid min-w-0 grid-cols-[2.75rem_minmax(0,1fr)_3rem] items-center gap-3 rounded-2xl border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-2 text-left transition hover:bg-[var(--ui-surface-hover)]",children:[t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:"size-11 object-contain"}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block truncate text-sm ${C}`,children:s.title}),t.jsx("span",{className:`block truncate text-[11px] ${_}`,children:s.requirementText})]}),t.jsxs("span",{className:`text-right text-xs ${b}`,children:[s.progressPercent,"%"]})]},s.id))]})]}),m==="armory"?t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(18rem,0.42fr)_minmax(0,1fr)]",children:[t.jsxs("div",{className:"relative min-h-[24rem] overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 shadow-[var(--ui-shadow-soft)]",children:[t.jsx("img",{src:A(((Q=M.data)==null?void 0:Q.metrics.mascot.spriteKey)??"mascot-state-014",512,l),alt:"Forge Smith mascot",onError:T,className:"absolute inset-x-0 bottom-0 mx-auto h-[23rem] object-contain"}),t.jsxs("div",{className:"relative z-10",children:[t.jsx(N,{className:"bg-[var(--ui-accent-soft)] text-[var(--tertiary)]",children:"Equipped"}),t.jsxs("div",{className:`mt-3 grid gap-1 text-sm ${b}`,children:[t.jsxs("span",{children:["Skin: ",(h==null?void 0:h.selectedMascotSkin)??"default"]}),t.jsxs("span",{children:["HUD: ",(h==null?void 0:h.selectedHudTreatment)??"default"]}),t.jsxs("span",{children:["Flame: ",(h==null?void 0:h.selectedStreakEffect)??"default"]}),t.jsxs("span",{children:["Shelf: ",(h==null?void 0:h.selectedTrophyShelf)??"default"]})]})]})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(s=>{const c=s.unlockType?B[s.unlockType]:null,f=ot(s),K=!!(c&&f&&(h==null?void 0:h[c.field])===f);return t.jsxs(D,{className:P("p-4",!s.unlocked&&"opacity-70"),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx(N,{className:W,children:(c==null?void 0:c.label)??"Cosmetic"}),K?t.jsx(ue,{className:"size-4 text-[var(--success)]"}):null]}),t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:P("mx-auto mt-3 size-28 object-contain",!s.unlocked&&"grayscale")}),t.jsx("div",{className:`mt-3 font-display text-lg ${C}`,children:s.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:s.unlocked?s.summary:s.requirementText}),t.jsx(j,{type:"button",variant:K?"secondary":"primary",size:"sm",disabled:!s.unlocked||!c||!f||Y.isPending,className:"mt-4 w-full",onClick:()=>{!c||!f||Y.mutate({[c.field]:K?null:f})},children:K?"Unequip":s.unlocked?"Equip":"Locked"})]},s.id)})})]}):m==="streak"?t.jsxs("section",{className:"grid gap-4",children:[t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(J,{className:"size-5 text-[var(--tertiary)]"}),"Streak power states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Qe.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," day power"]})]},c))})]}),t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(ee,{className:`size-5 ${_}`}),"Absence pressure states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Je.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," days away"]})]},c))})]})]}):t.jsx("section",{className:"grid gap-5",children:te.map(s=>{const c=ne.filter(f=>f.category===s.id);return c.length===0?null:t.jsxs("section",{className:"grid gap-3",children:[t.jsx("div",{className:"flex items-end justify-between gap-3",children:t.jsxs("div",{children:[t.jsx("div",{className:`font-display text-xl ${C}`,children:s.label}),t.jsxs("div",{className:`text-sm ${_}`,children:[c.length," visible rewards"]})]})}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:c.map(f=>t.jsx(nt,{item:f,gamificationTheme:l,onSelect:E},f.id))})]},s.id)})}),k?t.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-[var(--ui-overlay)] p-4 backdrop-blur-sm",onClick:()=>E(null),children:t.jsxs("div",{className:"max-h-[calc(100vh-2rem)] w-full max-w-[34rem] overflow-y-auto rounded-[26px] border border-[var(--ui-border-subtle)] bg-[var(--card-gradient)] p-5 shadow-[var(--card-shadow)]",onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start",children:[t.jsx("img",{src:A(k.assetKey,512,l),alt:"",onError:T,className:"size-32 shrink-0 object-contain"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(N,{className:P("border",se(k.tier)),children:k.tier}),t.jsx(N,{className:W,children:k.kind})]}),t.jsx("div",{className:`mt-3 font-display text-2xl ${C}`,children:k.title}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.summary})]})]}),t.jsxs("div",{className:`mt-5 ${H}`,children:[t.jsx("div",{className:`text-sm font-semibold ${C}`,children:"Requirement"}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.requirementText}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:k.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[k.progressCurrent,"/",k.progressTarget]}),t.jsx("span",{children:k.unlocked?"earned":"locked"})]})]})]}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsx(j,{type:"button",variant:"secondary",onClick:()=>E(null),children:"Close"})})]})}):null]})}export{gt as RewardsPage};
|
|
1
|
+
import{r as S,j as t,aF as le,ds as ce,aI as J,aG as Z,dt as ee,b3 as de,bl as ue}from"./vendor-Dnkkx2co.js";import{j as me,i as he,k as pe}from"./state-vCcAT5Hq.js";import{u as ke,ey as ge,aI as fe,bE as ye,dq as Ce,ez as be,E as ve,a8 as xe,B as j,eA as A,c as N,C as D,Z as P,W as re,eB as we}from"./index-BP9__l6C.js";import{P as Se}from"./page-hero-DgnhI5es.js";import"./motion-Lt5B1XuE.js";import"./ui-C1iwpj2-.js";import"./forms-hB0SqEh-.js";import"./board-dIX6etHh.js";import"./graph-DDUZNRsO.js";const U=[{id:"xp_levels",label:"XP and level",trophyCount:8,unlockCount:4},{id:"streaks",label:"Streak and comeback",trophyCount:14,unlockCount:10},{id:"tasks",label:"Tasks and focus runs",trophyCount:14,unlockCount:4},{id:"projects",label:"Projects, goals, and strategy",trophyCount:14,unlockCount:4},{id:"wiki",label:"Wiki, notes, and knowledge graph",trophyCount:16,unlockCount:6},{id:"psyche",label:"Psyche",trophyCount:18,unlockCount:10},{id:"habits",label:"Habits, Life Force, and health",trophyCount:8,unlockCount:8},{id:"agents",label:"Agents and collaboration",trophyCount:4,unlockCount:2}],je=[1,2,3,5,7,14,21,30,45,60,90,180,365,730],Ae=[1,2,3,5,7,10,14,21,30,60];function e(r,l){return{metric:r,threshold:l}}function n(...r){return{allOf:r}}function $(r){return r.toLowerCase().replace(/['’]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Te(r,l){const u=(r+1)/l;return u>.82?"platinum":u>.55?"gold":u>.25?"silver":"bronze"}function _e(r){return r==="platinum"?"legendary":r==="gold"?"hard":r==="silver"?"standard":"intro"}function Ne(r){return r==="platinum"?"legendary":r==="gold"?"epic":r==="silver"?"rare":"common"}function Pe(r){return`item-${r.kind}-${$(r.category)}-${$(r.title)}`}function a(r,l,u,d,i,m){return{category:r,kind:"trophy",title:l,summary:i,requirement:u,requirementText:d,reward:`${l} trophy on the Forge shelf`}}function o(r,l,u,d,i,m,p){return{category:r,kind:"unlock",title:l,summary:m,requirement:d,requirementText:i,reward:`${l} cosmetic`,unlockType:u,rewardPayload:p}}const Re=[a("xp_levels","The First Heat",e("nonManualXp",5e3),"Earn 5,000 non-manual XP.","The first real furnace of work is hot enough to be noticed."),a("xp_levels","Bellows Graduate",e("nonManualXp",1e4),"Earn 10,000 non-manual XP.","Your reward ledger is no longer a spark; it is a system."),a("xp_levels","Iron Apprentice",e("nonManualXp",2e4),"Earn 20,000 non-manual XP.","You have repeated the work enough that the anvil knows your hand."),a("xp_levels","Steel Temper",e("nonManualXp",5e4),"Earn 50,000 non-manual XP.","Pressure has started to make the metal cleaner instead of louder."),a("xp_levels","Crown of Coals",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A visible crown for an invisible mountain of completed work."),a("xp_levels","Obsidian Master",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","The Forge Smith stops testing your seriousness and starts respecting it."),a("xp_levels","Star-Forge Adept",e("nonManualXp",5e5),"Earn 500,000 non-manual XP.","Your XP trail burns like a constellation across the operating system."),a("xp_levels","Mythic Smith",e("nonManualXp",1e6),"Earn 1,000,000 non-manual XP.","A ridiculous trophy for a ridiculous amount of lived execution.")],Fe=[o("xp_levels","Obsidian Smith","mascot_skin",e("nonManualXp",8e3),"Earn 8,000 non-manual XP.","A dramatic black-iron Forge Smith skin.",{mascotSkin:"obsidian-smith"}),o("xp_levels","Molten Progress Bar","hud_treatment",e("nonManualXp",25e3),"Earn 25,000 non-manual XP.","A bright molten XP fill for the level ring.",{hudTreatment:"molten-progress"}),o("xp_levels","Apex Level Frame","icon_frame",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A high-tier frame for level and trophy icons.",{iconFrame:"apex-level"}),o("xp_levels","Masterwork Glow","celebration_variant",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","A stronger forge-bell reveal for major unlocks.",{celebrationVariant:"masterwork-glow"})],Ee=[a("streaks","Spark Kept",e("longestStreakDays",1),"Play one qualifying day.","The first day is small, but the forge heard it."),a("streaks","Three-Day Furnace",e("longestStreakDays",3),"Reach a 3-day streak.","Three returns make the first shape of discipline."),a("streaks","Week-Fire",e("longestStreakDays",7),"Reach a 7-day streak.","Seven days changes the temperature of your life."),a("streaks","Twin-Week Bellows",e("longestStreakDays",14),"Reach a 14-day streak.","Two weeks of showing up makes the room expect you."),a("streaks","Cinder Discipline",e("longestStreakDays",21),"Reach a 21-day streak.","The fire is not accidental anymore."),a("streaks","Monthly Forge",e("longestStreakDays",30),"Reach a 30-day streak.","A full month of returns becomes a personal weather system."),a("streaks","Sixty-Day Flame",e("longestStreakDays",60),"Reach a 60-day streak.","The Smith grows stronger because you stopped disappearing."),a("streaks","Quarter-Anvil",e("longestStreakDays",90),"Reach a 90-day streak.","Ninety days is not motivation. It is architecture."),a("streaks","Half-Year Inferno",e("longestStreakDays",180),"Reach a 180-day streak.","The forge is now a season of your life."),a("streaks","Year of Steel",e("longestStreakDays",365),"Reach a 365-day streak.","A year of returns. The anvil has become a witness."),a("streaks","Comeback Hammer",e("comebackAfter7Count",1),"Return after 7+ missed days and complete a qualifying action.","You came back after the room went cold."),a("streaks","Repair Artist",e("comebackAfter7Count",3),"Complete 3 major comebacks.","Breaking the chain did not become breaking the story."),a("streaks","Rust Refuser",n(e("comebackAfter7Count",5),e("longestStreakDays",30)),"Complete 5 major comebacks and reach a 30-day streak.","You repeatedly turned absence into a new strike."),a("streaks","Relentless Return",n(e("comebackAfter7Count",8),e("longestStreakDays",90)),"Complete 8 major comebacks and reach a 90-day streak.","This trophy is for the part of you that keeps coming back.")],Ie=[o("streaks","Bronze Ember Flame","streak_effect",e("longestStreakDays",3),"Reach a 3-day streak.","A small ember around the streak HUD.",{streakEffect:"bronze-ember"}),o("streaks","Blue Forge-Fire","streak_effect",e("longestStreakDays",7),"Reach a 7-day streak.","A cool blue streak flame.",{streakEffect:"blue-forge-fire"}),o("streaks","Violet Arc Flame","streak_effect",e("longestStreakDays",21),"Reach a 21-day streak.","A sharper violet flame effect.",{streakEffect:"violet-arc"}),o("streaks","Molten Crown Fire","streak_effect",e("longestStreakDays",60),"Reach a 60-day streak.","A crown-like fire treatment for streaks.",{streakEffect:"molten-crown"}),o("streaks","Stern Pressure Pose","mascot_pose",e("comebackAfter7Count",1),"Complete a major comeback.","Unlocks the Smith's stern pressure pose.",{mascotPose:"stern-pressure"}),o("streaks","Comeback Pose","mascot_pose",e("comebackAfter7Count",2),"Complete 2 major comebacks.","Unlocks the Smith's comeback repair pose.",{mascotPose:"comeback"}),o("streaks","Awakening Forge Pose","mascot_pose",e("longestStreakDays",30),"Reach a 30-day streak.","Unlocks the forge awakening mascot pose.",{mascotPose:"awakening-forge"}),o("streaks","Yearfire Aura","streak_effect",e("longestStreakDays",365),"Reach a 365-day streak.","A huge aura for year-scale presence.",{streakEffect:"yearfire-aura"}),o("streaks","Old Foundry Shelf","trophy_shelf",e("longestStreakDays",90),"Reach a 90-day streak.","A warmer trophy shelf skin.",{trophyShelf:"old-foundry"}),o("streaks","Relentless Bell","celebration_variant",e("longestStreakDays",180),"Reach a 180-day streak.","A heavier celebration sound-and-spark treatment.",{celebrationVariant:"relentless-bell"})],Me=[a("tasks","First Strike",e("taskCompletionCount",25),"Complete 25 tasks.","A real task trail begins."),a("tasks","Clean Swing",n(e("taskCompletionCount",50),e("focusRunCount",10)),"Complete 50 tasks and 10 task runs.","Tasks and time-tracked execution start to converge."),a("tasks","Five Rivets",n(e("taskCompletionCount",75),e("taskCloseoutReportCount",5)),"Complete 75 tasks and 5 completion reports.","You are leaving proof behind, not just checkmarks."),a("tasks","Task Blade",n(e("taskCompletionCount",120),e("focusRunCount",25)),"Complete 120 tasks and 25 task runs.","A sharp blade forged out of repeated finishes."),a("tasks","Anvil Marathon",n(e("taskCompletionCount",300),e("focusRunCount",75)),"Complete 300 tasks and 75 task runs.","The long road achievement for serious execution."),a("tasks","Deep-Work Maul",e("creditedFocusMinutes",3e3),"Log 3,000 credited focus minutes.","The heavy hammer of deliberate time."),a("tasks","Planned Heat",e("plannedFocusRunCount",25),"Complete 25 planned task runs.","You planned the heat before striking the metal."),a("tasks","Closeout Scribe",e("taskCloseoutReportCount",25),"Write 25 task completion reports.","The Forge remembers what changed because you wrote it down."),a("tasks","Hundred-Hammer Road",e("taskCompletionCount",500),"Complete 500 tasks.","A road paved with finished work."),a("tasks","Timebox Knight",n(e("plannedFocusRunCount",75),e("creditedFocusMinutes",7500)),"Complete 75 planned runs and 7,500 focus minutes.","A trophy for time that obeyed the mission."),a("tasks","Backlog Breaker",e("taskCompletionCount",750),"Complete 750 tasks.","The backlog learned to fear your return."),a("tasks","Execution Monarch",n(e("taskCompletionCount",1e3),e("focusRunCount",200)),"Complete 1,000 tasks and 200 task runs.","A crown for turning vague intention into finished artifacts."),a("tasks","Forge Ledger Exact",e("taskCloseoutReportCount",100),"Write 100 task completion reports.","The most boring discipline becomes the most useful history."),a("tasks","The Hammer Does Not Blink",n(e("taskCompletionCount",1500),e("creditedFocusMinutes",15e3)),"Complete 1,500 tasks and 15,000 focus minutes.","For absurd consistency under real load.")],Ke=[o("tasks","Hammer Cursor","icon_frame",e("taskCompletionCount",75),"Complete 75 tasks.","A hammer-shaped action accent.",{iconFrame:"hammer-cursor"}),o("tasks","Focus Rail Glow","hud_treatment",e("focusRunCount",25),"Complete 25 task runs.","A task-run glow for compact HUDs.",{hudTreatment:"focus-rail-glow"}),o("tasks","Completion Burst","celebration_variant",e("taskCloseoutReportCount",25),"Write 25 completion reports.","A sharper task-completion burst.",{celebrationVariant:"completion-burst"}),o("tasks","Ember Knight","mascot_skin",e("taskCompletionCount",500),"Complete 500 tasks.","A molten-armored Forge Smith skin for execution mastery.",{mascotSkin:"ember-knight"})],$e=[a("projects","Aligned Spark",e("goalLinkedTaskCompletionCount",25),"Complete 25 goal-linked tasks.","Work starts pointing at something bigger."),a("projects","Goal Rivet",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",3)),"Complete 50 goal-linked tasks across 3 goals.","Several goals now have real rivets, not just titles."),a("projects","Strategist's Seal",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",5)),"Complete 50 goal-linked tasks across 5 goals.","A seal for strategy that survived contact with execution."),a("projects","Project Spine",n(e("projectLinkedTaskCompletionCount",100),e("activeProjectCount",5)),"Complete 100 project-linked tasks while maintaining 5 active projects.","The work has a spine across multiple initiatives."),a("projects","Strategy Weld",e("strategyCount",10),"Create 10 strategies.","You forged planning layers instead of improvising every day."),a("projects","Purpose Hammer",e("goalLinkedTaskCompletionCount",150),"Complete 150 goal-linked tasks.","The hammer keeps landing where your stated life points."),a("projects","Arc Builder",n(e("projectLinkedTaskCompletionCount",250),e("distinctGoalsWithCompletions",8)),"Complete 250 project-linked tasks across 8 goals.","Multiple arcs moved because you kept building."),a("projects","North-Star Foundry",n(e("goalLinkedTaskCompletionCount",300),e("strategyCount",20)),"Complete 300 goal-linked tasks and create 20 strategies.","The north star is no longer decorative."),a("projects","Project Finisher",e("projectCompletionCount",5),"Complete 5 projects.","Finished projects leave heavier evidence than active dreams."),a("projects","Life-Work Crown",n(e("projectCompletionCount",10),e("goalLinkedTaskCompletionCount",500)),"Complete 10 projects and 500 goal-linked tasks.","A crown for long arcs that actually closed."),a("projects","Portfolio Anvil",e("activeProjectCount",12),"Maintain 12 active projects.","A large operating portfolio, held without flattening."),a("projects","Tracer Bullet Guild",n(e("projectCompletionCount",15),e("strategyCount",35)),"Complete 15 projects and create 35 strategies.","Strategy and delivery joined hands repeatedly."),a("projects","Mountain Moved",e("goalLinkedTaskCompletionCount",1e3),"Complete 1,000 goal-linked tasks.","The trophy for moving a mountain one task at a time."),a("projects","The Work Had A Spine",n(e("projectCompletionCount",25),e("distinctGoalsWithCompletions",12)),"Complete 25 projects across 12 goals.","Your life map became execution history.")],Le=[o("projects","Goal Compass Frame","icon_frame",e("goalLinkedTaskCompletionCount",50),"Complete 50 goal-linked tasks.","A compass frame for aligned-work trophies.",{iconFrame:"goal-compass"}),o("projects","War-Room Iron Shelf","trophy_shelf",e("projectLinkedTaskCompletionCount",150),"Complete 150 project-linked tasks.","A darker tactical trophy shelf.",{trophyShelf:"war-room-iron"}),o("projects","North-Star HUD","hud_treatment",e("strategyCount",20),"Create 20 strategies.","A strategy-forward HUD treatment.",{hudTreatment:"north-star"}),o("projects","Foundry Compass Burst","celebration_variant",e("projectCompletionCount",10),"Complete 10 projects.","A compass-shaped major reveal.",{celebrationVariant:"foundry-compass"})],Ge=[a("wiki","First Inscription",e("wikiPageCount",50),"Create 50 wiki pages.","Knowledge has started to become an archive."),a("wiki","Memory Rivet",e("noteCount",100),"Create 100 notes.","The system remembers because you gave it material."),a("wiki","Archive Ember",n(e("wikiPageCount",150),e("wikiLinkCount",50)),"Create 150 wiki pages and 50 wiki links.","The archive starts connecting to itself."),a("wiki","Knowledge Anvil",n(e("wikiPageCount",250),e("wikiLinkCount",150)),"Create 250 wiki pages and 150 wiki links.","A serious anvil of memory and links."),a("wiki","Living Index",n(e("wikiPageWithSummaryCount",100),e("linkedWikiPageCount",100)),"Maintain 100 wiki pages with summaries and linked entities.","Pages now carry shape, summary, and relationships."),a("wiki","Black Library",n(e("wikiPageCount",500),e("wikiLinkCount",300)),"Create 500 wiki pages and 300 wiki links.","The great hard knowledge trophy."),a("wiki","Obsidian Index",n(e("wikiPageWithSummaryCount",250),e("wikiLinkCount",500)),"Maintain 250 summarized pages and 500 links.","The archive is no longer just big; it is navigable."),a("wiki","Graph Lantern",e("knowledgeGraphNodeCount",500),"Reach 500 Knowledge Graph nodes.","The graph has enough stars to navigate by."),a("wiki","Entity Weaver",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","Your memory connects to the operating system."),a("wiki","Codex Temper",n(e("wikiPageCount",750),e("wikiLinkCount",750)),"Create 750 wiki pages and 750 wiki links.","A codex tempered by breadth and connection."),a("wiki","Note Furnace",e("noteCount",500),"Create 500 notes.","Raw notes became a real furnace of evidence."),a("wiki","Archive Cartographer",n(e("wikiPageWithSummaryCount",400),e("linkedWikiPageCount",300)),"Maintain 400 summarized pages and 300 linked pages.","You mapped the archive enough that it can map you back."),a("wiki","The Shelf Breathes",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","The knowledge system feels alive at a glance."),a("wiki","Librarian of Coals",n(e("noteCount",1e3),e("wikiLinkCount",1e3)),"Create 1,000 notes and 1,000 wiki links.","A trophy for the long, quiet archive discipline."),a("wiki","Living Codex",n(e("wikiPageCount",1500),e("wikiPageWithSummaryCount",750),e("wikiLinkCount",1500)),"Create 1,500 pages, 750 summarized pages, and 1,500 links.","The living memory crown."),a("wiki","Memory Starfield",e("knowledgeGraphNodeCount",2e3),"Reach 2,000 Knowledge Graph nodes.","The graph becomes a sky.")],Oe=[o("wiki","Quiet Library Shelf","trophy_shelf",e("wikiPageCount",150),"Create 150 wiki pages.","A quiet library shelf skin.",{trophyShelf:"quiet-library"}),o("wiki","Rune Page Frame","icon_frame",e("wikiLinkCount",150),"Create 150 wiki links.","A runic frame for knowledge trophies.",{iconFrame:"rune-page"}),o("wiki","Scholar Glass HUD","hud_treatment",e("wikiPageWithSummaryCount",100),"Maintain 100 summarized wiki pages.","A glassy scholar HUD treatment.",{hudTreatment:"scholar-glass"}),o("wiki","Archive Sparks","celebration_variant",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","A page-flare reveal variant.",{celebrationVariant:"archive-sparks"}),o("wiki","Astral Archive Shelf","trophy_shelf",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","A cosmic trophy shelf for memory work.",{trophyShelf:"astral-archive"}),o("wiki","Reading Smith Pose","mascot_pose",e("wikiPageWithSummaryCount",250),"Maintain 250 summarized wiki pages.","Unlocks the Forge Smith reading pose.",{mascotPose:"reading"})],De=[a("psyche","Named Spark",e("psycheValueCount",5),"Create 5 Psyche values.","You named the values the forge should obey."),a("psyche","Pattern Tongs",e("behaviorPatternCount",5),"Create 5 behavior patterns.","The recurring loops are now held with tongs."),a("psyche","Belief Crucible",e("beliefEntryCount",5),"Create 5 belief entries.","Beliefs entered the fire where they can be worked."),a("psyche","Mode Lantern",e("modeProfileCount",3),"Create 3 mode profiles.","The inner cast has names and lantern light."),a("psyche","Trigger Witness",e("triggerReportCount",3),"Create 3 trigger reports.","You turned moments of activation into evidence."),a("psyche","Mode Cartographer",n(e("modeProfileCount",8),e("linkedModeProfileCount",8)),"Create 8 mode profiles, each linked to a value, behavior, or pattern.","A map of modes, not a pile of labels."),a("psyche","Trigger Alchemist",n(e("triggerReportRichCount",30),e("triggerReportCompletedCount",20)),"Complete 30 rich trigger reports and mark 20 reports beyond draft.","Activation was turned into material for change."),a("psyche","Pattern Breaker",n(e("behaviorPatternCount",20),e("behaviorPatternWithReplacementCount",10)),"Create 20 patterns and link 10 to replacement responses.","The old loops now have counter-moves."),a("psyche","Belief Temperer",n(e("beliefEntryCount",25),e("beliefFlexibleAlternativeCount",25)),"Create 25 beliefs with flexible alternatives.","Rigid beliefs were heated until they could bend."),a("psyche","Value Blade",n(e("psycheValueCount",10),e("goalLinkedTaskCompletionCount",100)),"Create 10 values and complete 100 goal-linked tasks.","Values and work started cutting in the same direction."),a("psyche","Shadow Temper",n(e("modeProfileCount",12),e("triggerReportRichCount",50)),"Create 12 modes and 50 rich trigger reports.","Shadow material became usable steel."),a("psyche","Inner Forge",n(e("psycheValueCount",12),e("behaviorPatternCount",25),e("beliefFlexibleAlternativeCount",30)),"Create 12 values, 25 patterns, and 30 flexible beliefs.","A full inner forge takes shape."),a("psyche","Schema Bell",e("questionnaireRunCount",40),"Complete 40 questionnaire runs.","Structured self-observation rang the bell repeatedly."),a("psyche","Mode Guide",e("modeGuideSessionCount",5),"Complete 5 mode guide sessions.","Guided mode work became an actual practice."),a("psyche","Repair Script",e("behaviorCount",10),"Create 10 Psyche behaviors.","Behaviors now carry repair plans, not just names."),a("psyche","Flexible Self",e("beliefFlexibleAlternativeCount",50),"Create 50 beliefs with flexible alternatives.","A trophy for not letting old beliefs remain iron cages."),a("psyche","Trigger Cartography",e("triggerReportRichCount",100),"Create 100 rich trigger reports.","The map of activation became detailed enough to steer by."),a("psyche","The Inner Council",n(e("modeProfileCount",20),e("behaviorCount",20),e("beliefFlexibleAlternativeCount",75)),"Create 20 modes, 20 behaviors, and 75 flexible beliefs.","The inner system became a council instead of noise.")],He=[o("psyche","Scholar Smith","mascot_skin",e("psycheValueCount",7),"Create 7 Psyche values.","A wise, bookish Forge Smith skin.",{mascotSkin:"scholar-smith"}),o("psyche","Wise Smith Pose","mascot_pose",e("modeProfileCount",3),"Create 3 mode profiles.","Unlocks the wise mentor pose.",{mascotPose:"wise"}),o("psyche","Reflection Frame","icon_frame",e("beliefEntryCount",10),"Create 10 belief entries.","A reflective frame for Psyche trophies.",{iconFrame:"reflection"}),o("psyche","Mode Lens HUD","hud_treatment",e("modeProfileCount",8),"Create 8 mode profiles.","A HUD tuned to Psyche work.",{hudTreatment:"mode-lens"}),o("psyche","Shadow Smith","mascot_skin",e("triggerReportRichCount",25),"Create 25 rich trigger reports.","A darker Smith skin for shadow work.",{mascotSkin:"shadow-smith"}),o("psyche","Arcane Metallurgist","mascot_skin",e("beliefFlexibleAlternativeCount",25),"Create 25 beliefs with flexible alternatives.","A rune-lit Smith skin for deep reflection.",{mascotSkin:"arcane-metallurgist"}),o("psyche","Inner-Fire Halo","streak_effect",e("psycheValueCount",10),"Create 10 Psyche values.","A halo-like flame for reflective momentum.",{streakEffect:"inner-fire-halo"}),o("psyche","Mode Lantern Reveal","celebration_variant",e("modeProfileCount",12),"Create 12 mode profiles.","A lantern reveal for Psyche unlocks.",{celebrationVariant:"mode-lantern"}),o("psyche","Therapist's Shelf","trophy_shelf",e("triggerReportRichCount",50),"Create 50 rich trigger reports.","A quiet shelf for inner-work trophies.",{trophyShelf:"therapist-shelf"}),o("psyche","Prismatic Crucible","celebration_variant",e("beliefFlexibleAlternativeCount",50),"Create 50 flexible belief alternatives.","A prismatic reveal for belief work.",{celebrationVariant:"prismatic-crucible"})],ze=[a("habits","Ritual Spark",e("habitAlignedCount",25),"Record 25 aligned habit check-ins.","Your recurring commitments have started to leave marks."),a("habits","Routine Rivet",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","The habit rail is no longer decorative."),a("habits","Habit Heat",n(e("habitAlignedCount",150),e("habitStreakMax",14)),"Record 150 aligned check-ins and a 14-day habit streak.","One behavior got hot enough to shape you."),a("habits","Ritual Iron",e("habitAlignedCount",365),"Record 365 aligned habit check-ins.","The hard habit trophy."),a("habits","Recovery Shield",e("recoveryEventCount",50),"Earn 50 recovery rewards.","Recovery was treated as part of the work."),a("habits","Life-Force Alloy",e("lifeForceSnapshotCount",100),"Record 100 Life Force day snapshots.","Energy accounting became a usable alloy."),a("habits","Sleep Temper",e("healthSleepSessionCount",120),"Import 120 sleep sessions.","Sleep became evidence, not a guess."),a("habits","Vitality Forge",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","Body data and execution entered the same forge.")],Be=[o("habits","Recovery Blue Flame","streak_effect",e("recoveryEventCount",20),"Earn 20 recovery rewards.","A cooler recovery flame.",{streakEffect:"recovery-blue"}),o("habits","Ritual Check Glow","hud_treatment",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","A habit-check glow for the HUD.",{hudTreatment:"ritual-check"}),o("habits","Storm Forger","mascot_skin",e("workoutSessionCount",50),"Import 50 workouts.","A storm-lit Smith skin for movement arcs.",{mascotSkin:"storm-forger"}),o("habits","Clockwork Smith","mascot_skin",e("habitAlignedCount",150),"Record 150 aligned habit check-ins.","A clockwork skin for ritual precision.",{mascotSkin:"clockwork-smith"}),o("habits","Vital Flame","streak_effect",e("healthSleepSessionCount",90),"Import 90 sleep sessions.","A vital-sign flame around streak indicators.",{streakEffect:"vital-flame"}),o("habits","Life-Force Frame","icon_frame",e("lifeForceSnapshotCount",100),"Record 100 Life Force snapshots.","An AP-inspired frame for body trophies.",{iconFrame:"life-force"}),o("habits","Steady-State Aura","streak_effect",e("habitStreakMax",60),"Reach a 60-day habit streak.","An aura for long stable rituals.",{streakEffect:"steady-state"}),o("habits","Celestial Smith","mascot_skin",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","A celestial skin for body stewardship.",{mascotSkin:"celestial-smith"})],We=[a("agents","Companion Spark",e("agentActionCount",5),"Record 5 agent actions.","The first sign of a working human-agent council."),a("agents","Bot Bellows",e("agentCompletedActionCount",20),"Complete 20 agent actions.","Agents are not just present; they are moving work."),a("agents","Council Spark",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","The collaboration trophy for meaningful assisted work."),a("agents","Guild Forge",n(e("agentCompletedActionCount",100),e("collaborationRewardCount",100)),"Complete 100 agent actions and earn 100 collaboration rewards.","The Forge has become a small guild.")],Ue=[o("agents","Guild Badge Frame","icon_frame",e("agentCompletedActionCount",20),"Complete 20 agent actions.","A guild frame for agent trophies.",{iconFrame:"guild-badge"}),o("agents","Council Sparks Reveal","celebration_variant",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","A council-sparks reveal for collaboration.",{celebrationVariant:"council-sparks"})],Ye=[...Re,...Fe,...Ee,...Ie,...Me,...Ke,...$e,...Le,...Ge,...Oe,...De,...He,...ze,...Be,...We,...Ue];function Xe(){let r=0,l=0,u=0;const d=new Map;return Ye.map(i=>{const m=U.find(L=>L.id===i.category);if(!m)throw new Error(`Unknown gamification category ${i.category}`);const p=d.get(i.category)??{trophy:0,unlock:0},x=p[i.kind];p[i.kind]+=1,d.set(i.category,p);const R=i.kind==="trophy"?m.trophyCount:m.unlockCount,v=Te(x,R),F=`${i.kind}-${$(i.category)}-${$(i.title)}`,w=i.kind==="trophy"?l++:u++;return{id:F,kind:i.kind,category:i.category,tier:v,difficulty:_e(v),hidden:i.hidden??!1,title:i.title,summary:i.summary,requirement:i.requirement,requirementText:i.requirementText,reward:i.reward,unlockType:i.kind==="unlock"?i.unlockType??"icon_frame":null,rewardPayload:i.kind==="unlock"?i.rewardPayload??{}:{trophyId:F},assetKey:Pe(i),sheetKey:`${i.kind==="trophy"?"trophies":"unlocks"}-r${Math.floor(w/10)+1}-c${w%10+1}`,rarity:Ne(v),sortOrder:r++}})}const y=Xe();function qe(){if(y.length!==144)throw new Error(`GAMIFICATION_CATALOG must contain exactly 144 items; found ${y.length}.`);const r=y.filter(d=>d.kind==="trophy").length,l=y.filter(d=>d.kind==="unlock").length;if(r!==96||l!==48)throw new Error(`GAMIFICATION_CATALOG must contain 96 trophies and 48 unlocks; found ${r}/${l}.`);for(const d of U){const i=y.filter(p=>p.category===d.id&&p.kind==="trophy").length,m=y.filter(p=>p.category===d.id&&p.kind==="unlock").length;if(i!==d.trophyCount||m!==d.unlockCount)throw new Error(`${d.id} expected ${d.trophyCount}/${d.unlockCount}, found ${i}/${m}.`)}if(new Set(y.map(d=>d.assetKey)).size!==y.length)throw new Error("Every trophy and unlock must have a unique asset key.")}qe();const te=U.map(r=>({id:r.id,label:r.label})),Ve=Array.from({length:30},(r,l)=>`mascot-state-${String(l+1).padStart(3,"0")}`),Qe=je.map((r,l)=>[r,`mascot-state-${String(17+l).padStart(3,"0")}`]),Je=Ae.map((r,l)=>[r,`mascot-state-${String(10-l).padStart(3,"0")}`]),z=Ve;if(z.length!==30)throw new Error(`GAMIFICATION_MASCOT_KEYS must contain exactly 30 mascot/state keys; found ${z.length}.`);function Ze(r){switch(r.category){case"xp_levels":return"#f59e0b";case"streaks":return"#fb923c";case"tasks":return"#f97316";case"projects":return"#38bdf8";case"wiki":return"#a78bfa";case"psyche":return"#8b5cf6";case"habits":return"#4ade80";case"agents":return"#22d3ee";default:return"#f59e0b"}}function et(r){return["cinematic stylized blacksmith game icon",r.category.replace(/_/g," "),r.kind,r.title,"obsidian iron, ember gold, cool violet and cyan steel highlights, no text"].join(", ")}const tt=Object.fromEntries(y.map(r=>[r.assetKey,{key:r.assetKey,role:"item",itemKind:r.kind,alt:`${r.title} ${r.kind} icon.`,dominantColor:Ze(r),tierFrame:r.tier,sourcePath:`gamification/source/themes/dark-fantasy/items/${r.assetKey}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/items/${r.assetKey}-{size}.webp`,sheetKey:r.sheetKey,prompt:et(r)}])),at=Object.fromEntries(z.map(r=>{const l=Number(r.replace("mascot-state-","")),u=l<=10,d=l>=17;return[r,{key:r,role:d||u?"streak":"mascot",alt:u?"The Forge Smith in a safe cold-forge absence state.":"The Forge Smith mascot in a dramatic blacksmith game-art pose.",dominantColor:u?"#64748b":d?"#fb923c":"#38bdf8",tierFrame:"none",sourcePath:`gamification/source/themes/dark-fantasy/mascots/${r}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/mascots/${r}-{size}.webp`,sheetKey:null,prompt:"dramatic Forge Smith blacksmith mascot, premium game art, no text, no watermark"}]}));({...tt,...at});function T(r){r.currentTarget.hidden=!0}const rt=["all","bronze","silver","gold","platinum"],st=[{id:"trophies",label:"Trophies"},{id:"unlocks",label:"Unlocks"},{id:"armory",label:"Mascot Armory"},{id:"streak",label:"Streak Forge"}],B={mascot_skin:{field:"selectedMascotSkin",payloadKey:"mascotSkin",label:"Mascot skin"},hud_treatment:{field:"selectedHudTreatment",payloadKey:"hudTreatment",label:"HUD treatment"},streak_effect:{field:"selectedStreakEffect",payloadKey:"streakEffect",label:"Streak flame"},trophy_shelf:{field:"selectedTrophyShelf",payloadKey:"trophyShelf",label:"Trophy shelf"},celebration_variant:{field:"selectedCelebrationVariant",payloadKey:"celebrationVariant",label:"Celebration"}};function se(r){switch(r){case"platinum":return"border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] bg-[var(--ui-accent-soft)] text-[var(--primary)]";case"gold":return"border-[color-mix(in_srgb,var(--warning)_32%,var(--ui-border-subtle)_68%)] bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]";case"silver":return"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";default:return"border-[color-mix(in_srgb,var(--warning)_26%,var(--ui-border-subtle)_74%)] bg-[var(--ui-warning-soft)] text-[var(--warning)]"}}const ae="min-w-0 overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4",H="min-w-0 overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",C="text-[var(--ui-ink-strong)]",b="text-[var(--ui-ink-soft)]",_="text-[var(--ui-ink-faint)]",W="bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";function ot(r){const l=r.unlockType?B[r.unlockType]:null,u=l?r.rewardPayload[l.payloadKey]:null;return typeof u=="string"?u:null}function nt({item:r,gamificationTheme:l,onSelect:u}){return t.jsxs("button",{type:"button",onClick:()=>u(r),className:P("group relative min-h-[19rem] overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 text-left shadow-[var(--ui-shadow-soft)] transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] hover:bg-[var(--ui-surface-hover)]",!r.unlocked&&"opacity-78"),children:[t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsx(N,{className:P("border",se(r.tier)),children:r.tier}),t.jsx(N,{className:W,children:r.unlocked?"earned":"locked"})]}),t.jsx("div",{className:"mt-3 grid place-items-center",children:t.jsx("img",{src:A(r.assetKey,512,l),alt:"",onError:T,className:P("size-36 object-contain drop-shadow-[var(--ui-shadow-soft)] transition group-hover:scale-[1.03]",!r.unlocked&&"grayscale")})}),t.jsxs("div",{className:"mt-3 min-w-0",children:[t.jsx("div",{className:`font-display text-lg ${C}`,children:r.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:r.unlocked?r.summary:r.requirementText})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:r.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[r.progressCurrent,"/",r.progressTarget]}),t.jsxs("span",{children:[r.progressPercent,"%"]})]})]})]})}function gt(){var X,q,V,Q;const r=ke(),l=ge(),u=me(),d=fe(),i=Array.isArray(r.selectedUserIds)?r.selectedUserIds:[],[m,p]=S.useState("trophies"),[x,R]=S.useState("all"),[v,F]=S.useState("all"),[w,L]=S.useState("all"),[G,oe]=S.useState(""),[k,E]=S.useState(null),I=he({queryKey:["forge-gamification-catalog",...i],queryFn:()=>we(i)}),M=ye(i),Y=pe({mutationFn:s=>be(s,i),onSuccess:async()=>{await Promise.all([u.invalidateQueries({queryKey:["forge-gamification-catalog"]}),u.invalidateQueries({queryKey:["forge-xp-metrics"]})]),d(Ce.util.invalidateTags(["Gamification"]))}}),g=(X=I.data)==null?void 0:X.catalog,O=(g==null?void 0:g.items)??[],ne=S.useMemo(()=>{const s=G.trim().toLowerCase();return O.filter(c=>m==="trophies"&&c.kind!=="trophy"||m==="unlocks"&&c.kind!=="unlock"||(m==="armory"||m==="streak")&&c.kind!=="unlock"||m==="armory"&&!c.unlockType||m==="streak"&&c.unlockType!=="streak_effect"||x!=="all"&&c.category!==x||v!=="all"&&c.tier!==v||w==="unlocked"&&!c.unlocked||w==="locked"&&c.unlocked?!1:s?`${c.title} ${c.summary} ${c.requirementText} ${c.reward}`.toLowerCase().includes(s):!0)},[x,O,G,w,m,v]),h=(g==null?void 0:g.equipment)??((q=M.data)==null?void 0:q.metrics.equipment)??null,ie=O.filter(s=>s.kind==="unlock"&&s.unlockType&&B[s.unlockType]);return I.isError?t.jsx(ve,{eyebrow:"Rewards",error:I.error,onRetry:()=>void I.refetch()}):t.jsxs("div",{className:"mx-auto grid w-full max-w-[1320px] gap-5",children:[t.jsx(Se,{title:"Trophy Hall",description:"Achievements are earned from real Forge behavior: tasks, runs, goals, wiki links, Psyche work, habits, Life Force, health, and collaboration.",badge:g?`${g.unlockedCount}/${g.totalCount} earned`:"Loading",actions:(V=M.data)!=null&&V.metrics?t.jsx(xe,{metrics:M.data.metrics.profile}):null}),t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.42fr)]",children:[t.jsxs("div",{className:ae,children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(s=>t.jsxs(j,{type:"button",variant:m===s.id?"primary":"secondary",size:"sm",onClick:()=>p(s.id),children:[s.id==="trophies"?t.jsx(le,{className:"size-4"}):null,s.id==="armory"?t.jsx(ce,{className:"size-4"}):null,s.id==="streak"?t.jsx(J,{className:"size-4"}):null,s.id==="unlocks"?t.jsx(Z,{className:"size-4"}):null,s.label]},s.id))}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap items-center gap-2",children:[["all","unlocked","locked"].map(s=>t.jsxs(j,{type:"button",variant:w===s?"primary":"secondary",size:"sm",onClick:()=>L(s),children:[s==="locked"?t.jsx(ee,{className:"size-4"}):null,s]},s)),t.jsxs("label",{className:`ml-auto flex min-h-10 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 text-sm ${b} sm:min-w-[16rem]`,children:[t.jsx(de,{className:`size-4 shrink-0 ${_}`}),t.jsx("input",{value:G,onChange:s=>oe(s.target.value),placeholder:"Search rewards",className:"min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] outline-none placeholder:text-[var(--ui-ink-faint)]"})]})]}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:[t.jsx(j,{type:"button",variant:x==="all"?"primary":"secondary",size:"sm",onClick:()=>R("all"),children:"all categories"}),te.map(s=>t.jsx(j,{type:"button",variant:x===s.id?"primary":"secondary",size:"sm",onClick:()=>R(s.id),children:s.label},s.id))]}),t.jsx("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:rt.map(s=>t.jsx(j,{type:"button",variant:v===s?"primary":"secondary",size:"sm",onClick:()=>F(s),children:s},s))})]}),t.jsxs("div",{className:ae,children:[t.jsxs("div",{className:`flex items-center gap-2 text-sm font-semibold ${C}`,children:[t.jsx(Z,{className:"size-4 text-[var(--tertiary)]"}),"Near completion"]}),((g==null?void 0:g.nextTargets)??[]).map(s=>t.jsxs("button",{type:"button",onClick:()=>E(s),className:"grid min-w-0 grid-cols-[2.75rem_minmax(0,1fr)_3rem] items-center gap-3 rounded-2xl border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-2 text-left transition hover:bg-[var(--ui-surface-hover)]",children:[t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:"size-11 object-contain"}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block truncate text-sm ${C}`,children:s.title}),t.jsx("span",{className:`block truncate text-[11px] ${_}`,children:s.requirementText})]}),t.jsxs("span",{className:`text-right text-xs ${b}`,children:[s.progressPercent,"%"]})]},s.id))]})]}),m==="armory"?t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(18rem,0.42fr)_minmax(0,1fr)]",children:[t.jsxs("div",{className:"relative min-h-[24rem] overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 shadow-[var(--ui-shadow-soft)]",children:[t.jsx("img",{src:A(((Q=M.data)==null?void 0:Q.metrics.mascot.spriteKey)??"mascot-state-014",512,l),alt:"Forge Smith mascot",onError:T,className:"absolute inset-x-0 bottom-0 mx-auto h-[23rem] object-contain"}),t.jsxs("div",{className:"relative z-10",children:[t.jsx(N,{className:"bg-[var(--ui-accent-soft)] text-[var(--tertiary)]",children:"Equipped"}),t.jsxs("div",{className:`mt-3 grid gap-1 text-sm ${b}`,children:[t.jsxs("span",{children:["Skin: ",(h==null?void 0:h.selectedMascotSkin)??"default"]}),t.jsxs("span",{children:["HUD: ",(h==null?void 0:h.selectedHudTreatment)??"default"]}),t.jsxs("span",{children:["Flame: ",(h==null?void 0:h.selectedStreakEffect)??"default"]}),t.jsxs("span",{children:["Shelf: ",(h==null?void 0:h.selectedTrophyShelf)??"default"]})]})]})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(s=>{const c=s.unlockType?B[s.unlockType]:null,f=ot(s),K=!!(c&&f&&(h==null?void 0:h[c.field])===f);return t.jsxs(D,{className:P("p-4",!s.unlocked&&"opacity-70"),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx(N,{className:W,children:(c==null?void 0:c.label)??"Cosmetic"}),K?t.jsx(ue,{className:"size-4 text-[var(--success)]"}):null]}),t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:P("mx-auto mt-3 size-28 object-contain",!s.unlocked&&"grayscale")}),t.jsx("div",{className:`mt-3 font-display text-lg ${C}`,children:s.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:s.unlocked?s.summary:s.requirementText}),t.jsx(j,{type:"button",variant:K?"secondary":"primary",size:"sm",disabled:!s.unlocked||!c||!f||Y.isPending,className:"mt-4 w-full",onClick:()=>{!c||!f||Y.mutate({[c.field]:K?null:f})},children:K?"Unequip":s.unlocked?"Equip":"Locked"})]},s.id)})})]}):m==="streak"?t.jsxs("section",{className:"grid gap-4",children:[t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(J,{className:"size-5 text-[var(--tertiary)]"}),"Streak power states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Qe.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," day power"]})]},c))})]}),t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(ee,{className:`size-5 ${_}`}),"Absence pressure states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Je.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," days away"]})]},c))})]})]}):t.jsx("section",{className:"grid gap-5",children:te.map(s=>{const c=ne.filter(f=>f.category===s.id);return c.length===0?null:t.jsxs("section",{className:"grid gap-3",children:[t.jsx("div",{className:"flex items-end justify-between gap-3",children:t.jsxs("div",{children:[t.jsx("div",{className:`font-display text-xl ${C}`,children:s.label}),t.jsxs("div",{className:`text-sm ${_}`,children:[c.length," visible rewards"]})]})}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:c.map(f=>t.jsx(nt,{item:f,gamificationTheme:l,onSelect:E},f.id))})]},s.id)})}),k?t.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-[var(--ui-overlay)] p-4 backdrop-blur-sm",onClick:()=>E(null),children:t.jsxs("div",{className:"max-h-[calc(100vh-2rem)] w-full max-w-[34rem] overflow-y-auto rounded-[26px] border border-[var(--ui-border-subtle)] bg-[var(--card-gradient)] p-5 shadow-[var(--card-shadow)]",onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start",children:[t.jsx("img",{src:A(k.assetKey,512,l),alt:"",onError:T,className:"size-32 shrink-0 object-contain"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(N,{className:P("border",se(k.tier)),children:k.tier}),t.jsx(N,{className:W,children:k.kind})]}),t.jsx("div",{className:`mt-3 font-display text-2xl ${C}`,children:k.title}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.summary})]})]}),t.jsxs("div",{className:`mt-5 ${H}`,children:[t.jsx("div",{className:`text-sm font-semibold ${C}`,children:"Requirement"}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.requirementText}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:k.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[k.progressCurrent,"/",k.progressTarget]}),t.jsx("span",{children:k.unlocked?"earned":"locked"})]})]})]}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsx(j,{type:"button",variant:"secondary",onClick:()=>E(null),children:"Close"})})]})}):null]})}export{gt as RewardsPage};
|
package/dist/assets/{scheduling-rules-editor-DGgcBs1W.js → scheduling-rules-editor-BmGrjC9q.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./vendor-Dnkkx2co.js";import{C as J,I as c,B as z}from"./index-
|
|
1
|
+
import{r as l,j as e}from"./vendor-Dnkkx2co.js";import{C as J,I as c,B as z}from"./index-BP9__l6C.js";const F=[{value:"main_activity",label:"Main activity"},{value:"secondary_activity",label:"Secondary activity"},{value:"third_activity",label:"Third activity"},{value:"rest",label:"Rest"},{value:"holiday",label:"Holiday"},{value:"custom",label:"Custom"}],G=[{value:"busy",label:"Busy"},{value:"free",label:"Free"}],t={allowWorkBlockKinds:[],blockWorkBlockKinds:[],allowCalendarIds:[],blockCalendarIds:[],allowEventTypes:[],blockEventTypes:[],allowEventKeywords:[],blockEventKeywords:[],allowAvailability:[],blockAvailability:[]};function n(r){return r.join(", ")}function d(r){return r.split(",").map(v=>v.trim()).filter(Boolean)}function y({label:r,selected:v,onToggle:a,options:p}){return e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("div",{className:"flex min-w-0 flex-wrap gap-2",children:p.map(o=>{const b=v.includes(o.value);return e.jsx("button",{type:"button",onClick:()=>a(o.value),className:`rounded-full px-3 py-2 text-sm transition ${b?"bg-[var(--ui-accent-soft)] text-[var(--primary)] ring-1 ring-[color-mix(in_srgb,var(--primary)_24%,transparent)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"}`,children:o.label},o.value)})})]})}function Z({title:r,subtitle:v,initialRules:a,initialPlannedDurationSeconds:p,onSave:o,saveLabel:b="Save scheduling rules",allowPlannedDuration:w=!1}){const[k,A]=l.useState((a==null?void 0:a.allowWorkBlockKinds)??t.allowWorkBlockKinds),[g,T]=l.useState((a==null?void 0:a.blockWorkBlockKinds)??t.blockWorkBlockKinds),[i,S]=l.useState((a==null?void 0:a.allowAvailability)??t.allowAvailability),[x,I]=l.useState((a==null?void 0:a.blockAvailability)??t.blockAvailability),[h,W]=l.useState(n((a==null?void 0:a.allowCalendarIds)??t.allowCalendarIds)),[j,_]=l.useState(n((a==null?void 0:a.blockCalendarIds)??t.blockCalendarIds)),[f,M]=l.useState(n((a==null?void 0:a.allowEventTypes)??t.allowEventTypes)),[C,O]=l.useState(n((a==null?void 0:a.blockEventTypes)??t.blockEventTypes)),[E,L]=l.useState(n((a==null?void 0:a.allowEventKeywords)??t.allowEventKeywords)),[N,P]=l.useState(n((a==null?void 0:a.blockEventKeywords)??t.blockEventKeywords)),[B,H]=l.useState(p?String(Math.round(p/60)):"30"),[U,m]=l.useState(!1),Y=l.useMemo(()=>({allowWorkBlockKinds:k,blockWorkBlockKinds:g,allowCalendarIds:d(h),blockCalendarIds:d(j),allowEventTypes:d(f),blockEventTypes:d(C),allowEventKeywords:d(E),blockEventKeywords:d(N),allowAvailability:i,blockAvailability:x}),[i,h,E,f,k,x,j,N,C,g]),V=Object.values(Y).every(s=>s.length===0),u=(s,$,K)=>{$(s.includes(K)?s.filter(q=>q!==K):[...s,K])};return e.jsxs(J,{className:"grid min-w-0 gap-4 overflow-hidden border-[var(--ui-border-subtle)] !bg-[var(--ui-surface-1)]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:v})]}),w?e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Planned duration"}),e.jsx(c,{type:"number",min:15,step:15,value:B,onChange:s=>H(s.target.value),placeholder:"30"})]}):null,e.jsxs("div",{className:"grid min-w-0 gap-4 lg:grid-cols-2",children:[e.jsx(y,{label:"Allow work blocks",selected:k,onToggle:s=>u(k,A,s),options:F}),e.jsx(y,{label:"Block work blocks",selected:g,onToggle:s=>u(g,T,s),options:F}),e.jsx(y,{label:"Allow availability",selected:i,onToggle:s=>u(i,S,s),options:G}),e.jsx(y,{label:"Block availability",selected:x,onToggle:s=>u(x,I,s),options:G})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow calendar ids"}),e.jsx(c,{value:h,onChange:s=>W(s.target.value),placeholder:"calendar_123, primary"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block calendar ids"}),e.jsx(c,{value:j,onChange:s=>_(s.target.value),placeholder:"calendar_456"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event types"}),e.jsx(c,{value:f,onChange:s=>M(s.target.value),placeholder:"focus, personal"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event types"}),e.jsx(c,{value:C,onChange:s=>O(s.target.value),placeholder:"out-of-office, main-work"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event keywords"}),e.jsx(c,{value:E,onChange:s=>L(s.target.value),placeholder:"creative, writing"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event keywords"}),e.jsx(c,{value:N,onChange:s=>P(s.target.value),placeholder:"psychiatrist, clinic, rest"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(z,{pending:U,pendingLabel:"Saving",onClick:async()=>{m(!0);try{await o({schedulingRules:V?t:Y,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:b}),e.jsx(z,{variant:"secondary",onClick:async()=>{m(!0);try{A([]),T([]),S([]),I([]),W(""),_(""),M(""),O(""),L(""),P(""),await o({schedulingRules:null,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:"Clear custom rules"})]})]})}export{Z as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-Dnkkx2co.js";import{Z as l}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-Dnkkx2co.js";import{Z as l}from"./index-BP9__l6C.js";import{a as m,b as o}from"./schema-visuals-CvC9a3i6.js";function u({label:s,schemaType:a,compact:n=!1,showType:r=!1,className:t}){const i=o(a);return e.jsxs("span",{className:l("inline-flex max-w-full min-w-0 items-center gap-2 rounded-full border px-3 py-1.5 text-sm leading-tight shadow-[inset_0_1px_0_var(--ui-border-subtle)]",n?"min-h-8":"min-h-9",i.badgeTone,t),children:[r?e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-soft)]",children:m(a)}):null,e.jsx("span",{className:"min-w-0 break-words whitespace-normal",children:s})]})}export{u as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,cx as g,bl as k}from"./vendor-Dnkkx2co.js";import{Z as n}from"./index-
|
|
1
|
+
import{r as i,j as e,cx as g,bl as k}from"./vendor-Dnkkx2co.js";import{Z as n}from"./index-BP9__l6C.js";function y({label:m,value:l,options:u,onChange:b,className:h,triggerClassName:p,menuClassName:w}){const[a,c]=i.useState(!1),x=i.useRef(null),v=i.useRef(null),f=i.useId(),t=i.useMemo(()=>u.find(r=>r.value===l)??u[0],[u,l]);return i.useEffect(()=>{if(!a)return;const r=d=>{var o;(o=x.current)!=null&&o.contains(d.target)||c(!1)},s=d=>{var o;d.key==="Escape"&&(c(!1),(o=v.current)==null||o.focus())};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",s),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",s)}},[a]),e.jsxs("div",{className:n("relative min-w-0 max-w-full",h),ref:x,children:[e.jsx("div",{className:"mb-1.5 text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:m}),e.jsxs("button",{ref:v,type:"button",className:n("flex min-h-11 w-full min-w-0 items-center justify-between gap-3 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2.5 text-left shadow-[var(--ui-shadow-soft)] transition hover:border-[var(--ui-border-strong)] hover:bg-[var(--ui-surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--primary)_45%,transparent)] sm:min-w-[15rem]",p),"aria-haspopup":"listbox","aria-expanded":a,"aria-controls":f,onClick:()=>c(r=>!r),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium text-[var(--ui-ink-strong)]",children:(t==null?void 0:t.label)??l}),t!=null&&t.description?e.jsx("div",{className:"truncate text-xs text-[var(--ui-ink-faint)]",children:t.description}):null]}),e.jsx(g,{className:n("size-4 shrink-0 text-[var(--ui-ink-faint)] transition",a&&"rotate-180 text-[var(--ui-ink-medium)]")})]}),a?e.jsx("div",{id:f,role:"listbox","aria-label":m,className:n("absolute left-0 top-[calc(100%+0.6rem)] z-30 w-full overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-modal)] p-2 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",w),children:e.jsx("div",{className:"grid gap-1",children:u.map(r=>{const s=r.value===l;return e.jsxs("button",{type:"button",role:"option","aria-selected":s,className:n("flex w-full items-start justify-between gap-3 rounded-[16px] px-3 py-2.5 text-left transition",s?"bg-[var(--ui-surface-active)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onClick:()=>{b(r.value),c(!1)},children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:r.label}),r.description?e.jsx("div",{className:"mt-0.5 text-xs text-[var(--ui-ink-faint)]",children:r.description}):null]}),e.jsx(k,{className:n("mt-0.5 size-4 shrink-0 transition",s?"text-[var(--ui-ink-strong)]":"opacity-0")})]},r.value)})})}):null]})}export{y as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as v,j as e,de as Me,aK as qe,bl as Ce,c8 as Oe,b8 as De,b4 as Ee,df as Be,cw as He,cx as Ue}from"./vendor-Dnkkx2co.js";import{j as Ke,i as R,k as _}from"./state-vCcAT5Hq.js";import{Q as Se,dF as $e,j as F,F as g,I as C,T as ze,c as h,B as P,dG as We,dH as Qe,dI as Xe,dJ as Ge,dK as Ye,dL as Je,dM as Ze,dN as Ve,S as es,E as ye,C as N,V as Z,b as ss,du as ts,dv as as,dO as is,dP as rs,dQ as ns,dR as os,dS as ls}from"./index-BhkubYaC.js";import{R as ds,P as cs,O as us,C as ms,T as xs,D as ps,a as gs}from"./ui-C1iwpj2-.js";import{m as hs}from"./motion-Lt5B1XuE.js";import{S as vs}from"./settings-section-nav-kFFQSJEe.js";import{P as bs}from"./page-hero-DzEsy8i5.js";import{M as W}from"./metric-tile-NJiFcFxW.js";import"./forms-hB0SqEh-.js";import"./board-dIX6etHh.js";import"./graph-DDUZNRsO.js";const G=["read","write","insights","rewards.manage","psyche.read","psyche.write","psyche.note","psyche.insight","psyche.mode"],js=[{value:"read",label:"Read",description:"Inspect goals, projects, tasks, reviews, and metrics."},{value:"write",label:"Write",description:"Create and update work through the versioned API."},{value:"insights",label:"Insights",description:"Store structured findings, rationale, and feedback."},{value:"rewards.manage",label:"Rewards",description:"Tune reward rules and issue explainable bonus XP grants."},{value:"psyche.read",label:"Psyche read",description:"Read sensitive values, patterns, and trigger analyses."},{value:"psyche.write",label:"Psyche write",description:"Create and update sensitive therapeutic records."},{value:"psyche.note",label:"Psyche note",description:"Create and edit Markdown notes linked to reflective records."},{value:"psyche.insight",label:"Psyche insight",description:"Store therapeutic insights on Psyche entities."},{value:"psyche.mode",label:"Psyche mode",description:"Name, refine, and map mode profiles and guided mode results."}],te={mode:"active_only",goalsLimit:5,projectsLimit:8,tasksLimit:10,habitsLimit:6,strategiesLimit:4,peoplePageLimit:4,includePeoplePages:!0},X={userIds:[],projectIds:[],tagIds:[]};function V(a){return a==="review"?{mode:"active_only",goalsLimit:3,projectsLimit:5,tasksLimit:6,habitsLimit:4,strategiesLimit:3,peoplePageLimit:0,includePeoplePages:!1}:a==="operator"?{...te}:a==="autonomous"?{mode:"scoped",goalsLimit:10,projectsLimit:14,tasksLimit:16,habitsLimit:10,strategiesLimit:8,peoplePageLimit:6,includePeoplePages:!0}:{...te}}function ee(a){return Array.from(new Set(a.split(",").map(r=>r.trim()).filter(r=>r.length>0)))}function Ae(a,r,l){return r==="review"?{...a,preset:r,trustLevel:"trusted",autonomyMode:"approval_required",approvalMode:"approval_by_default",scopes:[...l],bootstrapPolicy:V(r),scopePolicy:{...X}}:r==="operator"?{...a,preset:r,trustLevel:"trusted",autonomyMode:"scoped_write",approvalMode:"high_impact_only",scopes:[...G],bootstrapPolicy:V(r),scopePolicy:{...X}}:r==="autonomous"?{...a,preset:r,trustLevel:"autonomous",autonomyMode:"autonomous",approvalMode:"none",scopes:[...G],bootstrapPolicy:V(r),scopePolicy:{...X}}:{...a,preset:r}}function ke(a,r,l){const p={preset:a,label:"Forge Pilot Token",agentLabel:r,agentType:"assistant",description:"Collaborative planning agent.",trustLevel:"trusted",autonomyMode:"scoped_write",approvalMode:"high_impact_only",scopes:[...G],bootstrapPolicy:{...te},scopePolicy:{...X}};return Ae(p,a,l)}function fs({open:a,onOpenChange:r,pending:l=!1,initialPreset:p="operator",defaultAgentLabel:m="OpenClaw",recommendedScopes:b=[...G],onSubmit:k}){const[u,f]=v.useState(()=>ke(p,m,b)),[M,j]=v.useState(null);v.useEffect(()=>{a&&(f(ke(p,m,b)),j(null))},[a,p,m,b]);const A=[{id:"preset",eyebrow:"Agent token",title:"Choose a starting point for this token",description:"Each preset locks in a sensible trust, autonomy, and approval policy. You can tune any setting in the next steps.",render:(i,n)=>e.jsx(F,{columns:3,value:i.preset,onChange:t=>n(Ae(i,t,b)),options:[{value:"review",label:"Review-first",description:"Every action waits for your approval. Safe starting point for a new agent you have not yet trusted."},{value:"operator",label:"Full operator",description:"Trusted collaborator with full scopes. High-impact actions still ask for approval."},{value:"autonomous",label:"Autonomous pilot",description:"No approval gates. Use only for agents you have fully verified in a controlled setup."},{value:"custom",label:"Custom",description:"Start from a blank slate and configure every dimension yourself."}]})},{id:"identity",eyebrow:"Agent identity",title:"Name the agent and this token",description:"The agent name appears in logs, approval requests, and audit trails. The token label is for your reference.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Agent name",labelHelp:"This label identifies the agent in every log entry, approval notification, and XP attribution. Pick something memorable.",children:e.jsx(C,{value:i.agentLabel,placeholder:"OpenClaw",onChange:t=>n({agentLabel:t.target.value})})}),e.jsx(g,{label:"Token label",description:"A short name for this credential — mainly for your reference in the token list.",children:e.jsx(C,{value:i.label,placeholder:"Forge Pilot Token",onChange:t=>n({label:t.target.value})})}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsx(g,{label:"Agent type",labelHelp:"Use 'assistant' for interactive agents. Use 'automation' for scripts or scheduled jobs with no conversational layer.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.agentType,onChange:t=>n({agentType:t.target.value}),children:[e.jsx("option",{value:"assistant",children:"assistant"}),e.jsx("option",{value:"automation",children:"automation"}),e.jsx("option",{value:"observer",children:"observer"})]})}),e.jsx(g,{label:"Description",description:"Optional note about what this agent does.",children:e.jsx(C,{value:i.description,placeholder:"Collaborative planning agent.",onChange:t=>n({description:t.target.value})})})]})]})},{id:"policy",eyebrow:"Access policy",title:"Set trust level and approval behaviour",description:"These three settings control how much autonomy the agent has and when it needs your sign-off. The preset you chose filled sensible defaults — adjust only if needed.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Trust level",labelHelp:"Standard agents are sandboxed readers. Trusted agents can write with policy guardrails. Autonomous agents bypass all trust checks — use with care.",children:e.jsx(F,{columns:3,value:i.trustLevel,onChange:t=>n({trustLevel:t}),options:[{value:"standard",label:"Standard",description:"Read-only by default, limited write surface."},{value:"trusted",label:"Trusted",description:"Full write surface with policy guardrails active."},{value:"autonomous",label:"Autonomous",description:"All checks bypassed — maximum capability."}]})}),e.jsx(g,{label:"Autonomy mode",labelHelp:"Approval-required means every mutation is held for review. Scoped write lets the agent act within its scopes. Autonomous skips all gates.",children:e.jsx(F,{columns:3,value:i.autonomyMode,onChange:t=>n({autonomyMode:t}),options:[{value:"approval_required",label:"Approval required",description:"Every write action queues for your review."},{value:"scoped_write",label:"Scoped write",description:"Acts freely within its assigned scopes."},{value:"autonomous",label:"Autonomous",description:"No gates — full freedom to write."}]})}),e.jsx(g,{label:"Approval policy",labelHelp:"Controls which actions trigger the approval queue. High-impact-only is the balanced default: routine writes go through, large mutations get reviewed.",children:e.jsx(F,{columns:3,value:i.approvalMode,onChange:t=>n({approvalMode:t}),options:[{value:"approval_by_default",label:"Approve by default",description:"Everything needs a sign-off unless explicitly exempt."},{value:"high_impact_only",label:"High impact only",description:"Routine writes pass through; high-stakes actions are held."},{value:"none",label:"None",description:"No approval gates — actions execute immediately."}]})})]})},{id:"scopes",eyebrow:"Scopes",title:"Select what this agent can access",description:"Scope selection follows the principle of least privilege — only grant what the agent actually needs. The full operator bundle covers every capability.",render:(i,n)=>e.jsxs(g,{label:"Capabilities",labelHelp:"Read lets the agent inspect the system. Write lets it create and update work. Rewards and Psyche scopes unlock more sensitive subsystems.",children:[e.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:js.map(t=>{const y=i.scopes.includes(t.value);return e.jsxs("button",{type:"button",className:`rounded-[18px] border px-4 py-4 text-left transition ${y?"border-[color-mix(in_srgb,var(--primary)_28%,transparent)] bg-[var(--ui-accent-soft)] text-[var(--ui-ink-strong)]":"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-muted)] hover:bg-[var(--ui-surface-2)]"}`,onClick:()=>{if(y){if(i.scopes.length===1)return;n({scopes:i.scopes.filter(S=>S!==t.value)})}else n({scopes:[...i.scopes,t.value]})},children:[e.jsx("div",{className:"font-medium",children:t.label}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-muted)]",children:t.description})]},t.value)})}),e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:[i.scopes.length," scope",i.scopes.length!==1?"s":""," ","selected"]})]})},{id:"default-scope",eyebrow:"Default read scope",title:"Decide which owners and slices this agent sees by default",description:"Leave these blank for broad reads. When set, Forge automatically narrows overview, context, and bootstrap reads for this token unless the request narrows further.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Default user IDs",description:"Comma-separated owner ids such as user_operator or user_forge_bot.",labelHelp:"If you set user ids here, this token only sees that owner slice by default. Explicit userIds in a request can narrow further, but they will not silently widen beyond this list.",children:e.jsx(C,{value:i.scopePolicy.userIds.join(", "),placeholder:"user_operator, user_forge_bot",onChange:t=>n({scopePolicy:{...i.scopePolicy,userIds:ee(t.target.value)}})})}),e.jsx(g,{label:"Project IDs",description:"Optional project-level boundary for overview, context, and bootstrap reads.",children:e.jsx(C,{value:i.scopePolicy.projectIds.join(", "),placeholder:"project_123, project_456",onChange:t=>n({scopePolicy:{...i.scopePolicy,projectIds:ee(t.target.value)}})})}),e.jsx(g,{label:"Tag IDs",description:"Optional tag-level boundary for overview, context, and bootstrap reads.",children:e.jsx(C,{value:i.scopePolicy.tagIds.join(", "),placeholder:"tag_focus, tag_client",onChange:t=>n({scopePolicy:{...i.scopePolicy,tagIds:ee(t.target.value)}})})}),e.jsxs("div",{className:"rounded-[16px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:["Default scope summary:"," ",i.scopePolicy.userIds.length>0?`${i.scopePolicy.userIds.length} user slice${i.scopePolicy.userIds.length===1?"":"s"}`:"all visible users",i.scopePolicy.projectIds.length>0?` · ${i.scopePolicy.projectIds.length} project ${i.scopePolicy.projectIds.length===1?"boundary":"boundaries"}`:"",i.scopePolicy.tagIds.length>0?` · ${i.scopePolicy.tagIds.length} tag ${i.scopePolicy.tagIds.length===1?"boundary":"boundaries"}`:""]})]})},{id:"bootstrap",eyebrow:"Bootstrap",title:"Decide how much Forge context is injected at session start",description:"This controls the automatic BOOTSTRAP snapshot for agent sessions. Keep it lean unless the agent genuinely needs broad context on every new session.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Bootstrap mode",labelHelp:"Disabled injects nothing. Active-only keeps a compact current-work snapshot. Scoped keeps budgets but not status filters. Full mirrors the legacy broad bootstrap.",children:e.jsx(F,{columns:3,value:i.bootstrapPolicy.mode,onChange:t=>n({bootstrapPolicy:{...i.bootstrapPolicy,mode:t}}),options:[{value:"disabled",label:"Disabled",description:"No automatic Forge snapshot is injected."},{value:"active_only",label:"Active only",description:"Only active projects, focus tasks, due habits, and bounded summaries."},{value:"scoped",label:"Scoped",description:"Bounded lists without forcing only active items."},{value:"full",label:"Full",description:"Legacy broad bootstrap. Highest context cost."}]})}),e.jsx("div",{className:"grid gap-5 md:grid-cols-3",children:[["goalsLimit","Goals"],["projectsLimit","Projects"],["tasksLimit","Tasks"],["habitsLimit","Habits"],["strategiesLimit","Strategies"],["peoplePageLimit","People pages"]].map(([t,y])=>e.jsx(g,{label:y,children:e.jsx(C,{type:"number",min:0,max:t==="peoplePageLimit"?50:100,value:i.bootstrapPolicy[t],onChange:S=>n({bootstrapPolicy:{...i.bootstrapPolicy,[t]:Number(S.target.value||0)}})})},t))}),e.jsxs("label",{className:"flex items-center gap-3 rounded-[16px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-medium)]",children:[e.jsx("input",{type:"checkbox",checked:i.bootstrapPolicy.includePeoplePages,onChange:t=>n({bootstrapPolicy:{...i.bootstrapPolicy,includePeoplePages:t.target.checked}})}),"Include People wiki pages in the bootstrap snapshot"]})]})}];return e.jsx(Se,{open:a,onOpenChange:r,eyebrow:"Agent setup",title:"Issue an agent token",description:"Configure a new agent token step by step. The preset fills sensible defaults — adjust what you need.",value:u,onChange:f,draftPersistenceKey:"settings.agent-token.new",steps:A,submitLabel:"Issue token",pending:l,pendingLabel:"Issuing token…",error:M,onSubmit:async()=>{j(null);const i=$e.safeParse({label:u.label,agentLabel:u.agentLabel,agentType:u.agentType,description:u.description,trustLevel:u.trustLevel,autonomyMode:u.autonomyMode,approvalMode:u.approvalMode,scopes:u.scopes,bootstrapPolicy:u.bootstrapPolicy,scopePolicy:u.scopePolicy});if(!i.success){const n=i.error.issues[0];j((n==null?void 0:n.message)??"Check the agent name and at least one scope before issuing.");return}try{await k(i.data),r(!1)}catch(n){j(n instanceof Error?n.message:"Could not issue the token right now.")}}})}function we(a){return{source:"new",taskId:"",title:"",description:"",owner:a,projectId:"",status:"done",points:40}}function ys({open:a,onOpenChange:r,pending:l=!1,defaultOwner:p="",availableTasks:m=[],availableProjects:b=[],onSubmit:k}){const[u,f]=v.useState(()=>we(p)),[M,j]=v.useState(null);v.useEffect(()=>{a&&(f(we(p)),j(null))},[a,p]);const A=[{id:"source",eyebrow:"Log work",title:"Is this work already tracked?",description:"If a task exists, link the work to it so Forge can update the record with the right status and XP. If not, a new task will be created from what you describe.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(F,{columns:2,value:i.source,onChange:t=>n({source:t,taskId:""}),options:[{value:"new",label:"New task",description:"The work is not tracked yet — Forge will create a task and log the time against it."},{value:"existing",label:"Existing task",description:"Pick a task already in the board. The log will update its record and award XP."}]}),i.source==="existing"&&m.length>0?e.jsx(g,{label:"Pick the task",description:"Select the task this work belongs to.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.taskId,onChange:t=>n({taskId:t.target.value}),children:[e.jsx("option",{value:"",children:"— choose a task —"}),m.map(t=>e.jsxs("option",{value:t.id,children:[t.title," · ",t.status.replaceAll("_"," ")]},t.id))]})}):i.source==="existing"&&m.length===0?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-muted)]",children:'No tasks are loaded yet. Switch to "New task" to create one from scratch.'}):null]})},{id:"details",eyebrow:"Work details",title:"Describe what was done",description:"Give the work a clear title and enough context to understand it later. These become the task record if you are creating a new one.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Title",labelHelp:"Write the title like a short achievement: what was completed, not what was started.",children:e.jsx(C,{value:i.title,placeholder:"Write postmortem draft",onChange:t=>n({title:t.target.value})})}),e.jsx(g,{label:"Owner",description:"Who did this work? Defaults to the operator name.",children:e.jsx(C,{value:i.owner,placeholder:"Your name",onChange:t=>n({owner:t.target.value})})}),e.jsx(g,{label:"Description",description:"What moved forward? What should remain visible in the project history?",children:e.jsx(ze,{className:"min-h-28",value:i.description,placeholder:"Wrote the full incident timeline and drafted the three key learnings for the team retrospective.",onChange:t=>n({description:t.target.value})})})]})},{id:"placement",eyebrow:"Placement",title:"Set the context and XP value",description:"Assign the work to a project and choose its final status. The XP value controls how much this work contributes to the operator's progress curve.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsx(g,{label:"Project",description:"Link this work to an active project if it belongs to one.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.projectId,onChange:t=>n({projectId:t.target.value}),children:[e.jsx("option",{value:"",children:"No project link"}),b.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx(g,{label:"Final status",labelHelp:"'Done' is the most common choice. Use 'In progress' if the work was real but the task is still open.",children:e.jsx(F,{columns:2,value:i.status,onChange:t=>n({status:t}),options:[{value:"done",label:"Done",description:"Work is complete."},{value:"in_progress",label:"In progress",description:"Still active but already worth logging."},{value:"focus",label:"Focus",description:"Moved into focus."},{value:"blocked",label:"Blocked",description:"Work hit a wall."}]})})]}),e.jsx(g,{label:"XP value",labelHelp:"Typical task XP ranges from 20 to 100. Use 40 for routine tasks, 80+ for complex deliverables.",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(C,{type:"number",min:5,max:500,className:"w-36",value:i.points,onChange:t=>n({points:Number(t.target.value)})}),e.jsx("div",{className:"flex gap-2",children:[20,40,80,120].map(t=>e.jsxs("button",{type:"button",className:`rounded-full px-3 py-1.5 text-xs transition ${i.points===t?"bg-[var(--ui-surface-3)] text-[var(--ui-ink-strong)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-muted)] hover:bg-[var(--ui-surface-2)]"}`,onClick:()=>n({points:t}),children:[t," xp"]},t))})]})})]})}];return e.jsx(Se,{open:a,onOpenChange:r,eyebrow:"Log work",title:"Log retroactive work",description:"Capture work that happened outside the timer so it counts toward progress and XP.",value:u,onChange:f,draftPersistenceKey:"settings.log-work",steps:A,submitLabel:"Log work",pending:l,pendingLabel:"Logging work…",error:M,onSubmit:async()=>{if(j(null),u.source==="new"&&u.title.trim().length===0){j("Add a title so Forge knows what work to create.");return}if(u.source==="existing"&&!u.taskId){j("Pick an existing task or switch to New task.");return}try{await k({taskId:u.source==="existing"&&u.taskId?u.taskId:void 0,title:u.source==="new"&&u.title.trim()?u.title.trim():void 0,description:u.description.trim()||void 0,owner:u.owner.trim()||void 0,projectId:u.projectId||null,status:u.status,points:u.points}),r(!1)}catch(i){j(i instanceof Error?i.message:"Could not log the work right now.")}}})}function Te({text:a}){const[r,l]=v.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2200)}catch{}};return e.jsxs("button",{type:"button",onClick:()=>void p(),className:"flex items-center gap-1.5 rounded-full bg-[var(--ui-surface-2)] px-3 py-1.5 text-xs font-medium text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-2)] hover:text-[var(--ui-ink-strong)]",children:[r?e.jsx(Ce,{className:"size-3 text-[var(--success)]"}):e.jsx(Oe,{className:"size-3"}),r?"Copied":"Copy"]})}function se({label:a,children:r,copyText:l}){return e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:a}),e.jsx(Te,{text:l??r})]}),e.jsx("pre",{className:"mt-3 overflow-x-auto rounded-[14px] bg-[var(--ui-code-bg)] p-3 text-xs leading-6 text-[var(--ui-ink-medium)]",children:e.jsx("code",{children:r})})]})}function ks({open:a,onOpenChange:r,state:l}){if(!l)return null;const{tokenString:p,agentLabel:m,onboarding:b}=l,k=JSON.stringify({baseUrl:b.forgeBaseUrl,apiToken:p,actorLabel:m,timeoutMs:b.defaultTimeoutMs},null,2),u=[`curl -s ${b.healthUrl} \\`,` -H "Authorization: Bearer ${p}" \\`,' -H "X-Forge-Source: agent" \\',` -H "X-Forge-Actor: ${m}"`].join(`
|
|
1
|
+
import{r as v,j as e,de as Me,aK as qe,bl as Ce,c8 as Oe,b8 as De,b4 as Ee,df as Be,cw as He,cx as Ue}from"./vendor-Dnkkx2co.js";import{j as Ke,i as R,k as _}from"./state-vCcAT5Hq.js";import{Q as Se,dF as $e,j as F,F as g,I as C,T as ze,c as h,B as P,dG as We,dH as Qe,dI as Xe,dJ as Ge,dK as Ye,dL as Je,dM as Ze,dN as Ve,S as es,E as ye,C as N,V as Z,b as ss,du as ts,dv as as,dO as is,dP as rs,dQ as ns,dR as os,dS as ls}from"./index-BP9__l6C.js";import{R as ds,P as cs,O as us,C as ms,T as xs,D as ps,a as gs}from"./ui-C1iwpj2-.js";import{m as hs}from"./motion-Lt5B1XuE.js";import{S as vs}from"./settings-section-nav-DV5umEkp.js";import{P as bs}from"./page-hero-DgnhI5es.js";import{M as W}from"./metric-tile-DCxLxNli.js";import"./forms-hB0SqEh-.js";import"./board-dIX6etHh.js";import"./graph-DDUZNRsO.js";const G=["read","write","insights","rewards.manage","psyche.read","psyche.write","psyche.note","psyche.insight","psyche.mode"],js=[{value:"read",label:"Read",description:"Inspect goals, projects, tasks, reviews, and metrics."},{value:"write",label:"Write",description:"Create and update work through the versioned API."},{value:"insights",label:"Insights",description:"Store structured findings, rationale, and feedback."},{value:"rewards.manage",label:"Rewards",description:"Tune reward rules and issue explainable bonus XP grants."},{value:"psyche.read",label:"Psyche read",description:"Read sensitive values, patterns, and trigger analyses."},{value:"psyche.write",label:"Psyche write",description:"Create and update sensitive therapeutic records."},{value:"psyche.note",label:"Psyche note",description:"Create and edit Markdown notes linked to reflective records."},{value:"psyche.insight",label:"Psyche insight",description:"Store therapeutic insights on Psyche entities."},{value:"psyche.mode",label:"Psyche mode",description:"Name, refine, and map mode profiles and guided mode results."}],te={mode:"active_only",goalsLimit:5,projectsLimit:8,tasksLimit:10,habitsLimit:6,strategiesLimit:4,peoplePageLimit:4,includePeoplePages:!0},X={userIds:[],projectIds:[],tagIds:[]};function V(a){return a==="review"?{mode:"active_only",goalsLimit:3,projectsLimit:5,tasksLimit:6,habitsLimit:4,strategiesLimit:3,peoplePageLimit:0,includePeoplePages:!1}:a==="operator"?{...te}:a==="autonomous"?{mode:"scoped",goalsLimit:10,projectsLimit:14,tasksLimit:16,habitsLimit:10,strategiesLimit:8,peoplePageLimit:6,includePeoplePages:!0}:{...te}}function ee(a){return Array.from(new Set(a.split(",").map(r=>r.trim()).filter(r=>r.length>0)))}function Ae(a,r,l){return r==="review"?{...a,preset:r,trustLevel:"trusted",autonomyMode:"approval_required",approvalMode:"approval_by_default",scopes:[...l],bootstrapPolicy:V(r),scopePolicy:{...X}}:r==="operator"?{...a,preset:r,trustLevel:"trusted",autonomyMode:"scoped_write",approvalMode:"high_impact_only",scopes:[...G],bootstrapPolicy:V(r),scopePolicy:{...X}}:r==="autonomous"?{...a,preset:r,trustLevel:"autonomous",autonomyMode:"autonomous",approvalMode:"none",scopes:[...G],bootstrapPolicy:V(r),scopePolicy:{...X}}:{...a,preset:r}}function ke(a,r,l){const p={preset:a,label:"Forge Pilot Token",agentLabel:r,agentType:"assistant",description:"Collaborative planning agent.",trustLevel:"trusted",autonomyMode:"scoped_write",approvalMode:"high_impact_only",scopes:[...G],bootstrapPolicy:{...te},scopePolicy:{...X}};return Ae(p,a,l)}function fs({open:a,onOpenChange:r,pending:l=!1,initialPreset:p="operator",defaultAgentLabel:m="OpenClaw",recommendedScopes:b=[...G],onSubmit:k}){const[u,f]=v.useState(()=>ke(p,m,b)),[M,j]=v.useState(null);v.useEffect(()=>{a&&(f(ke(p,m,b)),j(null))},[a,p,m,b]);const A=[{id:"preset",eyebrow:"Agent token",title:"Choose a starting point for this token",description:"Each preset locks in a sensible trust, autonomy, and approval policy. You can tune any setting in the next steps.",render:(i,n)=>e.jsx(F,{columns:3,value:i.preset,onChange:t=>n(Ae(i,t,b)),options:[{value:"review",label:"Review-first",description:"Every action waits for your approval. Safe starting point for a new agent you have not yet trusted."},{value:"operator",label:"Full operator",description:"Trusted collaborator with full scopes. High-impact actions still ask for approval."},{value:"autonomous",label:"Autonomous pilot",description:"No approval gates. Use only for agents you have fully verified in a controlled setup."},{value:"custom",label:"Custom",description:"Start from a blank slate and configure every dimension yourself."}]})},{id:"identity",eyebrow:"Agent identity",title:"Name the agent and this token",description:"The agent name appears in logs, approval requests, and audit trails. The token label is for your reference.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Agent name",labelHelp:"This label identifies the agent in every log entry, approval notification, and XP attribution. Pick something memorable.",children:e.jsx(C,{value:i.agentLabel,placeholder:"OpenClaw",onChange:t=>n({agentLabel:t.target.value})})}),e.jsx(g,{label:"Token label",description:"A short name for this credential — mainly for your reference in the token list.",children:e.jsx(C,{value:i.label,placeholder:"Forge Pilot Token",onChange:t=>n({label:t.target.value})})}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsx(g,{label:"Agent type",labelHelp:"Use 'assistant' for interactive agents. Use 'automation' for scripts or scheduled jobs with no conversational layer.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.agentType,onChange:t=>n({agentType:t.target.value}),children:[e.jsx("option",{value:"assistant",children:"assistant"}),e.jsx("option",{value:"automation",children:"automation"}),e.jsx("option",{value:"observer",children:"observer"})]})}),e.jsx(g,{label:"Description",description:"Optional note about what this agent does.",children:e.jsx(C,{value:i.description,placeholder:"Collaborative planning agent.",onChange:t=>n({description:t.target.value})})})]})]})},{id:"policy",eyebrow:"Access policy",title:"Set trust level and approval behaviour",description:"These three settings control how much autonomy the agent has and when it needs your sign-off. The preset you chose filled sensible defaults — adjust only if needed.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Trust level",labelHelp:"Standard agents are sandboxed readers. Trusted agents can write with policy guardrails. Autonomous agents bypass all trust checks — use with care.",children:e.jsx(F,{columns:3,value:i.trustLevel,onChange:t=>n({trustLevel:t}),options:[{value:"standard",label:"Standard",description:"Read-only by default, limited write surface."},{value:"trusted",label:"Trusted",description:"Full write surface with policy guardrails active."},{value:"autonomous",label:"Autonomous",description:"All checks bypassed — maximum capability."}]})}),e.jsx(g,{label:"Autonomy mode",labelHelp:"Approval-required means every mutation is held for review. Scoped write lets the agent act within its scopes. Autonomous skips all gates.",children:e.jsx(F,{columns:3,value:i.autonomyMode,onChange:t=>n({autonomyMode:t}),options:[{value:"approval_required",label:"Approval required",description:"Every write action queues for your review."},{value:"scoped_write",label:"Scoped write",description:"Acts freely within its assigned scopes."},{value:"autonomous",label:"Autonomous",description:"No gates — full freedom to write."}]})}),e.jsx(g,{label:"Approval policy",labelHelp:"Controls which actions trigger the approval queue. High-impact-only is the balanced default: routine writes go through, large mutations get reviewed.",children:e.jsx(F,{columns:3,value:i.approvalMode,onChange:t=>n({approvalMode:t}),options:[{value:"approval_by_default",label:"Approve by default",description:"Everything needs a sign-off unless explicitly exempt."},{value:"high_impact_only",label:"High impact only",description:"Routine writes pass through; high-stakes actions are held."},{value:"none",label:"None",description:"No approval gates — actions execute immediately."}]})})]})},{id:"scopes",eyebrow:"Scopes",title:"Select what this agent can access",description:"Scope selection follows the principle of least privilege — only grant what the agent actually needs. The full operator bundle covers every capability.",render:(i,n)=>e.jsxs(g,{label:"Capabilities",labelHelp:"Read lets the agent inspect the system. Write lets it create and update work. Rewards and Psyche scopes unlock more sensitive subsystems.",children:[e.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:js.map(t=>{const y=i.scopes.includes(t.value);return e.jsxs("button",{type:"button",className:`rounded-[18px] border px-4 py-4 text-left transition ${y?"border-[color-mix(in_srgb,var(--primary)_28%,transparent)] bg-[var(--ui-accent-soft)] text-[var(--ui-ink-strong)]":"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-muted)] hover:bg-[var(--ui-surface-2)]"}`,onClick:()=>{if(y){if(i.scopes.length===1)return;n({scopes:i.scopes.filter(S=>S!==t.value)})}else n({scopes:[...i.scopes,t.value]})},children:[e.jsx("div",{className:"font-medium",children:t.label}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-muted)]",children:t.description})]},t.value)})}),e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:[i.scopes.length," scope",i.scopes.length!==1?"s":""," ","selected"]})]})},{id:"default-scope",eyebrow:"Default read scope",title:"Decide which owners and slices this agent sees by default",description:"Leave these blank for broad reads. When set, Forge automatically narrows overview, context, and bootstrap reads for this token unless the request narrows further.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Default user IDs",description:"Comma-separated owner ids such as user_operator or user_forge_bot.",labelHelp:"If you set user ids here, this token only sees that owner slice by default. Explicit userIds in a request can narrow further, but they will not silently widen beyond this list.",children:e.jsx(C,{value:i.scopePolicy.userIds.join(", "),placeholder:"user_operator, user_forge_bot",onChange:t=>n({scopePolicy:{...i.scopePolicy,userIds:ee(t.target.value)}})})}),e.jsx(g,{label:"Project IDs",description:"Optional project-level boundary for overview, context, and bootstrap reads.",children:e.jsx(C,{value:i.scopePolicy.projectIds.join(", "),placeholder:"project_123, project_456",onChange:t=>n({scopePolicy:{...i.scopePolicy,projectIds:ee(t.target.value)}})})}),e.jsx(g,{label:"Tag IDs",description:"Optional tag-level boundary for overview, context, and bootstrap reads.",children:e.jsx(C,{value:i.scopePolicy.tagIds.join(", "),placeholder:"tag_focus, tag_client",onChange:t=>n({scopePolicy:{...i.scopePolicy,tagIds:ee(t.target.value)}})})}),e.jsxs("div",{className:"rounded-[16px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:["Default scope summary:"," ",i.scopePolicy.userIds.length>0?`${i.scopePolicy.userIds.length} user slice${i.scopePolicy.userIds.length===1?"":"s"}`:"all visible users",i.scopePolicy.projectIds.length>0?` · ${i.scopePolicy.projectIds.length} project ${i.scopePolicy.projectIds.length===1?"boundary":"boundaries"}`:"",i.scopePolicy.tagIds.length>0?` · ${i.scopePolicy.tagIds.length} tag ${i.scopePolicy.tagIds.length===1?"boundary":"boundaries"}`:""]})]})},{id:"bootstrap",eyebrow:"Bootstrap",title:"Decide how much Forge context is injected at session start",description:"This controls the automatic BOOTSTRAP snapshot for agent sessions. Keep it lean unless the agent genuinely needs broad context on every new session.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Bootstrap mode",labelHelp:"Disabled injects nothing. Active-only keeps a compact current-work snapshot. Scoped keeps budgets but not status filters. Full mirrors the legacy broad bootstrap.",children:e.jsx(F,{columns:3,value:i.bootstrapPolicy.mode,onChange:t=>n({bootstrapPolicy:{...i.bootstrapPolicy,mode:t}}),options:[{value:"disabled",label:"Disabled",description:"No automatic Forge snapshot is injected."},{value:"active_only",label:"Active only",description:"Only active projects, focus tasks, due habits, and bounded summaries."},{value:"scoped",label:"Scoped",description:"Bounded lists without forcing only active items."},{value:"full",label:"Full",description:"Legacy broad bootstrap. Highest context cost."}]})}),e.jsx("div",{className:"grid gap-5 md:grid-cols-3",children:[["goalsLimit","Goals"],["projectsLimit","Projects"],["tasksLimit","Tasks"],["habitsLimit","Habits"],["strategiesLimit","Strategies"],["peoplePageLimit","People pages"]].map(([t,y])=>e.jsx(g,{label:y,children:e.jsx(C,{type:"number",min:0,max:t==="peoplePageLimit"?50:100,value:i.bootstrapPolicy[t],onChange:S=>n({bootstrapPolicy:{...i.bootstrapPolicy,[t]:Number(S.target.value||0)}})})},t))}),e.jsxs("label",{className:"flex items-center gap-3 rounded-[16px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-medium)]",children:[e.jsx("input",{type:"checkbox",checked:i.bootstrapPolicy.includePeoplePages,onChange:t=>n({bootstrapPolicy:{...i.bootstrapPolicy,includePeoplePages:t.target.checked}})}),"Include People wiki pages in the bootstrap snapshot"]})]})}];return e.jsx(Se,{open:a,onOpenChange:r,eyebrow:"Agent setup",title:"Issue an agent token",description:"Configure a new agent token step by step. The preset fills sensible defaults — adjust what you need.",value:u,onChange:f,draftPersistenceKey:"settings.agent-token.new",steps:A,submitLabel:"Issue token",pending:l,pendingLabel:"Issuing token…",error:M,onSubmit:async()=>{j(null);const i=$e.safeParse({label:u.label,agentLabel:u.agentLabel,agentType:u.agentType,description:u.description,trustLevel:u.trustLevel,autonomyMode:u.autonomyMode,approvalMode:u.approvalMode,scopes:u.scopes,bootstrapPolicy:u.bootstrapPolicy,scopePolicy:u.scopePolicy});if(!i.success){const n=i.error.issues[0];j((n==null?void 0:n.message)??"Check the agent name and at least one scope before issuing.");return}try{await k(i.data),r(!1)}catch(n){j(n instanceof Error?n.message:"Could not issue the token right now.")}}})}function we(a){return{source:"new",taskId:"",title:"",description:"",owner:a,projectId:"",status:"done",points:40}}function ys({open:a,onOpenChange:r,pending:l=!1,defaultOwner:p="",availableTasks:m=[],availableProjects:b=[],onSubmit:k}){const[u,f]=v.useState(()=>we(p)),[M,j]=v.useState(null);v.useEffect(()=>{a&&(f(we(p)),j(null))},[a,p]);const A=[{id:"source",eyebrow:"Log work",title:"Is this work already tracked?",description:"If a task exists, link the work to it so Forge can update the record with the right status and XP. If not, a new task will be created from what you describe.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(F,{columns:2,value:i.source,onChange:t=>n({source:t,taskId:""}),options:[{value:"new",label:"New task",description:"The work is not tracked yet — Forge will create a task and log the time against it."},{value:"existing",label:"Existing task",description:"Pick a task already in the board. The log will update its record and award XP."}]}),i.source==="existing"&&m.length>0?e.jsx(g,{label:"Pick the task",description:"Select the task this work belongs to.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.taskId,onChange:t=>n({taskId:t.target.value}),children:[e.jsx("option",{value:"",children:"— choose a task —"}),m.map(t=>e.jsxs("option",{value:t.id,children:[t.title," · ",t.status.replaceAll("_"," ")]},t.id))]})}):i.source==="existing"&&m.length===0?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-muted)]",children:'No tasks are loaded yet. Switch to "New task" to create one from scratch.'}):null]})},{id:"details",eyebrow:"Work details",title:"Describe what was done",description:"Give the work a clear title and enough context to understand it later. These become the task record if you are creating a new one.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsx(g,{label:"Title",labelHelp:"Write the title like a short achievement: what was completed, not what was started.",children:e.jsx(C,{value:i.title,placeholder:"Write postmortem draft",onChange:t=>n({title:t.target.value})})}),e.jsx(g,{label:"Owner",description:"Who did this work? Defaults to the operator name.",children:e.jsx(C,{value:i.owner,placeholder:"Your name",onChange:t=>n({owner:t.target.value})})}),e.jsx(g,{label:"Description",description:"What moved forward? What should remain visible in the project history?",children:e.jsx(ze,{className:"min-h-28",value:i.description,placeholder:"Wrote the full incident timeline and drafted the three key learnings for the team retrospective.",onChange:t=>n({description:t.target.value})})})]})},{id:"placement",eyebrow:"Placement",title:"Set the context and XP value",description:"Assign the work to a project and choose its final status. The XP value controls how much this work contributes to the operator's progress curve.",render:(i,n)=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsx(g,{label:"Project",description:"Link this work to an active project if it belongs to one.",children:e.jsxs("select",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)]",value:i.projectId,onChange:t=>n({projectId:t.target.value}),children:[e.jsx("option",{value:"",children:"No project link"}),b.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx(g,{label:"Final status",labelHelp:"'Done' is the most common choice. Use 'In progress' if the work was real but the task is still open.",children:e.jsx(F,{columns:2,value:i.status,onChange:t=>n({status:t}),options:[{value:"done",label:"Done",description:"Work is complete."},{value:"in_progress",label:"In progress",description:"Still active but already worth logging."},{value:"focus",label:"Focus",description:"Moved into focus."},{value:"blocked",label:"Blocked",description:"Work hit a wall."}]})})]}),e.jsx(g,{label:"XP value",labelHelp:"Typical task XP ranges from 20 to 100. Use 40 for routine tasks, 80+ for complex deliverables.",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(C,{type:"number",min:5,max:500,className:"w-36",value:i.points,onChange:t=>n({points:Number(t.target.value)})}),e.jsx("div",{className:"flex gap-2",children:[20,40,80,120].map(t=>e.jsxs("button",{type:"button",className:`rounded-full px-3 py-1.5 text-xs transition ${i.points===t?"bg-[var(--ui-surface-3)] text-[var(--ui-ink-strong)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-muted)] hover:bg-[var(--ui-surface-2)]"}`,onClick:()=>n({points:t}),children:[t," xp"]},t))})]})})]})}];return e.jsx(Se,{open:a,onOpenChange:r,eyebrow:"Log work",title:"Log retroactive work",description:"Capture work that happened outside the timer so it counts toward progress and XP.",value:u,onChange:f,draftPersistenceKey:"settings.log-work",steps:A,submitLabel:"Log work",pending:l,pendingLabel:"Logging work…",error:M,onSubmit:async()=>{if(j(null),u.source==="new"&&u.title.trim().length===0){j("Add a title so Forge knows what work to create.");return}if(u.source==="existing"&&!u.taskId){j("Pick an existing task or switch to New task.");return}try{await k({taskId:u.source==="existing"&&u.taskId?u.taskId:void 0,title:u.source==="new"&&u.title.trim()?u.title.trim():void 0,description:u.description.trim()||void 0,owner:u.owner.trim()||void 0,projectId:u.projectId||null,status:u.status,points:u.points}),r(!1)}catch(i){j(i instanceof Error?i.message:"Could not log the work right now.")}}})}function Te({text:a}){const[r,l]=v.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2200)}catch{}};return e.jsxs("button",{type:"button",onClick:()=>void p(),className:"flex items-center gap-1.5 rounded-full bg-[var(--ui-surface-2)] px-3 py-1.5 text-xs font-medium text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-2)] hover:text-[var(--ui-ink-strong)]",children:[r?e.jsx(Ce,{className:"size-3 text-[var(--success)]"}):e.jsx(Oe,{className:"size-3"}),r?"Copied":"Copy"]})}function se({label:a,children:r,copyText:l}){return e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:a}),e.jsx(Te,{text:l??r})]}),e.jsx("pre",{className:"mt-3 overflow-x-auto rounded-[14px] bg-[var(--ui-code-bg)] p-3 text-xs leading-6 text-[var(--ui-ink-medium)]",children:e.jsx("code",{children:r})})]})}function ks({open:a,onOpenChange:r,state:l}){if(!l)return null;const{tokenString:p,agentLabel:m,onboarding:b}=l,k=JSON.stringify({baseUrl:b.forgeBaseUrl,apiToken:p,actorLabel:m,timeoutMs:b.defaultTimeoutMs},null,2),u=[`curl -s ${b.healthUrl} \\`,` -H "Authorization: Bearer ${p}" \\`,' -H "X-Forge-Source: agent" \\',` -H "X-Forge-Actor: ${m}"`].join(`
|
|
2
2
|
`),f=["openclaw gateway restart",'openclaw agent --message "forge_get_operator_overview"'].join(`
|
|
3
3
|
`);return e.jsx(ds,{open:a,onOpenChange:r,children:e.jsxs(cs,{children:[e.jsx(us,{className:"fixed inset-0 z-40 bg-[var(--overlay)] backdrop-blur-xl"}),e.jsxs(ms,{className:"fixed left-1/2 top-1/2 z-50 flex h-[min(52rem,calc(100vh-1rem))] w-[min(52rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[34px] border border-[color-mix(in_srgb,var(--primary)_28%,transparent)] bg-[image:var(--ui-surface-modal)] shadow-[var(--ui-shadow-floating)]",children:[e.jsx(xs,{className:"sr-only",children:"Token issued — setup instructions"}),e.jsx(ps,{className:"sr-only",children:"Your new agent token has been issued. Copy it now and follow the setup guide."}),e.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-4 border-b border-[var(--ui-border-subtle)] px-6 py-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-[var(--ui-accent-soft)]",children:e.jsx(Me,{className:"size-5 text-[var(--primary)]"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Token issued"}),e.jsx("div",{className:"mt-0.5 font-display text-xl text-[var(--ui-ink-strong)]",children:"Save your token now"})]})]}),e.jsx(gs,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Close",className:"rounded-full bg-[var(--ui-surface-3)] p-2 text-[var(--ui-ink-muted)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)]",children:e.jsx(qe,{className:"size-4"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:e.jsxs(hs.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"grid gap-5",children:[e.jsxs("div",{className:"rounded-[20px] border border-[color-mix(in_srgb,var(--warning)_28%,transparent)] bg-[var(--ui-warning-soft)] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]",children:"One-time reveal"}),e.jsx("span",{className:"text-sm text-[var(--ui-ink-medium)]",children:"This value will not be shown again."})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 rounded-[14px] bg-[var(--ui-code-bg)] px-4 py-3",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs text-[var(--ui-ink-medium)]",children:p}),e.jsx(Te,{text:p})]}),e.jsx("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:"Forge stores only a hash — the raw token is unrecoverable after you close this dialog. If lost, rotate the token from the Agents settings page."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"flex size-5 items-center justify-center rounded-full bg-[var(--ui-surface-3)] text-xs font-semibold text-[var(--ui-ink-strong)]",children:"1"}),e.jsx("span",{className:"text-sm font-medium text-[var(--ui-ink-strong)]",children:"Add the token to your OpenClaw plugin config"})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4 text-sm leading-6 text-[var(--ui-ink-medium)]",children:["Open your ",e.jsx("code",{className:"rounded-md bg-[var(--ui-surface-2)] px-1.5 py-0.5 text-xs text-[var(--ui-ink-medium)]",children:"openclaw.json"})," file and find the"," ",e.jsx("code",{className:"rounded-md bg-[var(--ui-surface-2)] px-1.5 py-0.5 text-xs text-[var(--ui-ink-medium)]",children:"forge"})," plugin entry under"," ",e.jsx("code",{className:"rounded-md bg-[var(--ui-surface-2)] px-1.5 py-0.5 text-xs text-[var(--ui-ink-medium)]",children:"plugins"}),". Add or replace its"," ",e.jsx("code",{className:"rounded-md bg-[var(--ui-surface-2)] px-1.5 py-0.5 text-xs text-[var(--ui-ink-medium)]",children:"params"})," with the config block below."]}),e.jsx("div",{className:"mt-3",children:e.jsx(se,{label:"Plugin params — paste into openclaw.json → plugins → forge → params",copyText:k,children:k})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"flex size-5 items-center justify-center rounded-full bg-[var(--ui-surface-3)] text-xs font-semibold text-[var(--ui-ink-strong)]",children:"2"}),e.jsx("span",{className:"text-sm font-medium text-[var(--ui-ink-strong)]",children:"Restart the gateway and confirm the agent can connect"})]}),e.jsx(se,{label:"Run in terminal",copyText:f,children:f})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"flex size-5 items-center justify-center rounded-full bg-[var(--ui-surface-3)] text-xs font-semibold text-[var(--ui-ink-strong)]",children:"3"}),e.jsx("span",{className:"text-sm font-medium text-[var(--ui-ink-strong)]",children:"Verify the token is accepted by the API"})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4 text-sm leading-6 text-[var(--ui-ink-medium)]",children:["Run the curl below. A"," ",e.jsx("code",{className:"rounded-md bg-[var(--ui-surface-2)] px-1.5 py-0.5 text-xs text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]",children:"200 OK"})," response means the token works and the agent"," ",e.jsx("strong",{className:"text-[var(--ui-ink-medium)]",children:m})," is authenticated."]}),e.jsx("div",{className:"mt-3",children:e.jsx(se,{label:"Verify token — run in terminal",copyText:u,children:u})})]}),e.jsxs("div",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm leading-6 text-[var(--ui-ink-muted)]",children:[e.jsx("strong",{className:"text-[var(--ui-ink-medium)]",children:"Tip:"})," If you ever lose this token, go to ",e.jsx("strong",{className:"text-[var(--ui-ink-medium)]",children:"Settings → Agents → Agent tokens"}),", find the entry, and click"," ",e.jsx("strong",{className:"text-[var(--ui-ink-medium)]",children:"Rotate & reveal"})," to get a fresh value without creating a new agent identity."]})]})}),e.jsx("div",{className:"shrink-0 border-t border-[var(--ui-border-subtle)] px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-sm text-[var(--ui-ink-muted)]",children:"Token saved? Close this dialog when you are ready."}),e.jsxs(P,{onClick:()=>r(!1),children:[e.jsx(Ce,{className:"size-4"}),"Done"]})]})})]})]})})}function Q(a,r){return r.every(l=>a.scopes.includes(l))}function z(a){if(!a)return"Never";try{return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(a))}catch{return a}}function Ne(a){return a==="connected"?"text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]":a==="stale"||a==="reconnecting"?"text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]":a==="error"?"text-[color-mix(in_srgb,var(--danger)_78%,var(--ui-ink-strong)_22%)]":"text-[var(--ui-ink-muted)]"}function ws(a){return a.some(r=>r.status==="connected")?"connected":a.some(r=>r.status==="reconnecting")?"reconnecting":a.some(r=>r.status==="error")?"error":a.some(r=>r.status==="stale")?"stale":"disconnected"}function Ns(a){const r=new Map;for(const l of a){const p=l.agentId??`${l.provider}:${l.agentLabel}`,m=r.get(p);if(!m){r.set(p,{key:p,agentId:l.agentId,agentLabel:l.agentLabel,provider:l.provider,status:l.status,primary:l,sessions:[l],actionCount:l.actionCount,eventCount:l.eventCount});continue}m.sessions.push(l),m.actionCount+=l.actionCount,m.eventCount+=l.eventCount,m.sessions.sort((b,k)=>Date.parse(k.lastHeartbeatAt)-Date.parse(b.lastHeartbeatAt)),m.primary=m.sessions[0]??m.primary,m.status=ws(m.sessions)}return Array.from(r.values()).sort((l,p)=>Date.parse(p.primary.lastHeartbeatAt)-Date.parse(l.primary.lastHeartbeatAt))}function Pe(a){return a.replaceAll("_"," ")}function Ps(a){const r=[];return a.scopePolicy.userIds.length>0?r.push(`${a.scopePolicy.userIds.length} user${a.scopePolicy.userIds.length===1?"":"s"}`):r.push("all visible users"),a.scopePolicy.projectIds.length>0&&r.push(`${a.scopePolicy.projectIds.length} project${a.scopePolicy.projectIds.length===1?"":"s"}`),a.scopePolicy.tagIds.length>0&&r.push(`${a.scopePolicy.tagIds.length} tag${a.scopePolicy.tagIds.length===1?"":"s"}`),r.join(" · ")}function Os(){var ge,he,ve,be,je,fe;const a=Ke(),[r,l]=v.useState(!1),[p,m]=v.useState("operator"),[b,k]=v.useState(null),[u,f]=v.useState(!1),[M,j]=v.useState(!1),[A,i]=v.useState(!1),[n,t]=v.useState(null),y=R({queryKey:["forge-operator-session"],queryFn:ts}),S=y.isSuccess,q=R({queryKey:["forge-settings"],queryFn:as,enabled:S}),Le=R({queryKey:["forge-approval-requests"],queryFn:is,enabled:S}),ae=R({queryKey:["forge-agent-onboarding"],queryFn:rs}),Y=R({queryKey:["forge-agent-runtime-sessions"],queryFn:ns,enabled:S}),J=R({queryKey:["forge-agent-runtime-session-history",n],queryFn:()=>os(n),enabled:S&&!!n}),_e=R({queryKey:["forge-operator-context"],queryFn:ls,enabled:S}),T=async()=>{await Promise.all([a.invalidateQueries({queryKey:["forge-operator-session"]}),a.invalidateQueries({queryKey:["forge-settings"]}),a.invalidateQueries({queryKey:["forge-approval-requests"]}),a.invalidateQueries({queryKey:["forge-agent-onboarding"]}),a.invalidateQueries({queryKey:["forge-agent-runtime-sessions"]}),a.invalidateQueries({queryKey:["forge-agent-runtime-session-history"]}),a.invalidateQueries({queryKey:["forge-operator-context"]})])},ie=_({mutationFn:s=>We(s),onSuccess:T}),re=_({mutationFn:s=>Qe(s),onSuccess:async s=>{if(await T(),o){const d=s.token;k({tokenString:d.token,agentLabel:d.tokenSummary.agentLabel??"forge-agent",onboarding:o}),f(!0)}}}),ne=_({mutationFn:s=>Xe(s),onSuccess:T}),oe=_({mutationFn:s=>Ge(s),onSuccess:T}),le=_({mutationFn:s=>Ye(s),onSuccess:T}),de=_({mutationFn:({sessionId:s,note:d})=>Je(s,d),onSuccess:T}),ce=_({mutationFn:({sessionId:s,note:d,lastError:c})=>Ze(s,{note:d,lastError:c}),onSuccess:T}),O=_({mutationFn:Ve,onSuccess:T}),w=(ge=q.data)==null?void 0:ge.settings,D=((he=Le.data)==null?void 0:he.approvalRequests)??[],o=(ve=ae.data)==null?void 0:ve.onboarding,ue=v.useMemo(()=>{var s;return((s=Y.data)==null?void 0:s.sessions)??[]},[(be=Y.data)==null?void 0:be.sessions]),E=v.useMemo(()=>Ns(ue),[ue]),I=J.data,x=(je=_e.data)==null?void 0:je.context,L=(w==null?void 0:w.agentTokens.filter(s=>s.status==="active"))??[],me=(o==null?void 0:o.recommendedScopes)??[],B=L.some(s=>Q(s,me)),H=L.some(s=>Q(s,["rewards.manage"])),U=L.some(s=>Q(s,["psyche.write"])),K=L.some(s=>s.autonomyMode!=="approval_required"&&Q(s,["write"])),$=L.length>0,xe=E.filter(s=>s.status==="connected"),pe=E.filter(s=>s.status==="stale"),Ie=v.useMemo(()=>{if(!x)return[];const s=[...x.focusTasks,...x.currentBoard.backlog,...x.currentBoard.focus,...x.currentBoard.inProgress,...x.currentBoard.blocked,...x.currentBoard.done],d=new Map;for(const c of s)d.set(c.id,c);return[...d.values()]},[x]),Re=(w==null?void 0:w.profile.operatorName)??"",Fe=[{label:"Operator session",ok:!0,badge:"active",badgeTone:"emerald",detail:(fe=y.data)!=null&&fe.session?`Session open as ${y.data.session.actorLabel}. Works for localhost and Tailscale without a token.`:"Passwordless session is active for local and Tailscale access.",action:null},{label:"Agent token",ok:$,badge:$?`${L.length} active`:"none issued",badgeTone:$?"emerald":"amber",detail:$?`${L.length} active token${L.length===1?"":"s"} allow external agents and scripts to authenticate.`:"No token yet. Issue one to let external agents connect via the API.",action:$?null:{label:"Issue token",preset:"operator",onClick:()=>{m("operator"),l(!0)}}},{label:"Full operator bundle",ok:B,badge:B?"ready":"optional",badgeTone:B?"emerald":"neutral",detail:B?"A token covers all recommended scopes for full operator collaboration.":"No token covers the full recommended scope bundle. Issue one to unlock complete agent collaboration.",action:B?null:{label:"Set up",preset:"operator",onClick:()=>{m("operator"),l(!0)}}},{label:"Reward control",ok:H,badge:H?"ready":"optional",badgeTone:H?"emerald":"neutral",detail:H?"An agent can tune reward rules and issue bonus XP grants.":"No token has rewards.manage — agents cannot adjust XP rules or issue bonuses.",action:H?null:{label:"Add scope",preset:"operator",onClick:()=>{m("operator"),l(!0)}}},{label:"Psyche writes",ok:U,badge:U?"ready":"optional",badgeTone:U?"emerald":"neutral",detail:U?"Sensitive Psyche collaboration is enabled — agents can create and update therapeutic records.":"No token has psyche.write — agent collaboration on sensitive Psyche records is disabled.",action:U?null:{label:"Add scope",preset:"operator",onClick:()=>{m("operator"),l(!0)}}},{label:"Scoped writes",ok:K,badge:K?"ready":"optional",badgeTone:K?"emerald":"neutral",detail:K?"A trusted agent can write without constant approval prompts.":"All write tokens are approval-required. Agents must queue every mutation for your review.",action:K?null:{label:"Configure",preset:"operator",onClick:()=>{m("operator"),l(!0)}}}];return y.isLoading||q.isLoading?e.jsx(es,{eyebrow:"Settings · Agents",title:"Loading agent console",description:"Establishing the operator session and loading agent configuration.",columns:2,blocks:6}):y.isError?e.jsx(ye,{eyebrow:"Settings · Agents",error:y.error,onRetry:()=>void y.refetch()}):q.isError||!w?e.jsx(ye,{eyebrow:"Settings · Agents",error:q.error??new Error("Could not load settings."),onRetry:()=>void q.refetch()}):e.jsxs("div",{className:"mx-auto grid w-full max-w-[1220px] gap-5",children:[e.jsx(bs,{title:"Agents",description:"Connection status, capability access, tokens, approval queue, and work logging."}),e.jsx(vs,{}),e.jsx(fs,{open:r,onOpenChange:l,pending:ie.isPending,initialPreset:p,defaultAgentLabel:(o==null?void 0:o.defaultActorLabel)??"OpenClaw",recommendedScopes:me,onSubmit:async s=>{const d=await ie.mutateAsync(s);l(!1),o&&(k({tokenString:d.token.token,agentLabel:s.agentLabel,onboarding:o}),f(!0))}}),e.jsx(ks,{open:u,onOpenChange:f,state:b}),e.jsx(ys,{open:M,onOpenChange:j,pending:O.isPending,defaultOwner:Re,availableTasks:Ie,availableProjects:(x==null?void 0:x.activeProjects)??[],onSubmit:async s=>{await O.mutateAsync(s)}}),e.jsxs("div",{className:"grid gap-5",children:[x?e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[e.jsx(W,{label:"Active sessions",value:xe.length,tone:"core"}),e.jsx(W,{label:"Stale sessions",value:pe.length,tone:"core"}),e.jsx(W,{label:"Pending approvals",value:D.filter(s=>s.status==="pending").length,tone:"core"}),e.jsx(W,{label:"Operator level",value:x.xp.profile.level,tone:"core",detail:`${x.xp.profile.totalXp} total XP`})]}):null,e.jsxs(N,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Capability status"}),e.jsx("div",{className:"mt-4 grid gap-3",children:Fe.map(s=>e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"font-medium text-[var(--ui-ink-strong)]",children:s.label}),e.jsx(h,{className:s.badgeTone==="emerald"?"text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]":s.badgeTone==="amber"?"text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]":"text-[var(--ui-ink-muted)]",children:s.badge})]}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-[var(--ui-ink-muted)]",children:s.detail})]}),s.action?e.jsxs("button",{type:"button",onClick:s.action.onClick,className:"mt-0.5 flex shrink-0 items-center gap-1.5 rounded-full bg-[var(--ui-surface-2)] px-3 py-1.5 text-xs font-medium text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-2)] hover:text-[var(--ui-ink-strong)]",children:[s.action.label,e.jsx(De,{className:"size-3"})]}):null]},s.label))})]}),e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Runtime sessions"}),e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-muted)]",children:"Live OpenClaw, Hermes, and Codex sessions registered against this Forge runtime, with stale detection and reconnect guidance."})]}),E.length>0?e.jsxs(h,{className:"text-[var(--ui-ink-medium)]",children:[xe.length," live ·"," ",pe.length," stale"]}):null]}),e.jsx("div",{className:"mt-4 grid gap-3",children:Y.isLoading?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-4 text-sm text-[var(--ui-ink-muted)]",children:"Loading agent runtime sessions…"}):E.length===0?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-4 text-sm text-[var(--ui-ink-muted)]",children:"No runtime sessions have registered yet. OpenClaw, Hermes, and Codex now self-register here when their Forge adapter starts."}):E.map(s=>{const d=s.primary;return e.jsxs("div",{className:"min-w-0 rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:s.agentLabel}),e.jsx(h,{className:Ne(s.status),children:s.status})]}),e.jsxs("div",{className:"mt-1 text-sm text-[var(--ui-ink-muted)]",children:[s.provider," ·"," ",d.connectionMode.replaceAll("_"," ")," · last heartbeat ",z(d.lastHeartbeatAt)]}),e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs text-[var(--ui-ink-muted)]",children:[e.jsxs("span",{children:[s.sessions.length," runtime session",s.sessions.length===1?"":"s"]}),e.jsxs("span",{className:"min-w-0 break-all",children:["Current key ",d.sessionKey]}),e.jsxs("span",{children:[s.actionCount," recorded actions"]}),e.jsxs("span",{children:[s.eventCount," session events"]})]}),d.lastError?e.jsx("div",{className:"mt-3 text-sm text-[color-mix(in_srgb,var(--danger)_78%,var(--ui-ink-strong)_22%)]",children:d.lastError}):null]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap gap-2 lg:shrink-0 lg:justify-end",children:[s.status!=="connected"?e.jsx(P,{variant:"secondary",size:"sm",className:"flex-1 sm:flex-none",pending:de.isPending,pendingLabel:"Requesting",onClick:()=>void de.mutateAsync({sessionId:d.id}),children:"Reconnect"}):null,e.jsx(P,{variant:"secondary",size:"sm",className:"flex-1 sm:flex-none",onClick:()=>t(c=>c===d.id?null:d.id),children:n===d.id?"Hide history":"View history"}),s.status!=="disconnected"?e.jsx(P,{variant:"ghost",size:"sm",className:"flex-1 sm:flex-none",pending:ce.isPending,pendingLabel:"Closing",onClick:()=>void ce.mutateAsync({sessionId:d.id,note:"Marked disconnected from the Forge agents console."}),children:"Mark offline"}):null]})]}),d.recentEvents.length>0?e.jsx("div",{className:"mt-4 grid gap-2",children:d.recentEvents.slice(0,3).map(c=>e.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-[16px] bg-[var(--ui-surface-2)] px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm text-[var(--ui-ink-strong)]",children:c.title}),e.jsx("div",{className:"mt-0.5 text-xs leading-5 text-[var(--ui-ink-muted)]",children:c.summary||c.eventType})]}),e.jsx("div",{className:"shrink-0 text-xs text-[var(--ui-ink-muted)]",children:z(c.createdAt)})]},c.id))}):null,e.jsxs("div",{className:"mt-4 rounded-[16px] bg-[var(--ui-code-bg)] p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Reconnect plan"}),e.jsx("div",{className:"mt-2 text-sm text-[var(--ui-ink-medium)]",children:d.reconnectPlan.summary}),e.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-words text-xs leading-6 text-[var(--ui-ink-medium)] md:overflow-x-auto md:whitespace-pre",children:e.jsx("code",{className:"break-words",children:d.reconnectPlan.commands.join(`
|
|
4
4
|
`)})})]}),s.sessions.length>1?e.jsxs("div",{className:"mt-4 rounded-[16px] bg-[var(--ui-code-bg)] p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Session history under this agent"}),e.jsx("div",{className:"mt-2 grid gap-2",children:s.sessions.slice(0,6).map(c=>e.jsxs("div",{className:"grid min-w-0 gap-1 rounded-[12px] bg-[var(--ui-surface-2)] px-3 py-2 text-xs text-[var(--ui-ink-muted)] sm:flex sm:items-center sm:justify-between sm:gap-2",children:[e.jsx("span",{className:"min-w-0 break-all sm:truncate",children:c.sessionKey}),e.jsxs("span",{className:`${Ne(c.status)} min-w-0 break-words sm:shrink-0`,children:[c.status," ·"," ",z(c.lastHeartbeatAt)]})]},c.id))})]}):null,n===d.id?e.jsxs("div",{className:"mt-4 rounded-[16px] bg-[var(--ui-code-bg)] p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Work history"}),J.isLoading?e.jsx("div",{className:"mt-3 text-sm text-[var(--ui-ink-muted)]",children:"Loading session history…"}):J.isError?e.jsx("div",{className:"mt-3 text-sm text-[color-mix(in_srgb,var(--danger)_78%,var(--ui-ink-strong)_22%)]",children:"Could not load session history."}):(I==null?void 0:I.session.id)===d.id?e.jsxs("div",{className:"mt-3 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Agent actions"}),e.jsx("div",{className:"mt-2 grid gap-2",children:I.actions.length>0?I.actions.map(c=>e.jsxs("div",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-sm text-[var(--ui-ink-strong)]",children:c.title}),e.jsx(h,{className:"text-[var(--ui-ink-muted)]",children:c.status})]}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-muted)]",children:c.summary||c.actionType}),e.jsx("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:z(c.createdAt)})]},c.id)):e.jsx("div",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-2.5 text-sm text-[var(--ui-ink-muted)]",children:"No recorded agent actions for this session yet."})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Session events"}),e.jsx("div",{className:"mt-2 grid gap-2",children:I.events.length>0?I.events.map(c=>e.jsxs("div",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-sm text-[var(--ui-ink-strong)]",children:c.title}),e.jsx(h,{className:"text-[var(--ui-ink-muted)]",children:c.level})]}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-muted)]",children:c.summary||c.eventType}),e.jsx("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:z(c.createdAt)})]},c.id)):e.jsx("div",{className:"rounded-[14px] bg-[var(--ui-surface-2)] px-3 py-2.5 text-sm text-[var(--ui-ink-muted)]",children:"No session events recorded yet."})})]})]}):null]}):null]},s.key)})})]}),e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Agent tokens"}),e.jsxs(P,{size:"sm",variant:"secondary",onClick:()=>{m("operator"),l(!0)},children:[e.jsx(Ee,{className:"size-3.5"}),"Issue token"]})]}),e.jsx("div",{className:"mt-4 grid gap-3",children:w.agentTokens.length===0?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-4 text-sm text-[var(--ui-ink-muted)]",children:"No tokens yet. Issue one to let external agents or scripts authenticate with Forge."}):w.agentTokens.map(s=>e.jsxs("div",{className:"min-w-0 rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:s.label}),e.jsxs("div",{className:"mt-0.5 text-sm text-[var(--ui-ink-muted)]",children:[s.agentLabel??"Unassigned agent"," ·"," ",e.jsx("span",{className:"break-all font-mono text-xs",children:s.tokenPrefix})]})]}),e.jsx(h,{className:`${s.status==="active"?"text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]":"text-[var(--ui-ink-muted)]"} self-start`,children:s.status})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs text-[var(--ui-ink-muted)]",children:[e.jsx("span",{children:s.trustLevel}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.autonomyMode.replaceAll("_"," ")}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.approvalMode.replaceAll("_"," ")})]}),e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:["Bootstrap: ",Pe(s.bootstrapPolicy.mode)," · ",s.bootstrapPolicy.projectsLimit," projects"," · ",s.bootstrapPolicy.tasksLimit," tasks",s.bootstrapPolicy.includePeoplePages?` · ${s.bootstrapPolicy.peoplePageLimit} people pages`:" · no people pages"]}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:["Default read scope: ",Ps(s)]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:["write","rewards.manage","psyche.write"].map(d=>e.jsx(h,{className:s.scopes.includes(d)?"text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]":"text-[var(--ui-ink-muted)]",children:d},d))}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(P,{variant:"secondary",size:"sm",pending:re.isPending,pendingLabel:"Rotating",onClick:()=>void re.mutateAsync(s.id),children:"Rotate & reveal new token"}),e.jsx(P,{variant:"ghost",size:"sm",pending:ne.isPending,pendingLabel:"Revoking",onClick:()=>void ne.mutateAsync(s.id),children:"Revoke"})]})]},s.id))}),e.jsx("div",{className:"mt-3 px-1 text-xs text-[var(--ui-ink-muted)]",children:"Raw token values are shown once and are never recoverable. If a token is lost, rotate or issue a new one."})]}),w.agents.length>0?e.jsxs(N,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Connected agents"}),e.jsx("div",{className:"mt-4 grid gap-3",children:w.agents.map(s=>e.jsxs("div",{className:"flex min-w-0 flex-col gap-3 rounded-[18px] bg-[var(--ui-surface-2)] p-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:s.label}),s.description?e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-muted)]",children:s.description}):null,s.linkedUsers.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:s.linkedUsers.map(d=>{var c;return e.jsx(h,{className:"text-[var(--ui-ink-muted)]",children:((c=d.user)==null?void 0:c.displayName)??d.userId},d.userId)})}):null,e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-sm text-[var(--ui-ink-muted)]",children:[e.jsx("span",{children:s.agentType}),s.identityKey?e.jsx("span",{className:"min-w-0 break-all font-mono text-xs",children:s.identityKey}):null,e.jsx("span",{children:s.autonomyMode.replaceAll("_"," ")}),e.jsxs("span",{children:[s.activeTokenCount," active token",s.activeTokenCount!==1?"s":""]})]})]}),e.jsx(h,{className:"self-start text-[var(--ui-ink-medium)]",children:s.trustLevel})]},s.id))})]}):null,x?e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,0.95fr)]",children:[e.jsxs(N,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Recommended next move"}),x.recommendedNextTask?e.jsxs("div",{className:"mt-4 grid gap-2",children:[e.jsx(Z,{kind:"task",label:x.recommendedNextTask.title,variant:"heading",size:"lg"}),e.jsx("div",{className:"text-sm leading-6 text-[var(--ui-ink-muted)]",children:x.recommendedNextTask.description||"No extra notes yet."}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.jsx(h,{children:x.recommendedNextTask.status.replaceAll("_"," ")}),e.jsxs(h,{children:[x.recommendedNextTask.points," xp"]}),e.jsx(h,{children:x.recommendedNextTask.owner})]})]}):e.jsx("div",{className:"mt-4 text-sm text-[var(--ui-ink-muted)]",children:"Board is clear. No recommended task right now."})]}),e.jsxs(N,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Board pulse"}),e.jsx("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[{label:"Backlog",value:x.currentBoard.backlog.length},{label:"Focus",value:x.currentBoard.focus.length},{label:"In progress",value:x.currentBoard.inProgress.length},{label:"Blocked",value:x.currentBoard.blocked.length}].map(s=>e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:s.label}),e.jsx("div",{className:"mt-2 font-display text-3xl text-[var(--ui-ink-strong)]",children:s.value})]},s.label))})]})]}):null,x&&x.activeProjects.length>0?e.jsxs(N,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Active projects"}),e.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:x.activeProjects.slice(0,6).map(s=>e.jsxs("div",{className:"min-w-0 rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsx("div",{className:"min-w-0",children:e.jsx(Z,{kind:"project",label:s.title})}),e.jsxs(h,{className:"self-start",children:[s.progress,"%"]})]}),e.jsx("div",{className:"mt-2",children:e.jsx(ss,{kind:"goal",label:s.goalTitle,compact:!0,gradient:!1})}),e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:[s.activeTaskCount," active ·"," ",s.completedTaskCount," done"]})]},s.id))})]}):null,e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Approval queue"}),D.filter(s=>s.status==="pending").length>0?e.jsxs(h,{className:"text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]",children:[D.filter(s=>s.status==="pending").length," pending"]}):null]}),e.jsx("div",{className:"mt-4 grid gap-3",children:D.length===0?e.jsx("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-4 text-sm text-[var(--ui-ink-muted)]",children:"No pending approvals. Agent actions are flowing through."}):D.map(s=>e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:s.title}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--ui-ink-muted)]",children:s.summary||s.actionType})]}),e.jsx(h,{className:s.status==="pending"?"text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]":"text-[var(--ui-ink-muted)]",children:s.status})]}),s.status==="pending"?e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(P,{variant:"secondary",size:"sm",pending:oe.isPending,pendingLabel:"Approving",onClick:()=>void oe.mutateAsync(s.id),children:"Approve"}),e.jsx(P,{variant:"ghost",size:"sm",pending:le.isPending,pendingLabel:"Rejecting",onClick:()=>void le.mutateAsync(s.id),children:"Reject"})]}):null]},s.id))})]}),e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Retroactive work log"}),e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-muted)]",children:"Capture work done outside the timer so it counts toward progress and XP."})]}),e.jsxs(P,{variant:"secondary",size:"sm",onClick:()=>j(!0),children:[e.jsx(Be,{className:"size-3.5"}),"Log work"]})]}),O.data?e.jsxs("div",{className:"mt-4 rounded-[18px] bg-[var(--ui-accent-soft)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",children:["Logged"," ",e.jsx("span",{className:"inline-block align-middle",children:e.jsx(Z,{kind:"task",label:O.data.task.title,showKind:!1})}),". Operator XP updated to ",O.data.xp.profile.totalXp,"."]}):null]}),e.jsxs(N,{children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-4 text-left",onClick:()=>i(s=>!s),children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Connection & onboarding"}),o?e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-muted)]",children:o.forgeBaseUrl}):null]}),A?e.jsx(He,{className:"size-4 shrink-0 text-[var(--ui-ink-muted)]"}):e.jsx(Ue,{className:"size-4 shrink-0 text-[var(--ui-ink-muted)]"})]}),A&&o?e.jsxs("div",{className:"mt-5 grid gap-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Forge API"}),e.jsx("div",{className:"mt-2 break-all text-sm text-[var(--ui-ink-strong)]",children:o.forgeBaseUrl})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Web app"}),e.jsx("div",{className:"mt-2 break-all text-sm text-[var(--ui-ink-strong)]",children:o.webAppUrl})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"OpenAPI spec"}),e.jsx("div",{className:"mt-2 break-all text-sm text-[var(--ui-ink-strong)]",children:o.openApiUrl})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Default policy"}),e.jsxs("div",{className:"mt-2 text-sm text-[var(--ui-ink-strong)]",children:[o.recommendedTrustLevel," ·"," ",o.recommendedAutonomyMode.replaceAll("_"," ")," ·"," ",o.recommendedApprovalMode.replaceAll("_"," ")]}),e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:["Bootstrap default:"," ",Pe(o.defaultBootstrapPolicy.mode)," · ",o.defaultBootstrapPolicy.projectsLimit," projects"," · ",o.defaultBootstrapPolicy.tasksLimit," tasks"]})]})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:o.authModes.operatorSession.label}),e.jsx(h,{className:"mt-1 text-[color-mix(in_srgb,var(--success)_78%,var(--ui-ink-strong)_22%)]",children:o.defaultConnectionMode==="operator_session"?"default":"available"}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:o.authModes.operatorSession.summary}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:o.authModes.operatorSession.trustedTargets.map(s=>e.jsx(h,{className:"text-[var(--ui-ink-medium)]",children:s},s))})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:o.authModes.managedToken.label}),e.jsx(h,{className:"mt-1 text-[var(--ui-ink-muted)]",children:"optional"}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:o.authModes.managedToken.summary}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-muted)]",children:o.tokenRecovery.rotationSummary})]})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Shared runtime"}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:"Keep Forge, OpenClaw, Hermes, and the browser on the same runtime when they should see one shared user directory, one strategy graph, and one task history."}),e.jsxs("div",{className:"mt-3 text-xs leading-5 text-[var(--ui-ink-muted)]",children:["Base URL: ",o.forgeBaseUrl]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Agent identity"}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:"Create each agent as a bot user, then write with that user's `userId`. The relationship graph in Settings -> Users controls what each direction can see, message, share, plan, and affect."}),e.jsx("div",{className:"mt-3 text-xs leading-5 text-[var(--ui-ink-muted)]",children:"Cross-owner links stay valid even when ownership differs."})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Contract timing"}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-medium)]",children:"Leave strategies editable while humans and bots refine the graph. Lock them only when the plan becomes the contract the alignment metrics should judge."}),e.jsx("div",{className:"mt-3 text-xs leading-5 text-[var(--ui-ink-muted)]",children:"Coverage, sequencing, scope discipline, and quality all contribute to alignment now."})]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Fast onboarding checklist"}),e.jsxs("div",{className:"mt-3 grid gap-2 text-sm leading-6 text-[var(--ui-ink-medium)]",children:[e.jsx("div",{children:"1. Create the human and bot users in Settings -> Users."}),e.jsx("div",{children:"2. Keep the default graph permissive until collaboration is flowing cleanly."}),e.jsx("div",{children:"3. Point OpenClaw and Hermes at the same Forge runtime and storage root when they should collaborate."}),e.jsx("div",{children:"4. Give each adapter a distinct actor label so activity stays readable."}),e.jsx("div",{children:"5. Build strategies as drafts first, then lock when the plan is ready to become the contract."})]})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Rights language"}),e.jsxs("div",{className:"mt-3 grid gap-2 text-sm leading-6 text-[var(--ui-ink-medium)]",children:[e.jsx("div",{children:"`See` means discover, search, and read another owner."}),e.jsx("div",{children:"`Message` means coordinate and hand off through Forge."}),e.jsx("div",{children:"`Plan` means draft or edit that owner's strategies."}),e.jsx("div",{children:"`Affect` means create or mutate that owner's work."})]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Strategy lifecycle"}),e.jsxs("div",{className:"mt-3 grid gap-2 text-sm leading-6 text-[var(--ui-ink-medium)]",children:[e.jsx("div",{children:"1. Save an incomplete draft while the plan is still being negotiated."}),e.jsx("div",{children:"2. Let humans and bots refine targets, nodes, and sequence together."}),e.jsx("div",{children:"3. Lock only when the graph becomes the contract for alignment."}),e.jsx("div",{children:"4. Unlock only when the contract itself is being renegotiated."})]})]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Quick-connect verification"}),e.jsx("pre",{className:"mt-3 overflow-x-auto rounded-[16px] bg-[var(--ui-code-bg)] p-4 text-xs leading-6 text-[var(--ui-ink-medium)]",children:e.jsx("code",{children:[`curl -s ${o.healthUrl}`,"openclaw plugins install ./projects/forge","openclaw gateway restart"].join(`
|