@xopcai/xopc 0.0.172 → 0.0.174

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 (223) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-C3Y-bESI.js → activity-store-CyEDJeIt.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CPyev9P7.js → agent-avatar-dicebear-DF7Bol6I.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +2 -0
  6. package/dist/gateway/static/root/assets/{api-B7qEr_Rw.js → api-DYunqroX.js} +1 -1
  7. package/dist/gateway/static/root/assets/api-DwyUxpgY.js +1 -0
  8. package/dist/gateway/static/root/assets/{app-management-settings-panel-Br_9-7fs.js → app-management-settings-panel-B4xJyvDu.js} +1 -1
  9. package/dist/gateway/static/root/assets/{appearance-settings-uyLcRPai.js → appearance-settings-B2PQxRiu.js} +1 -1
  10. package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +1 -0
  11. package/dist/gateway/static/root/assets/{archive-plugin-B19REnR5.js → archive-plugin-DWhBmmjD.js} +1 -1
  12. package/dist/gateway/static/root/assets/{attachment-load-DLWCC4Yi.js → attachment-load-BOpZfa_I.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automation-suggestion-card-ky5S5lly.js → automation-suggestion-card-Byu3I7Rs.js} +1 -1
  14. package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +6 -0
  15. package/dist/gateway/static/root/assets/{binary-plugins-CtPEzLlo.js → binary-plugins-6AG1qatz.js} +1 -1
  16. package/dist/gateway/static/root/assets/{block-editor-CQVR4Xij.js → block-editor-CJhrn98_.js} +5 -5
  17. package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +8 -0
  18. package/dist/gateway/static/root/assets/{browser-workflow-inputs-CimCGbhq.js → browser-workflow-inputs-CBVb4mt9.js} +1 -1
  19. package/dist/gateway/static/root/assets/{browser-workflows-page-DewuCw3p.js → browser-workflows-page-Cq4XUKbu.js} +2 -2
  20. package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +7 -0
  21. package/dist/gateway/static/root/assets/{capability-presets-api-B5RTs-Az.js → capability-presets-api-hbW4NAKO.js} +1 -1
  22. package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +1 -0
  23. package/dist/gateway/static/root/assets/{channel-recipient-api-Czu0YzIZ.js → channel-recipient-api-CzMjHb17.js} +1 -1
  24. package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +1 -0
  25. package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +1 -0
  26. package/dist/gateway/static/root/assets/{connector-logo-Di3gnR_D.js → connector-logo-B9Au6gMZ.js} +1 -1
  27. package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +2 -0
  28. package/dist/gateway/static/root/assets/copy-VueTIC2x.js +1 -0
  29. package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +1 -0
  30. package/dist/gateway/static/root/assets/{desktop-pet-settings-C3L6AI8_.js → desktop-pet-settings-CNff5TFb.js} +1 -1
  31. package/dist/gateway/static/root/assets/{directory-picker-path-field-Dvq4iG6P.js → directory-picker-path-field-Bf956uo-.js} +1 -1
  32. package/dist/gateway/static/root/assets/dreaming-settings-CHM8FE1g.js +3 -0
  33. package/dist/gateway/static/root/assets/{extension-debug-page-BecQjU0J.js → extension-debug-page-ZqM_0eUs.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-BeVkPSm-.js → extension-page-D4hvXOMM.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-settings-page-DMoo2mKx.js → extension-settings-page-GsqxaJjA.js} +1 -1
  36. package/dist/gateway/static/root/assets/focus-detail-page-CE6uwrl1.js +1 -0
  37. package/dist/gateway/static/root/assets/{gateway-config-api-Bthb3_6v.js → gateway-config-api-B4THmgnS.js} +1 -1
  38. package/dist/gateway/static/root/assets/{gateway-settings-Bh8nPvJQ.js → gateway-settings-CPv-MxGE.js} +1 -1
  39. package/dist/gateway/static/root/assets/{gateway-startup-retry-D3USVm9D.js → gateway-startup-retry-MP3K71pP.js} +1 -1
  40. package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +1 -0
  41. package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +4 -0
  42. package/dist/gateway/static/root/assets/{goals-config-api-C_2QWBtb.js → goals-config-api-DCcDuIjG.js} +1 -1
  43. package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +2 -0
  44. package/dist/gateway/static/root/assets/{goals-settings-DhL643tc.js → goals-settings-o9QMXvNq.js} +1 -1
  45. package/dist/gateway/static/root/assets/{heartbeat-settings-COVFwp7C.js → heartbeat-settings-DixwpXnH.js} +1 -1
  46. package/dist/gateway/static/root/assets/{image-generation-api-BNQlnwpU.js → image-generation-api-BOGH9FGi.js} +1 -1
  47. package/dist/gateway/static/root/assets/index-CfXiRNN5.css +1 -0
  48. package/dist/gateway/static/root/assets/index-eyttVNS_.js +212 -0
  49. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DfdJRJVy.js → keyboard-shortcuts-settings-D4o4ZPF6.js} +1 -1
  50. package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +2 -0
  51. package/dist/gateway/static/root/assets/{local-apps-page-BvCPOgoi.js → local-apps-page-GzMmpO7G.js} +1 -1
  52. package/dist/gateway/static/root/assets/{locale-store-BP0vD37A.js → locale-store-CAuhEGCn.js} +1 -1
  53. package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +7 -0
  54. package/dist/gateway/static/root/assets/{markdown-split-YO1rDk9m.js → markdown-split-CIX8D1pv.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-CU_RRf-q.js → media-plugins-Bp3eIA45.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-BiBdO1-O.js +3 -0
  57. package/dist/gateway/static/root/assets/{notes-page-CeFiOK3S.js → notes-page-RVFiYAoO.js} +1 -1
  58. package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +4 -0
  59. package/dist/gateway/static/root/assets/{page-tabs-tiHmRJUA.js → page-tabs-BGAYH3Ef.js} +1 -1
  60. package/dist/gateway/static/root/assets/{preview-open-alternatives-CU6XgaCz.js → preview-open-alternatives-BM6pDkHp.js} +1 -1
  61. package/dist/gateway/static/root/assets/{product-open-page-Dn4_qor4.js → product-open-page-BiMetEmn.js} +1 -1
  62. package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +1 -0
  63. package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +1 -0
  64. package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +1 -0
  65. package/dist/gateway/static/root/assets/{save-bar-controls-edDUIbXo.js → save-bar-controls-BdjV8MK5.js} +1 -1
  66. package/dist/gateway/static/root/assets/{schedule-field-DqJO_5Yb.js → schedule-field-ChlqXU46.js} +1 -1
  67. package/dist/gateway/static/root/assets/{schema-form-CMh0jzy5.js → schema-form-DDKf5ZSH.js} +1 -1
  68. package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +1 -0
  69. package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +1 -0
  70. package/dist/gateway/static/root/assets/{settings-form-section-Bb0Bc3nJ.js → settings-form-section-CPG0KGVs.js} +1 -1
  71. package/dist/gateway/static/root/assets/{settings-loading-skeleton-DQhADvz1.js → settings-loading-skeleton-DRSDHucM.js} +1 -1
  72. package/dist/gateway/static/root/assets/{settings-page-b0M5HukN.js → settings-page-CeB7_xD0.js} +1 -1
  73. package/dist/gateway/static/root/assets/{settings-page-layout-hvjtIjvh.js → settings-page-layout-BENrkwd0.js} +1 -1
  74. package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +1 -0
  75. package/dist/gateway/static/root/assets/{share-preview-page-rbeaOpTg.js → share-preview-page-DIzczJkG.js} +1 -1
  76. package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +1 -0
  77. package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +1 -0
  78. package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +2 -0
  79. package/dist/gateway/static/root/assets/{system-settings-panel-BHo_hgnL.js → system-settings-panel-Dp4d5Q1B.js} +1 -1
  80. package/dist/gateway/static/root/assets/{theme-store-C3KnnjcU.js → theme-store-CbGc1laW.js} +1 -1
  81. package/dist/gateway/static/root/assets/{time-picker-D-G-uwVJ.js → time-picker-BhgCeDuO.js} +1 -1
  82. package/dist/gateway/static/root/assets/{typed-models-lib-DtRnG-YI.js → typed-models-lib-DwPk3OPL.js} +1 -1
  83. package/dist/gateway/static/root/assets/{use-channel-catalog-CWWItX2g.js → use-channel-catalog-CXrEu2dw.js} +1 -1
  84. package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +1 -0
  85. package/dist/gateway/static/root/assets/{voice-api-key-field-BTnltQHZ.js → voice-api-key-field-DFoA79LB.js} +1 -1
  86. package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +1 -0
  87. package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +1 -0
  88. package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +1 -0
  89. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D7vKChFZ.js → workflow-run-setup-panel-BuniGPO0.js} +2 -2
  90. package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +11 -0
  91. package/dist/gateway/static/root/index.html +7 -7
  92. package/dist/package.js +1 -1
  93. package/dist/src/agent/agent-manager.d.ts +3 -1
  94. package/dist/src/agent/agent-manager.js +4 -3
  95. package/dist/src/agent/capabilities/definitions.d.ts +2 -1
  96. package/dist/src/agent/capabilities/definitions.js +3 -1
  97. package/dist/src/agent/prompt/sections/tooling.js +4 -0
  98. package/dist/src/agent/service.d.ts +2 -1
  99. package/dist/src/agent/service.js +26 -0
  100. package/dist/src/agent/skills/hub-pull.js +1 -1
  101. package/dist/src/agent/skills/index.js +1 -1
  102. package/dist/src/agent/skills/install-target.js +1 -1
  103. package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.d.ts +64 -0
  104. package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +27 -18
  105. package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
  106. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
  107. package/dist/src/agent/skills/marketplace/search.d.ts +46 -0
  108. package/dist/src/agent/skills/marketplace/search.js +193 -0
  109. package/dist/src/agent/skills/skill-tool-gating.js +2 -1
  110. package/dist/src/agent/tools/delegate-tool.js +2 -0
  111. package/dist/src/agent/tools/factory.d.ts +4 -2
  112. package/dist/src/agent/tools/factory.js +11 -5
  113. package/dist/src/agent/tools/index.d.ts +2 -1
  114. package/dist/src/agent/tools/index.js +2 -1
  115. package/dist/src/agent/tools/skill-install-tool.d.ts +17 -0
  116. package/dist/src/agent/tools/skill-install-tool.js +76 -8
  117. package/dist/src/agent/tools/skills-marketplace-search-tool.d.ts +17 -0
  118. package/dist/src/agent/tools/skills-marketplace-search-tool.js +77 -0
  119. package/dist/src/browser/providers/cloakbrowser.js +1 -1
  120. package/dist/src/capabilities/store-connector.js +1 -1
  121. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  122. package/dist/src/config/agent-profile.js +1 -1
  123. package/dist/src/extensions/api.js +1 -1
  124. package/dist/src/extensions/install.js +1 -1
  125. package/dist/src/focuses/candidate-repository.d.ts +15 -0
  126. package/dist/src/focuses/candidate-repository.js +91 -0
  127. package/dist/src/focuses/index.d.ts +7 -0
  128. package/dist/src/focuses/index.js +7 -0
  129. package/dist/src/focuses/insight-repository.d.ts +22 -0
  130. package/dist/src/focuses/insight-repository.js +77 -0
  131. package/dist/src/focuses/prompts.d.ts +2 -0
  132. package/dist/src/focuses/prompts.js +18 -0
  133. package/dist/src/focuses/reconciler.d.ts +5 -0
  134. package/dist/src/focuses/reconciler.js +26 -0
  135. package/dist/src/focuses/repository.d.ts +61 -0
  136. package/dist/src/focuses/repository.js +214 -0
  137. package/dist/src/focuses/run-processor.d.ts +18 -0
  138. package/dist/src/focuses/run-processor.js +162 -0
  139. package/dist/src/focuses/service.d.ts +42 -0
  140. package/dist/src/focuses/service.js +241 -0
  141. package/dist/src/focuses/types.d.ts +89 -0
  142. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  143. package/dist/src/gateway/agent-builtin-tools.js +2 -0
  144. package/dist/src/gateway/agents-admin.js +1 -1
  145. package/dist/src/gateway/hono/routes/commands-skills.js +2 -2
  146. package/dist/src/gateway/hono/routes/focuses.d.ts +3 -0
  147. package/dist/src/gateway/hono/routes/focuses.js +319 -0
  148. package/dist/src/gateway/hono/routes/home.js +15 -17
  149. package/dist/src/gateway/hono/routes/index.js +2 -0
  150. package/dist/src/gateway/hono/routes/projects.js +2 -103
  151. package/dist/src/gateway/hono/routes/work-discovery.js +0 -239
  152. package/dist/src/gateway/service/marketplace-service.js +1 -1
  153. package/dist/src/gateway/service.d.ts +1 -1
  154. package/dist/src/gateway/service.js +15 -11
  155. package/dist/src/storage/sqlite/migrations/066_first_class_focuses.sql +126 -0
  156. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  157. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  158. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  159. package/dist/src/storage/sqlite/schema.js +1 -1
  160. package/dist/src/work-discovery/index.d.ts +0 -2
  161. package/dist/src/work-discovery/index.js +1 -3
  162. package/dist/src/work-discovery/service.d.ts +0 -30
  163. package/dist/src/work-discovery/service.js +1 -35
  164. package/dist/src/work-discovery/thread-service.d.ts +5 -0
  165. package/dist/src/work-discovery/thread-service.js +36 -88
  166. package/package.json +1 -1
  167. package/skills/tools/find-skills/SKILL.md +18 -428
  168. package/dist/gateway/static/root/assets/agents-Bf_kK2Ay.js +0 -2
  169. package/dist/gateway/static/root/assets/apps-page-DXFCP5-1.js +0 -1
  170. package/dist/gateway/static/root/assets/automations-page-D8pT1o2O.js +0 -6
  171. package/dist/gateway/static/root/assets/browser-settings-page-Bav_skKN.js +0 -8
  172. package/dist/gateway/static/root/assets/capabilities-settings-panel-BHaYYo9E.js +0 -7
  173. package/dist/gateway/static/root/assets/capability-presets-settings-panel-BgchTh81.js +0 -1
  174. package/dist/gateway/static/root/assets/channels-settings-BP0e62wt.js +0 -1
  175. package/dist/gateway/static/root/assets/channels-status-swr-DBWKfeGe.js +0 -1
  176. package/dist/gateway/static/root/assets/connectors-page-CC5kh0de.js +0 -2
  177. package/dist/gateway/static/root/assets/desktop-pet-D-ZUNHhn.js +0 -1
  178. package/dist/gateway/static/root/assets/dreaming-settings-D9i54kWO.js +0 -3
  179. package/dist/gateway/static/root/assets/goal-create-dialog-Dp0AyDHI.js +0 -1
  180. package/dist/gateway/static/root/assets/goal-detail-page-CNt7nrdS.js +0 -4
  181. package/dist/gateway/static/root/assets/goals-page-Bm_NZFiZ.js +0 -2
  182. package/dist/gateway/static/root/assets/index-C_XSKOH6.css +0 -1
  183. package/dist/gateway/static/root/assets/index-DUasAutC.js +0 -212
  184. package/dist/gateway/static/root/assets/local-app-workbench-page-DZwkD1co.js +0 -2
  185. package/dist/gateway/static/root/assets/logs-page-dNL0Y1dA.js +0 -7
  186. package/dist/gateway/static/root/assets/messages-BWtP5TFz.js +0 -3
  187. package/dist/gateway/static/root/assets/notes-workbench-B8MKxpZb.js +0 -4
  188. package/dist/gateway/static/root/assets/project-detail-page-CWBuuX-S.js +0 -1
  189. package/dist/gateway/static/root/assets/projects-page-BJSsLsXH.js +0 -1
  190. package/dist/gateway/static/root/assets/remote-access-hub-DXJDb8vB.js +0 -1
  191. package/dist/gateway/static/root/assets/sessions-page-DeHpWgxM.js +0 -1
  192. package/dist/gateway/static/root/assets/settings-advanced-gate-Cf-TEYUd.js +0 -1
  193. package/dist/gateway/static/root/assets/setup-status-panel-BFyfed_g.js +0 -1
  194. package/dist/gateway/static/root/assets/shares-settings-CYnH9sTt.js +0 -1
  195. package/dist/gateway/static/root/assets/skill-reload-api-Cr8_m-jS.js +0 -1
  196. package/dist/gateway/static/root/assets/skills-page-Chtc1xDO.js +0 -2
  197. package/dist/gateway/static/root/assets/user-context-page-D7qMR26X.js +0 -1
  198. package/dist/gateway/static/root/assets/work-discovery-page-CpqFZze9.js +0 -1
  199. package/dist/gateway/static/root/assets/work-item-detail-page-t4dXpGC0.js +0 -1
  200. package/dist/gateway/static/root/assets/work-page-BXwDKiMZ.js +0 -1
  201. package/dist/gateway/static/root/assets/workflows-page-Bos9HyqT.js +0 -11
  202. package/dist/src/proactive/calendar-signals.d.ts +0 -4
  203. package/dist/src/proactive/calendar-signals.js +0 -120
  204. package/dist/src/proactive/focus-service.d.ts +0 -62
  205. package/dist/src/proactive/focus-service.js +0 -173
  206. package/dist/src/proactive/index.d.ts +0 -7
  207. package/dist/src/proactive/index.js +0 -7
  208. package/dist/src/proactive/insight-repository.d.ts +0 -21
  209. package/dist/src/proactive/insight-repository.js +0 -109
  210. package/dist/src/proactive/run-processor.d.ts +0 -19
  211. package/dist/src/proactive/run-processor.js +0 -146
  212. package/dist/src/proactive/trial-expiry-reconciler.d.ts +0 -5
  213. package/dist/src/proactive/trial-expiry-reconciler.js +0 -30
  214. package/dist/src/proactive/types.d.ts +0 -66
  215. package/dist/src/proactive/value-score.d.ts +0 -13
  216. package/dist/src/proactive/value-score.js +0 -30
  217. package/dist/src/proactive/watch-repository.d.ts +0 -28
  218. package/dist/src/proactive/watch-repository.js +0 -129
  219. package/dist/src/work-discovery/governance.d.ts +0 -25
  220. package/dist/src/work-discovery/governance.js +0 -96
  221. package/dist/src/work-discovery/thread-repository.d.ts +0 -34
  222. package/dist/src/work-discovery/thread-repository.js +0 -112
  223. /package/dist/src/{proactive → focuses}/types.js +0 -0
