forge-openclaw-plugin 0.3.18 → 0.3.19
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/{action-bar-BAZevCEA.js → action-bar-B3ttL3XF.js} +1 -1
- package/dist/assets/{activity-page-CnT_hnCU.js → activity-page-CoNcd0PX.js} +1 -1
- package/dist/assets/{ai-surface-workspace-GPZzIIut.js → ai-surface-workspace-Db34puL5.js} +1 -1
- package/dist/assets/artifacts-page-C09tfJTW.js +2 -0
- package/dist/assets/{atlas-panel-B95nrYpZ.js → atlas-panel-DRMA3RbG.js} +1 -1
- package/dist/assets/{board-CGgOvBP9.js → board-Dl7As76Q.js} +1 -1
- package/dist/assets/{calendar-page-mlr94wIS.js → calendar-page-CagtpmrB.js} +1 -1
- package/dist/assets/{calendar-rules-DdxPmBZJ.js → calendar-rules-jys-Ya5M.js} +1 -1
- package/dist/assets/{calendar-week-toolbar-Cu8V6zv1.js → calendar-week-toolbar-DWTObcj1.js} +1 -1
- package/dist/assets/{charts-Cdtn55ol.js → charts-YpkKrjkZ.js} +1 -1
- package/dist/assets/{companion-sync-lab-page-CJI5jf8W.js → companion-sync-lab-page-COYI00E2.js} +1 -1
- package/dist/assets/{daily-metrics-dashboard-CXESx7bU.js → daily-metrics-dashboard-CLoHakVX.js} +1 -1
- package/dist/assets/{define-workbench-box-Dbl9W7oE.js → define-workbench-box-DkTWtzNA.js} +1 -1
- package/dist/assets/{entity-link-multiselect-DZ_jAjs4.js → entity-link-multiselect-HmmmJO5A.js} +1 -1
- package/dist/assets/{entity-note-count-link-FOK_qhcC.js → entity-note-count-link-BDLj5ezr.js} +1 -1
- package/dist/assets/{entity-notes-surface-Dq9dFKjD.js → entity-notes-surface-Csbm1myW.js} +1 -1
- package/dist/assets/{execution-board-D9hkXKC2.js → execution-board-C7wYWJE4.js} +1 -1
- package/dist/assets/{faceted-token-search-BeShxjkc.js → faceted-token-search-B2XWEl8j.js} +1 -1
- package/dist/assets/{flagship-signal-deck-DZx_HEH9.js → flagship-signal-deck-DnNN_VE1.js} +1 -1
- package/dist/assets/{floating-action-menu-CFrgvQJi.js → floating-action-menu-D2Lk9TOc.js} +1 -1
- package/dist/assets/{forms-DhEGHkFR.js → forms-DznAv9hZ.js} +1 -1
- package/dist/assets/{generic-node-view-C1kLClIm.js → generic-node-view-C_WhZXoj.js} +1 -1
- package/dist/assets/goal-detail-page-B395rAnv.js +1 -0
- package/dist/assets/{goal-dialog-BlZHh3dw.js → goal-dialog-DiEV3MyU.js} +1 -1
- package/dist/assets/goals-page-BNwaz0yD.js +1 -0
- package/dist/assets/{graph-U1J6VkbG.js → graph-BUSFLDnl.js} +1 -1
- package/dist/assets/{habits-page-DHxZSThT.js → habits-page-BkfbiwMJ.js} +1 -1
- package/dist/assets/{health-boxes-BZjIqiiG.js → health-boxes-BlA33CqS.js} +1 -1
- package/dist/assets/index-C0CztQTU.js +2 -0
- package/dist/assets/index-CKnJCN1y.css +1 -0
- package/dist/assets/{inline-note-fields-DpmCMAJf.js → inline-note-fields-CbA0QOnc.js} +1 -1
- package/dist/assets/{insight-flow-dialog-DNIe0sts.js → insight-flow-dialog-DdxIE6oo.js} +1 -1
- package/dist/assets/{insights-page-D_N_MWGu.js → insights-page-C0q_J9Hz.js} +1 -1
- package/dist/assets/{kanban-boxes-DTDG5UEJ.js → kanban-boxes-BynqbGHC.js} +1 -1
- package/dist/assets/{kanban-page-DEvIY5IW.js → kanban-page-DyiaHH0e.js} +1 -1
- package/dist/assets/{knowledge-graph-page-CvXSnnG5.js → knowledge-graph-page-Cn9VkUur.js} +1 -1
- package/dist/assets/{life-force-page-CgvUrqQb.js → life-force-page-DQPEIj23.js} +1 -1
- package/dist/assets/{life-force-workspace-BNeMbRHf.js → life-force-workspace-Db7XThH2.js} +1 -1
- package/dist/assets/{maps-Dk9tZqTA.js → maps-CpdpZmGM.js} +1 -1
- package/dist/assets/{metric-tile-DAhX60rg.js → metric-tile-sDt_l_O7.js} +1 -1
- package/dist/assets/{motion-DeJZhOSA.js → motion-eRlWWQT8.js} +1 -1
- package/dist/assets/{movement-boxes-BOqU18NH.js → movement-boxes-birc_cd8.js} +1 -1
- package/dist/assets/{movement-page-DCDeUynh.js → movement-page-BQllmJBm.js} +1 -1
- package/dist/assets/{note-markdown-Cxj84-0j.js → note-markdown-Dpve4W0R.js} +1 -1
- package/dist/assets/{note-tags-input-CP0-EPpE.js → note-tags-input-Hvi_ifLe.js} +1 -1
- package/dist/assets/{notes-boxes-C7WPT7mf.js → notes-boxes-J-MuDr8u.js} +1 -1
- package/dist/assets/{notes-page-Dll8PIks.js → notes-page-uR_LafDv.js} +1 -1
- package/dist/assets/{open-in-graph-button-BHl16hJP.js → open-in-graph-button-JgYTH-IQ.js} +1 -1
- package/dist/assets/{orbit-map-De0qpMpY.js → orbit-map-BpNCTagm.js} +1 -1
- package/dist/assets/overview-page-DQB4q_vg.js +1 -0
- package/dist/assets/{page-hero-DYmFM6-q.js → page-hero-ED69y6m0.js} +1 -1
- package/dist/assets/pill-cluster-DbPrs1Y4.js +1 -0
- package/dist/assets/{preference-entity-handoff-button-1XXtBsUF.js → preference-entity-handoff-button-NkwkWqGv.js} +1 -1
- package/dist/assets/{preferences-page-OwfPIQwe.js → preferences-page-BFUVjsHA.js} +1 -1
- package/dist/assets/{project-collections-DfmkBk9d.js → project-collections-DHXN2w-P.js} +1 -1
- package/dist/assets/{project-detail-page-BC_MNaca.js → project-detail-page-nE0M0UmN.js} +1 -1
- package/dist/assets/{project-dialog-BuZdXECa.js → project-dialog-CDkUuAgl.js} +1 -1
- package/dist/assets/{project-management-hierarchy-page-AhEHe60K.js → project-management-hierarchy-page-CID81NpW.js} +1 -1
- package/dist/assets/{project-management-section-nav-CnaseOqL.js → project-management-section-nav-BjFavt6d.js} +1 -1
- package/dist/assets/{projects-boxes-D0zM8PfY.js → projects-boxes-DzGqWlhE.js} +1 -1
- package/dist/assets/projects-page-DpFKm_CM.js +1 -0
- package/dist/assets/{psyche-behaviors-page-CPurgDg6.js → psyche-behaviors-page-CEQ2EByW.js} +1 -1
- package/dist/assets/{psyche-flashcards-page-DnUSe-bb.js → psyche-flashcards-page-D-g1DOS7.js} +1 -1
- package/dist/assets/{psyche-goal-map-page-uWocO7kZ.js → psyche-goal-map-page-DbWVOpVH.js} +1 -1
- package/dist/assets/{psyche-graph-BDszV3UN.js → psyche-graph-1FHrdH3f.js} +1 -1
- package/dist/assets/{psyche-metrics-page-CIJLJTPy.js → psyche-metrics-page-B3736p8_.js} +1 -1
- package/dist/assets/{psyche-mode-guide-page-uC8L4WvH.js → psyche-mode-guide-page-CjsMqDsi.js} +1 -1
- package/dist/assets/{psyche-modes-page-CtBeRA_3.js → psyche-modes-page-B2qzppBs.js} +1 -1
- package/dist/assets/{psyche-page-Ds3QDsin.js → psyche-page-BEPP2B13.js} +1 -1
- package/dist/assets/{psyche-patterns-page-Cvq5WshW.js → psyche-patterns-page-CWeNeX2P.js} +2 -2
- package/dist/assets/{psyche-questionnaire-builder-page-Cg5Upe6z.js → psyche-questionnaire-builder-page-QFg9LkM0.js} +1 -1
- package/dist/assets/{psyche-questionnaire-detail-page-D4jEnNoh.js → psyche-questionnaire-detail-page-D67EJ1D5.js} +1 -1
- package/dist/assets/psyche-questionnaire-run-detail-page-C1KsEy8T.js +1 -0
- package/dist/assets/{psyche-questionnaire-run-page-Yg_VG2vq.js → psyche-questionnaire-run-page-CB3rSTAX.js} +1 -1
- package/dist/assets/{psyche-questionnaires-page-BqeOJRj7.js → psyche-questionnaires-page-wU3bZws7.js} +1 -1
- package/dist/assets/{psyche-report-detail-page-BtcMQ7mk.js → psyche-report-detail-page-DI3jE820.js} +3 -3
- package/dist/assets/{psyche-reports-page-tagvW0To.js → psyche-reports-page-aUbgZ_12.js} +1 -1
- package/dist/assets/{psyche-schemas-CvRSkI_u.js → psyche-schemas-B00gm5HO.js} +1 -1
- package/dist/assets/{psyche-schemas-beliefs-page-4NL3415v.js → psyche-schemas-beliefs-page-C_PMXwjL.js} +2 -2
- package/dist/assets/{psyche-screen-time-page-Bc5AwZHQ.js → psyche-screen-time-page-CMIgDG-3.js} +1 -1
- package/dist/assets/{psyche-self-observation-page-CUrUYbQ_.js → psyche-self-observation-page-DC3orZgf.js} +1 -1
- package/dist/assets/{psyche-values-page-BshT2sXE.js → psyche-values-page-CPdKfTdl.js} +2 -2
- package/dist/assets/{question-flow-dialog-CPyXCqA-.js → question-flow-dialog-B4B3BI8e.js} +2 -2
- package/dist/assets/{report-chain-fields-C0UMLpze.js → report-chain-fields-D-XNut8V.js} +1 -1
- package/dist/assets/rewards-page-D8w07BIZ.js +1 -0
- package/dist/assets/{scheduling-rules-editor-DiA6KkQ4.js → scheduling-rules-editor-Cn6t-RRn.js} +1 -1
- package/dist/assets/{schema-badge-DURw2eYH.js → schema-badge-Dsk9AoYd.js} +1 -1
- package/dist/assets/{schemas-D_z2C8l1.js → schemas-3GS34K1i.js} +1 -1
- package/dist/assets/{select-menu-BUB8__Nx.js → select-menu-BDeaaa4m.js} +1 -1
- package/dist/assets/{settings-agents-page-Kk98Whcf.js → settings-agents-page-CkS4s4kN.js} +2 -2
- package/dist/assets/settings-bin-page-BHlW0n-a.js +1 -0
- package/dist/assets/{settings-calendar-page-CdhlUnUW.js → settings-calendar-page-BAmKOPeT.js} +3 -3
- package/dist/assets/{settings-data-page-BvvuZNbb.js → settings-data-page-C-VrzHGq.js} +1 -1
- package/dist/assets/{settings-logs-page-CrzkXxtZ.js → settings-logs-page-CnVuzJ7d.js} +1 -1
- package/dist/assets/{settings-mobile-page-Dl582NK6.js → settings-mobile-page-0SWGg6CE.js} +1 -1
- package/dist/assets/settings-models-page-BjVixsws.js +1 -0
- package/dist/assets/{settings-page-DqnlOCgo.js → settings-page-DVZ58c3R.js} +1 -1
- package/dist/assets/settings-rewards-page-Df0ONVFq.js +1 -0
- package/dist/assets/{settings-section-nav-C1NcWveT.js → settings-section-nav-Btjx5m2u.js} +1 -1
- package/dist/assets/settings-users-page-Cl0YuOOI.js +1 -0
- package/dist/assets/{settings-wiki-page-CkpnUkiZ.js → settings-wiki-page-K8KBzeYx.js} +1 -1
- package/dist/assets/{sleep-page-DrS1zs3B.js → sleep-page-BFj8hcTf.js} +1 -1
- package/dist/assets/{sports-page-EVnB_zjB.js → sports-page-7yta1r8s.js} +1 -1
- package/dist/assets/{state-DWw8Jay_.js → state-CkEUXgqt.js} +1 -1
- package/dist/assets/{strategies-page-COhyv_SH.js → strategies-page-BQoWnPtN.js} +1 -1
- package/dist/assets/strategy-detail-page-D9DTQoyy.js +1 -0
- package/dist/assets/strategy-dialog-z9w2UB3s.js +1 -0
- package/dist/assets/{surface-Dg5fauKP.js → surface-BL_bDiZ5.js} +1 -1
- package/dist/assets/{table-CWVROEBP.js → table--SK_dk4S.js} +1 -1
- package/dist/assets/{task-detail-page-3IeMYIXl.js → task-detail-page-RcbvVzXn.js} +1 -1
- package/dist/assets/{task-dialog-B7ZT4KE5.js → task-dialog-ri1qEzPp.js} +4 -4
- package/dist/assets/timebox-planning-dialog-DoeeGwCm.js +1 -0
- package/dist/assets/{today-boxes-BbUNpb16.js → today-boxes-CTw0D5JP.js} +1 -1
- package/dist/assets/today-page-5-qRLbBt.js +1 -0
- package/dist/assets/{training-load-page-DTYbu9f0.js → training-load-page-DrGnOtnH.js} +1 -1
- package/dist/assets/{ui-CdEDMtXF.js → ui-CDt36qNz.js} +1 -1
- package/dist/assets/{use-anchored-overlay-position-Cracjgo6.js → use-anchored-overlay-position-C2kg0Ay0.js} +1 -1
- package/dist/assets/{use-psyche-focus-target-DvRgu-94.js → use-psyche-focus-target-p2l8W-Af.js} +1 -1
- package/dist/assets/{user-badge-B8hYK6NU.js → user-badge-BWoSrGA-.js} +1 -1
- package/dist/assets/{user-select-field-akGHK-2t.js → user-select-field-DbB9v7Lf.js} +1 -1
- package/dist/assets/{utility-widgets-D4KsKxLT.js → utility-widgets-fodvUR7I.js} +2 -2
- package/dist/assets/{vendor-y_uz1Wft.js → vendor-Dgw7UY7q.js} +1 -1
- package/dist/assets/{vitals-page-Cjcxh-kO.js → vitals-page-f8QdPdpp.js} +1 -1
- package/dist/assets/{weekly-review-page-CR57efzH.js → weekly-review-page-D0wPiQgO.js} +1 -1
- package/dist/assets/{weight-loss-page-Bk7YkB7b.js → weight-loss-page-BT9dPxYi.js} +1 -1
- package/dist/assets/{wiki-article-markdown-um6gpmGQ.js → wiki-article-markdown-Hyu5JwrY.js} +1 -1
- package/dist/assets/{wiki-editor-page-DdP5hvjZ.js → wiki-editor-page-ujqNw8ua.js} +1 -1
- package/dist/assets/{wiki-ingest-history-page-DSTndduq.js → wiki-ingest-history-page-BwoDT00-.js} +1 -1
- package/dist/assets/{wiki-ingest-modal-PNW3CJ-o.js → wiki-ingest-modal-cvnNma0M.js} +1 -1
- package/dist/assets/{wiki-page-CsJlPyQ6.js → wiki-page-jHyJ7EgO.js} +1 -1
- package/dist/assets/{workbench-flow-page-DFtIKgNe.js → workbench-flow-page-DJD5sXMF.js} +1 -1
- package/dist/assets/{workbench-page-DEpKjMEv.js → workbench-page-Ci0xh6rG.js} +1 -1
- package/dist/assets/{workout-detail-page-BwfEhxA_.js → workout-detail-page-DA30ubtE.js} +2 -2
- package/dist/index.html +8 -8
- package/dist/openclaw/tools.js +1 -1
- package/dist/server/apps/api/src/app.js +26 -8
- package/dist/server/apps/api/src/openapi.js +103 -24
- package/dist/server/apps/api/src/services/artifacts.js +138 -68
- package/dist/server/apps/web/src/lib/api.js +3 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/forge-openclaw/SKILL.md +7 -5
- package/skills/forge-openclaw/entity_conversation_playbooks.md +5 -3
- package/dist/assets/artifacts-page-Bqjp0L-L.js +0 -2
- package/dist/assets/goal-detail-page-BhMrnVQs.js +0 -1
- package/dist/assets/goals-page-CesC8IkZ.js +0 -1
- package/dist/assets/index-CHbe1sy1.css +0 -1
- package/dist/assets/index-Dj8q65se.js +0 -2
- package/dist/assets/overview-page-C1RX7dcq.js +0 -1
- package/dist/assets/pill-cluster-ClkmFVFT.js +0 -1
- package/dist/assets/projects-page-ltrWfLrA.js +0 -1
- package/dist/assets/psyche-questionnaire-run-detail-page-CWoZEY31.js +0 -1
- package/dist/assets/rewards-page-D9BzsNPW.js +0 -1
- package/dist/assets/settings-bin-page-BnJ-mgy2.js +0 -1
- package/dist/assets/settings-models-page-COoBw28S.js +0 -1
- package/dist/assets/settings-rewards-page-Cw5QSTjy.js +0 -1
- package/dist/assets/settings-users-page-0opvepcM.js +0 -1
- package/dist/assets/strategy-detail-page-BaCVkvIu.js +0 -1
- package/dist/assets/strategy-dialog-DvlPo9WV.js +0 -1
- package/dist/assets/timebox-planning-dialog-DoZzpEBp.js +0 -1
- package/dist/assets/today-page-adKXN2g1.js +0 -1
|
@@ -108,7 +108,8 @@ Never hide placeholders in `query` or `body`, and never guess a nearby path.
|
|
|
108
108
|
CRUD records, `questionnaire_instrument`, `sleep_session`, and `workout_session`.
|
|
109
109
|
- `wiki_page`, `calendar_connection`, and `artifact` are specialized CRUD surfaces.
|
|
110
110
|
Use the wiki tools for wiki pages, the calendar connection tools for provider setup
|
|
111
|
-
and sync, and the Artifact Store route family for
|
|
111
|
+
and sync, and the Artifact Store route family for paged metadata listing,
|
|
112
|
+
trusted file upload, metadata,
|
|
112
113
|
static scan, LLM metadata enrichment, generic entity links, trust state, versions,
|
|
113
114
|
and audit. Batch CRUD may search, update, delete, and restore artifact metadata, but
|
|
114
115
|
it must not create file artifacts or access file bytes.
|
|
@@ -127,10 +128,11 @@ Never hide placeholders in `query` or `body`, and never guess a nearby path.
|
|
|
127
128
|
both point to the same `/api/v1/life-force/*` route family.
|
|
128
129
|
- Artifact Store route keys live under
|
|
129
130
|
`forge_get_agent_onboarding.entityRouteModel.specializedCrudEntities.artifact`.
|
|
130
|
-
When the adapter exposes `forge_call_artifact_route`, use it for artifact list
|
|
131
|
-
trusted upload, metadata update, static rescan, LLM
|
|
132
|
-
replacement, trust state, versions, or audit.
|
|
133
|
-
|
|
131
|
+
When the adapter exposes `forge_call_artifact_route`, use it for artifact list
|
|
132
|
+
with `limit`/`offset`, trusted upload, metadata update, static rescan, LLM
|
|
133
|
+
enrichment, generic entity-link replacement, trust state, versions, or audit.
|
|
134
|
+
Use batch CRUD for artifact metadata delete/restore. Do not expose or call the
|
|
135
|
+
download route from agent tools; downloads are human-operator-only.
|
|
134
136
|
- The live onboarding `routeKeys` list, `methodRoutes` map, and specialized
|
|
135
137
|
route-key tool schemas include the exact route-key to method/path map. Use
|
|
136
138
|
`routeKeys` for the allowed names and `methodRoutes` as the
|
|
@@ -741,11 +741,13 @@ still knowing the exact write/read family before it acts.
|
|
|
741
741
|
- `calendar_connection`: specialized CRUD. Use provider discovery, connection CRUD,
|
|
742
742
|
selected-calendar rediscovery, sync, and delete routes rather than batch entity
|
|
743
743
|
tools.
|
|
744
|
-
- `artifact`: specialized CRUD. Use `/api/v1/artifacts` for
|
|
744
|
+
- `artifact`: specialized CRUD. Use `/api/v1/artifacts` for paged metadata listing
|
|
745
|
+
with `limit`/`offset` and trusted file upload, plus artifact detail routes for
|
|
745
746
|
metadata reads and updates, static rescan, optional LLM metadata enrichment,
|
|
746
747
|
trust-state decisions, version and audit reads, and replacement of general
|
|
747
|
-
`entity_links`.
|
|
748
|
-
an agent; download is
|
|
748
|
+
`entity_links`. Use batch CRUD for artifact metadata delete/restore. Do not
|
|
749
|
+
download, open, execute, preview, or transform file bytes as an agent; download is
|
|
750
|
+
a human-operator-only action.
|
|
749
751
|
- `operator_overview`: read-model-only operator surface. Use
|
|
750
752
|
`forge_get_operator_overview` or `/api/v1/operator/overview` when the user wants
|
|
751
753
|
the current Forge picture, attention cues, or broad status before choosing a
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b_ as be,b7 as je,r as m,j as e,b$ as ye,c0 as Ne,c1 as we,c2 as ke,c3 as Se,aX as Ce,aQ as Ie,aG as Le,aD as Fe,c4 as Ee,c5 as ae,c6 as ie}from"./vendor-y_uz1Wft.js";import{j as Te,i as B,k as S}from"./state-DWw8Jay_.js";import{F as b,Q as Ae}from"./question-flow-dialog-CPyXCqA-.js";import{P as De}from"./page-hero-DYmFM6-q.js";import{I as h,B as g,T as E,C as j,e as Ue,h as ne,j as u,c as $,k as ze,m as Me,n as Oe,p as _e,o as Ke,q as Re,t as Be,v as qe,w as Pe}from"./index-Dj8q65se.js";import"./ui-CdEDMtXF.js";import"./motion-DeJZhOSA.js";import"./board-CGgOvBP9.js";import"./forms-DhEGHkFR.js";const $e=["low","moderate","high","blocked"],Qe=["spreadsheet","document","presentation","pdf","text","structured_text","image"];function y(t){if(!Number.isFinite(t)||t<=0)return"0 B";const l=["B","KB","MB","GB"];let d=t,o=0;for(;d>=1024&&o<l.length-1;)d/=1024,o+=1;return`${d.toFixed(d>=10||o===0?0:1)} ${l[o]}`}function p(t){return t.replaceAll("_"," ").replace(/\b\w/g,l=>l.toUpperCase())}function Q(t){return t==="blocked"?"border-red-400/40 bg-red-500/12 text-red-100":t==="high"?"border-orange-400/40 bg-orange-500/12 text-orange-100":t==="moderate"?"border-yellow-300/35 bg-yellow-300/10 text-yellow-100":"border-emerald-300/35 bg-emerald-400/10 text-emerald-100"}function Ge(t){return typeof t=="object"&&t!==null&&Array.isArray(t.findings)}function Je(t){return!t||!Ge(t.scanResults)?[]:t.scanResults.findings}function We(t){return new Promise((l,d)=>{const o=new FileReader;o.onload=()=>{const f=typeof o.result=="string"?o.result:"",v=f.includes(",")?f.slice(f.indexOf(",")+1):f;l(v)},o.onerror=()=>d(o.error??new Error("Unable to read file.")),o.readAsDataURL(t)})}function Xe(t){const l=t.name.replace(/\.[^.]+$/,"").replace(/[_-]+/g," ").trim();return{id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${t.name}-${t.size}-${t.lastModified}-${Math.random().toString(36).slice(2)}`,file:t,title:l,shortDescription:"",description:"",sourceLabel:"",sourceKind:"upload",useLlmEnrichment:!1,genericLinksText:"",metadataText:""}}function le(t,l){return l.length===0?t:{...t,items:[...t.items,...l.map(Xe)],activeItemId:null}}function x(t,l,d){return{...t,items:t.items.map(o=>o.id===l?{...o,...d}:o)}}function He(t,l){return{items:t.items.filter(d=>d.id!==l),activeItemId:t.activeItemId===l?null:t.activeItemId}}function de(t){const l=t.trim();if(!l)return{};const d=JSON.parse(l);if(!d||typeof d!="object"||Array.isArray(d))throw new Error("Metadata JSON must be an object.");return d}function oe(t){return t instanceof Error?t.message:String(t)}const q={items:[],activeItemId:null},Ye=[".xlsx",".xlsm",".docx",".pptx",".pdf",".csv",".tsv",".txt",".md",".json",".yaml",".yml",".png",".jpg",".jpeg",".webp"].join(","),Ze=["upload","agent_upload","wiki_ingest","external_reference","manual"];function ce(t){return t.split(/\n+/).map(l=>l.trim()).filter(Boolean).map(l=>{const[d="",o="",f="related",v=""]=l.split(":").map(U=>U.trim());return{entityType:d,entityId:o,relationship:f,anchorKey:v}}).filter(l=>l.entityType.length>0&&l.entityId.length>0)}function Ve(t){return t.map(l=>[l.targetEntityType,l.targetEntityId,l.relationship||"related",l.anchorKey??""].filter((d,o)=>o<3||d.length>0).join(":")).join(`
|
|
2
|
-
`)}function es({artifact:t,selected:l,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:$("w-full rounded-[var(--radius-card)] border p-3 text-left transition",l?"border-[color-mix(in_srgb,var(--primary)_45%,var(--ui-border-subtle)_55%)] bg-[var(--ui-accent-soft)]":"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] hover:bg-[var(--ui-surface-hover)]"),children:[e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",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.title}),e.jsx("div",{className:"mt-1 truncate text-xs text-[var(--ui-ink-muted)]",children:t.originalFileName})]}),e.jsxs(u,{size:"xs",className:$("shrink-0",Q(t.dangerLevel)),children:[t.dangerScore,"/100"]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(u,{size:"xs",tone:"meta",children:t.detectedExtension.toUpperCase()}),e.jsx(u,{size:"xs",tone:"meta",children:y(t.byteSize)}),e.jsx(u,{size:"xs",tone:"meta",children:p(t.artifactState)})]})]})}function P({result:t}){return t?t.status==="success"?e.jsx(u,{size:"xs",className:"border-emerald-300/35 bg-emerald-400/10 text-emerald-100",children:"Uploaded"}):e.jsx(u,{size:"xs",className:"border-red-400/40 bg-red-500/12 text-red-100",children:"Failed"}):e.jsx(u,{size:"xs",tone:"meta",children:"Pending"})}function cs(){var ee,se,te,re;const{artifactId:t}=be(),l=je(),d=Te(),[o,f]=m.useState(""),[v,U]=m.useState(""),[z,me]=m.useState(""),[C,M]=m.useState(!1),[T,O]=m.useState(q),[N,I]=m.useState([]),[ue,L]=m.useState(null),[_,K]=m.useState(null),[G,J]=m.useState(""),A=B({queryKey:["artifacts",o,v,z],queryFn:()=>Be({query:o||void 0,dangerLevel:v||void 0,formatFamily:z||void 0,limit:200})}),w=((ee=A.data)==null?void 0:ee.artifacts)??[],i=m.useMemo(()=>w.find(s=>s.id===t)??w[0]??null,[t,w]),W=B({queryKey:["artifact-versions",i==null?void 0:i.id],enabled:!!(i!=null&&i.id),queryFn:()=>qe(i.id)}),xe=B({queryKey:["artifact-audit",i==null?void 0:i.id],enabled:!!(i!=null&&i.id),queryFn:()=>Pe(i.id)});m.useEffect(()=>{!t&&i&&!C&&l(`/artifacts/${i.id}`,{replace:!0})},[t,l,i,C]),m.useEffect(()=>{!C&&_&&(l(`/artifacts/${_}`),K(null))},[l,C,_]);const F=async()=>{await Promise.all([d.invalidateQueries({queryKey:["artifacts"]}),d.invalidateQueries({queryKey:["artifact-versions"]}),d.invalidateQueries({queryKey:["artifact-audit"]}),d.invalidateQueries({queryKey:["knowledge-graph"]})])},D=S({mutationFn:async s=>{if(s.length===0)throw new Error("Choose one or more files first.");const n=[];for(const r of s)try{const a={title:r.title.trim()||void 0,shortDescription:r.shortDescription,description:r.description,originalFileName:r.file.name,declaredMimeType:r.file.type,contentBase64:await We(r.file),sourceKind:r.sourceKind,sourceLabel:r.sourceLabel,metadata:de(r.metadataText),links:ce(r.genericLinksText),useLlmEnrichment:r.useLlmEnrichment},{artifact:c}=await Re(a);n.push({itemId:r.id,fileName:r.file.name,status:"success",artifactId:c.id,title:c.title})}catch(a){n.push({itemId:r.id,fileName:r.file.name,status:"error",error:oe(a)})}return n},onSuccess:async s=>{I(r=>{const a=new Map(r.map(c=>[c.itemId,c]));for(const c of s)a.set(c.itemId,c);return Array.from(a.values())}),await F();const n=s.find(r=>r.status==="success");(n==null?void 0:n.status)==="success"&&K(n.artifactId)}}),R=S({mutationFn:s=>_e(i.id,s),onSuccess:F}),X=S({mutationFn:()=>ze(i.id),onSuccess:F}),H=S({mutationFn:()=>Me(i.id,{fillMissingOnly:!0}),onSuccess:F}),Y=S({mutationFn:s=>Ke(i.id,s),onSuccess:F}),Z=S({mutationFn:async()=>{const s=i,n=await Oe(s.id),r=URL.createObjectURL(n.blob),a=document.createElement("a");a.href=r,a.download=n.fileName??s.originalFileName,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(r)}}),V=Je(i),pe=((se=W.data)==null?void 0:se.versions.length)??0,fe=((te=xe.data)==null?void 0:te.events)??[];m.useEffect(()=>{J(i?Ve(i.links):"")},[i==null?void 0:i.id,i==null?void 0:i.links.length,i==null?void 0:i.updatedAt]);const k=m.useMemo(()=>new Map(N.map(s=>[s.itemId,s])),[N]),he=()=>{O(q),I([]),L(null),K(null),M(!0)},ge=m.useMemo(()=>[{id:"files",eyebrow:"Select",title:"Choose the files to preserve",description:"Select one or more trusted files. Forge stores bytes content-addressably, scans them conservatively, and keeps downloads human-only.",render:(s,n)=>e.jsxs("div",{className:"grid gap-4",children:[e.jsx("div",{className:"rounded-[26px] border border-dashed border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-5",onDragOver:r=>r.preventDefault(),onDrop:r=>{r.preventDefault(),I([]),n(le(s,Array.from(r.dataTransfer.files)))},children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ye,{className:"size-4 text-[var(--primary)]"}),"Files"]}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-muted)]",children:"Spreadsheets, documents, PDFs, text, structured text, and images are supported."})]}),e.jsx(h,{"aria-label":"Artifact files",type:"file",multiple:!0,accept:Ye,className:"w-full sm:max-w-xs",onChange:r=>{const a=Array.from(r.target.files??[]);I([]),n(le(s,a)),r.target.value=""}})]})}),s.items.length===0?e.jsx("div",{className:"rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3 text-sm text-[var(--ui-ink-muted)]",children:"No files selected yet."}):e.jsx("div",{className:"grid gap-2",children:s.items.map(r=>e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:r.file.name}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[y(r.file.size)," · ",r.file.type||"unknown type"]})]}),e.jsx(P,{result:k.get(r.id)})]},r.id))})]})},{id:"queue",eyebrow:"Describe",title:"Review each file before upload",description:"Add quick descriptions from the queue, or open a file's details for provenance, links, metadata JSON, and LLM enrichment.",render:(s,n)=>{const r=s.items.find(a=>a.id===s.activeItemId);return r?e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:r.file.name}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[y(r.file.size)," · ",r.file.type||"unknown type"]})]}),e.jsx(g,{type:"button",variant:"secondary",onClick:()=>n({activeItemId:null}),children:"Back to file queue"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(b,{label:"Title",children:e.jsx(h,{value:r.title,onChange:a=>n(x(s,r.id,{title:a.target.value}))})}),e.jsx(b,{label:"Source kind",children:e.jsx("select",{value:r.sourceKind,onChange:a=>n(x(s,r.id,{sourceKind:a.target.value})),className:"interactive-tap min-h-10 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-3 text-sm text-[var(--ui-ink-strong)]",children:Ze.map(a=>e.jsx("option",{value:a,children:p(a)},a))})})]}),e.jsx(b,{label:"Short description",children:e.jsx(h,{value:r.shortDescription,onChange:a=>n(x(s,r.id,{shortDescription:a.target.value}))})}),e.jsx(b,{label:"Long description",children:e.jsx(E,{value:r.description,onChange:a=>n(x(s,r.id,{description:a.target.value}))})}),e.jsx(b,{label:"Source label or provenance note",children:e.jsx(h,{value:r.sourceLabel,onChange:a=>n(x(s,r.id,{sourceLabel:a.target.value})),placeholder:"Where this file came from or why it is worth preserving"})}),e.jsx(b,{label:"Generic entity links",hint:"One per line: entityType:entityId:relationship:anchorKey",children:e.jsx(E,{value:r.genericLinksText,onChange:a=>n(x(s,r.id,{genericLinksText:a.target.value}))})}),e.jsx(b,{label:"Metadata JSON",hint:'Optional object, for example {"period":"Q2","owner":"Albert"}',children:e.jsx(E,{value:r.metadataText,onChange:a=>n(x(s,r.id,{metadataText:a.target.value}))})}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--ui-ink-medium)]",children:[e.jsx("input",{type:"checkbox",checked:r.useLlmEnrichment,onChange:a=>n(x(s,r.id,{useLlmEnrichment:a.target.checked}))}),"Use configured LLM to fill missing metadata for this file"]})]}):e.jsx("div",{className:"grid gap-3",children:s.items.length===0?e.jsx("div",{className:"rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3 text-sm text-[var(--ui-ink-muted)]",children:"Choose files first."}):s.items.map(a=>e.jsxs("div",{className:"grid gap-3 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex 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:"truncate text-sm font-medium",children:a.file.name}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[y(a.file.size)," · ",a.file.type||"unknown type"]})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[e.jsxs(g,{type:"button",variant:"secondary",onClick:()=>n({activeItemId:a.id}),children:[e.jsx(Ne,{className:"size-4"}),"Details"]}),e.jsxs(g,{type:"button",variant:"secondary",onClick:()=>n(He(s,a.id)),children:[e.jsx(we,{className:"size-4"}),"Remove"]})]})]}),e.jsx(h,{"aria-label":`Short description for ${a.file.name}`,value:a.shortDescription,onChange:c=>n(x(s,a.id,{shortDescription:c.target.value})),placeholder:"Quick short description"}),e.jsx(P,{result:k.get(a.id)})]},a.id))})}},{id:"review",eyebrow:"Upload",title:"Upload artifacts",description:"Forge will create one artifact per file. Successful files stay saved even if another file fails.",render:s=>{const n=N.filter(a=>a.status==="success").length,r=N.filter(a=>a.status==="error").length;return e.jsxs("div",{className:"grid gap-4",children:[N.length>0?e.jsxs("div",{className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ke,{className:"size-4 text-[var(--primary)]"}),"Upload results"]}),e.jsxs("p",{className:"mt-2 text-sm text-[var(--ui-ink-muted)]",children:[n," uploaded · ",r," failed"]})]}):null,e.jsx("div",{className:"grid gap-3",children:s.items.map(a=>{const c=k.get(a.id);return e.jsxs("div",{className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex 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:"truncate text-sm font-medium",children:a.title||a.file.name}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[a.file.name," · ",y(a.file.size)]}),a.shortDescription?e.jsx("p",{className:"mt-2 text-sm text-[var(--ui-ink-muted)]",children:a.shortDescription}):null]}),e.jsx(P,{result:c})]}),(c==null?void 0:c.status)==="error"?e.jsx("p",{className:"mt-3 rounded-[18px] border border-red-400/30 bg-red-500/10 px-3 py-2 text-sm text-red-100",children:c.error}):null]},a.id)})})]})}}],[k,N]),ve=async()=>{const s=T.items.filter(n=>{var r;return((r=k.get(n.id))==null?void 0:r.status)!=="success"});if(T.items.length===0){L("Choose one or more files first.");return}if(s.length===0){M(!1),O(q),I([]);return}try{for(const n of s)de(n.metadataText)}catch(n){L(oe(n));return}L(null),await D.mutateAsync(s)};return e.jsxs("div",{className:"min-h-full bg-[var(--ui-bg)] text-[var(--ui-ink-strong)]",children:[e.jsx(De,{entityKind:"artifact",title:"Artifacts",description:"Trusted file storage for precise metadata, safety scans, provenance, generic entity links, and human-only downloads.",badge:`${w.length} stored`,actions:e.jsxs(g,{type:"button",onClick:he,children:[e.jsx(Se,{className:"size-4"}),"Add artifacts"]})}),e.jsxs("main",{className:"grid gap-5 px-5 py-5 lg:grid-cols-[minmax(280px,380px)_minmax(0,1fr)] lg:px-7",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Ce,{className:"size-4 text-[var(--primary)]"}),"Store"]}),e.jsx(h,{value:o,onChange:s=>f(s.target.value),placeholder:"Search title, file, description, provenance"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("select",{value:v,onChange:s=>U(s.target.value),className:"interactive-tap min-h-10 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-3 text-sm text-[var(--ui-ink-strong)]",children:[e.jsx("option",{value:"",children:"Any danger"}),$e.map(s=>e.jsx("option",{value:s,children:p(s)},s))]}),e.jsxs("select",{value:z,onChange:s=>me(s.target.value),className:"interactive-tap min-h-10 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-3 text-sm text-[var(--ui-ink-strong)]",children:[e.jsx("option",{value:"",children:"Any format"}),Qe.map(s=>e.jsx("option",{value:s,children:p(s)},s))]})]})]}),e.jsx("div",{className:"space-y-2",children:A.isLoading?e.jsx(j,{className:"text-sm text-[var(--ui-ink-muted)]",children:"Loading artifacts..."}):A.error?e.jsx(Ue,{error:A.error}):w.length===0?e.jsx(ne,{title:"No artifacts found",description:"Upload a trusted file to create the first artifact record."}):w.map(s=>e.jsx(es,{artifact:s,selected:s.id===(i==null?void 0:i.id),onSelect:()=>l(`/artifacts/${s.id}`)},s.id))})]}),e.jsx("section",{className:"min-w-0 space-y-4",children:i?e.jsxs(e.Fragment,{children:[e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(u,{className:$(Q(i.dangerLevel)),children:[p(i.dangerLevel)," danger"]}),e.jsx(u,{tone:"meta",children:p(i.artifactState)}),e.jsx(u,{tone:"meta",children:i.detectedExtension.toUpperCase()})]}),e.jsx("h2",{className:"mt-3 break-words text-2xl font-semibold",children:i.title}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm text-[var(--ui-ink-muted)]",children:i.shortDescription||i.description})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(g,{variant:"secondary",type:"button",onClick:()=>X.mutate(),pending:X.isPending,children:[e.jsx(Ie,{className:"size-4"}),"Scan"]}),e.jsxs(g,{variant:"secondary",type:"button",onClick:()=>H.mutate(),pending:H.isPending,children:[e.jsx(Le,{className:"size-4"}),"Enrich"]}),e.jsxs(g,{type:"button",onClick:()=>Z.mutate(),pending:Z.isPending,disabled:i.downloadPolicy!=="human_only"||i.artifactState==="blocked",children:[e.jsx(Fe,{className:"size-4"}),"Download"]})]})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-4",children:[["File",i.originalFileName],["Size",y(i.byteSize)],["Versions",pe],["Links",i.links.length]].map(([s,n])=>e.jsxs("div",{className:"rounded-[var(--radius-card)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:s}),e.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:n})]},s))}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(h,{defaultValue:i.title,onBlur:s=>{const n=s.target.value.trim();n&&n!==i.title&&R.mutate({title:n})},"aria-label":"Artifact title"}),e.jsx(h,{defaultValue:i.shortDescription,onBlur:s=>{const n=s.target.value.trim();n!==i.shortDescription&&R.mutate({shortDescription:n})},"aria-label":"Artifact short description"})]}),e.jsx(E,{defaultValue:i.description,onBlur:s=>{const n=s.target.value.trim();n!==i.description&&R.mutate({description:n})},"aria-label":"Artifact description"})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_minmax(280px,360px)]",children:[e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Ee,{className:"size-4 text-[var(--primary)]"}),"Safety Findings"]}),V.length===0?e.jsx("p",{className:"text-sm text-[var(--ui-ink-muted)]",children:"No findings recorded."}):e.jsx("div",{className:"space-y-2",children:V.map(s=>e.jsxs("div",{className:"rounded-[var(--radius-card)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(u,{size:"xs",className:Q(s.severity),children:p(s.severity)}),e.jsx("span",{className:"text-xs font-medium text-[var(--ui-ink-medium)]",children:s.code})]}),e.jsx("p",{className:"mt-2 text-sm text-[var(--ui-ink-muted)]",children:s.message})]},`${s.code}:${s.message}`))})]}),e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ae,{className:"size-4 text-[var(--primary)]"}),"Entity Links"]}),i.links.length===0?e.jsx("p",{className:"text-sm text-[var(--ui-ink-muted)]",children:"No linked entities."}):e.jsx("div",{className:"space-y-2",children:i.links.map(s=>e.jsxs("div",{className:"rounded-[var(--radius-card)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-sm",children:[e.jsx("div",{className:"font-medium",children:p(s.targetEntityType)}),e.jsx("div",{className:"mt-1 break-all text-xs text-[var(--ui-ink-muted)]",children:s.targetEntityId}),e.jsx(u,{className:"mt-2",size:"xs",tone:"meta",children:p(s.relationship)}),s.anchorKey?e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:["Anchor: ",s.anchorKey]}):null]},`${s.targetEntityType}:${s.targetEntityId}:${s.relationship}`))}),e.jsx(E,{value:G,onChange:s=>J(s.target.value),placeholder:"Generic entity links, one per line: entityType:entityId:relationship:anchorKey","aria-label":"Generic entity links"}),e.jsxs(g,{type:"button",variant:"secondary",onClick:()=>Y.mutate(ce(G)),pending:Y.isPending,children:[e.jsx(ae,{className:"size-4"}),"Save Links"]})]})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ie,{className:"size-4 text-[var(--primary)]"}),"Versions"]}),(((re=W.data)==null?void 0:re.versions)??[]).map(s=>e.jsxs("div",{className:"rounded-[var(--radius-card)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-sm",children:[e.jsxs("div",{className:"font-medium",children:["Version ",s.versionNumber]}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[y(s.byteSize)," · ",s.originalFileName]})]},s.id))]}),e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ie,{className:"size-4 text-[var(--primary)]"}),"Audit"]}),fe.slice(0,10).map(s=>e.jsxs("div",{className:"rounded-[var(--radius-card)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-sm",children:[e.jsx("div",{className:"font-medium",children:s.eventType}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[new Date(s.createdAt).toLocaleString()," · ",s.source]})]},s.id))]})]})]}):e.jsx(ne,{title:"Select an artifact",description:"Choose an artifact from the list to inspect metadata, scans, links, versions, and audit history."})})]}),e.jsx(Ae,{open:C,onOpenChange:s=>{M(s),s||L(null)},eyebrow:"Artifact Store",title:"Add artifacts",description:"A guided flow for preserving trusted files with metadata, safety scans, provenance, and generic Forge entity links.",value:T,onChange:O,steps:ge,pending:D.isPending,pendingLabel:"Uploading",submitLabel:T.items.some(s=>{var n;return((n=k.get(s.id))==null?void 0:n.status)!=="success"})?"Upload artifacts":"All files uploaded",error:ue??(D.error instanceof Error?D.error.message:null),resolveContinueNudge:(s,n)=>s==="files"&&n.items.length===0?"Choose one or more files first.":s==="queue"?"Quick descriptions are enough; use Details when provenance matters.":null,onSubmit:ve})]})}export{cs as ArtifactsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b_ as F,b7 as q,r as l,j as e,aC as p}from"./vendor-y_uz1Wft.js";import{j as A,k as H}from"./state-DWw8Jay_.js";import{GoalDialog as L}from"./goal-dialog-BlZHh3dw.js";import{O as _}from"./open-in-graph-button-BHl16hJP.js";import{N as $}from"./note-markdown-Cxj84-0j.js";import{ProjectDialog as z}from"./project-dialog-BuZdXECa.js";import{E as K}from"./entity-notes-surface-Dq9dFKjD.js";import{P as Q}from"./preference-entity-handoff-button-1XXtBsUF.js";import{b as X,f as J,P as V}from"./project-collections-DfmkBk9d.js";import{P as W}from"./page-hero-DYmFM6-q.js";import{u as Y,d as Z,h as ee,E as T,B as x,C as j,b as k,j as u,_ as te,i as ae,$ as se}from"./index-Dj8q65se.js";import{U as C}from"./user-badge-B8hYK6NU.js";import{g as ie,a as ne}from"./activity-copy-Bj4h9OcF.js";import{g as oe}from"./entity-links-DwpxhW2H.js";import{g as le}from"./user-ownership-DJGl4rAj.js";import"./question-flow-dialog-CPyXCqA-.js";import"./ui-CdEDMtXF.js";import"./motion-DeJZhOSA.js";import"./inline-note-fields-DpmCMAJf.js";import"./user-select-field-akGHK-2t.js";import"./schemas-D_z2C8l1.js";import"./forms-DhEGHkFR.js";import"./note-tags-input-CP0-EPpE.js";import"./entity-link-multiselect-DZ_jAjs4.js";import"./use-anchored-overlay-position-Cracjgo6.js";import"./board-CGgOvBP9.js";function Ee(){const{t:a}=Y(),i=Z(),d=F(),G=q(),f=A(),[O,N]=l.useState(!1),[S,y]=l.useState(!1),[m,B]=l.useState("active"),v=le(i.selectedUserIds),[E,b]=l.useState(null),D=H({mutationFn:()=>se(d.goalId),onSuccess:async()=>{await Promise.all([ae(f),f.invalidateQueries({queryKey:["project-board"]}),f.invalidateQueries({queryKey:["task-context"]})]),G("/goals")}}),s=i.snapshot.dashboard.goals.find(t=>t.id===d.goalId)??null,g=l.useMemo(()=>i.snapshot.dashboard.projects.filter(t=>t.goalId===d.goalId),[d.goalId,i.snapshot.dashboard.projects]),R=l.useMemo(()=>X(g),[g]),o=l.useMemo(()=>J(g,m),[g,m]),w=new Set(g.map(t=>t.id)),I=new Set(i.snapshot.tasks.filter(t=>w.has(t.projectId??"")).map(t=>t.id)),h=i.snapshot.activity.filter(t=>t.entityId===d.goalId||w.has(t.entityId)||I.has(t.entityId)||t.entityType==="task_run"&&typeof t.metadata.taskId=="string"&&I.has(t.metadata.taskId));if(!s)return e.jsx(ee,{eyebrow:a("common.goalDetail.eyebrow"),title:a("common.goalDetail.missingTitle"),description:a("common.goalDetail.missingDescription"),action:e.jsx(p,{to:"/goals",className:"inline-flex min-h-10 min-w-0 max-w-full items-center justify-center whitespace-nowrap rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-[var(--ui-ink-on-accent)] transition hover:opacity-90",children:a("common.goalDetail.backToGoals")})});const n=o.find(t=>t.nextTaskTitle)??o[0]??null,r=i.snapshot.overview.neglectedGoals.find(t=>t.goalId===s.id)??null,c=h[0]??null,M=async t=>{b(t);try{await i.patchProject(t,{status:"active"})}finally{b(null)}},U=async()=>{window.confirm(a("common.goalDetail.deleteGoalConfirm",{title:s.title}))&&await D.mutateAsync()};return e.jsxs("div",{className:"grid min-w-0 gap-5",children:[e.jsx(W,{entityKind:"goal",title:e.jsx(T,{kind:"goal",label:s.title,variant:"heading",size:"lg"}),titleText:s.title,description:s.description?e.jsx($,{markdown:s.description,className:"[&>p]:text-[13px] [&>p]:leading-6 [&>blockquote]:text-[13px] [&>ul]:text-[13px] [&>ol]:text-[13px]"}):"No strategic description yet.",badge:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(Q,{userId:v,domain:"projects",entityType:"goal",entityId:s.id,label:s.title,description:s.description}),e.jsx(_,{entityType:"goal",entityId:s.id})]})}),s.user?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-[var(--ui-ink-soft)]",children:[e.jsx("span",{className:"text-[var(--ui-ink-faint)]",children:"Owned by"}),e.jsx(C,{user:s.user})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(x,{onClick:()=>N(!0),children:a("common.goalDetail.edit")}),e.jsx(x,{variant:"secondary",onClick:()=>y(!0),children:a("common.goalDetail.addProject")}),e.jsx(x,{variant:"ghost",className:"text-[var(--danger)] hover:bg-[var(--ui-danger-soft)]",pending:D.isPending,pendingLabel:a("common.goalDetail.deleting"),onClick:()=>void U(),children:a("common.goalDetail.deleteGoal")})]}),e.jsxs("section",{className:"grid min-w-0 gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsxs(j,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionProjects")}),e.jsx(V,{value:m,counts:R,onChange:B,className:"justify-end"})]}),o.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:m==="active"?a("common.goalDetail.noProjects"):"No projects match this lifecycle filter yet. Switch filters or restart one to make it active again."}):e.jsx("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:o.map(t=>e.jsxs("div",{className:"rounded-[22px] bg-[var(--ui-surface-2)] p-5 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"project",compact:!0,gradient:!1}),t.user?e.jsx(C,{user:t.user,compact:!0}):null]}),e.jsx(u,{children:t.status})]}),e.jsx("div",{className:"mt-4",children:e.jsx(p,{to:`/projects/${t.id}`,className:"transition hover:opacity-90",children:e.jsx(T,{kind:"project",label:t.title,variant:"heading",size:"lg"})})}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-soft)]",children:t.description}),e.jsx("div",{className:"mt-4",children:e.jsx(te,{value:t.progress})}),e.jsx("div",{className:"mt-4 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:t.nextTaskTitle?a("common.goalDetail.nextMove",{value:t.nextTaskTitle}):a("common.goalDetail.addNextTask")}),e.jsxs("div",{className:"mt-4 flex flex-wrap justify-between gap-3",children:[e.jsx(p,{to:`/projects/${t.id}`,children:e.jsx(x,{variant:"ghost",children:"Open project"})}),m!=="active"&&t.status!=="active"?e.jsx(x,{variant:"secondary",size:"sm",pending:E===t.id,pendingLabel:"Restarting…",onClick:()=>void M(t.id),children:"Restart"}):null]})]},t.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-5",children:e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionHealth")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"goal",compact:!0,gradient:!1}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressTitle",{progress:s.progress,count:s.completedTasks})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressDetail",{xp:s.earnedPoints})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length})})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldProgress")}),e.jsxs("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:[s.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldCompletedTasks")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.completedTasks})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldXpBanked")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.earnedPoints})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[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:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalNext")}),n?e.jsx(k,{kind:"project",compact:!0,gradient:!1}):null]}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(n==null?void 0:n.title)??a("common.goalDetail.noProject")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:n!=null&&n.nextTaskTitle?a("common.goalDetail.nextMove",{value:n.nextTaskTitle}):(n==null?void 0:n.description)||a("common.goalDetail.noProjectDetail")})]}),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-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalRisk")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(r==null?void 0:r.title)??a("common.goalDetail.noRisk")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(r==null?void 0:r.summary)||a("common.goalDetail.noRiskDetail")})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalEvidence")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(c==null?void 0:c.title)??a("common.goalDetail.noEvidence")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(c==null?void 0:c.description)||a("common.goalDetail.noEvidenceDetail")})]})]})]})]})})]}),e.jsx(K,{entityType:"goal",entityId:s.id,title:"Goal notes",description:"Use notes to capture strategy changes, meaning shifts, and progress context that belongs at the goal level."}),e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionEvidence")}),h.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:a("common.goalDetail.noEvidenceLogged")}):e.jsx("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:h.slice(0,6).map(t=>e.jsxs(p,{to:oe(t)??`/activity?eventId=${t.id}`,className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:ie(t)}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:ne(t)})]},t.id))})]}),e.jsx(L,{open:O,editingGoal:s,tags:i.snapshot.tags,users:i.snapshot.users,defaultUserId:s.userId??v,onOpenChange:N,onSubmit:async(t,P)=>{P&&await i.patchGoal(P,t)}}),e.jsx(z,{open:S,goals:i.snapshot.goals,users:i.snapshot.users,editingProject:null,initialGoalId:s.id,defaultUserId:s.userId??v,onOpenChange:y,onSubmit:async t=>{await i.createProject(t)}})]})}export{Ee as GoalDetailPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,j as e,aC as b,c8 as P,bX as C}from"./vendor-y_uz1Wft.js";import{P as S}from"./page-hero-DYmFM6-q.js";import{E as G}from"./entity-note-count-link-FOK_qhcC.js";import{C as k,B as y,b as w,E as h,j as l,c as N,d as E,h as z,a0 as L,_ as T}from"./index-Dj8q65se.js";import{GoalDialog as B}from"./goal-dialog-BlZHh3dw.js";import{P as I}from"./pill-cluster-ClkmFVFT.js";import{b as R,f as D,P as F}from"./project-collections-DfmkBk9d.js";import{U}from"./user-badge-B8hYK6NU.js";import{g as M}from"./user-ownership-DJGl4rAj.js";import"./state-DWw8Jay_.js";import"./motion-DeJZhOSA.js";import"./ui-CdEDMtXF.js";import"./board-CGgOvBP9.js";import"./forms-DhEGHkFR.js";import"./question-flow-dialog-CPyXCqA-.js";import"./inline-note-fields-DpmCMAJf.js";import"./user-select-field-akGHK-2t.js";import"./schemas-D_z2C8l1.js";function O({goals:t,tags:r,users:o,defaultUserId:d=null,pending:c=!1,onCreate:n,onUpdate:v}){const[f,m]=p.useState(!1),[g,u]=p.useState(null),a=t.find(s=>s.id===g)??null;return e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:"Goal arcs"}),e.jsx("h3",{className:"mt-2 font-display text-3xl text-[var(--ui-ink-strong)]",children:"Strategic arcs before tickets"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:"This is the long-horizon map. Each arc shows why it matters, how much ground has been covered, and which project should move next."})]}),e.jsx(y,{onClick:()=>{u(null),m(!0)},children:"Create goal"})]}),e.jsxs("div",{className:"mt-5 grid gap-3 xl:grid-cols-2",children:[t.length===0?e.jsx("div",{className:"rounded-[24px] bg-[var(--ui-surface-2)] p-5 text-sm leading-7 text-[var(--ui-ink-soft)] xl:col-span-2",children:"Start with a life goal. Once the destination is clear, you can attach projects and then fill those projects with tasks."}):null,t.map(s=>{const x=`${Math.max(6,Math.min(100,s.progress))}%`;return e.jsxs(b,{to:`/goals/${s.id}`,className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(w,{kind:"goal",compact:!0,gradient:!1}),e.jsx("div",{className:"mt-2",children:e.jsx(h,{kind:"goal",label:s.title,variant:"heading",size:"lg",showKind:!1,lines:2})}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:s.description||"No strategic note attached yet."})]}),e.jsx("button",{className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",type:"button",onClick:i=>{i.preventDefault(),i.stopPropagation(),u(s.id),m(!0)},children:e.jsx(P,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:s.horizon}),e.jsx(l,{className:s.status==="active"?"text-[var(--success)]":s.status==="paused"?"text-[var(--warning)]":"text-[var(--tertiary)]",children:s.status}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.earnedPoints," / ",s.targetPoints," xp"]}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.totalTasks," tasks"]})]}),e.jsx("div",{className:"mt-4 h-1.5 rounded-full bg-[var(--ui-surface-2)]",children:e.jsx("div",{className:"h-full rounded-full bg-[var(--primary)]",style:{width:x}})}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:s.tags.map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:i.name},i.id))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.momentumLabel}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",style:{color:s.themeColor},children:["Open arc",e.jsx(C,{className:"size-3.5"})]})]})]},s.id)})]})]}),e.jsx(B,{open:f,pending:c,editingGoal:a,tags:r,users:o,defaultUserId:d,onOpenChange:s=>{m(s),s||u(null)},onSubmit:async(s,x)=>{if(x){await v(x,s);return}await n(s)}})]})}function $({eyebrow:t,title:r,description:o,meta:d,actions:c,className:n}){return e.jsxs("div",{className:N("flex flex-wrap items-start justify-between gap-3",n),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[t?e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:t}):null,e.jsxs("div",{className:N("min-w-0",t&&"mt-2"),children:[e.jsx("div",{className:"min-w-0 text-lg text-[var(--ui-ink-strong)]",children:r}),o?e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:o}):null]})]}),d||c?e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:[d,c]}):null]})}function ne(){const t=E(),[r,o]=p.useState("active"),[d,c]=p.useState(null),n=t.snapshot.dashboard.goals.length>0,v=R(t.snapshot.dashboard.projects),f=D(t.snapshot.dashboard.projects,r),m=M(t.selectedUserIds),g=new Map(t.snapshot.dashboard.goals.map(a=>[a.id,f.filter(s=>s.goalId===a.id)])),u=async a=>{c(a);try{await t.patchProject(a,{status:"active"})}finally{c(null)}};return e.jsxs("div",{className:"grid gap-5",children:[e.jsx(S,{entityKind:"goal",title:e.jsx(h,{kind:"goal",label:"Life Goals",variant:"heading",size:"lg"}),titleText:"Life Goals",description:"Life goals are the destinations you care about over the long run. Each one can hold several projects, and those projects turn direction into real work.",badge:`${t.snapshot.dashboard.goals.length} active goals`,actions:n?e.jsxs("div",{className:"inline-flex min-h-10 items-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2 text-sm whitespace-nowrap text-[var(--ui-ink-soft)]",children:[t.snapshot.dashboard.projects.length," live project",t.snapshot.dashboard.projects.length===1?"":"s"," ","attached"]}):null}),e.jsx(O,{goals:t.snapshot.dashboard.goals,tags:t.snapshot.tags,users:t.snapshot.users,defaultUserId:m,onCreate:t.createGoal,onUpdate:t.patchGoal}),n?e.jsx(F,{value:r,counts:v,onChange:o}):null,n?null:e.jsx(z,{eyebrow:"Life goals",title:"No life goals yet",description:"Define the first long-horizon direction above so Forge can attach projects, tasks, momentum, and evidence to something meaningful."}),n?e.jsx("div",{className:"grid gap-4",children:t.snapshot.dashboard.goals.map(a=>{const s=g.get(a.id)??[],x=L(t.snapshot.dashboard.notesSummaryByEntity,"goal",a.id);return e.jsx(b,{to:`/goals/${a.id}`,className:"min-w-0 overflow-hidden rounded-[28px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)] sm:p-5",children:e.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)] xl:gap-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(I,{children:[a.tags.slice(0,3).map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)]",style:{color:i.color},children:i.name},i.id)),e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a.horizon}),e.jsx(U,{user:a.user,compact:!0})]}),e.jsx("div",{className:"mt-4",children:e.jsx(h,{kind:"goal",label:a.title,variant:"heading",size:"xl",lines:2})}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:a.description}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Progress"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Tasks done"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.completedTasks,"/",Math.max(a.totalTasks,1)]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"XP banked"}),e.jsx("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:a.earnedPoints})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(T,{value:a.progress})}),e.jsx("div",{className:"mt-4",children:e.jsx(G,{entityType:"goal",entityId:a.id,count:x.count})})]}),e.jsxs("div",{className:"min-w-0 rounded-[24px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx($,{title:"Projects carrying this direction",meta:e.jsx("div",{className:"shrink-0 text-sm text-[var(--ui-ink-faint)]",children:s.length}),className:"gap-2"}),s.length===0?e.jsx("div",{className:"mt-4 text-sm leading-6 text-[var(--ui-ink-soft)]",children:r==="active"?"No active project is attached yet. Create one so this direction starts producing visible work.":"No projects in this lifecycle view are attached yet. Switch filters or restart one to bring it back into active motion."}):e.jsx("div",{className:"mt-4 grid gap-3",children:s.slice(0,3).map(i=>e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-hover)] px-4 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(w,{kind:"project",compact:!0,gradient:!1}),e.jsx(h,{kind:"project",label:i.title,className:"min-w-0",showIcon:!1,lines:2})]}),e.jsx(l,{className:"shrink-0",children:i.status})]}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:i.description}),e.jsxs("div",{className:"mt-3 text-sm text-[var(--ui-ink-faint)]",children:["Next move:"," ",i.nextTaskTitle??"Define the first attached task"]}),r!=="active"&&i.status!=="active"?e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(y,{variant:"secondary",size:"sm",pending:d===i.id,pendingLabel:"Restarting…",onClick:j=>{j.preventDefault(),j.stopPropagation(),u(i.id)},children:"Restart"})}):null]},i.id))})]})]})},a.id)})}):e.jsx(k,{children:e.jsx("div",{className:"rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:"Goal cards will appear here once the first long-horizon direction is created."})})]})}export{ne as GoalsPage};
|