@runfusion/fusion 0.77.0-beta.7 → 0.77.0-beta.8

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 (136) hide show
  1. package/dist/bin.js +548 -86
  2. package/dist/child-process-worker.js +546 -86
  3. package/dist/client/.vite/manifest.json +249 -249
  4. package/dist/client/assets/{AgentDetailView-C1eh_vXv.js → AgentDetailView-DsMRc-aH.js} +1 -1
  5. package/dist/client/assets/{AgentPermissionPolicyEditor-CeKsO1LR.js → AgentPermissionPolicyEditor-BXJ52YpO.js} +1 -1
  6. package/dist/client/assets/{AgentsView-BNe2ABOc.js → AgentsView-DO-25nlB.js} +3 -3
  7. package/dist/client/assets/{CommandCenter-BuREM-G1.js → CommandCenter-BMXMg_I2.js} +1 -1
  8. package/dist/client/assets/{DevServerView-D0i1b-QO.js → DevServerView-DAeL5TYz.js} +1 -1
  9. package/dist/client/assets/{DirectoryPicker-VOx91hQt.js → DirectoryPicker-Cw-XRjAa.js} +1 -1
  10. package/dist/client/assets/{DocumentsView-CO5W_WVb.js → DocumentsView-CusClN9u.js} +1 -1
  11. package/dist/client/assets/{EvalsView-BqSINSrZ.js → EvalsView-gNdeUDww.js} +1 -1
  12. package/dist/client/assets/{ExperimentalAgentOnboardingModal-DEcFgONi.js → ExperimentalAgentOnboardingModal-Bmzbqzhs.js} +1 -1
  13. package/dist/client/assets/{GoalsView-DZ57wXmJ.js → GoalsView-J8JMsoLn.js} +1 -1
  14. package/dist/client/assets/{InsightsView-DSWfXG7Q.js → InsightsView-BVbv56K0.js} +1 -1
  15. package/dist/client/assets/{MemoryView-BEX10uhl.js → MemoryView-DNvJFoDu.js} +1 -1
  16. package/dist/client/assets/{PiExtensionsManager-DcAmXXoR.js → PiExtensionsManager-BPMexS34.js} +1 -1
  17. package/dist/client/assets/{PluginManager-BU0omQUv.js → PluginManager-DGEv-ptu.js} +1 -1
  18. package/dist/client/assets/{PullRequestView-B-JL_8Kk.js → PullRequestView-CF7fx-Uo.js} +1 -1
  19. package/dist/client/assets/ReportModal-B8S5BFgn.js +21 -0
  20. package/dist/client/assets/ReportModal-Dx3f2aj7.css +1 -0
  21. package/dist/client/assets/{ResearchView-CnwTXfQO.js → ResearchView-CBeXsevy.js} +1 -1
  22. package/dist/client/assets/{SecretsView-BDvzsLFz.js → SecretsView-Dmi9wZkv.js} +1 -1
  23. package/dist/client/assets/{SettingsModal-801eFQ9u.js → SettingsModal-D2kXP7Um.js} +3 -3
  24. package/dist/client/assets/{SettingsModal-BZHeQ3ED.js → SettingsModal-DSW3xnGk.js} +1 -1
  25. package/dist/client/assets/{SettingsTextareaRow-B0rTuelr.js → SettingsTextareaRow-CLab4Vcd.js} +1 -1
  26. package/dist/client/assets/{SetupWizardModal-CoExPwIn.js → SetupWizardModal-Ct6juX9x.js} +2 -2
  27. package/dist/client/assets/{SkillsView-WVP25LPj.js → SkillsView-Dn0bwT6i.js} +1 -1
  28. package/dist/client/assets/{WorkflowNodeEditor-pCMyKcnS.js → WorkflowNodeEditor-cvReMlG-.js} +1 -1
  29. package/dist/client/assets/{agent-import-generation-M_hKtjgN.js → agent-import-generation-C8_ewVzC.js} +1 -1
  30. package/dist/client/assets/{agentsOrgChartLayout-DjvIMhFD.js → agentsOrgChartLayout-p1i6XROQ.js} +1 -1
  31. package/dist/client/assets/{architectureDiagram-3BPJPVTR-CkzEm8i9.js → architectureDiagram-3BPJPVTR-CzCk1QdH.js} +1 -1
  32. package/dist/client/assets/{blockDiagram-GPEHLZMM-Dc-dUMjY.js → blockDiagram-GPEHLZMM-74Rj-5ov.js} +1 -1
  33. package/dist/client/assets/{c4Diagram-AAUBKEIU-DnYjsrR0.js → c4Diagram-AAUBKEIU-B570qYH-.js} +1 -1
  34. package/dist/client/assets/channel-DWAK5y-J.js +1 -0
  35. package/dist/client/assets/{chunk-2J33WTMH-0E1GEFEr.js → chunk-2J33WTMH-DejJkxt6.js} +1 -1
  36. package/dist/client/assets/{chunk-4BX2VUAB-Dj5oZd51.js → chunk-4BX2VUAB-DlgxkBuE.js} +1 -1
  37. package/dist/client/assets/{chunk-55IACEB6-DfNT0s8E.js → chunk-55IACEB6-XCfE8PwC.js} +1 -1
  38. package/dist/client/assets/{chunk-727SXJPM-BnFjhiIQ.js → chunk-727SXJPM-D-nDw0Bi.js} +1 -1
  39. package/dist/client/assets/{chunk-AQP2D5EJ-DR84wSqR.js → chunk-AQP2D5EJ-C4KySao0.js} +1 -1
  40. package/dist/client/assets/{chunk-FMBD7UC4-IjByNOrR.js → chunk-FMBD7UC4-CXKdLygA.js} +1 -1
  41. package/dist/client/assets/{chunk-ND2GUHAM-By0q_jZm.js → chunk-ND2GUHAM-bNYWWGVJ.js} +1 -1
  42. package/dist/client/assets/{chunk-QZHKN3VN-BELcl3N5.js → chunk-QZHKN3VN-cfBQJ-MX.js} +1 -1
  43. package/dist/client/assets/classDiagram-4FO5ZUOK-WTkXRkfm.js +1 -0
  44. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-WTkXRkfm.js +1 -0
  45. package/dist/client/assets/{cose-bilkent-S5V4N54A-D4cCw9-_.js → cose-bilkent-S5V4N54A-CiZrg3mQ.js} +1 -1
  46. package/dist/client/assets/{dagre-BM42HDAG-JJp5dVeY.js → dagre-BM42HDAG-Bckph2U4.js} +1 -1
  47. package/dist/client/assets/{dashboard-view-Bl9CPhxE.js → dashboard-view-CN_fkDM1.js} +1 -1
  48. package/dist/client/assets/{dashboard-view-C5Nt8cvY.js → dashboard-view-CVYHQZwx.js} +1 -1
  49. package/dist/client/assets/{dashboard-view-6zPJm9zC.js → dashboard-view-DDRKwfFs.js} +1 -1
  50. package/dist/client/assets/{dashboard-view-MAC_LHDX.js → dashboard-view-IuPjDVGa.js} +1 -1
  51. package/dist/client/assets/{diagram-2AECGRRQ-D4L7j_t_.js → diagram-2AECGRRQ-Bnaurex7.js} +1 -1
  52. package/dist/client/assets/{diagram-5GNKFQAL-VAGFaXqG.js → diagram-5GNKFQAL-BKz1omVN.js} +1 -1
  53. package/dist/client/assets/{diagram-KO2AKTUF-hqXSggfW.js → diagram-KO2AKTUF-C51lEZwo.js} +1 -1
  54. package/dist/client/assets/{diagram-LMA3HP47-B3eAIuy8.js → diagram-LMA3HP47-BYm5gql7.js} +1 -1
  55. package/dist/client/assets/{diagram-OG6HWLK6-BGufp0RK.js → diagram-OG6HWLK6-B9CFA4ha.js} +1 -1
  56. package/dist/client/assets/{erDiagram-TEJ5UH35-DplXdx8w.js → erDiagram-TEJ5UH35-BLyCSssl.js} +1 -1
  57. package/dist/client/assets/{flowDiagram-I6XJVG4X-C1Ms2bko.js → flowDiagram-I6XJVG4X-yDVmpkro.js} +1 -1
  58. package/dist/client/assets/{folder-open-nMraSDXu.js → folder-open-Cf2NA9nV.js} +1 -1
  59. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DVgxMtXb.js → ganttDiagram-6RSMTGT7-mC9YPFcx.js} +1 -1
  60. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DH2_n0J8.js → gitGraphDiagram-PVQCEYII-DS0bEccv.js} +1 -1
  61. package/dist/client/assets/index-BjM7LxzY.js +2805 -0
  62. package/dist/client/assets/index-DcKIzuMk.css +1 -0
  63. package/dist/client/assets/{infoDiagram-5YYISTIA-DmZdWVcU.js → infoDiagram-5YYISTIA-CuuNZITP.js} +1 -1
  64. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-DsEIHSXr.js → ishikawaDiagram-YF4QCWOH-MBSaC94m.js} +1 -1
  65. package/dist/client/assets/{journeyDiagram-JHISSGLW-CsfIWmu1.js → journeyDiagram-JHISSGLW-DkaAow9E.js} +1 -1
  66. package/dist/client/assets/{kanban-definition-UN3LZRKU-CQKqeZvc.js → kanban-definition-UN3LZRKU-DSf5OLtq.js} +1 -1
  67. package/dist/client/assets/{mermaid.core-DkC_dr4-.js → mermaid.core-HmTn21MF.js} +4 -4
  68. package/dist/client/assets/{mindmap-definition-RKZ34NQL-RnmE-NUe.js → mindmap-definition-RKZ34NQL-sv0Dl8aI.js} +1 -1
  69. package/dist/client/assets/{pieDiagram-4H26LBE5-DPu6FPc4.js → pieDiagram-4H26LBE5-BDK2IQNq.js} +1 -1
  70. package/dist/client/assets/{puzzle-DwhHOf32.js → puzzle-D00mP67o.js} +1 -1
  71. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CYbypO2p.js → quadrantDiagram-W4KKPZXB-CiWAhwf1.js} +1 -1
  72. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DFk1vK_N.js → requirementDiagram-4Y6WPE33-DwC99D35.js} +1 -1
  73. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-CkUY1Zzu.js → sankeyDiagram-5OEKKPKP-CQn8z721.js} +1 -1
  74. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CFivaLOO.js → sequenceDiagram-3UESZ5HK-B0CT8-vw.js} +1 -1
  75. package/dist/client/assets/{standing-instructions-template-BbqKGAC1.js → standing-instructions-template-BIBO_Prr.js} +1 -1
  76. package/dist/client/assets/{stateDiagram-AJRCARHV-BPeD5PwG.js → stateDiagram-AJRCARHV-BYAB_dFF.js} +1 -1
  77. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-DduiCPMb.js → stateDiagram-v2-BHNVJYJU-Cd19uJBk.js} +1 -1
  78. package/dist/client/assets/{timeline-definition-PNZ67QCA-CGUNNVro.js → timeline-definition-PNZ67QCA-DQLh8XkY.js} +1 -1
  79. package/dist/client/assets/{upload-BS96H1o7.js → upload-D4pkNOz2.js} +1 -1
  80. package/dist/client/assets/{users--irrWoyU.js → users-COgviS_S.js} +1 -1
  81. package/dist/client/assets/{vennDiagram-CIIHVFJN-CybTaJJH.js → vennDiagram-CIIHVFJN-BmwG1Wud.js} +1 -1
  82. package/dist/client/assets/{wardley-L42UT6IY-DSxaSCGi.js → wardley-L42UT6IY-BiO7jkmj.js} +1 -1
  83. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-YFb0AxNt.js → wardleyDiagram-YWT4CUSO-Dq0IPg5H.js} +1 -1
  84. package/dist/client/assets/{xychartDiagram-2RQKCTM6-Cv6zlMJC.js → xychartDiagram-2RQKCTM6-BlMOlSBc.js} +1 -1
  85. package/dist/client/index.html +13 -6
  86. package/dist/client/theme-data.css +85 -0
  87. package/dist/client/version.json +1 -1
  88. package/dist/droid-cli/package.json +1 -1
  89. package/dist/extension.js +548 -86
  90. package/dist/pi-claude-cli/package.json +1 -1
  91. package/dist/plugin-sdk/index.d.ts +5 -1
  92. package/dist/plugin-sdk/index.js +43 -19
  93. package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +43 -19
  94. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  95. package/dist/plugins/fusion-plugin-claude-runtime/bundled.js +43 -19
  96. package/dist/plugins/fusion-plugin-claude-runtime/package.json +1 -1
  97. package/dist/plugins/fusion-plugin-cli-printing-press/bundled.js +43 -19
  98. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  99. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +43 -19
  100. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  101. package/dist/plugins/fusion-plugin-cursor-runtime/bundled.js +43 -19
  102. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  103. package/dist/plugins/fusion-plugin-dependency-graph/bundled.js +43 -19
  104. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  105. package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +43 -19
  106. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  107. package/dist/plugins/fusion-plugin-grok-runtime/bundled.js +43 -19
  108. package/dist/plugins/fusion-plugin-grok-runtime/package.json +1 -1
  109. package/dist/plugins/fusion-plugin-hermes-runtime/bundled.js +43 -19
  110. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  111. package/dist/plugins/fusion-plugin-linear-import/bundled.js +43 -19
  112. package/dist/plugins/fusion-plugin-linear-import/package.json +1 -1
  113. package/dist/plugins/fusion-plugin-omp-runtime/bundled.js +43 -19
  114. package/dist/plugins/fusion-plugin-omp-runtime/package.json +1 -1
  115. package/dist/plugins/fusion-plugin-openclaw-runtime/bundled.js +43 -19
  116. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  117. package/dist/plugins/fusion-plugin-paperclip-runtime/bundled.js +43 -19
  118. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  119. package/dist/plugins/fusion-plugin-quality/bundled.js +43 -19
  120. package/dist/plugins/fusion-plugin-quality/package.json +1 -1
  121. package/dist/plugins/fusion-plugin-reports/bundled.js +43 -19
  122. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  123. package/dist/plugins/fusion-plugin-roadmap/bundled.js +43 -19
  124. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  125. package/dist/plugins/fusion-plugin-todos/bundled.js +43 -19
  126. package/dist/plugins/fusion-plugin-todos/package.json +1 -1
  127. package/dist/plugins/fusion-plugin-whatsapp-chat/bundled.js +43 -19
  128. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  129. package/package.json +1 -1
  130. package/dist/client/assets/ReportModal-DxggF_RH.js +0 -21
  131. package/dist/client/assets/ReportModal-lzN_xrnM.css +0 -1
  132. package/dist/client/assets/channel-CxQ40s_U.js +0 -1
  133. package/dist/client/assets/classDiagram-4FO5ZUOK-C2ARdiRL.js +0 -1
  134. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-C2ARdiRL.js +0 -1
  135. package/dist/client/assets/index-BJc-A7eB.css +0 -1
  136. package/dist/client/assets/index-CBFPgFTp.js +0 -2787