@@ -1,4 +1,9 @@
1
1
  import type { WorkContextSnapshot, WorkDiscoveryResult, WorkUnderstandingEvidenceItem, WorkUnderstandingThread } from './types.js';
2
+ /**
3
+ * Discovery produces suggestions only. The user turns a suggestion into a Focus explicitly.
4
+ * The legacy thread-shaped return value remains local to the discovery result renderer; it is
5
+ * not a second persisted domain model.
6
+ */
2
7
  export declare function persistWorkThreadsFromDiscovery(input: {
3
8
  projectId: string;
4
9
  result: WorkDiscoveryResult;
@@ -1,104 +1,52 @@
1
- import { listWorkUnderstandingThreads, upsertWorkUnderstandingThread } from "./thread-repository.js";
1
+ import { upsertFocusCandidate } from "../focuses/candidate-repository.js";
2
2
  //#region src/work-discovery/thread-service.ts
3
3
  function confidenceValue(value) {
4
4
  return value === "high" ? .9 : value === "medium" ? .72 : .55;
5
5
  }
6
- function recencyPoints(observedAt, nowMs) {
7
- if (!observedAt) return 8;
8
- const days = Math.max(0, (nowMs - observedAt) / 864e5);
9
- if (days <= 2) return 40;
10
- if (days <= 7) return 32;
11
- if (days <= 14) return 24;
12
- if (days <= 30) return 14;
13
- return 5;
14
- }
15
- function focusScore(input) {
16
- const latest = input.evidence.reduce((value, item) => item.observedAt != null && (value == null || item.observedAt > value) ? item.observedAt : value, void 0);
17
- const commitDays = new Set((input.snapshot.git?.recentCommits ?? []).flatMap((commit) => commit.committedAt ? [new Date(commit.committedAt).toISOString().slice(0, 10)] : []));
18
- const sourceTypes = new Set(input.evidence.map((item) => item.sourceType));
19
- const continuity = Math.min(20, commitDays.size * 5);
20
- const corroboration = Math.min(15, input.evidence.length * 3 + Math.max(0, sourceTypes.size - 1) * 5);
21
- const unfinished = input.candidate.status === "active" ? 15 : input.candidate.status === "blocked" ? 12 : 3;
22
- const confidence = Math.round(confidenceValue(input.candidate.confidence) * 10);
23
- const horizonAdjustment = input.candidate.horizon === "current" ? 0 : input.candidate.horizon === "ongoing" ? -4 : -8;
24
- return Math.max(0, Math.min(100, Math.round(recencyPoints(latest, input.nowMs) + continuity + corroboration + unfinished + confidence + horizonAdjustment)));
25
- }
26
- function fallbackCandidate(result, evidence) {
27
- return {
28
- topicKey: "current-project-work",
29
- title: result.projectSummary.slice(0, 200),
30
- summary: result.currentState.slice(0, 2e3),
31
- status: result.lowConfidence ? "uncertain" : "active",
32
- horizon: "current",
33
- confidence: result.lowConfidence ? "low" : "medium",
34
- evidenceRefs: evidence.slice(0, 6).map((item) => item.sourceRef)
35
- };
36
- }
37
- function titleTokens(value) {
38
- return new Set(value.toLocaleLowerCase().match(/[\p{L}\p{N}]{2,}/gu)?.filter((token) => ![
39
- "the",
40
- "and",
41
- "for",
42
- "with",
43
- "from",
44
- "this",
45
- "that"
46
- ].includes(token)).slice(0, 30) ?? []);
47
- }
48
- function titleSimilarity(left, right) {
49
- const leftTokens = titleTokens(left);
50
- const rightTokens = titleTokens(right);
51
- if (!leftTokens.size || !rightTokens.size) return 0;
52
- return [...leftTokens].filter((token) => rightTokens.has(token)).length / Math.max(leftTokens.size, rightTokens.size);
53
- }
54
- function canonicalKeyForCandidate(input) {
55
- const proposed = `${input.projectId}:${input.candidate.horizon}:${input.candidate.topicKey}`.slice(0, 300);
56
- const existing = listWorkUnderstandingThreads({
57
- projectId: input.projectId,
58
- includeRejected: true,
59
- limit: 100
60
- });
61
- const exact = existing.find((thread) => thread.canonicalKey === proposed);
62
- if (exact) return exact.canonicalKey;
63
- return existing.filter((thread) => thread.horizon === input.candidate.horizon && thread.userStatus !== "rejected").map((thread) => ({
64
- thread,
65
- similarity: titleSimilarity(thread.title, input.candidate.title)
66
- })).filter((item) => item.similarity >= .5).sort((left, right) => right.similarity - left.similarity)[0]?.thread.canonicalKey ?? proposed;
67
- }
6
+ /**
7
+ * Discovery produces suggestions only. The user turns a suggestion into a Focus explicitly.
8
+ * The legacy thread-shaped return value remains local to the discovery result renderer; it is
9
+ * not a second persisted domain model.
10
+ */
68
11
  function persistWorkThreadsFromDiscovery(input) {
69
12
  const nowMs = input.nowMs ?? Date.now();
70
- const candidates = input.result.workThreadCandidates?.length ? input.result.workThreadCandidates : input.evidence.length ? [fallbackCandidate(input.result, input.evidence)] : [];
71
- const persist = (candidate) => {
13
+ return (input.result.workThreadCandidates ?? []).flatMap((candidate) => {
72
14
  const evidence = candidate.evidenceRefs.flatMap((ref) => {
73
- const match = input.evidence.find((item) => item.sourceRef === ref);
74
- return match ? [match] : [];
15
+ const item = input.evidence.find((entry) => entry.sourceRef === ref);
16
+ return item ? [{
17
+ label: item.observation.slice(0, 300),
18
+ source: item.sourceRef
19
+ }] : [];
75
20
  });
76
- if (!evidence.length) return [];
77
- return [upsertWorkUnderstandingThread({
78
- canonicalKey: canonicalKeyForCandidate({
79
- projectId: input.projectId,
80
- candidate
81
- }),
21
+ if (evidence.length === 0) return [];
22
+ const canonicalKey = `${input.projectId}:${candidate.horizon}:${candidate.topicKey}`.slice(0, 300);
23
+ const stored = upsertFocusCandidate({
24
+ canonicalKey,
82
25
  title: candidate.title,
83
26
  summary: candidate.summary,
84
- status: candidate.status,
85
- horizon: candidate.horizon,
86
- focusScore: focusScore({
87
- candidate,
88
- evidence,
89
- snapshot: input.snapshot,
90
- nowMs
91
- }),
92
27
  confidence: confidenceValue(candidate.confidence),
28
+ evidence,
93
29
  projectIds: [input.projectId],
94
- evidenceIds: evidence.map((item) => item.id),
95
- observedAt: evidence.reduce((latest, item) => Math.max(latest, item.observedAt ?? nowMs), 0) || nowMs,
96
30
  nowMs
97
- })];
98
- };
99
- const persisted = candidates.flatMap(persist);
100
- if (persisted.length || !input.evidence.length || !input.result.workThreadCandidates?.length) return persisted;
101
- return persist(fallbackCandidate(input.result, input.evidence));
31
+ });
32
+ return [{
33
+ id: stored.id,
34
+ canonicalKey,
35
+ title: stored.title,
36
+ summary: stored.summary,
37
+ status: candidate.status,
38
+ horizon: candidate.horizon,
39
+ focusScore: Math.round(stored.confidence * 100),
40
+ confidence: stored.confidence,
41
+ userStatus: "unreviewed",
42
+ projectIds: stored.projectIds,
43
+ evidenceIds: [],
44
+ firstObservedAt: stored.discoveredAt,
45
+ lastObservedAt: stored.updatedAt,
46
+ createdAt: stored.discoveredAt,
47
+ updatedAt: stored.updatedAt
48
+ }];
49
+ });
102
50
  }
103
51
  //#endregion
104
52
  export { persistWorkThreadsFromDiscovery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xopcai/xopc",
3
- "version": "0.0.172",
3
+ "version": "0.0.174",
4
4
  "description": "Local-first AI system that remembers context, coordinates AI, and sustains long-term progress.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -1,440 +1,30 @@
1
1
  ---
2
2
  name: find-skills
3
- description: Helps users discover, install, and manage agent skills in XOPC workspace
4
- license: MIT
3
+ description: Find and evaluate installable agent skills across the XOPC Store, ClawHub, and skills.sh. Use when a user asks whether a skill exists, wants capability recommendations, or wants help choosing a high-value skill.
5
4
  ---
6
5
 
7
6
  # Find Skills
8
7
 
9
- This skill helps you discover, install, and manage skills in the XOPC ecosystem.
8
+ Use `skills_marketplace_search` for discovery. It is an internal read-only Tool, so it works in Electron without an `xopc` executable or renderer bearer token. It searches XOPC Store and ClawHub directly; skills.sh results are obtained through ClawHub's federation with their original provenance preserved.
10
9
 
11
- ## When to Use This Skill
10
+ ## Workflow
12
11
 
13
- Use this skill when the user:
12
+ 1. Turn the requested capability, stack, and constraints into two to four concise queries. Include useful ecosystem synonyms.
13
+ 2. Call `skills_marketplace_search` for the best query. Broaden once only when results are weak.
14
+ 3. Prefer an already-installed skill when it fits well. Do not favor a marketplace duplicate solely because it has more downloads.
15
+ 4. Compare at most five plausible candidates using this priority:
16
+ - direct task and environment fit;
17
+ - trustworthy provenance and acceptable security posture;
18
+ - specific, usable instructions and understandable scripts;
19
+ - recent maintenance and coherent versioning;
20
+ - downloads and stars as supporting evidence only;
21
+ - low overlap, dependency cost, and privilege requirements.
22
+ 5. Return three to five candidates at most. Include source, installed status, why it fits, evidence, caveats, and canonical link or full install reference. Label one **Recommended** only when there is a clear winner.
14
23
 
15
- - Asks "how do I do X" where X might be a common task with an existing skill
16
- - Says "find a skill for X" or "is there a skill for X"
17
- - Asks "can you do X" where X is a specialized capability
18
- - Wants to install a skill from GitHub or skills.sh
19
- - Needs to manage installed skills (enable, disable, configure)
20
- - Wants to browse available skills
24
+ Treat `valueScore` as heuristic ordering, not proof of quality. Never collapse ClawHub or skills.sh entries by slug alone; retain `source`, stable `id`, `canonicalUrl`, and `install.reference`. Surface `security.scanners` warnings and failures as caveats; do not recommend a scanner-failing candidate. Disclose any source whose status is not `ok`.
21
25
 
22
- ## XOPC Skills CLI Commands
26
+ ## Installation boundary
23
27
 
24
- XOPC provides built-in commands for skill management:
28
+ Search does not install anything. If installation was not explicitly requested, ask first. When the user explicitly requests a Store or native ClawHub result, call `skill_install` with its `provider` and full `install.reference` as `name`; omit `target` for the default global install under `~/.xopc/skills`, and pass `target: workspace` only when the user explicitly requests current-agent workspace scope. Never shorten an owner-scoped ClawHub reference to its slug. Use `source` only for an explicit Git, archive, file URL, or local-path installation. A skills.sh page URL is not automatically an installable source, so use the product Skills UI when no repository or archive source is available. Never extract or print Gateway credentials, and never set `force` or overwrite an existing skill without explicit approval.
25
29
 
26
- ### List Available Skills
27
-
28
- ```bash
29
- # List all skills (builtin + workspace + global)
30
- xopc skills list
31
-
32
- # Show detailed information
33
- xopc skills list -v
34
-
35
- # JSON format
36
- xopc skills list --json
37
- ```
38
-
39
- ### Install Skills
40
-
41
- **From GitHub:**
42
-
43
- ```bash
44
- # Clone a skill repository to workspace
45
- git clone <repo-url> ~/.xopc/workspace/main/skills/<skill-name>
46
-
47
- # Example: Install vercel-react-best-practices
48
- git clone https://github.com/vercel-labs/agent-skills.git ~/.xopc/workspace/main/skills/vercel-react-best-practices-temp
49
- mv ~/.xopc/workspace/main/skills/vercel-react-best-practices-temp/SKILL.md ~/.xopc/workspace/main/skills/vercel-react-best-practices/SKILL.md
50
- rm -rf ~/.xopc/workspace/main/skills/vercel-react-best-practices-temp
51
- ```
52
-
53
- **Using `xopc skills install` (for skills with install specs):**
54
-
55
- ```bash
56
- # Install skill dependencies
57
- xopc skills install <skill-name>
58
-
59
- # Specify install method
60
- xopc skills install <skill-name> -i <install-id>
61
-
62
- # Dry run (preview)
63
- xopc skills install <skill-name> --dry-run
64
- ```
65
-
66
- ### Enable/Disable Skills
67
-
68
- ```bash
69
- # Enable a skill
70
- xopc skills enable <skill-name>
71
-
72
- # Disable a skill
73
- xopc skills disable <skill-name>
74
- ```
75
-
76
- ### Check Skill Status
77
-
78
- ```bash
79
- # Show all skills status
80
- xopc skills status
81
-
82
- # Show specific skill details
83
- xopc skills status <skill-name>
84
-
85
- # JSON format
86
- xopc skills status --json
87
- ```
88
-
89
- ### Configure Skills
90
-
91
- ```bash
92
- # Show current configuration
93
- xopc skills config <skill-name> --show
94
-
95
- # Set API key
96
- xopc skills config <skill-name> --api-key=YOUR_API_KEY
97
-
98
- # Set environment variables
99
- xopc skills config <skill-name> --env API_KEY=value --env DEBUG=true
100
- ```
101
-
102
- ### Test Skills
103
-
104
- ```bash
105
- # Test all skills
106
- xopc skills test
107
-
108
- # Test specific skill
109
- xopc skills test <skill-name>
110
-
111
- # Validate SKILL.md file
112
- xopc skills test validate ./skills/weather/SKILL.md
113
-
114
- # Security audit
115
- xopc skills test security --deep
116
- ```
117
-
118
- ## How to Help Users Find and Install Skills
119
-
120
- ### Step 1: Understand What They Need
121
-
122
- When a user asks for help with something, identify:
123
-
124
- 1. **The domain** (e.g., React, testing, design, deployment)
125
- 2. **The specific task** (e.g., writing tests, creating animations, reviewing PRs)
126
- 3. **Whether a skill likely exists** for this common task
127
-
128
- ### Step 2: Search for Skills
129
-
130
- **Option A: Check installed skills first**
131
-
132
- ```bash
133
- xopc skills list -v
134
- ```
135
-
136
- **Option B: Search online skill repositories**
137
-
138
- Use your browsing capabilities to search:
139
- - https://skills.sh/ - Official skills marketplace
140
- - GitHub: Search for "agent-skills" or "claude-skills"
141
- - Popular repos:
142
- - `vercel-labs/agent-skills`
143
- - `ComposioHQ/awesome-claude-skills`
144
-
145
- ### Step 3: Install the Skill
146
-
147
- **For XOPC-compatible skills:**
148
-
149
- 1. **Check if skill has install specs** in SKILL.md:
150
- ```bash
151
- xopc skills status <skill-name>
152
- ```
153
-
154
- 2. **Install dependencies** (if any):
155
- ```bash
156
- xopc skills install <skill-name>
157
- ```
158
-
159
- **For GitHub skills (manual installation):**
160
-
161
- 1. **Create skill directory** in workspace:
162
- ```bash
163
- mkdir -p ~/.xopc/workspace/main/skills/<skill-name>
164
- ```
165
-
166
- 2. **Download SKILL.md**:
167
- ```bash
168
- # From GitHub
169
- curl -L https://raw.githubusercontent.com/<owner>/<repo>/main/skills/<skill-name>/SKILL.md \
170
- -o ~/.xopc/workspace/main/skills/<skill-name>/SKILL.md
171
-
172
- # Or clone and copy
173
- git clone <repo-url> /tmp/skill-temp
174
- cp /tmp/skill-temp/skills/<skill-name>/SKILL.md ~/.xopc/workspace/main/skills/<skill-name>/
175
- rm -rf /tmp/skill-temp
176
- ```
177
-
178
- 3. **Verify installation**:
179
- ```bash
180
- xopc skills list | grep <skill-name>
181
- ```
182
-
183
- ### Step 4: Present Results to User
184
-
185
- When you find relevant skills, present them with:
186
-
187
- 1. **Skill name and description**
188
- 2. **Installation status** (already installed / needs installation)
189
- 3. **Install command** (if not installed)
190
- 4. **Link to learn more**
191
-
192
- **Example response:**
193
-
194
- ```
195
- I found a skill that might help!
196
-
197
- 📦 vercel-react-best-practices
198
- React and Next.js performance optimization guidelines from Vercel Engineering.
199
-
200
- Status: ✅ Already installed
201
-
202
- You can start using it immediately! Just ask me to help with React optimization tasks.
203
- ```
204
-
205
- **Or if not installed:**
206
-
207
- ```
208
- I found a skill that might help!
209
-
210
- 📦 vercel-react-best-practices
211
- React and Next.js performance optimization guidelines from Vercel Engineering.
212
-
213
- To install it, run:
214
- xopc skills install vercel-react-best-practices
215
-
216
- Or manually:
217
- mkdir -p ~/.xopc/workspace/main/skills/vercel-react-best-practices
218
- curl -L https://raw.githubusercontent.com/vercel-labs/agent-skills/main/skills/vercel-react-best-practices/SKILL.md \
219
- -o ~/.xopc/workspace/main/skills/vercel-react-best-practices/SKILL.md
220
-
221
- Learn more: https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
222
- ```
223
-
224
- ### Step 5: Offer to Install
225
-
226
- If the user wants to proceed, you can help them install:
227
-
228
- ```bash
229
- # For XOPC skills with install specs
230
- xopc skills install <skill-name> -y
231
-
232
- # For GitHub skills (automated)
233
- mkdir -p ~/.xopc/workspace/main/skills/<skill-name>
234
- curl -L <skill-url>/SKILL.md -o ~/.xopc/workspace/main/skills/<skill-name>/SKILL.md
235
- ```
236
-
237
- ## Common Skill Categories
238
-
239
- | Category | Example Queries | Popular Skills |
240
- | --------------- | ---------------------------------------- | --------------------------------- |
241
- | Web Development | react, nextjs, typescript, css, tailwind | vercel-react-best-practices |
242
- | Testing | testing, jest, playwright, e2e | playwright-testing |
243
- | DevOps | deploy, docker, kubernetes, ci-cd | docker-compose, github-actions |
244
- | Documentation | docs, readme, changelog, api-docs | api-documentation |
245
- | Code Quality | review, lint, refactor, best-practices | code-review-checklist |
246
- | Design | ui, ux, design-system, accessibility | accessibility-checklist |
247
- | Productivity | workflow, automation, git | git-workflow |
248
-
249
- ## Skill Directory Structure
250
-
251
- Skills must be installed in the correct directory structure:
252
-
253
- ```
254
- ~/.xopc/workspace/main/skills/
255
- ├── <skill-name>/ ← Each skill needs its own directory
256
- │ ├── SKILL.md ← Required: Skill metadata and instructions
257
- │ ├── config.json ← Optional: Default configuration
258
- │ └── scripts/ ← Optional: Helper scripts
259
- ├── another-skill/
260
- │ └── SKILL.md
261
- └── ...
262
- ```
263
-
264
- **⚠️ Common Mistake:** Don't put SKILL.md directly in `skills/` directory!
265
-
266
- **Correct:**
267
- ```
268
- ~/.xopc/workspace/main/skills/my-skill/SKILL.md
269
- ```
270
-
271
- **Incorrect:**
272
- ```
273
- ~/.xopc/workspace/main/skills/SKILL.md ← Won't be loaded!
274
- ```
275
-
276
- ## Skill Installation Methods
277
-
278
- ### Method 1: XOPC Built-in Install (Recommended)
279
-
280
- For skills that declare install dependencies:
281
-
282
- ```bash
283
- # Check what will be installed
284
- xopc skills install <skill-name> --dry-run
285
-
286
- # Install
287
- xopc skills install <skill-name>
288
- ```
289
-
290
- This method:
291
- - ✅ Automatically installs dependencies (brew, pnpm, go, etc.)
292
- - ✅ Performs security scanning
293
- - ✅ Validates the skill
294
- - ✅ Reports any issues
295
-
296
- ### Method 2: Manual GitHub Installation
297
-
298
- For skills without install specs:
299
-
300
- ```bash
301
- # 1. Create directory
302
- mkdir -p ~/.xopc/workspace/main/skills/<skill-name>
303
-
304
- # 2. Download SKILL.md
305
- curl -L https://raw.githubusercontent.com/<owner>/<repo>/main/skills/<skill-name>/SKILL.md \
306
- -o ~/.xopc/workspace/main/skills/<skill-name>/SKILL.md
307
-
308
- # 3. Verify
309
- xopc skills list | grep <skill-name>
310
- ```
311
-
312
- ### Method 3: Git Clone
313
-
314
- For complex skills with multiple files:
315
-
316
- ```bash
317
- # Clone to temp location
318
- git clone <repo-url> /tmp/skill-clone
319
-
320
- # Copy skill directory
321
- cp -r /tmp/skill-clone/skills/<skill-name> ~/.xopc/workspace/main/skills/
322
-
323
- # Clean up
324
- rm -rf /tmp/skill-clone
325
-
326
- # Verify
327
- xopc skills status <skill-name>
328
- ```
329
-
330
- ## Troubleshooting
331
-
332
- ### Skill Not Loading
333
-
334
- **Check directory structure:**
335
- ```bash
336
- # Should show SKILL.md in a subdirectory
337
- ls -la ~/.xopc/workspace/main/skills/<skill-name>/
338
- ```
339
-
340
- **Validate SKILL.md format:**
341
- ```bash
342
- xopc skills test validate ~/.xopc/workspace/main/skills/<skill-name>/SKILL.md
343
- ```
344
-
345
- **Check for errors:**
346
- ```bash
347
- xopc skills list --json | jq '.diagnostics'
348
- ```
349
-
350
- ### Installation Failed
351
-
352
- **Check dependencies:**
353
- ```bash
354
- xopc skills status <skill-name>
355
- ```
356
-
357
- **Manual installation:**
358
- ```bash
359
- # If skill requires 'curl'
360
- brew install curl # macOS
361
- sudo apt-get install curl # Linux
362
- ```
363
-
364
- **Retry:**
365
- ```bash
366
- xopc skills install <skill-name>
367
- ```
368
-
369
- ### Skill Not Working
370
-
371
- 1. **Check if enabled:**
372
- ```bash
373
- xopc skills status <skill-name>
374
- ```
375
-
376
- 2. **Enable if needed:**
377
- ```bash
378
- xopc skills enable <skill-name>
379
- ```
380
-
381
- 3. **Check configuration:**
382
- ```bash
383
- xopc skills config <skill-name> --show
384
- ```
385
-
386
- 4. **Set API key if required:**
387
- ```bash
388
- xopc skills config <skill-name> --api-key=YOUR_KEY
389
- ```
390
-
391
- ## Examples
392
-
393
- ### Example 1: User asks about React performance
394
-
395
- **User:** "How can I make my React app faster?"
396
-
397
- **You:**
398
- 1. Check installed skills: `xopc skills list | grep -i react`
399
- 2. If found: "You have the vercel-react-best-practices skill installed!"
400
- 3. If not found: Offer to install it
401
-
402
- ### Example 2: User wants to add testing capability
403
-
404
- **User:** "Can you help me write Playwright tests?"
405
-
406
- **You:**
407
- 1. Search for testing skills
408
- 2. Found: `playwright-testing`
409
- 3. Install:
410
- ```bash
411
- mkdir -p ~/.xopc/workspace/main/skills/playwright-testing
412
- curl -L <url>/SKILL.md -o ~/.xopc/workspace/main/skills/playwright-testing/SKILL.md
413
- ```
414
- 4. Verify: `xopc skills status playwright-testing`
415
-
416
- ### Example 3: User wants to browse all skills
417
-
418
- **User:** "What skills do you have?"
419
-
420
- **You:**
421
- ```bash
422
- xopc skills list -v
423
- ```
424
-
425
- Then present the list with descriptions.
426
-
427
- ## Tips for Effective Skill Management
428
-
429
- 1. **Always verify installation**: Run `xopc skills list` after installing
430
- 2. **Check skill status**: Use `xopc skills status <name>` for details
431
- 3. **Keep skills updated**: Periodically check for skill updates
432
- 4. **Review security**: Run `xopc skills test security` for audits
433
- 5. **Organize workspace**: Keep only needed skills to reduce clutter
434
-
435
- ## References
436
-
437
- - **Skills Marketplace**: https://skills.sh/
438
- - **XOPC Skills CLI**: `xopc skills --help`
439
- - **Skill Format**: SKILL.md frontmatter specification
440
- - **GitHub Skills**: Search "agent-skills" on GitHub
30
+ If no candidate clears the quality bar, say so and propose creating a focused skill instead of padding the recommendation.