forge-openclaw-plugin 0.3.17 → 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.
Files changed (163) hide show
  1. package/dist/assets/{action-bar-D3CEYlj4.js → action-bar-B3ttL3XF.js} +1 -1
  2. package/dist/assets/{activity-page-Ce1pHIu5.js → activity-page-CoNcd0PX.js} +1 -1
  3. package/dist/assets/{ai-surface-workspace-DEliwOjF.js → ai-surface-workspace-Db34puL5.js} +1 -1
  4. package/dist/assets/artifacts-page-C09tfJTW.js +2 -0
  5. package/dist/assets/{atlas-panel-VZOnJa1c.js → atlas-panel-DRMA3RbG.js} +1 -1
  6. package/dist/assets/{board-DprRipIG.js → board-Dl7As76Q.js} +1 -1
  7. package/dist/assets/{calendar-page-Zstsn4uG.js → calendar-page-CagtpmrB.js} +1 -1
  8. package/dist/assets/{calendar-rules-BGIBuEDk.js → calendar-rules-jys-Ya5M.js} +1 -1
  9. package/dist/assets/{calendar-week-toolbar-DXFkMkbq.js → calendar-week-toolbar-DWTObcj1.js} +1 -1
  10. package/dist/assets/{charts-C5S0-BL7.js → charts-YpkKrjkZ.js} +1 -1
  11. package/dist/assets/{companion-sync-lab-page-DIPPLFKt.js → companion-sync-lab-page-COYI00E2.js} +1 -1
  12. package/dist/assets/{daily-metrics-dashboard-CG-OOCJz.js → daily-metrics-dashboard-CLoHakVX.js} +1 -1
  13. package/dist/assets/{define-workbench-box-BEEdtBkQ.js → define-workbench-box-DkTWtzNA.js} +1 -1
  14. package/dist/assets/{entity-link-multiselect-BfDAROHB.js → entity-link-multiselect-HmmmJO5A.js} +1 -1
  15. package/dist/assets/{entity-note-count-link-BGOiaash.js → entity-note-count-link-BDLj5ezr.js} +1 -1
  16. package/dist/assets/{entity-notes-surface-DPsJwqQa.js → entity-notes-surface-Csbm1myW.js} +1 -1
  17. package/dist/assets/{execution-board-Dg-2GSKv.js → execution-board-C7wYWJE4.js} +1 -1
  18. package/dist/assets/{faceted-token-search-DV7MSVYb.js → faceted-token-search-B2XWEl8j.js} +1 -1
  19. package/dist/assets/{flagship-signal-deck-D3wVL3bC.js → flagship-signal-deck-DnNN_VE1.js} +1 -1
  20. package/dist/assets/{floating-action-menu-BUs382px.js → floating-action-menu-D2Lk9TOc.js} +1 -1
  21. package/dist/assets/{forms-ByKjodjN.js → forms-DznAv9hZ.js} +1 -1
  22. package/dist/assets/{generic-node-view-BY5dbPXJ.js → generic-node-view-C_WhZXoj.js} +1 -1
  23. package/dist/assets/goal-detail-page-B395rAnv.js +1 -0
  24. package/dist/assets/{goal-dialog-nkdME5Uy.js → goal-dialog-DiEV3MyU.js} +1 -1
  25. package/dist/assets/goals-page-BNwaz0yD.js +1 -0
  26. package/dist/assets/{graph-CHVj0Z7n.js → graph-BUSFLDnl.js} +1 -1
  27. package/dist/assets/{habits-page-wO461EVU.js → habits-page-BkfbiwMJ.js} +1 -1
  28. package/dist/assets/{health-boxes-BphMeSJj.js → health-boxes-BlA33CqS.js} +1 -1
  29. package/dist/assets/index-C0CztQTU.js +2 -0
  30. package/dist/assets/index-CKnJCN1y.css +1 -0
  31. package/dist/assets/{inline-note-fields-BvQwmMAv.js → inline-note-fields-CbA0QOnc.js} +1 -1
  32. package/dist/assets/{insight-flow-dialog-H_eaOmst.js → insight-flow-dialog-DdxIE6oo.js} +1 -1
  33. package/dist/assets/{insights-page-DINYe3cB.js → insights-page-C0q_J9Hz.js} +1 -1
  34. package/dist/assets/{kanban-boxes-oACOTDYG.js → kanban-boxes-BynqbGHC.js} +1 -1
  35. package/dist/assets/{kanban-page-BGLXH91f.js → kanban-page-DyiaHH0e.js} +1 -1
  36. package/dist/assets/{knowledge-graph-page-VfMvw5jL.js → knowledge-graph-page-Cn9VkUur.js} +1 -1
  37. package/dist/assets/{life-force-page-DQPb6UL-.js → life-force-page-DQPEIj23.js} +1 -1
  38. package/dist/assets/{life-force-workspace-BJ1aI3JE.js → life-force-workspace-Db7XThH2.js} +1 -1
  39. package/dist/assets/{maps-CvEHVkBk.js → maps-CpdpZmGM.js} +1 -1
  40. package/dist/assets/{metric-tile-CbEe19Gd.js → metric-tile-sDt_l_O7.js} +1 -1
  41. package/dist/assets/{motion-BibSzp57.js → motion-eRlWWQT8.js} +1 -1
  42. package/dist/assets/{movement-boxes-dtDYhw5c.js → movement-boxes-birc_cd8.js} +1 -1
  43. package/dist/assets/{movement-page-BhmwCHjs.js → movement-page-BQllmJBm.js} +1 -1
  44. package/dist/assets/{note-markdown-CG8u2d6p.js → note-markdown-Dpve4W0R.js} +1 -1
  45. package/dist/assets/{note-tags-input-D_conqDO.js → note-tags-input-Hvi_ifLe.js} +1 -1
  46. package/dist/assets/{notes-boxes-BLKucFqW.js → notes-boxes-J-MuDr8u.js} +1 -1
  47. package/dist/assets/{notes-page-CafVxWjb.js → notes-page-uR_LafDv.js} +1 -1
  48. package/dist/assets/{open-in-graph-button-DFQ4r6SN.js → open-in-graph-button-JgYTH-IQ.js} +1 -1
  49. package/dist/assets/{orbit-map-DsEl3ori.js → orbit-map-BpNCTagm.js} +1 -1
  50. package/dist/assets/overview-page-DQB4q_vg.js +1 -0
  51. package/dist/assets/{page-hero-U603l9rQ.js → page-hero-ED69y6m0.js} +1 -1
  52. package/dist/assets/pill-cluster-DbPrs1Y4.js +1 -0
  53. package/dist/assets/{preference-entity-handoff-button-cPrTpHsV.js → preference-entity-handoff-button-NkwkWqGv.js} +1 -1
  54. package/dist/assets/{preferences-page-DQjFIOmt.js → preferences-page-BFUVjsHA.js} +1 -1
  55. package/dist/assets/{project-collections-B9OGHGqm.js → project-collections-DHXN2w-P.js} +1 -1
  56. package/dist/assets/{project-detail-page-r1Sw2kcO.js → project-detail-page-nE0M0UmN.js} +1 -1
  57. package/dist/assets/{project-dialog-B2_PcXAf.js → project-dialog-CDkUuAgl.js} +1 -1
  58. package/dist/assets/{project-management-hierarchy-page-qLNG8hsh.js → project-management-hierarchy-page-CID81NpW.js} +1 -1
  59. package/dist/assets/{project-management-section-nav-DFUlmMEB.js → project-management-section-nav-BjFavt6d.js} +1 -1
  60. package/dist/assets/{projects-boxes-BA7_XaqX.js → projects-boxes-DzGqWlhE.js} +1 -1
  61. package/dist/assets/projects-page-DpFKm_CM.js +1 -0
  62. package/dist/assets/{psyche-behaviors-page-ByWpXlLq.js → psyche-behaviors-page-CEQ2EByW.js} +1 -1
  63. package/dist/assets/{psyche-flashcards-page-B9nSc0mk.js → psyche-flashcards-page-D-g1DOS7.js} +1 -1
  64. package/dist/assets/{psyche-goal-map-page-BQU7qI88.js → psyche-goal-map-page-DbWVOpVH.js} +1 -1
  65. package/dist/assets/{psyche-graph-DCeP7r2b.js → psyche-graph-1FHrdH3f.js} +1 -1
  66. package/dist/assets/{psyche-metrics-page-DD2lOP-J.js → psyche-metrics-page-B3736p8_.js} +1 -1
  67. package/dist/assets/{psyche-mode-guide-page-DbtZgnjr.js → psyche-mode-guide-page-CjsMqDsi.js} +1 -1
  68. package/dist/assets/{psyche-modes-page-3zFJWFQf.js → psyche-modes-page-B2qzppBs.js} +1 -1
  69. package/dist/assets/{psyche-page-D5vXYkfB.js → psyche-page-BEPP2B13.js} +1 -1
  70. package/dist/assets/{psyche-patterns-page-BneAAeKS.js → psyche-patterns-page-CWeNeX2P.js} +2 -2
  71. package/dist/assets/{psyche-questionnaire-builder-page-BH1la5C9.js → psyche-questionnaire-builder-page-QFg9LkM0.js} +1 -1
  72. package/dist/assets/{psyche-questionnaire-detail-page-DYav634P.js → psyche-questionnaire-detail-page-D67EJ1D5.js} +1 -1
  73. package/dist/assets/psyche-questionnaire-run-detail-page-C1KsEy8T.js +1 -0
  74. package/dist/assets/{psyche-questionnaire-run-page-e1T6k_dS.js → psyche-questionnaire-run-page-CB3rSTAX.js} +1 -1
  75. package/dist/assets/{psyche-questionnaires-page-Dyv367z9.js → psyche-questionnaires-page-wU3bZws7.js} +1 -1
  76. package/dist/assets/{psyche-report-detail-page-hqxHIXw2.js → psyche-report-detail-page-DI3jE820.js} +3 -3
  77. package/dist/assets/{psyche-reports-page-DhIfcGbt.js → psyche-reports-page-aUbgZ_12.js} +1 -1
  78. package/dist/assets/{psyche-schemas-Cg51Ztxz.js → psyche-schemas-B00gm5HO.js} +1 -1
  79. package/dist/assets/{psyche-schemas-beliefs-page-Dgb5o9vx.js → psyche-schemas-beliefs-page-C_PMXwjL.js} +2 -2
  80. package/dist/assets/{psyche-screen-time-page-D6MnJGNa.js → psyche-screen-time-page-CMIgDG-3.js} +1 -1
  81. package/dist/assets/{psyche-self-observation-page-C1Vyezbv.js → psyche-self-observation-page-DC3orZgf.js} +1 -1
  82. package/dist/assets/{psyche-values-page-B_JWVw1Q.js → psyche-values-page-CPdKfTdl.js} +2 -2
  83. package/dist/assets/{question-flow-dialog-yMYVk998.js → question-flow-dialog-B4B3BI8e.js} +2 -2
  84. package/dist/assets/{report-chain-fields-D4NM9a6I.js → report-chain-fields-D-XNut8V.js} +1 -1
  85. package/dist/assets/rewards-page-D8w07BIZ.js +1 -0
  86. package/dist/assets/{scheduling-rules-editor-De72IUax.js → scheduling-rules-editor-Cn6t-RRn.js} +1 -1
  87. package/dist/assets/{schema-badge-jX28kUa6.js → schema-badge-Dsk9AoYd.js} +1 -1
  88. package/dist/assets/{schemas-BlFy-uPR.js → schemas-3GS34K1i.js} +1 -1
  89. package/dist/assets/{select-menu-BXv1rsVc.js → select-menu-BDeaaa4m.js} +1 -1
  90. package/dist/assets/{settings-agents-page-DN_np10S.js → settings-agents-page-CkS4s4kN.js} +2 -2
  91. package/dist/assets/settings-bin-page-BHlW0n-a.js +1 -0
  92. package/dist/assets/{settings-calendar-page-Cg0gSSFs.js → settings-calendar-page-BAmKOPeT.js} +1 -1
  93. package/dist/assets/{settings-data-page-Dwmp2rLy.js → settings-data-page-C-VrzHGq.js} +1 -1
  94. package/dist/assets/{settings-logs-page-DQNM21Re.js → settings-logs-page-CnVuzJ7d.js} +1 -1
  95. package/dist/assets/{settings-mobile-page-DQdiRa-a.js → settings-mobile-page-0SWGg6CE.js} +1 -1
  96. package/dist/assets/settings-models-page-BjVixsws.js +1 -0
  97. package/dist/assets/{settings-page-Cl2KiCFg.js → settings-page-DVZ58c3R.js} +1 -1
  98. package/dist/assets/settings-rewards-page-Df0ONVFq.js +1 -0
  99. package/dist/assets/{settings-section-nav-D_N87IG0.js → settings-section-nav-Btjx5m2u.js} +1 -1
  100. package/dist/assets/settings-users-page-Cl0YuOOI.js +1 -0
  101. package/dist/assets/{settings-wiki-page-BxMQM5Vi.js → settings-wiki-page-K8KBzeYx.js} +1 -1
  102. package/dist/assets/{sleep-page-DUYmQKrg.js → sleep-page-BFj8hcTf.js} +1 -1
  103. package/dist/assets/{sports-page-Bzi5TF9T.js → sports-page-7yta1r8s.js} +1 -1
  104. package/dist/assets/{state-BFyKSULP.js → state-CkEUXgqt.js} +1 -1
  105. package/dist/assets/{strategies-page-C-T2MZx4.js → strategies-page-BQoWnPtN.js} +1 -1
  106. package/dist/assets/strategy-detail-page-D9DTQoyy.js +1 -0
  107. package/dist/assets/strategy-dialog-z9w2UB3s.js +1 -0
  108. package/dist/assets/{surface-BJObZeRw.js → surface-BL_bDiZ5.js} +1 -1
  109. package/dist/assets/{table-CTLroJKN.js → table--SK_dk4S.js} +1 -1
  110. package/dist/assets/{task-detail-page-ZZOXSpSF.js → task-detail-page-RcbvVzXn.js} +1 -1
  111. package/dist/assets/{task-dialog-2wy0xI7f.js → task-dialog-ri1qEzPp.js} +4 -4
  112. package/dist/assets/timebox-planning-dialog-DoeeGwCm.js +1 -0
  113. package/dist/assets/{today-boxes-B_TdgSDz.js → today-boxes-CTw0D5JP.js} +1 -1
  114. package/dist/assets/today-page-5-qRLbBt.js +1 -0
  115. package/dist/assets/{training-load-page-B78e1-o-.js → training-load-page-DrGnOtnH.js} +1 -1
  116. package/dist/assets/{ui-uo_bNP7c.js → ui-CDt36qNz.js} +1 -1
  117. package/dist/assets/{use-anchored-overlay-position-BSxFX6Hi.js → use-anchored-overlay-position-C2kg0Ay0.js} +1 -1
  118. package/dist/assets/{use-psyche-focus-target-1GLkhYiv.js → use-psyche-focus-target-p2l8W-Af.js} +1 -1
  119. package/dist/assets/{user-badge-C4eZu1e_.js → user-badge-BWoSrGA-.js} +1 -1
  120. package/dist/assets/{user-select-field-CmKwcbZt.js → user-select-field-DbB9v7Lf.js} +1 -1
  121. package/dist/assets/{utility-widgets-B06wQFrd.js → utility-widgets-fodvUR7I.js} +2 -2
  122. package/dist/assets/{vendor-B7FKSwHK.js → vendor-Dgw7UY7q.js} +1 -1
  123. package/dist/assets/{vitals-page-BC7QFsm2.js → vitals-page-f8QdPdpp.js} +1 -1
  124. package/dist/assets/{weekly-review-page-BjNsNoWj.js → weekly-review-page-D0wPiQgO.js} +1 -1
  125. package/dist/assets/{weight-loss-page-BOahGY9r.js → weight-loss-page-BT9dPxYi.js} +1 -1
  126. package/dist/assets/{wiki-article-markdown-DO47HnZf.js → wiki-article-markdown-Hyu5JwrY.js} +1 -1
  127. package/dist/assets/{wiki-editor-page-OWRUHl4O.js → wiki-editor-page-ujqNw8ua.js} +3 -3
  128. package/dist/assets/{wiki-ingest-history-page-CuHpg2lZ.js → wiki-ingest-history-page-BwoDT00-.js} +1 -1
  129. package/dist/assets/{wiki-ingest-modal-EZ3kX-vA.js → wiki-ingest-modal-cvnNma0M.js} +1 -1
  130. package/dist/assets/{wiki-page-BPV3HIgu.js → wiki-page-jHyJ7EgO.js} +1 -1
  131. package/dist/assets/{workbench-flow-page-C53KueEz.js → workbench-flow-page-DJD5sXMF.js} +1 -1
  132. package/dist/assets/{workbench-page-DJ7nT2JQ.js → workbench-page-Ci0xh6rG.js} +1 -1
  133. package/dist/assets/{workout-detail-page-Dhyu0q7o.js → workout-detail-page-DA30ubtE.js} +2 -2
  134. package/dist/index.html +8 -8
  135. package/dist/openclaw/tools.js +1 -1
  136. package/dist/server/apps/api/migrations/073_artifact_entity_links_repair.sql +24 -0
  137. package/dist/server/apps/api/src/app.js +26 -8
  138. package/dist/server/apps/api/src/openapi.js +103 -24
  139. package/dist/server/apps/api/src/services/artifacts.js +138 -68
  140. package/dist/server/apps/web/src/lib/api.js +3 -0
  141. package/openclaw.plugin.json +1 -1
  142. package/package.json +1 -1
  143. package/server/migrations/073_artifact_entity_links_repair.sql +24 -0
  144. package/skills/forge-openclaw/SKILL.md +7 -5
  145. package/skills/forge-openclaw/entity_conversation_playbooks.md +14 -9
  146. package/dist/assets/artifacts-page-BgyFVIVM.js +0 -2
  147. package/dist/assets/goal-detail-page-MYr6j2B4.js +0 -1
  148. package/dist/assets/goals-page-BsFeBzU1.js +0 -1
  149. package/dist/assets/index-CSd8ylsy.css +0 -1
  150. package/dist/assets/index-gmPaoLN-.js +0 -2
  151. package/dist/assets/overview-page-BffcX-pM.js +0 -1
  152. package/dist/assets/pill-cluster-BYVFNppV.js +0 -1
  153. package/dist/assets/projects-page-B6ggXWFw.js +0 -1
  154. package/dist/assets/psyche-questionnaire-run-detail-page-9VaijhJm.js +0 -1
  155. package/dist/assets/rewards-page-B5-bcL4R.js +0 -1
  156. package/dist/assets/settings-bin-page-BM5BpK_i.js +0 -1
  157. package/dist/assets/settings-models-page-CAEPpuHF.js +0 -1
  158. package/dist/assets/settings-rewards-page-DoIUumhe.js +0 -1
  159. package/dist/assets/settings-users-page-CPesR62N.js +0 -1
  160. package/dist/assets/strategy-detail-page-3tYuSZu-.js +0 -1
  161. package/dist/assets/strategy-dialog-BWm4slo4.js +0 -1
  162. package/dist/assets/timebox-planning-dialog-C6h0Hp71.js +0 -1
  163. package/dist/assets/today-page-Dipns9tl.js +0 -1