@@ -8228,7 +8228,16 @@ var projectTableNames = [
8228
8228
  "chat_rooms",
8229
8229
  "chat_room_members",
8230
8230
  "chat_room_messages",
8231
- "chat_token_usage"
8231
+ "chat_token_usage",
8232
+ /*
8233
+ FNXC:WorkspaceCoordination 2026-08-23-20:05:
8234
+ FN-9059 (migration 0060) added these two tables to the schema without registering them here, so
8235
+ every registry consumer under-counted them: the PostgreSQL test harness never TRUNCATEd them
8236
+ between tests (a held `repo:<repo>` lease leaked from one case into the next and made the next
8237
+ land report the previous test's successor as the busy holder), and health compaction skipped them.
8238
+ */
8239
+ "workspace_coordination_leases",
8240
+ "workspace_land_intents"
8232
8241
  ];
8233
8242
 
8234
8243
  // ../core/src/postgres/schema/central.ts
@@ -9513,12 +9522,16 @@ var DEFAULT_PROJECT_SETTINGS = {
9513
9522
  executorEscalationProvider: void 0,
9514
9523
  executorEscalationModelId: void 0,
9515
9524
  executorEscalationNodeId: void 0,
9516
- reviewConvergenceEscalationEnabled: true,
9517
- reviewConvergenceEscalationProvider: void 0,
9518
- reviewConvergenceEscalationModelId: void 0,
9519
- reviewArbitrationEnabled: true,
9520
- reviewArbitrationProvider: void 0,
9521
- reviewArbitrationModelId: void 0,
9525
+ /*
9526
+ FNXC:ReviewConvergence 2026-08-23-21:05:
9527
+ FN-149's six review-convergence/arbitration keys are declared in BUILTIN_WORKFLOW_SETTINGS, which
9528
+ the U4 hard-move made the SINGLE source of truth for a moved key's default. Re-declaring them here
9529
+ put them back in the legacy object the hard-move emptied, so an undeclared key on a custom workflow
9530
+ could resolve to this literal instead of the declaration default — the exact drift
9531
+ `workflow-settings-fallback-alignment` guards. The declaration defaults are identical (both
9532
+ `*Enabled` default true, the provider/model lanes carry no default), and the reader uses
9533
+ `!== false`, so removing them here preserves behaviour and restores the invariant.
9534
+ */
9522
9535
  /**
9523
9536
  * FNXC:Merge 2026-06-26-00:00:
9524
9537
  * New and unconfigured projects default AI merge to sync a dirty checked-out integration branch, restoring the legacy stash → fast-forward → restore landing behavior. Explicit persisted merger.allowDirtyLocalCheckoutSync values still win, and no existing-project migration stamps this default into storage.
@@ -10411,6 +10424,20 @@ function classifyWorkflowAgentNode(node) {
10411
10424
  }
10412
10425
  }
10413
10426
 
10427
+ // ../core/src/workflows/workflow-merge-region.ts
10428
+ var MERGE_REGION_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10429
+ "merge-gate",
10430
+ "merge-attempt",
10431
+ "manual-merge-hold",
10432
+ "retry-backoff",
10433
+ "recovery-router",
10434
+ "branch-group-member-integration",
10435
+ "branch-group-promotion",
10436
+ "pr-create",
10437
+ "pr-respond",
10438
+ "pr-merge"
10439
+ ]);
10440
+
10414
10441
  // ../core/src/workflows/workflow-extension-types.ts
10415
10442
  function workflowExtensionRegistryId(pluginId, extensionId) {
10416
10443
  return `plugin:${pluginId}:${extensionId}`;
@@ -10939,18 +10966,7 @@ function reachableFrom(start, outgoing) {
10939
10966
  }
10940
10967
  return seen;
10941
10968
  }
10942
- var INTERPRETER_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10943
- "merge-gate",
10944
- "merge-attempt",
10945
- "manual-merge-hold",
10946
- "retry-backoff",
10947
- "recovery-router",
10948
- "branch-group-member-integration",
10949
- "branch-group-promotion",
10950
- "pr-create",
10951
- "pr-respond",
10952
- "pr-merge"
10953
- ]);
10969
+ var INTERPRETER_ENTRY_NODE_KINDS = MERGE_REGION_ENTRY_NODE_KINDS;
10954
10970
  var MERGE_CLASS_NODE_KINDS = /* @__PURE__ */ new Set([
10955
10971
  "merge-gate",
10956
10972
  "merge-attempt",
@@ -12970,6 +12986,13 @@ Lint, tests, and typecheck are also hard quality gates:
12970
12986
  - Keep fixing failures caused by your change until lint, impacted tests, build, and typecheck pass.
12971
12987
  - If the repository exposes a typecheck command, run it and fix failures caused by your change.
12972
12988
  - When tests fail, classify whether the failure is caused by your change, a pre-existing defect, an unrelated flaky test, or an outdated test expectation.
12989
+
12990
+ **A behavior change owns every test that asserts the old behavior.** Targeted verification runs the tests for files you TOUCHED; the tests encoding the behavior you just changed usually live in files you did NOT touch, so a green targeted run is not evidence that none exist. Before finishing, search for them:
12991
+ - Added a guard, validation, or required field? Grep for the FIXTURES it will now refuse \u2014 they are outside your File Scope \u2014 and fix each to state its intent explicitly.
12992
+ - Removed a feature? Delete its tests. A test asserting a deliberately removed contract guards nothing, and making it pass later means re-adding removed behavior.
12993
+ - Changed an order, default, constant, or prompt string? Grep for the literal; topology lists, prompt-content assertions, and size budgets live far from the code they describe.
12994
+ - Added a public store/service method? Update the inventory/drift guards that require every public surface to be classified.
12995
+ Fix at the SHARED FIXTURE FACTORY, not per test \u2014 one helper usually explains dozens of failures. Never make a stale test pass by weakening it: update the fixture, record the new truth, or delete the test naming the change that removed its subject.
12973
12996
  - If broad workspace verification fails on unrelated or pre-existing failures after impacted checks pass, do NOT expand this task by fixing unrelated areas. Log the evidence, quarantine flakes per project policy, or create/link a follow-up task.
12974
12997
  - Do not repeatedly rerun a broad failing or hanging workspace command without a new hypothesis and a narrower confirming command.
12975
12998
 
@@ -13242,6 +13265,7 @@ files with assertions that run via a test runner. Typechecks and builds are NOT
13242
13265
  tests. Manual verification is NOT a test.
13243
13266
 
13244
13267
  - Each implementation step should include writing tests for the code being changed
13268
+ - **If the task CHANGES, GATES, or REMOVES existing behavior, include a step to find and update the tests that assert the OLD behavior.** Name the search in that step: the fixtures a new guard will now refuse, the tests of a removed feature, or the literal to grep for a changed order/default/constant/prompt string. Those tests live OUTSIDE the File Scope, so targeted verification will not surface them and the executor will not find them by accident. Measured 2026-08-24: five such changes left ~135 stale failing tests behind, every one having passed its own targeted verification; one shared fixture line accounted for 37 of them.
13245
13269
  - For bug fixes and UI-affordance add/remove tasks, the spec MUST include a \`## Surface Enumeration\` section. The workflow Plan Review gate validates this before execution when plan review is enabled; missing coverage is a blocking REVISE.
13246
13270
  - For bug fixes and UI-affordance add/remove tasks, populate \`## Surface Enumeration\` with this checklist from \`docs/testing.md\`: providers/bridges/execution paths; desktop + mobile breakpoints/platforms; empty/undefined/duplicate/populated data states; shared hooks/components/modules/helpers; every component that renders the affordance; leftover shells after removal.
13247
13271
  - For bug fixes and UI-affordance add/remove tasks, regression tests must assert the invariant across all known surfaces \u2014 enumerate every provider/bridge, desktop + mobile breakpoints, empty/undefined/populated data states, and for UI-affordance changes every component rendering the affordance plus leftover shells after removal \u2014 not just the reported repro (see FN-5787/FN-5789/FN-5803, FN-5751, and FN-6115/FN-6118/FN-6123)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/reports",
3
- "version": "0.1.55-beta.7",
3
+ "version": "0.1.55-beta.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8200,7 +8200,16 @@ var projectTableNames = [
8200
8200
  "chat_rooms",
8201
8201
  "chat_room_members",
8202
8202
  "chat_room_messages",
8203
- "chat_token_usage"
8203
+ "chat_token_usage",
8204
+ /*
8205
+ FNXC:WorkspaceCoordination 2026-08-23-20:05:
8206
+ FN-9059 (migration 0060) added these two tables to the schema without registering them here, so
8207
+ every registry consumer under-counted them: the PostgreSQL test harness never TRUNCATEd them
8208
+ between tests (a held `repo:<repo>` lease leaked from one case into the next and made the next
8209
+ land report the previous test's successor as the busy holder), and health compaction skipped them.
8210
+ */
8211
+ "workspace_coordination_leases",
8212
+ "workspace_land_intents"
8204
8213
  ];
8205
8214
 
8206
8215
  // ../core/src/postgres/schema/central.ts
@@ -9393,12 +9402,16 @@ var DEFAULT_PROJECT_SETTINGS = {
9393
9402
  executorEscalationProvider: void 0,
9394
9403
  executorEscalationModelId: void 0,
9395
9404
  executorEscalationNodeId: void 0,
9396
- reviewConvergenceEscalationEnabled: true,
9397
- reviewConvergenceEscalationProvider: void 0,
9398
- reviewConvergenceEscalationModelId: void 0,
9399
- reviewArbitrationEnabled: true,
9400
- reviewArbitrationProvider: void 0,
9401
- reviewArbitrationModelId: void 0,
9405
+ /*
9406
+ FNXC:ReviewConvergence 2026-08-23-21:05:
9407
+ FN-149's six review-convergence/arbitration keys are declared in BUILTIN_WORKFLOW_SETTINGS, which
9408
+ the U4 hard-move made the SINGLE source of truth for a moved key's default. Re-declaring them here
9409
+ put them back in the legacy object the hard-move emptied, so an undeclared key on a custom workflow
9410
+ could resolve to this literal instead of the declaration default — the exact drift
9411
+ `workflow-settings-fallback-alignment` guards. The declaration defaults are identical (both
9412
+ `*Enabled` default true, the provider/model lanes carry no default), and the reader uses
9413
+ `!== false`, so removing them here preserves behaviour and restores the invariant.
9414
+ */
9402
9415
  /**
9403
9416
  * FNXC:Merge 2026-06-26-00:00:
9404
9417
  * New and unconfigured projects default AI merge to sync a dirty checked-out integration branch, restoring the legacy stash → fast-forward → restore landing behavior. Explicit persisted merger.allowDirtyLocalCheckoutSync values still win, and no existing-project migration stamps this default into storage.
@@ -10291,6 +10304,20 @@ function classifyWorkflowAgentNode(node) {
10291
10304
  }
10292
10305
  }
10293
10306
 
10307
+ // ../core/src/workflows/workflow-merge-region.ts
10308
+ var MERGE_REGION_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10309
+ "merge-gate",
10310
+ "merge-attempt",
10311
+ "manual-merge-hold",
10312
+ "retry-backoff",
10313
+ "recovery-router",
10314
+ "branch-group-member-integration",
10315
+ "branch-group-promotion",
10316
+ "pr-create",
10317
+ "pr-respond",
10318
+ "pr-merge"
10319
+ ]);
10320
+
10294
10321
  // ../core/src/workflows/workflow-extension-types.ts
10295
10322
  function workflowExtensionRegistryId(pluginId, extensionId) {
10296
10323
  return `plugin:${pluginId}:${extensionId}`;
@@ -10819,18 +10846,7 @@ function reachableFrom(start, outgoing) {
10819
10846
  }
10820
10847
  return seen;
10821
10848
  }
10822
- var INTERPRETER_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10823
- "merge-gate",
10824
- "merge-attempt",
10825
- "manual-merge-hold",
10826
- "retry-backoff",
10827
- "recovery-router",
10828
- "branch-group-member-integration",
10829
- "branch-group-promotion",
10830
- "pr-create",
10831
- "pr-respond",
10832
- "pr-merge"
10833
- ]);
10849
+ var INTERPRETER_ENTRY_NODE_KINDS = MERGE_REGION_ENTRY_NODE_KINDS;
10834
10850
  var MERGE_CLASS_NODE_KINDS = /* @__PURE__ */ new Set([
10835
10851
  "merge-gate",
10836
10852
  "merge-attempt",
@@ -12850,6 +12866,13 @@ Lint, tests, and typecheck are also hard quality gates:
12850
12866
  - Keep fixing failures caused by your change until lint, impacted tests, build, and typecheck pass.
12851
12867
  - If the repository exposes a typecheck command, run it and fix failures caused by your change.
12852
12868
  - When tests fail, classify whether the failure is caused by your change, a pre-existing defect, an unrelated flaky test, or an outdated test expectation.
12869
+
12870
+ **A behavior change owns every test that asserts the old behavior.** Targeted verification runs the tests for files you TOUCHED; the tests encoding the behavior you just changed usually live in files you did NOT touch, so a green targeted run is not evidence that none exist. Before finishing, search for them:
12871
+ - Added a guard, validation, or required field? Grep for the FIXTURES it will now refuse \u2014 they are outside your File Scope \u2014 and fix each to state its intent explicitly.
12872
+ - Removed a feature? Delete its tests. A test asserting a deliberately removed contract guards nothing, and making it pass later means re-adding removed behavior.
12873
+ - Changed an order, default, constant, or prompt string? Grep for the literal; topology lists, prompt-content assertions, and size budgets live far from the code they describe.
12874
+ - Added a public store/service method? Update the inventory/drift guards that require every public surface to be classified.
12875
+ Fix at the SHARED FIXTURE FACTORY, not per test \u2014 one helper usually explains dozens of failures. Never make a stale test pass by weakening it: update the fixture, record the new truth, or delete the test naming the change that removed its subject.
12853
12876
  - If broad workspace verification fails on unrelated or pre-existing failures after impacted checks pass, do NOT expand this task by fixing unrelated areas. Log the evidence, quarantine flakes per project policy, or create/link a follow-up task.
12854
12877
  - Do not repeatedly rerun a broad failing or hanging workspace command without a new hypothesis and a narrower confirming command.
12855
12878
 
@@ -13122,6 +13145,7 @@ files with assertions that run via a test runner. Typechecks and builds are NOT
13122
13145
  tests. Manual verification is NOT a test.
13123
13146
 
13124
13147
  - Each implementation step should include writing tests for the code being changed
13148
+ - **If the task CHANGES, GATES, or REMOVES existing behavior, include a step to find and update the tests that assert the OLD behavior.** Name the search in that step: the fixtures a new guard will now refuse, the tests of a removed feature, or the literal to grep for a changed order/default/constant/prompt string. Those tests live OUTSIDE the File Scope, so targeted verification will not surface them and the executor will not find them by accident. Measured 2026-08-24: five such changes left ~135 stale failing tests behind, every one having passed its own targeted verification; one shared fixture line accounted for 37 of them.
13125
13149
  - For bug fixes and UI-affordance add/remove tasks, the spec MUST include a \`## Surface Enumeration\` section. The workflow Plan Review gate validates this before execution when plan review is enabled; missing coverage is a blocking REVISE.
13126
13150
  - For bug fixes and UI-affordance add/remove tasks, populate \`## Surface Enumeration\` with this checklist from \`docs/testing.md\`: providers/bridges/execution paths; desktop + mobile breakpoints/platforms; empty/undefined/duplicate/populated data states; shared hooks/components/modules/helpers; every component that renders the affordance; leftover shells after removal.
13127
13151
  - For bug fixes and UI-affordance add/remove tasks, regression tests must assert the invariant across all known surfaces \u2014 enumerate every provider/bridge, desktop + mobile breakpoints, empty/undefined/populated data states, and for UI-affordance changes every component rendering the affordance plus leftover shells after removal \u2014 not just the reported repro (see FN-5787/FN-5789/FN-5803, FN-5751, and FN-6115/FN-6118/FN-6123)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/roadmap",
3
- "version": "0.1.55-beta.7",
3
+ "version": "0.1.55-beta.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8200,7 +8200,16 @@ var projectTableNames = [
8200
8200
  "chat_rooms",
8201
8201
  "chat_room_members",
8202
8202
  "chat_room_messages",
8203
- "chat_token_usage"
8203
+ "chat_token_usage",
8204
+ /*
8205
+ FNXC:WorkspaceCoordination 2026-08-23-20:05:
8206
+ FN-9059 (migration 0060) added these two tables to the schema without registering them here, so
8207
+ every registry consumer under-counted them: the PostgreSQL test harness never TRUNCATEd them
8208
+ between tests (a held `repo:<repo>` lease leaked from one case into the next and made the next
8209
+ land report the previous test's successor as the busy holder), and health compaction skipped them.
8210
+ */
8211
+ "workspace_coordination_leases",
8212
+ "workspace_land_intents"
8204
8213
  ];
8205
8214
 
8206
8215
  // ../core/src/postgres/schema/central.ts
@@ -9393,12 +9402,16 @@ var DEFAULT_PROJECT_SETTINGS = {
9393
9402
  executorEscalationProvider: void 0,
9394
9403
  executorEscalationModelId: void 0,
9395
9404
  executorEscalationNodeId: void 0,
9396
- reviewConvergenceEscalationEnabled: true,
9397
- reviewConvergenceEscalationProvider: void 0,
9398
- reviewConvergenceEscalationModelId: void 0,
9399
- reviewArbitrationEnabled: true,
9400
- reviewArbitrationProvider: void 0,
9401
- reviewArbitrationModelId: void 0,
9405
+ /*
9406
+ FNXC:ReviewConvergence 2026-08-23-21:05:
9407
+ FN-149's six review-convergence/arbitration keys are declared in BUILTIN_WORKFLOW_SETTINGS, which
9408
+ the U4 hard-move made the SINGLE source of truth for a moved key's default. Re-declaring them here
9409
+ put them back in the legacy object the hard-move emptied, so an undeclared key on a custom workflow
9410
+ could resolve to this literal instead of the declaration default — the exact drift
9411
+ `workflow-settings-fallback-alignment` guards. The declaration defaults are identical (both
9412
+ `*Enabled` default true, the provider/model lanes carry no default), and the reader uses
9413
+ `!== false`, so removing them here preserves behaviour and restores the invariant.
9414
+ */
9402
9415
  /**
9403
9416
  * FNXC:Merge 2026-06-26-00:00:
9404
9417
  * New and unconfigured projects default AI merge to sync a dirty checked-out integration branch, restoring the legacy stash → fast-forward → restore landing behavior. Explicit persisted merger.allowDirtyLocalCheckoutSync values still win, and no existing-project migration stamps this default into storage.
@@ -10291,6 +10304,20 @@ function classifyWorkflowAgentNode(node) {
10291
10304
  }
10292
10305
  }
10293
10306
 
10307
+ // ../core/src/workflows/workflow-merge-region.ts
10308
+ var MERGE_REGION_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10309
+ "merge-gate",
10310
+ "merge-attempt",
10311
+ "manual-merge-hold",
10312
+ "retry-backoff",
10313
+ "recovery-router",
10314
+ "branch-group-member-integration",
10315
+ "branch-group-promotion",
10316
+ "pr-create",
10317
+ "pr-respond",
10318
+ "pr-merge"
10319
+ ]);
10320
+
10294
10321
  // ../core/src/workflows/workflow-extension-types.ts
10295
10322
  function workflowExtensionRegistryId(pluginId, extensionId) {
10296
10323
  return `plugin:${pluginId}:${extensionId}`;
@@ -10819,18 +10846,7 @@ function reachableFrom(start, outgoing) {
10819
10846
  }
10820
10847
  return seen;
10821
10848
  }
10822
- var INTERPRETER_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
10823
- "merge-gate",
10824
- "merge-attempt",
10825
- "manual-merge-hold",
10826
- "retry-backoff",
10827
- "recovery-router",
10828
- "branch-group-member-integration",
10829
- "branch-group-promotion",
10830
- "pr-create",
10831
- "pr-respond",
10832
- "pr-merge"
10833
- ]);
10849
+ var INTERPRETER_ENTRY_NODE_KINDS = MERGE_REGION_ENTRY_NODE_KINDS;
10834
10850
  var MERGE_CLASS_NODE_KINDS = /* @__PURE__ */ new Set([
10835
10851
  "merge-gate",
10836
10852
  "merge-attempt",
@@ -12850,6 +12866,13 @@ Lint, tests, and typecheck are also hard quality gates:
12850
12866
  - Keep fixing failures caused by your change until lint, impacted tests, build, and typecheck pass.
12851
12867
  - If the repository exposes a typecheck command, run it and fix failures caused by your change.
12852
12868
  - When tests fail, classify whether the failure is caused by your change, a pre-existing defect, an unrelated flaky test, or an outdated test expectation.
12869
+
12870
+ **A behavior change owns every test that asserts the old behavior.** Targeted verification runs the tests for files you TOUCHED; the tests encoding the behavior you just changed usually live in files you did NOT touch, so a green targeted run is not evidence that none exist. Before finishing, search for them:
12871
+ - Added a guard, validation, or required field? Grep for the FIXTURES it will now refuse \u2014 they are outside your File Scope \u2014 and fix each to state its intent explicitly.
12872
+ - Removed a feature? Delete its tests. A test asserting a deliberately removed contract guards nothing, and making it pass later means re-adding removed behavior.
12873
+ - Changed an order, default, constant, or prompt string? Grep for the literal; topology lists, prompt-content assertions, and size budgets live far from the code they describe.
12874
+ - Added a public store/service method? Update the inventory/drift guards that require every public surface to be classified.
12875
+ Fix at the SHARED FIXTURE FACTORY, not per test \u2014 one helper usually explains dozens of failures. Never make a stale test pass by weakening it: update the fixture, record the new truth, or delete the test naming the change that removed its subject.
12853
12876
  - If broad workspace verification fails on unrelated or pre-existing failures after impacted checks pass, do NOT expand this task by fixing unrelated areas. Log the evidence, quarantine flakes per project policy, or create/link a follow-up task.
12854
12877
  - Do not repeatedly rerun a broad failing or hanging workspace command without a new hypothesis and a narrower confirming command.
12855
12878
 
@@ -13122,6 +13145,7 @@ files with assertions that run via a test runner. Typechecks and builds are NOT
13122
13145
  tests. Manual verification is NOT a test.
13123
13146
 
13124
13147
  - Each implementation step should include writing tests for the code being changed
13148
+ - **If the task CHANGES, GATES, or REMOVES existing behavior, include a step to find and update the tests that assert the OLD behavior.** Name the search in that step: the fixtures a new guard will now refuse, the tests of a removed feature, or the literal to grep for a changed order/default/constant/prompt string. Those tests live OUTSIDE the File Scope, so targeted verification will not surface them and the executor will not find them by accident. Measured 2026-08-24: five such changes left ~135 stale failing tests behind, every one having passed its own targeted verification; one shared fixture line accounted for 37 of them.
13125
13149
  - For bug fixes and UI-affordance add/remove tasks, the spec MUST include a \`## Surface Enumeration\` section. The workflow Plan Review gate validates this before execution when plan review is enabled; missing coverage is a blocking REVISE.
13126
13150
  - For bug fixes and UI-affordance add/remove tasks, populate \`## Surface Enumeration\` with this checklist from \`docs/testing.md\`: providers/bridges/execution paths; desktop + mobile breakpoints/platforms; empty/undefined/duplicate/populated data states; shared hooks/components/modules/helpers; every component that renders the affordance; leftover shells after removal.
13127
13151
  - For bug fixes and UI-affordance add/remove tasks, regression tests must assert the invariant across all known surfaces \u2014 enumerate every provider/bridge, desktop + mobile breakpoints, empty/undefined/populated data states, and for UI-affordance changes every component rendering the affordance plus leftover shells after removal \u2014 not just the reported repro (see FN-5787/FN-5789/FN-5803, FN-5751, and FN-6115/FN-6118/FN-6123)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/todos",
3
- "version": "0.1.4-beta.7",
3
+ "version": "0.1.4-beta.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -165501,7 +165501,16 @@ var projectTableNames = [
165501
165501
  "chat_rooms",
165502
165502
  "chat_room_members",
165503
165503
  "chat_room_messages",
165504
- "chat_token_usage"
165504
+ "chat_token_usage",
165505
+ /*
165506
+ FNXC:WorkspaceCoordination 2026-08-23-20:05:
165507
+ FN-9059 (migration 0060) added these two tables to the schema without registering them here, so
165508
+ every registry consumer under-counted them: the PostgreSQL test harness never TRUNCATEd them
165509
+ between tests (a held `repo:<repo>` lease leaked from one case into the next and made the next
165510
+ land report the previous test's successor as the busy holder), and health compaction skipped them.
165511
+ */
165512
+ "workspace_coordination_leases",
165513
+ "workspace_land_intents"
165505
165514
  ];
165506
165515
 
165507
165516
  // ../core/src/postgres/schema/central.ts
@@ -166694,12 +166703,16 @@ var DEFAULT_PROJECT_SETTINGS = {
166694
166703
  executorEscalationProvider: void 0,
166695
166704
  executorEscalationModelId: void 0,
166696
166705
  executorEscalationNodeId: void 0,
166697
- reviewConvergenceEscalationEnabled: true,
166698
- reviewConvergenceEscalationProvider: void 0,
166699
- reviewConvergenceEscalationModelId: void 0,
166700
- reviewArbitrationEnabled: true,
166701
- reviewArbitrationProvider: void 0,
166702
- reviewArbitrationModelId: void 0,
166706
+ /*
166707
+ FNXC:ReviewConvergence 2026-08-23-21:05:
166708
+ FN-149's six review-convergence/arbitration keys are declared in BUILTIN_WORKFLOW_SETTINGS, which
166709
+ the U4 hard-move made the SINGLE source of truth for a moved key's default. Re-declaring them here
166710
+ put them back in the legacy object the hard-move emptied, so an undeclared key on a custom workflow
166711
+ could resolve to this literal instead of the declaration default — the exact drift
166712
+ `workflow-settings-fallback-alignment` guards. The declaration defaults are identical (both
166713
+ `*Enabled` default true, the provider/model lanes carry no default), and the reader uses
166714
+ `!== false`, so removing them here preserves behaviour and restores the invariant.
166715
+ */
166703
166716
  /**
166704
166717
  * FNXC:Merge 2026-06-26-00:00:
166705
166718
  * New and unconfigured projects default AI merge to sync a dirty checked-out integration branch, restoring the legacy stash → fast-forward → restore landing behavior. Explicit persisted merger.allowDirtyLocalCheckoutSync values still win, and no existing-project migration stamps this default into storage.
@@ -167592,6 +167605,20 @@ function classifyWorkflowAgentNode(node) {
167592
167605
  }
167593
167606
  }
167594
167607
 
167608
+ // ../core/src/workflows/workflow-merge-region.ts
167609
+ var MERGE_REGION_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
167610
+ "merge-gate",
167611
+ "merge-attempt",
167612
+ "manual-merge-hold",
167613
+ "retry-backoff",
167614
+ "recovery-router",
167615
+ "branch-group-member-integration",
167616
+ "branch-group-promotion",
167617
+ "pr-create",
167618
+ "pr-respond",
167619
+ "pr-merge"
167620
+ ]);
167621
+
167595
167622
  // ../core/src/workflows/workflow-extension-types.ts
167596
167623
  function workflowExtensionRegistryId(pluginId, extensionId) {
167597
167624
  return `plugin:${pluginId}:${extensionId}`;
@@ -168120,18 +168147,7 @@ function reachableFrom(start, outgoing) {
168120
168147
  }
168121
168148
  return seen;
168122
168149
  }
168123
- var INTERPRETER_ENTRY_NODE_KINDS = /* @__PURE__ */ new Set([
168124
- "merge-gate",
168125
- "merge-attempt",
168126
- "manual-merge-hold",
168127
- "retry-backoff",
168128
- "recovery-router",
168129
- "branch-group-member-integration",
168130
- "branch-group-promotion",
168131
- "pr-create",
168132
- "pr-respond",
168133
- "pr-merge"
168134
- ]);
168150
+ var INTERPRETER_ENTRY_NODE_KINDS = MERGE_REGION_ENTRY_NODE_KINDS;
168135
168151
  var MERGE_CLASS_NODE_KINDS = /* @__PURE__ */ new Set([
168136
168152
  "merge-gate",
168137
168153
  "merge-attempt",
@@ -170151,6 +170167,13 @@ Lint, tests, and typecheck are also hard quality gates:
170151
170167
  - Keep fixing failures caused by your change until lint, impacted tests, build, and typecheck pass.
170152
170168
  - If the repository exposes a typecheck command, run it and fix failures caused by your change.
170153
170169
  - When tests fail, classify whether the failure is caused by your change, a pre-existing defect, an unrelated flaky test, or an outdated test expectation.
170170
+
170171
+ **A behavior change owns every test that asserts the old behavior.** Targeted verification runs the tests for files you TOUCHED; the tests encoding the behavior you just changed usually live in files you did NOT touch, so a green targeted run is not evidence that none exist. Before finishing, search for them:
170172
+ - Added a guard, validation, or required field? Grep for the FIXTURES it will now refuse \u2014 they are outside your File Scope \u2014 and fix each to state its intent explicitly.
170173
+ - Removed a feature? Delete its tests. A test asserting a deliberately removed contract guards nothing, and making it pass later means re-adding removed behavior.
170174
+ - Changed an order, default, constant, or prompt string? Grep for the literal; topology lists, prompt-content assertions, and size budgets live far from the code they describe.
170175
+ - Added a public store/service method? Update the inventory/drift guards that require every public surface to be classified.
170176
+ Fix at the SHARED FIXTURE FACTORY, not per test \u2014 one helper usually explains dozens of failures. Never make a stale test pass by weakening it: update the fixture, record the new truth, or delete the test naming the change that removed its subject.
170154
170177
  - If broad workspace verification fails on unrelated or pre-existing failures after impacted checks pass, do NOT expand this task by fixing unrelated areas. Log the evidence, quarantine flakes per project policy, or create/link a follow-up task.
170155
170178
  - Do not repeatedly rerun a broad failing or hanging workspace command without a new hypothesis and a narrower confirming command.
170156
170179
 
@@ -170423,6 +170446,7 @@ files with assertions that run via a test runner. Typechecks and builds are NOT
170423
170446
  tests. Manual verification is NOT a test.
170424
170447
 
170425
170448
  - Each implementation step should include writing tests for the code being changed
170449
+ - **If the task CHANGES, GATES, or REMOVES existing behavior, include a step to find and update the tests that assert the OLD behavior.** Name the search in that step: the fixtures a new guard will now refuse, the tests of a removed feature, or the literal to grep for a changed order/default/constant/prompt string. Those tests live OUTSIDE the File Scope, so targeted verification will not surface them and the executor will not find them by accident. Measured 2026-08-24: five such changes left ~135 stale failing tests behind, every one having passed its own targeted verification; one shared fixture line accounted for 37 of them.
170426
170450
  - For bug fixes and UI-affordance add/remove tasks, the spec MUST include a \`## Surface Enumeration\` section. The workflow Plan Review gate validates this before execution when plan review is enabled; missing coverage is a blocking REVISE.
170427
170451
  - For bug fixes and UI-affordance add/remove tasks, populate \`## Surface Enumeration\` with this checklist from \`docs/testing.md\`: providers/bridges/execution paths; desktop + mobile breakpoints/platforms; empty/undefined/duplicate/populated data states; shared hooks/components/modules/helpers; every component that renders the affordance; leftover shells after removal.
170428
170452
  - For bug fixes and UI-affordance add/remove tasks, regression tests must assert the invariant across all known surfaces \u2014 enumerate every provider/bridge, desktop + mobile breakpoints, empty/undefined/populated data states, and for UI-affordance changes every component rendering the affordance plus leftover shells after removal \u2014 not just the reported repro (see FN-5787/FN-5789/FN-5803, FN-5751, and FN-6115/FN-6118/FN-6123)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/whatsapp-chat",
3
- "version": "0.1.55-beta.7",
3
+ "version": "0.1.55-beta.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runfusion/fusion",
3
- "version": "0.77.0-beta.7",
3
+ "version": "0.77.0-beta.8",
4
4
  "license": "MIT",
5
5
  "description": "Fusion CLI: HTTP API server, daemon, dashboard launcher, and task tooling for the Fusion AI coding agent.",
6
6
  "homepage": "https://github.com/Runfusion/Fusion#readme",
@@ -1,21 +0,0 @@
1
- import{r as n,j as e,b as se}from"./vendor-react-SZ_qB27O.js";import{c as T,da as re,dd as Q,U as le,C as X,de as oe,df as ne,q as ce,aT as ie,bt as he,dg as A,dh as de,di as Y}from"./index-CBFPgFTp.js";import{u as _}from"./vendor-i18n-Duky4gdQ.js";/**
2
- * @license lucide-react v1.7.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ue=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],me=T("bug",ue);/**
7
- * @license lucide-react v1.7.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const pe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],be=T("life-buoy",pe);/**
12
- * @license lucide-react v1.7.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const we=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ve=T("moon",we);/**
17
- * @license lucide-react v1.7.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const fe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ye=T("sun",fe);async function G(s,d){const l=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!l.ok)throw new Error((await l.json().catch(()=>({error:l.statusText}))).error??l.statusText);return l.json()}function ge(s){return G("/api/report/draft",s)}function Ne(s){return G("/api/report/file",s)}function xe(s){return G("/api/report/help",{question:s})}async function ke(s){const d=new FormData;d.append("screenshot",s,"report-screenshot.png");const l=await fetch("/api/report/attachment",{method:"POST",body:d});if(!l.ok)throw new Error((await l.json().catch(()=>({error:l.statusText}))).error??l.statusText);return l.json()}async function Me(){const s=await fetch("/api/report/discussion-categories");if(!s.ok)throw new Error((await s.json().catch(()=>({error:s.statusText}))).error??s.statusText);return s.json()}function $e(s){const d=new URLSearchParams(s.search),l=s.hash.match(/^#\/tasks\/([^/?#]+)/),r=l?.[1]?decodeURIComponent(l[1]):d.get("taskId")??void 0,u=d.get("agentId")??void 0;return r||u?{taskId:r,agentId:u}:void 0}const J=[{value:"light",label:"Light",icon:ye},{value:"dark",label:"Dark",icon:ve},{value:"system",label:"System",icon:re}],V=[{value:"default",label:"Fusion Legacy",className:"theme-swatch-default"},{value:"ocean",label:"Ocean",className:"theme-swatch-ocean"},{value:"forest",label:"Forest",className:"theme-swatch-forest"},{value:"sunset",label:"Sunset",className:"theme-swatch-sunset"},{value:"zen",label:"Zen",className:"theme-swatch-zen"},{value:"berry",label:"Berry",className:"theme-swatch-berry"},{value:"high-contrast",label:"High Contrast",className:"theme-swatch-high-contrast"},{value:"industrial",label:"Industrial",className:"theme-swatch-industrial"},{value:"monochrome",label:"Mono",className:"theme-swatch-monochrome"},{value:"slate",label:"Slate",className:"theme-swatch-slate"},{value:"ash",label:"Ash",className:"theme-swatch-ash"},{value:"air",label:"Air",className:"theme-swatch-air"},{value:"graphite",label:"Graphite",className:"theme-swatch-graphite"},{value:"silver",label:"Silver",className:"theme-swatch-silver"},{value:"solarized",label:"Solarized",className:"theme-swatch-solarized"},{value:"factory",label:"Factory",className:"theme-swatch-factory"},{value:"factory-mono",label:"Factory Mono",className:"theme-swatch-factory-mono"},{value:"ayu",label:"Ayu",className:"theme-swatch-ayu"},{value:"one-dark",label:"One Dark",className:"theme-swatch-one-dark"},{value:"nord",label:"Nord",className:"theme-swatch-nord"},{value:"dracula",label:"Dracula",className:"theme-swatch-dracula"},{value:"gruvbox",label:"Gruvbox",className:"theme-swatch-gruvbox"},{value:"tokyo-night",label:"Tokyo Night",className:"theme-swatch-tokyo-night"},{value:"catppuccin-mocha",label:"Catppuccin Mocha",className:"theme-swatch-catppuccin-mocha"},{value:"github-dark",label:"GitHub Dark",className:"theme-swatch-github-dark"},{value:"everforest",label:"Everforest",className:"theme-swatch-everforest"},{value:"rose-pine",label:"Rosé Pine",className:"theme-swatch-rose-pine"},{value:"kanagawa",label:"Kanagawa",className:"theme-swatch-kanagawa"},{value:"night-owl",label:"Night Owl",className:"theme-swatch-night-owl"},{value:"palenight",label:"Palenight",className:"theme-swatch-palenight"},{value:"monokai-pro",label:"Monokai Pro",className:"theme-swatch-monokai-pro"},{value:"slime",label:"Slime",className:"theme-swatch-slime"},{value:"brutalist",label:"Brutalist",className:"theme-swatch-brutalist"},{value:"neon-city",label:"Neon City",className:"theme-swatch-neon-city"},{value:"parchment",label:"Parchment",className:"theme-swatch-parchment"},{value:"medieval",label:"Medieval",className:"theme-swatch-medieval"},{value:"terminal",label:"Terminal",className:"theme-swatch-terminal"},{value:"glass",label:"Glass",className:"theme-swatch-glass"},{value:"glass-silver",label:"Glass Silver",className:"theme-swatch-glass-silver"},{value:"horizon",label:"Horizon",className:"theme-swatch-horizon"},{value:"vitesse",label:"Vitesse",className:"theme-swatch-vitesse"},{value:"outrun",label:"Outrun",className:"theme-swatch-outrun"},{value:"snazzy",label:"Snazzy",className:"theme-swatch-snazzy"},{value:"porple",label:"Porple",className:"theme-swatch-porple"},{value:"espresso",label:"Espresso",className:"theme-swatch-espresso"},{value:"mars",label:"Mars",className:"theme-swatch-mars"},{value:"poimandres",label:"Poimandres",className:"theme-swatch-poimandres"},{value:"ember",label:"Ember",className:"theme-swatch-ember"},{value:"rust",label:"Rust",className:"theme-swatch-rust"},{value:"copper",label:"Copper",className:"theme-swatch-copper"},{value:"foundry",label:"Foundry",className:"theme-swatch-foundry"},{value:"carbon",label:"Carbon",className:"theme-swatch-carbon"},{value:"sandstone",label:"Sandstone",className:"theme-swatch-sandstone"},{value:"lagoon",label:"Lagoon",className:"theme-swatch-lagoon"},{value:"frost",label:"Frost",className:"theme-swatch-frost"},{value:"lavender",label:"Lavender",className:"theme-swatch-lavender"},{value:"neon-bloom",label:"Neon Bloom",className:"theme-swatch-neon-bloom"},{value:"sepia",label:"Sepia",className:"theme-swatch-sepia"},{value:"cobalt",label:"Cobalt",className:"theme-swatch-cobalt"},{value:"clay",label:"Clay",className:"theme-swatch-clay"},{value:"moss",label:"Moss",className:"theme-swatch-moss"},{value:"aurora",label:"Aurora",className:"theme-swatch-aurora"},{value:"calm",label:"Calm",className:"theme-swatch-calm"},{value:"dawn",label:"Dawn",className:"theme-swatch-dawn"},{value:"sage",label:"Sage",className:"theme-swatch-sage"},{value:"midnight",label:"Midnight",className:"theme-swatch-midnight"},{value:"velvet",label:"Velvet",className:"theme-swatch-velvet"},{value:"factory-dark",label:"Factory Dark",className:"theme-swatch-factory-dark"},{value:"factory-light",label:"Factory Light",className:"theme-swatch-factory-light"},{value:"shadcn",label:"Shadcn",className:"theme-swatch-shadcn"},{value:"shadcn-ember",label:"Shadcn Ember (Default)",className:"theme-swatch-shadcn-ember"},{value:"shadcn-custom",label:"Shadcn Custom",className:"theme-swatch-shadcn-custom"},{value:"shadcn-blue",label:"Shadcn Blue",className:"theme-swatch-shadcn-blue"},{value:"shadcn-green",label:"Shadcn Green",className:"theme-swatch-shadcn-green"},{value:"shadcn-red",label:"Shadcn Red",className:"theme-swatch-shadcn-red"},{value:"shadcn-purple",label:"Shadcn Purple",className:"theme-swatch-shadcn-purple"},{value:"shadcn-pink",label:"Shadcn Pink",className:"theme-swatch-shadcn-pink"},{value:"shadcn-orange",label:"Shadcn Orange",className:"theme-swatch-shadcn-orange"},{value:"shadcn-yellow",label:"Shadcn Yellow",className:"theme-swatch-shadcn-yellow"},{value:"shadcn-mono",label:"Shadcn Mono",className:"theme-swatch-shadcn-mono"},{value:"shadcn-mono-red",label:"Shadcn Mono Red",className:"theme-swatch-shadcn-mono-red"},{value:"shadcn-mono-blue",label:"Shadcn Mono Blue",className:"theme-swatch-shadcn-mono-blue"},{value:"shadcn-mono-green",label:"Shadcn Mono Green",className:"theme-swatch-shadcn-mono-green"},{value:"shadcn-mono-purple",label:"Shadcn Mono Purple",className:"theme-swatch-shadcn-mono-purple"},{value:"shadcn-mono-pink",label:"Shadcn Mono Pink",className:"theme-swatch-shadcn-mono-pink"},{value:"shadcn-mono-orange",label:"Shadcn Mono Orange",className:"theme-swatch-shadcn-mono-orange"},{value:"shadcn-mono-yellow",label:"Shadcn Mono Yellow",className:"theme-swatch-shadcn-mono-yellow"},{value:"shadcn-black",label:"Shadcn Black",className:"theme-swatch-shadcn-black"},{value:"shadcn-gray",label:"Shadcn Gray",className:"theme-swatch-shadcn-gray"},{value:"shadcn-gray-blue",label:"Shadcn Gray Blue",className:"theme-swatch-shadcn-gray-blue"}];function je(s){const d=s.trim();if(/^#[\da-f]{6}$/i.test(d))return d;if(/^#[\da-f]{3}$/i.test(d)){const[,l,r,u]=d;return`#${l}${l}${r}${r}${u}${u}`}return"#000000"}function Ce({value:s={},onChange:d,resolvedThemeMode:l="dark"}){const{t:r}=_("app"),[u,j]=n.useState(!1),t=n.useId(),w=n.useMemo(()=>Q(s),[s]),h=(o,v)=>{d(Q({...w,[o]:v}))},m=u?r("theme.shadcnCustom.collapse","Collapse custom colors"):r("theme.shadcnCustom.show","Show custom colors"),i=u?le:X;return e.jsxs("section",{className:"shadcn-color-picker card","data-testid":"shadcn-color-picker","aria-labelledby":"shadcn-color-picker-title",children:[e.jsxs("div",{className:"shadcn-color-picker-header",children:[e.jsxs("div",{className:"shadcn-color-picker-heading",children:[e.jsx("h3",{id:"shadcn-color-picker-title",className:"shadcn-color-picker-title",children:r("theme.shadcnCustom.title","Custom shadcn colors")}),e.jsx("p",{className:"shadcn-color-picker-description",children:r("theme.shadcnCustom.description","Override shadcn design tokens with hex colors. Blank tokens use the theme defaults.")})]}),e.jsx("button",{type:"button",className:"btn btn-icon btn-sm shadcn-color-picker-toggle","aria-expanded":u,"aria-controls":t,"aria-label":m,title:m,onClick:()=>j(o=>!o),children:e.jsx(i,{size:16,"aria-hidden":"true"})})]}),u?e.jsxs("div",{id:t,className:"shadcn-color-picker-controls-panel","data-testid":"shadcn-color-picker-controls",children:[e.jsx("div",{className:"shadcn-color-picker-actions",children:e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>d({}),children:r("theme.shadcnCustom.reset","Reset custom colors")})}),e.jsx("div",{className:"shadcn-color-picker-grid",children:oe.map(o=>{const v=ne(o,l),g=w[o.cssVar]??v,y=`shadcn-color-${o.cssVar.replace(/^--/,"").replace(/[^a-z0-9]+/gi,"-")}`;return e.jsxs("div",{className:"shadcn-color-picker-row","data-testid":`shadcn-color-${o.cssVar}`,children:[e.jsxs("label",{className:"shadcn-color-picker-label",htmlFor:y,children:[e.jsx("span",{children:r(`theme.shadcnCustom.token.${o.cssVar}`,o.label)}),e.jsx("code",{children:o.cssVar})]}),e.jsxs("div",{className:"shadcn-color-picker-controls",children:[e.jsx("input",{"aria-label":r("theme.shadcnCustom.colorInput","Pick {{label}} color",{label:o.label}),className:"shadcn-color-picker-native",type:"color",value:je(g),onChange:k=>h(o.cssVar,k.currentTarget.value)}),e.jsx("input",{id:y,"aria-label":r("theme.shadcnCustom.hexInput","{{label}} hex color",{label:o.label}),className:"input shadcn-color-picker-hex",type:"text",inputMode:"text",spellCheck:!1,value:g,onChange:k=>h(o.cssVar,k.currentTarget.value)})]})]},o.cssVar)})})]}):null]})}function Se(s){return V.find(d=>d.value===s)??V[0]}function Z(s){return s.trim().normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase()}function O({className:s}){return e.jsxs("span",{className:`theme-option-swatch ${s}`,"aria-hidden":"true",children:[e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-1"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-2"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-3"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-4"})]})}function Le({colorTheme:s,onColorThemeChange:d,themeMode:l,shadcnCustomColors:r={},resolvedThemeMode:u=l==="light"?"light":"dark",onThemeModeChange:j,onShadcnCustomColorsChange:t=()=>{},triggerVariant:w="compact"}){const{t:h}=_("app"),[m,i]=n.useState(!1),[o,v]=n.useState(""),[g,y]=n.useState(s),[k,S]=n.useState(null),I=n.useRef(null),D=n.useRef(null),E=n.useRef(!1),N=n.useRef([]),M=n.useMemo(()=>Se(s),[s]),z=l==="system"?u:l,$=J.find(a=>a.value===z)?.icon,c=l==="system"?h("theme.system","System"):h(`theme.${l}`,l?`${l.charAt(0).toUpperCase()}${l.slice(1)}`:"Dark"),b=h(`theme.colorTheme.${M.value}`,M.label),R=`${h("theme.currentTheme","Current theme")} ${c} / ${b}`,H="theme-dropdown-listbox",B=n.useMemo(()=>V.map(a=>({...a,displayLabel:h(`theme.colorTheme.${a.value}`,a.label)})),[h]),U=Z(o),p=n.useMemo(()=>B.filter(a=>Z(a.displayLabel).includes(U)),[U,B]),W=p.findIndex(a=>a.value===g),L=()=>{i(!1),v(""),y(s),S(null),E.current=!1,N.current=[]};n.useEffect(()=>{if(!m)return;const a=f=>{I.current&&!I.current.contains(f.target)&&L()};return document.addEventListener("pointerdown",a),()=>document.removeEventListener("pointerdown",a)},[m,s]),n.useEffect(()=>{m&&(p.some(a=>a.value===g)||y(p[0]?.value??null))},[g,p,m]),n.useEffect(()=>{if(m){if(k==="pointer"&&E.current)D.current?.focus(),E.current=!1;else if(k==="keyboard"){const a=p.findIndex(f=>f.value===g);N.current[a]?.focus()}}},[g,p,m,k]);const q=a=>{d(a),L()},K=(a,f)=>{if(a==="pointer")E.current=!0,y(s);else{const F=p.some(C=>C.value===s),x=f==="ArrowUp"?p.at(-1)?.value??null:f==="ArrowDown"?p[0]?.value??null:F?s:p[0]?.value??null;y(x)}S(a),i(!0)},ee=a=>{(a.key==="ArrowDown"||a.key==="ArrowUp"||a.key==="Enter"||a.key===" ")&&(a.preventDefault(),K("keyboard",a.key))},ae=a=>{if(a.key==="Escape"){a.preventDefault(),L();return}if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;const f=a.key==="ArrowUp"?p.length-1:Math.max(0,W);f<0||!p[f]||(a.preventDefault(),y(p[f].value),N.current[f]?.focus())},te=(a,f,F)=>{if(a.key==="Escape"){a.preventDefault(),L();return}if(a.key==="ArrowDown"||a.key==="ArrowUp"){a.preventDefault();const x=a.key==="ArrowDown"?1:-1,C=(f+x+p.length)%p.length;y(p[C]?.value??null),N.current[C]?.focus();return}if(a.key==="Home"){a.preventDefault(),y(p[0]?.value??null),N.current[0]?.focus();return}if(a.key==="End"){a.preventDefault();const x=p.length-1;y(p[x]?.value??null),N.current[x]?.focus();return}(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),q(F))};return e.jsxs("div",{className:`theme-dropdown${w==="current-row"?" theme-dropdown--current-row":""}${m?" open":""}`,ref:I,children:[e.jsxs("button",{type:"button",className:`theme-dropdown-trigger btn${w==="current-row"?" theme-dropdown-trigger--current-row":""}`,"aria-label":w==="current-row"?R:void 0,"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?H:void 0,onClick:()=>m?L():K("pointer"),onKeyDown:ee,children:[w==="current-row"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"theme-dropdown-current-row-icon","aria-hidden":"true",children:$?e.jsx($,{size:20}):null}),e.jsxs("span",{className:"theme-dropdown-current-row-info",children:[e.jsx("span",{className:"theme-dropdown-current-row-label",children:h("theme.currentTheme","Current theme")}),e.jsxs("span",{className:"theme-dropdown-current-row-value",children:[c," / ",b]})]}),e.jsx(O,{className:M.className})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{className:M.className}),e.jsx("span",{className:"theme-dropdown-trigger-label",children:b})]}),e.jsx(X,{size:16,"aria-hidden":"true"})]}),l&&j?e.jsx("div",{className:"theme-dropdown-modes",role:"radiogroup","aria-label":h("theme.modeLabel","Theme mode"),children:J.map(({value:a,label:f,icon:F})=>e.jsxs("button",{type:"button",className:`theme-dropdown-mode-btn btn btn-sm${l===a?" active":""}`,"aria-pressed":l===a,onClick:()=>j(a),title:h(`theme.${a}Mode`,`${f} mode`),children:[e.jsx(F,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:h(`theme.${a}`,f)})]},a))}):null,s==="shadcn-custom"?e.jsx(Ce,{value:r,onChange:t,resolvedThemeMode:u}):null,m?e.jsxs("div",{className:"theme-dropdown-popover",role:"presentation",children:[e.jsxs("label",{className:"theme-dropdown-filter",children:[e.jsx("span",{className:"sr-only",children:h("theme.filterColorThemes","Filter color themes")}),e.jsx("input",{ref:D,type:"search",className:"input",value:o,placeholder:h("theme.filterColorThemesPlaceholder","Filter color themes"),"aria-label":h("theme.filterColorThemes","Filter color themes"),onChange:a=>v(a.target.value),onKeyDown:ae})]}),p.length?e.jsx("div",{id:H,className:"theme-dropdown-list",role:"listbox","aria-label":h("theme.colorThemeLabel","Color theme"),children:p.map(({value:a,displayLabel:f,className:F},x)=>{const C=s===a;return e.jsxs("button",{ref:P=>{N.current[x]=P},type:"button",className:`theme-dropdown-option${C?" active":""}`,role:"option","aria-selected":C,tabIndex:x===W?0:-1,onClick:()=>q(a),onKeyDown:P=>te(P,x,a),children:[e.jsx(O,{className:F}),e.jsx("span",{className:"theme-dropdown-option-label",children:f}),C?e.jsx(ce,{size:16,"aria-hidden":"true"}):null]},a)})}):e.jsx("p",{className:"theme-dropdown-no-results",children:h("theme.noColorThemes","No color themes found")})]}):null]})}const De=[{type:"bug",label:"Report bug",Icon:me},{type:"feedback",label:"Send feedback",Icon:ie},{type:"idea",label:"Share idea",Icon:he},{type:"help",label:"Get help",Icon:be}];function Te({onSelect:s}){const{t:d}=_("app"),[l,r]=n.useState(!1),[u,j]=n.useState(),t=n.useRef(null),w=n.useRef(null),h=n.useCallback(()=>{const i=t.current?.getBoundingClientRect();i&&j({top:i.bottom,left:i.left,right:window.innerWidth-i.right})},[]);n.useEffect(()=>{if(!l)return;h();const i=()=>h();return window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[l,h]),n.useEffect(()=>{if(!l)return;const i=v=>{const g=v.target;t.current?.contains(g)||w.current?.contains(g)||r(!1)},o=v=>{v.key==="Escape"&&(r(!1),t.current?.focus())};return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[l]);const m=l&&u&&typeof document<"u"?se.createPortal(e.jsx("div",{ref:w,className:"report-action-menu__list report-action-menu__list--portal",role:"menu",style:{top:u.top,left:u.left,right:u.right},children:De.map(({type:i,label:o,Icon:v})=>e.jsxs("button",{className:"report-action-menu__item",type:"button",role:"menuitem",onClick:()=>{r(!1),s(i)},children:[e.jsx(v,{"aria-hidden":"true"}),d(`report.actions.${i}`,o)]},i))}),document.body):null;return e.jsxs("div",{className:"report-action-menu",children:[e.jsx("button",{ref:t,className:"btn btn-secondary",type:"button","aria-haspopup":"menu","aria-expanded":l,onClick:()=>r(i=>!i),children:d("report.menu","Report")}),m]})}const Ee={bug:"What went wrong?",feedback:"What would you like to share?",idea:"What would you like Fusion to do?",help:"What would you like help with?"};function _e({actionType:s,onClose:d,contextRefs:l}){const{t:r}=_("app"),[u,j]=n.useState(""),[t,w]=n.useState(),[h,m]=n.useState(!1),[i,o]=n.useState(),[v,g]=n.useState(!1),[y,k]=n.useState(),[S,I]=n.useState(),[D,E]=n.useState(!1),N=n.useRef(0),M=async c=>{m(!0),o(void 0);try{const b=await de();if(!b)throw new Error("Screen capture was unavailable or denied.");const{artifactId:R}=await ke(b);if(N.current!==c)return;I(R)}catch(b){if(N.current!==c)return;g(!1),o(b instanceof Error?b.message:"We could not capture the current screen.")}finally{N.current===c&&m(!1)}},z=async()=>{if(u.trim()){if(v&&(!S||!D)){o("Capture and confirm local screenshot retention before continuing, or turn attachment off.");return}m(!0),o(void 0);try{if(Y("report"),s==="help"){const c=await xe(u);if(c.answered){w({kind:"help",answer:c.answer});return}}w(await ge({actionType:s,targetType:y,userPrompt:u,contextRefs:l,activityTrace:A(),screenshotArtifactId:v&&D?S:void 0}))}catch{o("We could not prepare your report. Check your connection and try again.")}finally{m(!1)}}},$=async(c,b,R)=>{if(t?.report){m(!0),o(void 0);try{Y("report"),w(await Ne({actionType:s,targetType:y,report:t.report,endorseIssueNumber:c,endorseDiscussionId:b,endorseRoadmapIssueNumber:R,activityTrace:A(),screenshotArtifactId:v&&D?S:void 0}))}catch{o("We could not send your report. Your draft is still here; try again.")}finally{m(!1)}}};return e.jsx("div",{className:"report-modal-backdrop",role:"presentation",children:e.jsxs("section",{className:"card report-modal",role:"dialog","aria-modal":"true","aria-label":`${s} report`,children:[e.jsx("button",{className:"btn-icon report-modal__close",type:"button","aria-label":r("report.close","Close report"),onClick:d,children:"×"}),i&&e.jsx("p",{className:"report-modal__error",role:"alert",children:i}),!t&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:s[0].toUpperCase()+s.slice(1)}),e.jsx("label",{htmlFor:"report-prompt",children:Ee[s]}),e.jsx("textarea",{id:"report-prompt",className:"input",value:u,onChange:c=>j(c.target.value),maxLength:4e3}),e.jsxs("label",{className:"report-modal__screenshot-option",children:[e.jsx("input",{type:"checkbox",checked:v,onChange:c=>{const b=c.target.checked,R=++N.current;g(b),I(void 0),E(!1),b?M(R):m(!1)}})," ",r("report.storeScreenshot","Store a screenshot locally")]}),v&&e.jsx("div",{className:"report-modal__screenshot-preview",children:S?e.jsxs("label",{className:"report-modal__screenshot-option",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:c=>E(c.target.checked)})," ",r("report.confirmScreenshotRetention","I confirm Fusion may retain this screenshot locally for this report.")]}):e.jsx("p",{children:r("report.capturingScreenshot","Capturing and storing locally…")})}),e.jsx("label",{htmlFor:"report-target",children:r("report.targetLabel","Filing target")}),e.jsxs("select",{id:"report-target",className:"input",value:y??"",onChange:c=>k(c.target.value||void 0),children:[e.jsx("option",{value:"",children:r("report.targetInherit","Use configured action target")}),e.jsx("option",{value:"issue",children:r("report.targetIssue","GitHub Issue")}),e.jsx("option",{value:"discussion",children:r("report.targetDiscussion","GitHub Discussion")})]}),e.jsxs("details",{className:"report-modal__activity-trace",children:[e.jsx("summary",{children:r("report.activityTrace","Activity trace to send")}),e.jsx("ul",{children:A().map((c,b)=>e.jsx("li",{children:c},`${c}-${b}`))})]}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:!u.trim()||h,onClick:()=>void z(),children:i?"Retry":"Continue"})]}),t?.kind==="draft-ready"&&t.report&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:r("report.review","Review your report")}),e.jsx("label",{htmlFor:"report-review-prompt",children:r("report.summary","Report summary")}),e.jsx("textarea",{id:"report-review-prompt",className:"input",value:t.report.userPrompt,onChange:c=>{const b=c.target.value;w({...t,report:{...t.report,userPrompt:b}})}}),e.jsx("label",{htmlFor:"report-review-body",children:r("report.structured","Structured report")}),e.jsx("textarea",{id:"report-review-body",className:"input",value:t.report.body??"",onChange:c=>w({...t,report:{...t.report,body:c.target.value}})}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:h,onClick:()=>void $(),children:r("report.file","File report")})]}),t?.kind==="duplicate-found"&&t.issue&&t.report&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:t.issue.roadmap?r("report.roadmapDuplicate.title","Already on the roadmap — add your data point?"):r("report.duplicateReview","Review data point for a similar open issue")}),e.jsx("a",{href:t.issue.url,target:"_blank",rel:"noreferrer",children:t.issue.title}),e.jsx("label",{htmlFor:"report-duplicate-prompt",children:r("report.summary","Report summary")}),e.jsx("textarea",{id:"report-duplicate-prompt",className:"input",value:t.report.userPrompt,onChange:c=>{const b=c.target.value;w({...t,report:{...t.report,userPrompt:b}})}}),e.jsx("label",{htmlFor:"report-duplicate-body",children:r("report.structuredDataPoint","Structured data point")}),e.jsx("textarea",{id:"report-duplicate-body",className:"input",value:t.report.body??"",onChange:c=>w({...t,report:{...t.report,body:c.target.value}})}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:h,onClick:()=>void $(t.issue.discussionId||t.issue.roadmap?void 0:t.issue.number,t.issue.discussionId,t.issue.roadmap?t.issue.number:void 0),children:r("report.confirmDataPoint","Confirm and add data point")})]}),(t?.kind==="filed"||t?.kind==="endorsed")&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:t.kind==="filed"&&t.destination==="issue"?"Report filed as an Issue":"Report sent"}),e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",children:r("report.viewGitHub","View on GitHub")}),t.report?.body&&e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"filed-report",children:r("report.final","Final report")}),e.jsx("textarea",{id:"filed-report",className:"input",value:t.report.body,readOnly:!0})]})]}),t?.kind==="help"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:r("report.suggestedHelp","Suggested help")}),e.jsx("p",{children:t.answer?.summary??t.answer?.content})]}),t?.kind==="unavailable"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"alert",children:t.message}),e.jsx("button",{className:"btn btn-secondary",type:"button",onClick:()=>{w(void 0),o(void 0)},children:r("report.returnToPrompt","Return to prompt")})]})]})})}export{me as B,Te as R,J as T,Le as a,_e as b,Me as l,$e as r};