@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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-C3Y-bESI.js → activity-store-CyEDJeIt.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CPyev9P7.js → agent-avatar-dicebear-DF7Bol6I.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +2 -0
- package/dist/gateway/static/root/assets/{api-B7qEr_Rw.js → api-DYunqroX.js} +1 -1
- package/dist/gateway/static/root/assets/api-DwyUxpgY.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Br_9-7fs.js → app-management-settings-panel-B4xJyvDu.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-uyLcRPai.js → appearance-settings-B2PQxRiu.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-B19REnR5.js → archive-plugin-DWhBmmjD.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DLWCC4Yi.js → attachment-load-BOpZfa_I.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-ky5S5lly.js → automation-suggestion-card-Byu3I7Rs.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CtPEzLlo.js → binary-plugins-6AG1qatz.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CQVR4Xij.js → block-editor-CJhrn98_.js} +5 -5
- package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CimCGbhq.js → browser-workflow-inputs-CBVb4mt9.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DewuCw3p.js → browser-workflows-page-Cq4XUKbu.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-B5RTs-Az.js → capability-presets-api-hbW4NAKO.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-Czu0YzIZ.js → channel-recipient-api-CzMjHb17.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-Di3gnR_D.js → connector-logo-B9Au6gMZ.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +2 -0
- package/dist/gateway/static/root/assets/copy-VueTIC2x.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C3L6AI8_.js → desktop-pet-settings-CNff5TFb.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Dvq4iG6P.js → directory-picker-path-field-Bf956uo-.js} +1 -1
- package/dist/gateway/static/root/assets/dreaming-settings-CHM8FE1g.js +3 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BecQjU0J.js → extension-debug-page-ZqM_0eUs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BeVkPSm-.js → extension-page-D4hvXOMM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DMoo2mKx.js → extension-settings-page-GsqxaJjA.js} +1 -1
- package/dist/gateway/static/root/assets/focus-detail-page-CE6uwrl1.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-Bthb3_6v.js → gateway-config-api-B4THmgnS.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Bh8nPvJQ.js → gateway-settings-CPv-MxGE.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-D3USVm9D.js → gateway-startup-retry-MP3K71pP.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-C_2QWBtb.js → goals-config-api-DCcDuIjG.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-DhL643tc.js → goals-settings-o9QMXvNq.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-COVFwp7C.js → heartbeat-settings-DixwpXnH.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BNQlnwpU.js → image-generation-api-BOGH9FGi.js} +1 -1
- package/dist/gateway/static/root/assets/index-CfXiRNN5.css +1 -0
- package/dist/gateway/static/root/assets/index-eyttVNS_.js +212 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DfdJRJVy.js → keyboard-shortcuts-settings-D4o4ZPF6.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BvCPOgoi.js → local-apps-page-GzMmpO7G.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BP0vD37A.js → locale-store-CAuhEGCn.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-YO1rDk9m.js → markdown-split-CIX8D1pv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CU_RRf-q.js → media-plugins-Bp3eIA45.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BiBdO1-O.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-CeFiOK3S.js → notes-page-RVFiYAoO.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-tiHmRJUA.js → page-tabs-BGAYH3Ef.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CU6XgaCz.js → preview-open-alternatives-BM6pDkHp.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dn4_qor4.js → product-open-page-BiMetEmn.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-edDUIbXo.js → save-bar-controls-BdjV8MK5.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-DqJO_5Yb.js → schedule-field-ChlqXU46.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CMh0jzy5.js → schema-form-DDKf5ZSH.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Bb0Bc3nJ.js → settings-form-section-CPG0KGVs.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DQhADvz1.js → settings-loading-skeleton-DRSDHucM.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-b0M5HukN.js → settings-page-CeB7_xD0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-hvjtIjvh.js → settings-page-layout-BENrkwd0.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-rbeaOpTg.js → share-preview-page-DIzczJkG.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-BHo_hgnL.js → system-settings-panel-Dp4d5Q1B.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-C3KnnjcU.js → theme-store-CbGc1laW.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-D-G-uwVJ.js → time-picker-BhgCeDuO.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DtRnG-YI.js → typed-models-lib-DwPk3OPL.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CWWItX2g.js → use-channel-catalog-CXrEu2dw.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BTnltQHZ.js → voice-api-key-field-DFoA79LB.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +1 -0
- package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D7vKChFZ.js → workflow-run-setup-panel-BuniGPO0.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +3 -1
- package/dist/src/agent/agent-manager.js +4 -3
- package/dist/src/agent/capabilities/definitions.d.ts +2 -1
- package/dist/src/agent/capabilities/definitions.js +3 -1
- package/dist/src/agent/prompt/sections/tooling.js +4 -0
- package/dist/src/agent/service.d.ts +2 -1
- package/dist/src/agent/service.js +26 -0
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/install-target.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.d.ts +64 -0
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +27 -18
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/marketplace/search.d.ts +46 -0
- package/dist/src/agent/skills/marketplace/search.js +193 -0
- package/dist/src/agent/skills/skill-tool-gating.js +2 -1
- package/dist/src/agent/tools/delegate-tool.js +2 -0
- package/dist/src/agent/tools/factory.d.ts +4 -2
- package/dist/src/agent/tools/factory.js +11 -5
- package/dist/src/agent/tools/index.d.ts +2 -1
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/skill-install-tool.d.ts +17 -0
- package/dist/src/agent/tools/skill-install-tool.js +76 -8
- package/dist/src/agent/tools/skills-marketplace-search-tool.d.ts +17 -0
- package/dist/src/agent/tools/skills-marketplace-search-tool.js +77 -0
- package/dist/src/browser/providers/cloakbrowser.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/focuses/candidate-repository.d.ts +15 -0
- package/dist/src/focuses/candidate-repository.js +91 -0
- package/dist/src/focuses/index.d.ts +7 -0
- package/dist/src/focuses/index.js +7 -0
- package/dist/src/focuses/insight-repository.d.ts +22 -0
- package/dist/src/focuses/insight-repository.js +77 -0
- package/dist/src/focuses/prompts.d.ts +2 -0
- package/dist/src/focuses/prompts.js +18 -0
- package/dist/src/focuses/reconciler.d.ts +5 -0
- package/dist/src/focuses/reconciler.js +26 -0
- package/dist/src/focuses/repository.d.ts +61 -0
- package/dist/src/focuses/repository.js +214 -0
- package/dist/src/focuses/run-processor.d.ts +18 -0
- package/dist/src/focuses/run-processor.js +162 -0
- package/dist/src/focuses/service.d.ts +42 -0
- package/dist/src/focuses/service.js +241 -0
- package/dist/src/focuses/types.d.ts +89 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +2 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +2 -2
- package/dist/src/gateway/hono/routes/focuses.d.ts +3 -0
- package/dist/src/gateway/hono/routes/focuses.js +319 -0
- package/dist/src/gateway/hono/routes/home.js +15 -17
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/projects.js +2 -103
- package/dist/src/gateway/hono/routes/work-discovery.js +0 -239
- package/dist/src/gateway/service/marketplace-service.js +1 -1
- package/dist/src/gateway/service.d.ts +1 -1
- package/dist/src/gateway/service.js +15 -11
- package/dist/src/storage/sqlite/migrations/066_first_class_focuses.sql +126 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/work-discovery/index.d.ts +0 -2
- package/dist/src/work-discovery/index.js +1 -3
- package/dist/src/work-discovery/service.d.ts +0 -30
- package/dist/src/work-discovery/service.js +1 -35
- package/dist/src/work-discovery/thread-service.d.ts +5 -0
- package/dist/src/work-discovery/thread-service.js +36 -88
- package/package.json +1 -1
- package/skills/tools/find-skills/SKILL.md +18 -428
- package/dist/gateway/static/root/assets/agents-Bf_kK2Ay.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-DXFCP5-1.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-D8pT1o2O.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Bav_skKN.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BHaYYo9E.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-BgchTh81.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-BP0e62wt.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DBWKfeGe.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CC5kh0de.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-D-ZUNHhn.js +0 -1
- package/dist/gateway/static/root/assets/dreaming-settings-D9i54kWO.js +0 -3
- package/dist/gateway/static/root/assets/goal-create-dialog-Dp0AyDHI.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CNt7nrdS.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-Bm_NZFiZ.js +0 -2
- package/dist/gateway/static/root/assets/index-C_XSKOH6.css +0 -1
- package/dist/gateway/static/root/assets/index-DUasAutC.js +0 -212
- package/dist/gateway/static/root/assets/local-app-workbench-page-DZwkD1co.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-dNL0Y1dA.js +0 -7
- package/dist/gateway/static/root/assets/messages-BWtP5TFz.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-B8MKxpZb.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CWBuuX-S.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BJSsLsXH.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DXJDb8vB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DeHpWgxM.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cf-TEYUd.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BFyfed_g.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CYnH9sTt.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Cr8_m-jS.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-Chtc1xDO.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-D7qMR26X.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CpqFZze9.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-t4dXpGC0.js +0 -1
- package/dist/gateway/static/root/assets/work-page-BXwDKiMZ.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Bos9HyqT.js +0 -11
- package/dist/src/proactive/calendar-signals.d.ts +0 -4
- package/dist/src/proactive/calendar-signals.js +0 -120
- package/dist/src/proactive/focus-service.d.ts +0 -62
- package/dist/src/proactive/focus-service.js +0 -173
- package/dist/src/proactive/index.d.ts +0 -7
- package/dist/src/proactive/index.js +0 -7
- package/dist/src/proactive/insight-repository.d.ts +0 -21
- package/dist/src/proactive/insight-repository.js +0 -109
- package/dist/src/proactive/run-processor.d.ts +0 -19
- package/dist/src/proactive/run-processor.js +0 -146
- package/dist/src/proactive/trial-expiry-reconciler.d.ts +0 -5
- package/dist/src/proactive/trial-expiry-reconciler.js +0 -30
- package/dist/src/proactive/types.d.ts +0 -66
- package/dist/src/proactive/value-score.d.ts +0 -13
- package/dist/src/proactive/value-score.js +0 -30
- package/dist/src/proactive/watch-repository.d.ts +0 -28
- package/dist/src/proactive/watch-repository.js +0 -129
- package/dist/src/work-discovery/governance.d.ts +0 -25
- package/dist/src/work-discovery/governance.js +0 -96
- package/dist/src/work-discovery/thread-repository.d.ts +0 -34
- package/dist/src/work-discovery/thread-repository.js +0 -112
- /package/dist/src/{proactive → focuses}/types.js +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { createFocusActivity, getFocusMonitorByAutomationId, updateFocusMonitorRuntime } from "./repository.js";
|
|
4
|
+
import { createFocusInsight } from "./insight-repository.js";
|
|
5
|
+
//#region src/focuses/run-processor.ts
|
|
6
|
+
init_logger();
|
|
7
|
+
const log = createLogger("FocusRunProcessor");
|
|
8
|
+
function nonEmptyString(value) {
|
|
9
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
10
|
+
}
|
|
11
|
+
function parseFocusMonitorResult(summary) {
|
|
12
|
+
const start = summary.indexOf("{");
|
|
13
|
+
const end = summary.lastIndexOf("}");
|
|
14
|
+
if (start < 0 || end <= start) return null;
|
|
15
|
+
let value;
|
|
16
|
+
try {
|
|
17
|
+
value = JSON.parse(summary.slice(start, end + 1));
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
22
|
+
const result = value;
|
|
23
|
+
if (result.meaningful === false) return { meaningful: false };
|
|
24
|
+
if (result.meaningful !== true) return null;
|
|
25
|
+
const title = nonEmptyString(result.title);
|
|
26
|
+
const resultSummary = nonEmptyString(result.summary);
|
|
27
|
+
const whyItMatters = nonEmptyString(result.whyItMatters);
|
|
28
|
+
const nextAction = nonEmptyString(result.nextAction);
|
|
29
|
+
const evidence = Array.isArray(result.evidence) ? result.evidence.flatMap((item) => {
|
|
30
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return [];
|
|
31
|
+
const record = item;
|
|
32
|
+
const label = nonEmptyString(record.label);
|
|
33
|
+
const source = nonEmptyString(record.source);
|
|
34
|
+
const publishedAtValue = nonEmptyString(record.publishedAt);
|
|
35
|
+
const publishedAt = publishedAtValue && Number.isFinite(Date.parse(publishedAtValue)) ? new Date(publishedAtValue).toISOString() : null;
|
|
36
|
+
return label ? [{
|
|
37
|
+
label,
|
|
38
|
+
...source ? { source } : {},
|
|
39
|
+
...publishedAt ? { publishedAt } : {}
|
|
40
|
+
}] : [];
|
|
41
|
+
}).slice(0, 8) : [];
|
|
42
|
+
if (!title || !resultSummary || !whyItMatters || !nextAction || evidence.length === 0) return null;
|
|
43
|
+
return {
|
|
44
|
+
meaningful: true,
|
|
45
|
+
title,
|
|
46
|
+
summary: resultSummary,
|
|
47
|
+
whyItMatters,
|
|
48
|
+
nextAction,
|
|
49
|
+
evidence
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function hasDatedExternalEvidence(evidence) {
|
|
53
|
+
return evidence.some((item) => {
|
|
54
|
+
if (!item.source || !item.publishedAt) return false;
|
|
55
|
+
try {
|
|
56
|
+
const url = new URL(item.source);
|
|
57
|
+
return (url.protocol === "https:" || url.protocol === "http:") && Number.isFinite(Date.parse(item.publishedAt));
|
|
58
|
+
} catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function processFocusMonitorRun(run) {
|
|
64
|
+
const monitor = getFocusMonitorByAutomationId(run.automationId);
|
|
65
|
+
if (!monitor) return { handled: false };
|
|
66
|
+
if (monitor.lastRunId === run.id && monitor.lastRunAt != null) return { handled: true };
|
|
67
|
+
const endedAt = run.endedAtMs ?? Date.now();
|
|
68
|
+
if (run.status !== "succeeded" || !run.summary) {
|
|
69
|
+
const errorMessage = run.error || `Monitor run ${run.status}`;
|
|
70
|
+
updateFocusMonitorRuntime({
|
|
71
|
+
id: monitor.id,
|
|
72
|
+
runState: "failed",
|
|
73
|
+
lastRunId: run.id,
|
|
74
|
+
lastRunAt: endedAt,
|
|
75
|
+
error: errorMessage
|
|
76
|
+
});
|
|
77
|
+
createFocusActivity({
|
|
78
|
+
focusId: monitor.focusId,
|
|
79
|
+
monitorId: monitor.id,
|
|
80
|
+
type: "run_failed",
|
|
81
|
+
summary: errorMessage,
|
|
82
|
+
details: { runId: run.id },
|
|
83
|
+
nowMs: endedAt
|
|
84
|
+
});
|
|
85
|
+
return { handled: true };
|
|
86
|
+
}
|
|
87
|
+
const result = parseFocusMonitorResult(run.summary);
|
|
88
|
+
if (!result || result.meaningful && monitor.kind === "external_changes" && !hasDatedExternalEvidence(result.evidence)) {
|
|
89
|
+
updateFocusMonitorRuntime({
|
|
90
|
+
id: monitor.id,
|
|
91
|
+
runState: "failed",
|
|
92
|
+
lastRunId: run.id,
|
|
93
|
+
lastRunAt: endedAt,
|
|
94
|
+
error: "Monitor returned an invalid result"
|
|
95
|
+
});
|
|
96
|
+
createFocusActivity({
|
|
97
|
+
focusId: monitor.focusId,
|
|
98
|
+
monitorId: monitor.id,
|
|
99
|
+
type: "run_failed",
|
|
100
|
+
summary: "Monitor returned an invalid result",
|
|
101
|
+
details: { runId: run.id },
|
|
102
|
+
nowMs: endedAt
|
|
103
|
+
});
|
|
104
|
+
log.warn({
|
|
105
|
+
automationId: run.automationId,
|
|
106
|
+
runId: run.id,
|
|
107
|
+
monitorKind: monitor.kind
|
|
108
|
+
}, "Focus monitor returned an invalid result");
|
|
109
|
+
return { handled: true };
|
|
110
|
+
}
|
|
111
|
+
updateFocusMonitorRuntime({
|
|
112
|
+
id: monitor.id,
|
|
113
|
+
runState: "idle",
|
|
114
|
+
lastRunId: run.id,
|
|
115
|
+
lastRunAt: endedAt,
|
|
116
|
+
meaningful: result.meaningful,
|
|
117
|
+
error: null
|
|
118
|
+
});
|
|
119
|
+
if (!result.meaningful) {
|
|
120
|
+
createFocusActivity({
|
|
121
|
+
focusId: monitor.focusId,
|
|
122
|
+
monitorId: monitor.id,
|
|
123
|
+
type: "run_no_change",
|
|
124
|
+
summary: "No meaningful change found",
|
|
125
|
+
details: { runId: run.id },
|
|
126
|
+
nowMs: endedAt
|
|
127
|
+
});
|
|
128
|
+
return { handled: true };
|
|
129
|
+
}
|
|
130
|
+
const insight = createFocusInsight({
|
|
131
|
+
focusId: monitor.focusId,
|
|
132
|
+
monitorId: monitor.id,
|
|
133
|
+
runId: run.id,
|
|
134
|
+
kind: monitor.kind,
|
|
135
|
+
title: result.title,
|
|
136
|
+
summary: result.summary,
|
|
137
|
+
whyItMatters: result.whyItMatters,
|
|
138
|
+
nextAction: result.nextAction,
|
|
139
|
+
evidence: result.evidence,
|
|
140
|
+
nowMs: endedAt
|
|
141
|
+
});
|
|
142
|
+
if (insight) {
|
|
143
|
+
createFocusActivity({
|
|
144
|
+
focusId: monitor.focusId,
|
|
145
|
+
monitorId: monitor.id,
|
|
146
|
+
type: "insight_created",
|
|
147
|
+
summary: insight.title,
|
|
148
|
+
details: {
|
|
149
|
+
runId: run.id,
|
|
150
|
+
insightId: insight.id
|
|
151
|
+
},
|
|
152
|
+
nowMs: endedAt
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
handled: true,
|
|
156
|
+
insight
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return { handled: true };
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { parseFocusMonitorResult, processFocusMonitorRun };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Automation, AutomationRun } from '../automations/index.js';
|
|
2
|
+
import type { FocusCadence, FocusDetail, FocusMonitor, FocusMonitorKind, FocusStatus } from './types.js';
|
|
3
|
+
export interface FocusAutomationPort {
|
|
4
|
+
create(input: Parameters<import('../automations/index.js').AutomationService['create']>[0]): Promise<Automation>;
|
|
5
|
+
get(id: string): Promise<Automation | null>;
|
|
6
|
+
update(id: string, input: Parameters<import('../automations/index.js').AutomationService['update']>[1]): Promise<Automation>;
|
|
7
|
+
pause(id: string): Promise<Automation>;
|
|
8
|
+
resume(id: string): Promise<Automation>;
|
|
9
|
+
remove(id: string): Promise<boolean>;
|
|
10
|
+
runNow(id: string): Promise<AutomationRun>;
|
|
11
|
+
}
|
|
12
|
+
export declare class FocusService {
|
|
13
|
+
private readonly automations;
|
|
14
|
+
constructor(automations: FocusAutomationPort);
|
|
15
|
+
list(statuses?: FocusStatus[]): FocusDetail[];
|
|
16
|
+
get(id: string): FocusDetail | null;
|
|
17
|
+
create(input: {
|
|
18
|
+
title: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
projectIds?: string[];
|
|
21
|
+
goalId?: string;
|
|
22
|
+
}): FocusDetail;
|
|
23
|
+
update(id: string, input: {
|
|
24
|
+
title?: string;
|
|
25
|
+
summary?: string;
|
|
26
|
+
projectIds?: string[];
|
|
27
|
+
}): FocusDetail | null;
|
|
28
|
+
setStatus(id: string, status: FocusStatus): Promise<FocusDetail | null>;
|
|
29
|
+
remove(id: string): Promise<boolean>;
|
|
30
|
+
configureMonitor(input: {
|
|
31
|
+
focusId: string;
|
|
32
|
+
kind: FocusMonitorKind;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
cadence?: FocusCadence;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
monitor: FocusMonitor;
|
|
37
|
+
initialRunId?: string;
|
|
38
|
+
}>;
|
|
39
|
+
runMonitorNow(focusId: string, kind: FocusMonitorKind): Promise<AutomationRun>;
|
|
40
|
+
reconcile(): Promise<void>;
|
|
41
|
+
private detail;
|
|
42
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { createFocus, createFocusActivity, deleteFocus, getFocus, getFocusMonitor, listAllFocusMonitors, listFocusMonitors, listFocuses, updateFocus, updateFocusMonitorRuntime, upsertFocusMonitor } from "./repository.js";
|
|
4
|
+
import { buildFocusMonitorInstruction } from "./prompts.js";
|
|
5
|
+
//#region src/focuses/service.ts
|
|
6
|
+
init_logger();
|
|
7
|
+
const log = createLogger("FocusService");
|
|
8
|
+
const DEFAULT_CADENCE = {
|
|
9
|
+
kind: "interval",
|
|
10
|
+
everyMs: 864e5
|
|
11
|
+
};
|
|
12
|
+
var FocusService = class {
|
|
13
|
+
constructor(automations) {
|
|
14
|
+
this.automations = automations;
|
|
15
|
+
}
|
|
16
|
+
list(statuses) {
|
|
17
|
+
return listFocuses({ statuses }).map((focus) => this.detail(focus));
|
|
18
|
+
}
|
|
19
|
+
get(id) {
|
|
20
|
+
const focus = getFocus(id);
|
|
21
|
+
return focus ? this.detail(focus) : null;
|
|
22
|
+
}
|
|
23
|
+
create(input) {
|
|
24
|
+
if (!input.title.trim()) throw new Error("Focus title is required");
|
|
25
|
+
const focus = createFocus(input);
|
|
26
|
+
return this.detail(focus);
|
|
27
|
+
}
|
|
28
|
+
update(id, input) {
|
|
29
|
+
if (input.title !== void 0 && !input.title.trim()) throw new Error("Focus title is required");
|
|
30
|
+
if (!updateFocus({
|
|
31
|
+
id,
|
|
32
|
+
...input
|
|
33
|
+
})) return null;
|
|
34
|
+
createFocusActivity({
|
|
35
|
+
focusId: id,
|
|
36
|
+
type: "updated",
|
|
37
|
+
summary: "Focus updated"
|
|
38
|
+
});
|
|
39
|
+
return this.get(id);
|
|
40
|
+
}
|
|
41
|
+
async setStatus(id, status) {
|
|
42
|
+
const focus = getFocus(id);
|
|
43
|
+
if (!focus) return null;
|
|
44
|
+
if (focus.status === status) return this.detail(focus);
|
|
45
|
+
const monitors = listFocusMonitors(id);
|
|
46
|
+
if (status === "active") for (const monitor of monitors.filter((item) => item.enabled && item.automationId)) await this.automations.resume(monitor.automationId);
|
|
47
|
+
else if (status === "paused") for (const monitor of monitors.filter((item) => item.enabled && item.automationId)) await this.automations.pause(monitor.automationId);
|
|
48
|
+
else for (const monitor of monitors.filter((item) => item.automationId)) {
|
|
49
|
+
await this.automations.remove(monitor.automationId);
|
|
50
|
+
upsertFocusMonitor({
|
|
51
|
+
focusId: id,
|
|
52
|
+
kind: monitor.kind,
|
|
53
|
+
enabled: false,
|
|
54
|
+
cadence: monitor.cadence,
|
|
55
|
+
automationId: null
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!updateFocus({
|
|
59
|
+
id,
|
|
60
|
+
status
|
|
61
|
+
})) return null;
|
|
62
|
+
const type = status === "active" ? "resumed" : status === "paused" ? "paused" : "completed";
|
|
63
|
+
createFocusActivity({
|
|
64
|
+
focusId: id,
|
|
65
|
+
type,
|
|
66
|
+
summary: `Focus ${type}`
|
|
67
|
+
});
|
|
68
|
+
return this.get(id);
|
|
69
|
+
}
|
|
70
|
+
async remove(id) {
|
|
71
|
+
if (!getFocus(id)) return false;
|
|
72
|
+
for (const monitor of listFocusMonitors(id).filter((item) => item.automationId)) await this.automations.remove(monitor.automationId);
|
|
73
|
+
return deleteFocus(id);
|
|
74
|
+
}
|
|
75
|
+
async configureMonitor(input) {
|
|
76
|
+
const focus = getFocus(input.focusId);
|
|
77
|
+
if (!focus) throw new Error("Focus not found");
|
|
78
|
+
if (focus.status !== "active") throw new Error("Only active focuses can enable monitoring");
|
|
79
|
+
const existing = getFocusMonitor(input.focusId, input.kind);
|
|
80
|
+
const cadence = input.cadence ?? existing?.cadence ?? DEFAULT_CADENCE;
|
|
81
|
+
if (cadence.kind !== "interval" || cadence.everyMs < 6e4) throw new Error("Invalid monitor cadence");
|
|
82
|
+
if (input.enabled && existing?.enabled && existing.cadence.everyMs === cadence.everyMs) return { monitor: existing };
|
|
83
|
+
if (!input.enabled) {
|
|
84
|
+
if (existing?.automationId) await this.automations.pause(existing.automationId);
|
|
85
|
+
const monitor = upsertFocusMonitor({
|
|
86
|
+
focusId: input.focusId,
|
|
87
|
+
kind: input.kind,
|
|
88
|
+
enabled: false,
|
|
89
|
+
cadence,
|
|
90
|
+
automationId: existing?.automationId
|
|
91
|
+
});
|
|
92
|
+
createFocusActivity({
|
|
93
|
+
focusId: input.focusId,
|
|
94
|
+
monitorId: monitor.id,
|
|
95
|
+
type: "monitor_disabled",
|
|
96
|
+
summary: `${input.kind} monitoring disabled`
|
|
97
|
+
});
|
|
98
|
+
return { monitor };
|
|
99
|
+
}
|
|
100
|
+
let monitor = upsertFocusMonitor({
|
|
101
|
+
focusId: input.focusId,
|
|
102
|
+
kind: input.kind,
|
|
103
|
+
enabled: true,
|
|
104
|
+
runState: "queued",
|
|
105
|
+
cadence,
|
|
106
|
+
automationId: existing?.automationId
|
|
107
|
+
});
|
|
108
|
+
try {
|
|
109
|
+
let automation;
|
|
110
|
+
if (existing?.automationId) if (existing.cadence.everyMs !== cadence.everyMs) automation = await this.automations.update(existing.automationId, { trigger: {
|
|
111
|
+
kind: "schedule",
|
|
112
|
+
schedule: {
|
|
113
|
+
kind: "interval",
|
|
114
|
+
everyMs: cadence.everyMs
|
|
115
|
+
}
|
|
116
|
+
} });
|
|
117
|
+
else automation = await this.automations.resume(existing.automationId);
|
|
118
|
+
else automation = await this.automations.create({
|
|
119
|
+
name: `Monitor: ${focus.title}`.slice(0, 200),
|
|
120
|
+
description: `${input.kind} monitor for a user-confirmed focus.`,
|
|
121
|
+
...focus.projectIds[0] ? { projectId: focus.projectIds[0] } : {},
|
|
122
|
+
trigger: {
|
|
123
|
+
kind: "schedule",
|
|
124
|
+
schedule: {
|
|
125
|
+
kind: "interval",
|
|
126
|
+
everyMs: cadence.everyMs
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
action: {
|
|
130
|
+
kind: "agent",
|
|
131
|
+
instruction: buildFocusMonitorInstruction(focus, input.kind),
|
|
132
|
+
timeoutSeconds: 300
|
|
133
|
+
},
|
|
134
|
+
safety: { mode: "suggest_only" },
|
|
135
|
+
afterRun: { kind: "none" },
|
|
136
|
+
reliability: {
|
|
137
|
+
timeoutSeconds: 300,
|
|
138
|
+
disableAfterConsecutiveFailures: 3
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
monitor = upsertFocusMonitor({
|
|
142
|
+
focusId: input.focusId,
|
|
143
|
+
kind: input.kind,
|
|
144
|
+
enabled: true,
|
|
145
|
+
runState: "queued",
|
|
146
|
+
cadence,
|
|
147
|
+
automationId: automation.id
|
|
148
|
+
});
|
|
149
|
+
createFocusActivity({
|
|
150
|
+
focusId: input.focusId,
|
|
151
|
+
monitorId: monitor.id,
|
|
152
|
+
type: "monitor_enabled",
|
|
153
|
+
summary: `${input.kind} monitoring enabled`
|
|
154
|
+
});
|
|
155
|
+
const run = await this.automations.runNow(automation.id);
|
|
156
|
+
monitor = updateFocusMonitorRuntime({
|
|
157
|
+
id: monitor.id,
|
|
158
|
+
runState: "running",
|
|
159
|
+
lastRunId: run.id,
|
|
160
|
+
nextRunAt: automation.state.nextRunAtMs ?? null
|
|
161
|
+
}) ?? monitor;
|
|
162
|
+
createFocusActivity({
|
|
163
|
+
focusId: input.focusId,
|
|
164
|
+
monitorId: monitor.id,
|
|
165
|
+
type: "run_started",
|
|
166
|
+
summary: "Initial monitor check started",
|
|
167
|
+
details: { runId: run.id }
|
|
168
|
+
});
|
|
169
|
+
return {
|
|
170
|
+
monitor,
|
|
171
|
+
initialRunId: run.id
|
|
172
|
+
};
|
|
173
|
+
} catch (err) {
|
|
174
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
175
|
+
updateFocusMonitorRuntime({
|
|
176
|
+
id: monitor.id,
|
|
177
|
+
runState: "failed",
|
|
178
|
+
error: errorMessage
|
|
179
|
+
});
|
|
180
|
+
log.error({
|
|
181
|
+
err,
|
|
182
|
+
focusId: input.focusId,
|
|
183
|
+
monitorKind: input.kind
|
|
184
|
+
}, `Focus monitor enable failed: ${errorMessage}`);
|
|
185
|
+
throw err;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async runMonitorNow(focusId, kind) {
|
|
189
|
+
const monitor = getFocusMonitor(focusId, kind);
|
|
190
|
+
if (!monitor?.enabled || !monitor.automationId) throw new Error("Monitor is not enabled");
|
|
191
|
+
updateFocusMonitorRuntime({
|
|
192
|
+
id: monitor.id,
|
|
193
|
+
runState: "queued",
|
|
194
|
+
error: null
|
|
195
|
+
});
|
|
196
|
+
const run = await this.automations.runNow(monitor.automationId);
|
|
197
|
+
updateFocusMonitorRuntime({
|
|
198
|
+
id: monitor.id,
|
|
199
|
+
runState: "running",
|
|
200
|
+
lastRunId: run.id
|
|
201
|
+
});
|
|
202
|
+
createFocusActivity({
|
|
203
|
+
focusId,
|
|
204
|
+
monitorId: monitor.id,
|
|
205
|
+
type: "run_started",
|
|
206
|
+
summary: "Monitor check started",
|
|
207
|
+
details: { runId: run.id }
|
|
208
|
+
});
|
|
209
|
+
return run;
|
|
210
|
+
}
|
|
211
|
+
async reconcile() {
|
|
212
|
+
for (const monitor of listAllFocusMonitors()) {
|
|
213
|
+
const focus = getFocus(monitor.focusId);
|
|
214
|
+
if (!focus) continue;
|
|
215
|
+
const automation = monitor.automationId ? await this.automations.get(monitor.automationId) : null;
|
|
216
|
+
if (monitor.enabled && focus.status === "active" && !automation) try {
|
|
217
|
+
await this.configureMonitor({
|
|
218
|
+
focusId: focus.id,
|
|
219
|
+
kind: monitor.kind,
|
|
220
|
+
enabled: true,
|
|
221
|
+
cadence: monitor.cadence
|
|
222
|
+
});
|
|
223
|
+
} catch (err) {
|
|
224
|
+
log.warn({
|
|
225
|
+
err,
|
|
226
|
+
focusId: focus.id,
|
|
227
|
+
monitorId: monitor.id
|
|
228
|
+
}, "Focus monitor reconciliation failed");
|
|
229
|
+
}
|
|
230
|
+
else if ((!monitor.enabled || focus.status !== "active") && automation?.enabled) await this.automations.pause(automation.id);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
detail(focus) {
|
|
234
|
+
return {
|
|
235
|
+
...focus,
|
|
236
|
+
monitors: listFocusMonitors(focus.id)
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
//#endregion
|
|
241
|
+
export { FocusService };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type FocusStatus = 'active' | 'paused' | 'completed';
|
|
2
|
+
export type FocusSource = 'user' | 'discovery';
|
|
3
|
+
export type FocusCandidateStatus = 'pending' | 'accepted' | 'dismissed';
|
|
4
|
+
export type FocusMonitorKind = 'progress' | 'external_changes';
|
|
5
|
+
export type FocusMonitorRunState = 'idle' | 'queued' | 'running' | 'failed';
|
|
6
|
+
export type FocusInsightStatus = 'unread' | 'dismissed' | 'approved';
|
|
7
|
+
export type FocusActivityType = 'created' | 'updated' | 'paused' | 'resumed' | 'completed' | 'monitor_enabled' | 'monitor_disabled' | 'run_started' | 'run_no_change' | 'run_failed' | 'insight_created' | 'insight_dismissed' | 'insight_approved';
|
|
8
|
+
export interface FocusEvidence {
|
|
9
|
+
label: string;
|
|
10
|
+
source?: string;
|
|
11
|
+
publishedAt?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FocusCandidate {
|
|
14
|
+
id: string;
|
|
15
|
+
canonicalKey: string;
|
|
16
|
+
title: string;
|
|
17
|
+
summary: string;
|
|
18
|
+
confidence: number;
|
|
19
|
+
evidence: FocusEvidence[];
|
|
20
|
+
projectIds: string[];
|
|
21
|
+
status: FocusCandidateStatus;
|
|
22
|
+
discoveredAt: number;
|
|
23
|
+
updatedAt: number;
|
|
24
|
+
}
|
|
25
|
+
export interface Focus {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
summary: string;
|
|
29
|
+
status: FocusStatus;
|
|
30
|
+
source: FocusSource;
|
|
31
|
+
sourceCandidateId?: string;
|
|
32
|
+
projectIds: string[];
|
|
33
|
+
goalId?: string;
|
|
34
|
+
createdAt: number;
|
|
35
|
+
updatedAt: number;
|
|
36
|
+
completedAt?: number;
|
|
37
|
+
lastActivityAt?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface FocusCadence {
|
|
40
|
+
kind: 'interval';
|
|
41
|
+
everyMs: number;
|
|
42
|
+
}
|
|
43
|
+
export interface FocusMonitor {
|
|
44
|
+
id: string;
|
|
45
|
+
focusId: string;
|
|
46
|
+
kind: FocusMonitorKind;
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
runState: FocusMonitorRunState;
|
|
49
|
+
cadence: FocusCadence;
|
|
50
|
+
automationId?: string;
|
|
51
|
+
lastRunId?: string;
|
|
52
|
+
lastRunAt?: number;
|
|
53
|
+
nextRunAt?: number;
|
|
54
|
+
lastMeaningfulResultAt?: number;
|
|
55
|
+
lastError?: string;
|
|
56
|
+
consecutiveFailures: number;
|
|
57
|
+
createdAt: number;
|
|
58
|
+
updatedAt: number;
|
|
59
|
+
}
|
|
60
|
+
export interface FocusActivity {
|
|
61
|
+
id: string;
|
|
62
|
+
focusId: string;
|
|
63
|
+
monitorId?: string;
|
|
64
|
+
type: FocusActivityType;
|
|
65
|
+
summary: string;
|
|
66
|
+
details: Record<string, unknown>;
|
|
67
|
+
createdAt: number;
|
|
68
|
+
}
|
|
69
|
+
export interface FocusInsight {
|
|
70
|
+
id: string;
|
|
71
|
+
focusId: string;
|
|
72
|
+
monitorId: string;
|
|
73
|
+
runId: string;
|
|
74
|
+
kind: FocusMonitorKind;
|
|
75
|
+
title: string;
|
|
76
|
+
summary: string;
|
|
77
|
+
whyItMatters: string;
|
|
78
|
+
nextAction: string;
|
|
79
|
+
evidence: FocusEvidence[];
|
|
80
|
+
status: FocusInsightStatus;
|
|
81
|
+
valueScore: number;
|
|
82
|
+
valueReasons: string[];
|
|
83
|
+
createdAt: number;
|
|
84
|
+
updatedAt: number;
|
|
85
|
+
}
|
|
86
|
+
export interface FocusDetail extends Focus {
|
|
87
|
+
monitors: FocusMonitor[];
|
|
88
|
+
latestInsight?: FocusInsight;
|
|
89
|
+
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Built-in agent tool `name` values for gateway admin UI (disable toggles).
|
|
3
3
|
* Extension tools are not listed; users can still add arbitrary strings in config.
|
|
4
4
|
*/
|
|
5
|
-
export declare const GATEWAY_BUILTIN_TOOL_IDS: readonly ["code_search", "code_read_symbol", "code_trace", "code_impact", "code_architecture", "read_file", "write_file", "apply_patch", "list_dir", "grep", "find", "exec_command", "update_plan", "session_status", "dreaming", "tool_manual", "clarify", "todo", "skills_list", "skill_view", "skill_manage", "web_search", "web_fetch", "web_extract", "send_message", "send_media", "read_media", "create_share", "text_to_speech", "memory_search", "memory_get", "curated_memory", "session_search", "automation", "workflow", "delegate_task", "execute_code", "image", "image_generate", "create_desktop_pet", "browser_use", "extensions", "bundle-mcp"];
|
|
5
|
+
export declare const GATEWAY_BUILTIN_TOOL_IDS: readonly ["code_search", "code_read_symbol", "code_trace", "code_impact", "code_architecture", "read_file", "write_file", "apply_patch", "list_dir", "grep", "find", "exec_command", "update_plan", "session_status", "dreaming", "tool_manual", "clarify", "todo", "skills_list", "skill_view", "skill_manage", "skills_marketplace_search", "skill_install", "web_search", "web_fetch", "web_extract", "send_message", "send_media", "read_media", "create_share", "text_to_speech", "memory_search", "memory_get", "curated_memory", "session_search", "automation", "workflow", "delegate_task", "execute_code", "image", "image_generate", "create_desktop_pet", "browser_use", "extensions", "bundle-mcp"];
|
|
6
6
|
export type GatewayBuiltinToolId = (typeof GATEWAY_BUILTIN_TOOL_IDS)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
|
+
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
3
3
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
4
|
import { WORKSPACE_FILES, init_paths, resolveUserProfilePath } from "../config/paths.js";
|
|
5
5
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { effectiveWorkspacePathForSession } from "../../../session/session-workspace.js";
|
|
2
2
|
import { getProjectForSession } from "../../../projects/workspace.js";
|
|
3
|
+
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
4
|
+
import "../../../agent/skills/skills-marketplace.js";
|
|
3
5
|
import { isSkillInstallTarget } from "../../../agent/skills/install-target.js";
|
|
4
6
|
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
5
|
-
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
6
7
|
import { buildReviewContext, resolveGitRoot } from "../../../review/review-git.js";
|
|
7
8
|
import "../../../chat-commands/index.js";
|
|
8
|
-
import "../../../agent/skills/skills-marketplace.js";
|
|
9
9
|
//#region src/gateway/hono/routes/commands-skills.ts
|
|
10
10
|
function parseMarketplaceProviderQuery(raw) {
|
|
11
11
|
const v = raw?.trim().toLowerCase();
|