@@ -0,0 +1,24 @@
1
+ CREATE TABLE IF NOT EXISTS entity_links (
2
+ source_entity_type TEXT NOT NULL,
3
+ source_entity_id TEXT NOT NULL,
4
+ target_entity_type TEXT NOT NULL,
5
+ target_entity_id TEXT NOT NULL,
6
+ anchor_key TEXT NOT NULL DEFAULT '',
7
+ relationship TEXT NOT NULL DEFAULT 'related',
8
+ created_by_actor TEXT,
9
+ created_at TEXT NOT NULL,
10
+ PRIMARY KEY (
11
+ source_entity_type,
12
+ source_entity_id,
13
+ target_entity_type,
14
+ target_entity_id,
15
+ anchor_key,
16
+ relationship
17
+ )
18
+ );
19
+
20
+ CREATE INDEX IF NOT EXISTS idx_entity_links_source
21
+ ON entity_links (source_entity_type, source_entity_id, created_at DESC);
22
+
23
+ CREATE INDEX IF NOT EXISTS idx_entity_links_target
24
+ ON entity_links (target_entity_type, target_entity_id, created_at DESC);
@@ -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 trusted file upload, metadata,
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 enrichment, generic entity-link
132
- replacement, trust state, versions, or audit. Do not expose or call the download
133
- route from agent tools; downloads are human-operator-only.
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 trusted file upload,
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`. Do not download, open, execute, preview, or transform file bytes as
748
- an agent; download is a human-operator-only action.
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
@@ -1555,17 +1557,20 @@ bytes.
1555
1557
 
1556
1558
  Arc:
1557
1559
 
1558
- 1. Ask what the file should help the human retrieve, prove, review, or preserve later.
1559
- 2. Ask for the human-readable title, short description, provenance, and source path
1560
+ 1. Ask what the file or file set should help the human retrieve, prove, review, or preserve later.
1561
+ 2. If there are several files, treat them as a queue: get a quick short description per file,
1562
+ then open per-file details only where title, provenance, links, metadata JSON, or LLM enrichment
1563
+ choices need more care.
1564
+ 3. Ask for the human-readable title, short description, provenance, and source path
1560
1565
  only when the user has not already supplied them.
1561
- 3. Ask which Forge record the artifact should be linked to only when that link will
1566
+ 4. Ask which Forge record the artifact should be linked to only when that link will
1562
1567
  improve retrieval or context. Use Forge's general entity-to-entity link model.
1563
- 4. Ask whether optional LLM enrichment should fill missing description/provenance
1568
+ 5. Ask whether optional LLM enrichment should fill missing description/provenance
1564
1569
  fields and produce a danger summary when an LLM connection exists.
1565
- 5. Keep trust explicit: only a trusted human/operator or trusted agent may add file
1570
+ 6. Keep trust explicit: only a trusted human/operator or trusted agent may add file
1566
1571
  bytes, and the agent must not download, open, execute, preview, or transform the
1567
1572
  stored file.
1568
- 6. After upload, summarize the stored artifact metadata, scan result, danger score,
1573
+ 7. After upload, summarize the stored artifact metadata, scan result, danger score,
1569
1574
  and linked Forge records in product language.
1570
1575
 
1571
1576
  Helpful follow-up lanes:
@@ -1,2 +0,0 @@
1
- import{b_ as se,b7 as ae,r as o,j as e,b$ as O,aX as ie,aQ as re,aG as ne,aD as le,c0 as ce,c1 as H,c2 as X}from"./vendor-B7FKSwHK.js";import{j as oe,i as C,k as f}from"./state-BFyKSULP.js";import{P as de}from"./page-hero-U603l9rQ.js";import{B as k,C as m,I as g,T as w,e as ue,h as J,j as d,c as T,k as me,m as xe,n as pe,o as he,p as ge,q as ve,t as fe,v as ye,w as je}from"./index-gmPaoLN-.js";import"./motion-BibSzp57.js";import"./ui-uo_bNP7c.js";import"./board-DprRipIG.js";import"./forms-ByKjodjN.js";const be=["low","moderate","high","blocked"],Ne=["spreadsheet","document","presentation","pdf","text","structured_text","image"];function z(a){if(!Number.isFinite(a)||a<=0)return"0 B";const r=["B","KB","MB","GB"];let l=a,n=0;for(;l>=1024&&n<r.length-1;)l/=1024,n+=1;return`${l.toFixed(l>=10||n===0?0:1)} ${r[n]}`}function x(a){return a.replaceAll("_"," ").replace(/\b\w/g,r=>r.toUpperCase())}function D(a){return a==="blocked"?"border-red-400/40 bg-red-500/12 text-red-100":a==="high"?"border-orange-400/40 bg-orange-500/12 text-orange-100":a==="moderate"?"border-yellow-300/35 bg-yellow-300/10 text-yellow-100":"border-emerald-300/35 bg-emerald-400/10 text-emerald-100"}function ke(a){return typeof a=="object"&&a!==null&&Array.isArray(a.findings)}function Le(a){return!a||!ke(a.scanResults)?[]:a.scanResults.findings}function we(a){return new Promise((r,l)=>{const n=new FileReader;n.onload=()=>{const u=typeof n.result=="string"?n.result:"",p=u.includes(",")?u.slice(u.indexOf(",")+1):u;r(p)},n.onerror=()=>l(n.error??new Error("Unable to read file.")),n.readAsDataURL(a)})}function W(a){return a.split(/\n+/).map(r=>r.trim()).filter(Boolean).map(r=>{const[l="",n="",u="related",p=""]=r.split(":").map(S=>S.trim());return{entityType:l,entityId:n,relationship:u,anchorKey:p}}).filter(r=>r.entityType.length>0&&r.entityId.length>0)}function Se(a){return a.map(r=>[r.targetEntityType,r.targetEntityId,r.relationship||"related",r.anchorKey??""].filter((l,n)=>n<3||l.length>0).join(":")).join(`
2
- `)}function Ee({artifact:a,selected:r,onSelect:l}){return e.jsxs("button",{type:"button",onClick:l,className:T("w-full rounded-[var(--radius-card)] border p-3 text-left transition",r?"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:a.title}),e.jsx("div",{className:"mt-1 truncate text-xs text-[var(--ui-ink-muted)]",children:a.originalFileName})]}),e.jsxs(d,{size:"xs",className:T("shrink-0",D(a.dangerLevel)),children:[a.dangerScore,"/100"]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(d,{size:"xs",tone:"meta",children:a.detectedExtension.toUpperCase()}),e.jsx(d,{size:"xs",tone:"meta",children:z(a.byteSize)}),e.jsx(d,{size:"xs",tone:"meta",children:x(a.artifactState)})]})]})}function Ue(){var $,Q,_,G;const{artifactId:a}=se(),r=ae(),l=oe(),[n,u]=o.useState(""),[p,S]=o.useState(""),[E,Y]=o.useState(""),[y,A]=o.useState(null),[c,h]=o.useState({title:"",shortDescription:"",description:"",sourceLabel:"",useLlmEnrichment:!1,genericLinksText:""}),[B,K]=o.useState(""),L=C({queryKey:["artifacts",n,p,E],queryFn:()=>fe({query:n||void 0,dangerLevel:p||void 0,formatFamily:E||void 0,limit:200})}),v=(($=L.data)==null?void 0:$.artifacts)??[],s=o.useMemo(()=>v.find(t=>t.id===a)??v[0]??null,[a,v]),U=C({queryKey:["artifact-versions",s==null?void 0:s.id],enabled:!!(s!=null&&s.id),queryFn:()=>ye(s.id)}),Z=C({queryKey:["artifact-audit",s==null?void 0:s.id],enabled:!!(s!=null&&s.id),queryFn:()=>je(s.id)});o.useEffect(()=>{!a&&s&&r(`/artifacts/${s.id}`,{replace:!0})},[a,r,s]);const j=async()=>{await Promise.all([l.invalidateQueries({queryKey:["artifacts"]}),l.invalidateQueries({queryKey:["artifact-versions"]}),l.invalidateQueries({queryKey:["artifact-audit"]}),l.invalidateQueries({queryKey:["knowledge-graph"]})])},b=f({mutationFn:async()=>{if(!y)throw new Error("Choose a file first.");const t={title:c.title||void 0,shortDescription:c.shortDescription,description:c.description,originalFileName:y.name,declaredMimeType:y.type,contentBase64:await we(y),sourceLabel:c.sourceLabel,links:W(c.genericLinksText),useLlmEnrichment:c.useLlmEnrichment};return me(t)},onSuccess:async({artifact:t})=>{A(null),h({title:"",shortDescription:"",description:"",sourceLabel:"",useLlmEnrichment:!1,genericLinksText:""}),await j(),r(`/artifacts/${t.id}`)}}),F=f({mutationFn:t=>ge(s.id,t),onSuccess:j}),q=f({mutationFn:()=>xe(s.id),onSuccess:j}),I=f({mutationFn:()=>pe(s.id,{fillMissingOnly:!0}),onSuccess:j}),M=f({mutationFn:t=>ve(s.id,t),onSuccess:j}),P=f({mutationFn:async()=>{const t=s,i=await he(t.id),V=URL.createObjectURL(i.blob),N=document.createElement("a");N.href=V,N.download=i.fileName??t.originalFileName,document.body.append(N),N.click(),N.remove(),URL.revokeObjectURL(V)}}),R=Le(s),ee=((Q=U.data)==null?void 0:Q.versions.length)??0,te=((_=Z.data)==null?void 0:_.events)??[];return o.useEffect(()=>{K(s?Se(s.links):"")},[s==null?void 0:s.id,s==null?void 0:s.links.length,s==null?void 0:s.updatedAt]),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:`${v.length} stored`,actions:e.jsxs(k,{type:"button",onClick:()=>b.mutate(),pending:b.isPending,disabled:!y,children:[e.jsx(O,{className:"size-4"}),"Upload"]})}),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(m,{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)]"}),"Store"]}),e.jsx(g,{value:n,onChange:t=>u(t.target.value),placeholder:"Search title, file, description, provenance"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("select",{value:p,onChange:t=>S(t.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"}),be.map(t=>e.jsx("option",{value:t,children:x(t)},t))]}),e.jsxs("select",{value:E,onChange:t=>Y(t.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"}),Ne.map(t=>e.jsx("option",{value:t,children:x(t)},t))]})]})]}),e.jsxs(m,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(O,{className:"size-4 text-[var(--primary)]"}),"Add File"]}),e.jsx(g,{type:"file",onChange:t=>{var i;return A(((i=t.target.files)==null?void 0:i[0])??null)}}),e.jsx(g,{value:c.title,onChange:t=>h(i=>({...i,title:t.target.value})),placeholder:"Title"}),e.jsx(g,{value:c.shortDescription,onChange:t=>h(i=>({...i,shortDescription:t.target.value})),placeholder:"Short description"}),e.jsx(g,{value:c.sourceLabel,onChange:t=>h(i=>({...i,sourceLabel:t.target.value})),placeholder:"Provenance or source label"}),e.jsx(w,{value:c.description,onChange:t=>h(i=>({...i,description:t.target.value})),placeholder:"Description"}),e.jsx(w,{value:c.genericLinksText,onChange:t=>h(i=>({...i,genericLinksText:t.target.value})),placeholder:"Optional generic entity links, one per line: entityType:entityId:relationship:anchorKey"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--ui-ink-medium)]",children:[e.jsx("input",{type:"checkbox",checked:c.useLlmEnrichment,onChange:t=>h(i=>({...i,useLlmEnrichment:t.target.checked}))}),"Use configured LLM to fill missing metadata"]}),b.error?e.jsx("p",{className:"text-sm text-red-200",children:b.error instanceof Error?b.error.message:"Upload failed."}):null]}),e.jsx("div",{className:"space-y-2",children:L.isLoading?e.jsx(m,{className:"text-sm text-[var(--ui-ink-muted)]",children:"Loading artifacts..."}):L.error?e.jsx(ue,{error:L.error}):v.length===0?e.jsx(J,{title:"No artifacts found",description:"Upload a trusted file to create the first artifact record."}):v.map(t=>e.jsx(Ee,{artifact:t,selected:t.id===(s==null?void 0:s.id),onSelect:()=>r(`/artifacts/${t.id}`)},t.id))})]}),e.jsx("section",{className:"min-w-0 space-y-4",children:s?e.jsxs(e.Fragment,{children:[e.jsxs(m,{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(d,{className:T(D(s.dangerLevel)),children:[x(s.dangerLevel)," danger"]}),e.jsx(d,{tone:"meta",children:x(s.artifactState)}),e.jsx(d,{tone:"meta",children:s.detectedExtension.toUpperCase()})]}),e.jsx("h2",{className:"mt-3 break-words text-2xl font-semibold",children:s.title}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm text-[var(--ui-ink-muted)]",children:s.shortDescription||s.description})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(k,{variant:"secondary",type:"button",onClick:()=>q.mutate(),pending:q.isPending,children:[e.jsx(re,{className:"size-4"}),"Scan"]}),e.jsxs(k,{variant:"secondary",type:"button",onClick:()=>I.mutate(),pending:I.isPending,children:[e.jsx(ne,{className:"size-4"}),"Enrich"]}),e.jsxs(k,{type:"button",onClick:()=>P.mutate(),pending:P.isPending,disabled:s.downloadPolicy!=="human_only"||s.artifactState==="blocked",children:[e.jsx(le,{className:"size-4"}),"Download"]})]})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-4",children:[["File",s.originalFileName],["Size",z(s.byteSize)],["Versions",ee],["Links",s.links.length]].map(([t,i])=>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:t}),e.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:i})]},t))}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(g,{defaultValue:s.title,onBlur:t=>{const i=t.target.value.trim();i&&i!==s.title&&F.mutate({title:i})},"aria-label":"Artifact title"}),e.jsx(g,{defaultValue:s.shortDescription,onBlur:t=>{const i=t.target.value.trim();i!==s.shortDescription&&F.mutate({shortDescription:i})},"aria-label":"Artifact short description"})]}),e.jsx(w,{defaultValue:s.description,onBlur:t=>{const i=t.target.value.trim();i!==s.description&&F.mutate({description:i})},"aria-label":"Artifact description"})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_minmax(280px,360px)]",children:[e.jsxs(m,{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)]"}),"Safety Findings"]}),R.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:R.map(t=>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(d,{size:"xs",className:D(t.severity),children:x(t.severity)}),e.jsx("span",{className:"text-xs font-medium text-[var(--ui-ink-medium)]",children:t.code})]}),e.jsx("p",{className:"mt-2 text-sm text-[var(--ui-ink-muted)]",children:t.message})]},`${t.code}:${t.message}`))})]}),e.jsxs(m,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(H,{className:"size-4 text-[var(--primary)]"}),"Entity Links"]}),s.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:s.links.map(t=>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:x(t.targetEntityType)}),e.jsx("div",{className:"mt-1 break-all text-xs text-[var(--ui-ink-muted)]",children:t.targetEntityId}),e.jsx(d,{className:"mt-2",size:"xs",tone:"meta",children:x(t.relationship)}),t.anchorKey?e.jsxs("div",{className:"mt-2 text-xs text-[var(--ui-ink-muted)]",children:["Anchor: ",t.anchorKey]}):null]},`${t.targetEntityType}:${t.targetEntityId}:${t.relationship}`))}),e.jsx(w,{value:B,onChange:t=>K(t.target.value),placeholder:"Generic entity links, one per line: entityType:entityId:relationship:anchorKey","aria-label":"Generic entity links"}),e.jsxs(k,{type:"button",variant:"secondary",onClick:()=>M.mutate(W(B)),pending:M.isPending,children:[e.jsx(H,{className:"size-4"}),"Save Links"]})]})]}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs(m,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(X,{className:"size-4 text-[var(--primary)]"}),"Versions"]}),(((G=U.data)==null?void 0:G.versions)??[]).map(t=>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 ",t.versionNumber]}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[z(t.byteSize)," · ",t.originalFileName]})]},t.id))]}),e.jsxs(m,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(X,{className:"size-4 text-[var(--primary)]"}),"Audit"]}),te.slice(0,10).map(t=>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:t.eventType}),e.jsxs("div",{className:"mt-1 text-xs text-[var(--ui-ink-muted)]",children:[new Date(t.createdAt).toLocaleString()," · ",t.source]})]},t.id))]})]})]}):e.jsx(J,{title:"Select an artifact",description:"Choose an artifact from the list to inspect metadata, scans, links, versions, and audit history."})})]})]})}export{Ue as ArtifactsPage};
@@ -1 +0,0 @@
1
- import{b_ as F,b7 as q,r as l,j as e,aC as p}from"./vendor-B7FKSwHK.js";import{j as A,k as H}from"./state-BFyKSULP.js";import{GoalDialog as L}from"./goal-dialog-nkdME5Uy.js";import{O as _}from"./open-in-graph-button-DFQ4r6SN.js";import{N as $}from"./note-markdown-CG8u2d6p.js";import{ProjectDialog as z}from"./project-dialog-B2_PcXAf.js";import{E as K}from"./entity-notes-surface-DPsJwqQa.js";import{P as Q}from"./preference-entity-handoff-button-cPrTpHsV.js";import{b as X,f as J,P as V}from"./project-collections-B9OGHGqm.js";import{P as W}from"./page-hero-U603l9rQ.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-gmPaoLN-.js";import{U as C}from"./user-badge-C4eZu1e_.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-yMYVk998.js";import"./ui-uo_bNP7c.js";import"./motion-BibSzp57.js";import"./inline-note-fields-BvQwmMAv.js";import"./user-select-field-CmKwcbZt.js";import"./schemas-BlFy-uPR.js";import"./forms-ByKjodjN.js";import"./note-tags-input-D_conqDO.js";import"./entity-link-multiselect-BfDAROHB.js";import"./use-anchored-overlay-position-BSxFX6Hi.js";import"./board-DprRipIG.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,c4 as P,bX as C}from"./vendor-B7FKSwHK.js";import{P as S}from"./page-hero-U603l9rQ.js";import{E as G}from"./entity-note-count-link-BGOiaash.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-gmPaoLN-.js";import{GoalDialog as B}from"./goal-dialog-nkdME5Uy.js";import{P as I}from"./pill-cluster-BYVFNppV.js";import{b as R,f as D,P as F}from"./project-collections-B9OGHGqm.js";import{U}from"./user-badge-C4eZu1e_.js";import{g as M}from"./user-ownership-DJGl4rAj.js";import"./state-BFyKSULP.js";import"./motion-BibSzp57.js";import"./ui-uo_bNP7c.js";import"./board-DprRipIG.js";import"./forms-ByKjodjN.js";import"./question-flow-dialog-yMYVk998.js";import"./inline-note-fields-BvQwmMAv.js";import"./user-select-field-CmKwcbZt.js";import"./schemas-BlFy-uPR.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};