@xopcai/xopc 0.0.174 → 0.0.175
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-CyEDJeIt.js → activity-store-CM6mQUS2.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DF7Bol6I.js → agent-avatar-dicebear-eckyE9AY.js} +1 -1
- package/dist/gateway/static/root/assets/agents-D-OIB_r0.js +2 -0
- package/dist/gateway/static/root/assets/{api-DwyUxpgY.js → api-2SLLStKp.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DYunqroX.js → api-BfMRS6FX.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B4xJyvDu.js → app-management-settings-panel-DYkzZQzZ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B2PQxRiu.js → appearance-settings-CDXXN57j.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CuvFyvuu.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DWhBmmjD.js → archive-plugin-k909a76t.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BOpZfa_I.js → attachment-load-CqNzyhdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Byu3I7Rs.js → automation-suggestion-card-snNG6u0v.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-DetGVTjI.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-6AG1qatz.js → binary-plugins-PfQ9ZHDF.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CJhrn98_.js → block-editor-Xrw-DnE_.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-G92AdEnX.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CBVb4mt9.js → browser-workflow-inputs-DJPF2lUY.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq4XUKbu.js → browser-workflows-page-BoXs4pgc.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-nS_AMN1K.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-hbW4NAKO.js → capability-presets-api-BgY-Ysmi.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DIO8ZNHW.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CzMjHb17.js → channel-recipient-api-D32T1EJM.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-4Im3vtnO.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-CMctpuqb.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B9Au6gMZ.js → connector-logo-C-l8haIK.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-vL3SjHSc.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-CwOI_Hei.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CNff5TFb.js → desktop-pet-settings-Cldo_pA3.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Bf956uo-.js → directory-picker-path-field-CMASXbgJ.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CHM8FE1g.js → dreaming-settings-BnMx02w0.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-ZqM_0eUs.js → extension-debug-page-mUFs3ign.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D4hvXOMM.js → extension-page-BsFBOZ5N.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-GsqxaJjA.js → extension-settings-page-CTEoovnV.js} +1 -1
- package/dist/gateway/static/root/assets/{focus-detail-page-CE6uwrl1.js → focus-detail-page-CCaZthpU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B4THmgnS.js → gateway-config-api-Bwx-EetD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CPv-MxGE.js → gateway-settings-CvgyqhR_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-MP3K71pP.js → gateway-startup-retry-C8f5KwkT.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Bhynl9LN.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-ChS2rU0w.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DCcDuIjG.js → goals-config-api-CUnfbgHa.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BAS_liXl.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-o9QMXvNq.js → goals-settings-Bkk-tOcf.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DixwpXnH.js → heartbeat-settings-D9Pldf5E.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BOGH9FGi.js → image-generation-api-D7aCMgOv.js} +1 -1
- package/dist/gateway/static/root/assets/index-DJ5vdaHk.css +1 -0
- package/dist/gateway/static/root/assets/{index-eyttVNS_.js → index-TnouSpay.js} +7 -7
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D4o4ZPF6.js → keyboard-shortcuts-settings-CBhtXhHb.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-HQeu_F1C.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-GzMmpO7G.js → local-apps-page-BtJGF3M8.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CAuhEGCn.js → locale-store-DO-u1yS7.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-0lvwfLAA.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CIX8D1pv.js → markdown-split-BGPaeTch.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bp3eIA45.js → media-plugins-C_Cx8v6u.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BiBdO1-O.js → messages-BP8aQX-5.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-RVFiYAoO.js → notes-page-CIYy5BKF.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-_FgNPlOx.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BGAYH3Ef.js → page-tabs-C2vsdfJO.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BM6pDkHp.js → preview-open-alternatives-D_VT83bW.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BiMetEmn.js → product-open-page-BNP9kZ3Q.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-MNi-3mZU.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-xx8nUKZO.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-H5DSn2bR.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BdjV8MK5.js → save-bar-controls-BJL6Xb-F.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-ChlqXU46.js → schedule-field-CxCPSLbu.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DDKf5ZSH.js → schema-form-Cao1wGbk.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CMQsupwM.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-OBUdG6bV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CPG0KGVs.js → settings-form-section-9pgClEud.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DRSDHucM.js → settings-loading-skeleton-CQz0gEUK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CeB7_xD0.js → settings-page-DgsMzZLm.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BENrkwd0.js → settings-page-layout-BhqupMfG.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B7BsWxJt.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DIzczJkG.js → share-preview-page-CC4dQsQN.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bhz21P05.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CBP-UB88.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-A0rNObNB.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-CF4AYPQg.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Dp4d5Q1B.js → system-settings-panel-CzZHWI4u.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CbGc1laW.js → theme-store-BZWNdSZC.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-BC922Mdg.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DwPk3OPL.js → typed-models-lib-C1S-B1pk.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CXrEu2dw.js → use-channel-catalog-DTiLxcLF.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-8XdpiAyP.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DFoA79LB.js → voice-api-key-field-CtIYRNfI.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-DBer86NF.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-BUPyfYaq.js +1 -0
- package/dist/gateway/static/root/assets/work-page-G8phwwI1.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BuniGPO0.js → workflow-run-setup-panel-IKxqDAXw.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CNls7g6v.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.d.ts +2 -0
- package/dist/src/agent/skills/index.js +14 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/automations/domain/defaults.d.ts +1 -0
- package/dist/src/automations/domain/defaults.js +4 -0
- package/dist/src/automations/domain/index.d.ts +1 -0
- package/dist/src/automations/domain/index.js +2 -1
- package/dist/src/automations/index.js +2 -1
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +16 -3
- package/dist/src/gateway/hono/routes/home.js +98 -25
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/project-skills.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-skills.js +119 -0
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.js +2 -1
- package/dist/src/projects/project-skill-service.d.ts +67 -0
- package/dist/src/projects/project-skill-service.js +131 -0
- package/dist/src/storage/sqlite/home-attention-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/home-attention-repository.js +21 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/067_home_attention_acknowledgements.sql +9 -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/storage/sqlite/schema.sql +10 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +0 -2
- package/dist/gateway/static/root/assets/index-CfXiRNN5.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +0 -7
- package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BhgCeDuO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +0 -11
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>XOPC — Turn goals into loops. Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-TnouSpay.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/circle-alert-BEjgurr2.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-BP8aQX-5.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-DO-u1yS7.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-BTRT9kCS.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
37
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-C8f5KwkT.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-CM6mQUS2.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-BZWNdSZC.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DJ5vdaHk.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
|
40
40
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -17,8 +17,8 @@ import { clearBootstrapSnapshot } from "./bootstrap/bootstrap-cache.js";
|
|
|
17
17
|
import { resolveBootstrapContextSync } from "./bootstrap/bootstrap-files.js";
|
|
18
18
|
import { loadProjectAgentsContextFile } from "./bootstrap/project-agents-context.js";
|
|
19
19
|
import { createSkillConfigManager, isSkillEnabled, resolveSkillConfig } from "./skills/config.js";
|
|
20
|
-
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
21
20
|
import { isValidSkillEnvVarName } from "./skills/required-env-vars.js";
|
|
21
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
22
22
|
import { loadSkillsLock } from "./skills/hub-lock.js";
|
|
23
23
|
import { isUnderManagedSkillsDir } from "./skills/managed-store.js";
|
|
24
24
|
import { isMemorySubsystemEnabled, shouldRegisterCuratedMemoryTool } from "./memory/memory-config.js";
|
|
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
|
|
4
4
|
import { XopcStdioClientTransport } from "./mcp-stdio-transport.js";
|
|
5
5
|
import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
|
|
6
|
+
import { fetch } from "undici";
|
|
6
7
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
7
8
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
8
|
-
import { fetch } from "undici";
|
|
9
9
|
//#region src/agent/mcp/mcp-transport.ts
|
|
10
10
|
init_logger();
|
|
11
11
|
init_string_coerce();
|
|
@@ -12,6 +12,7 @@ import { getProjectForSession } from "../projects/workspace.js";
|
|
|
12
12
|
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
13
13
|
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
14
14
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
15
|
+
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
15
16
|
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
16
17
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
17
18
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
@@ -63,7 +64,6 @@ import "./workflow/index.js";
|
|
|
63
64
|
import { FeedbackCoordinator } from "./feedback/feedback-coordinator.js";
|
|
64
65
|
import "./feedback/index.js";
|
|
65
66
|
import { PersistentGoalService } from "./goals/persistent-goal-service.js";
|
|
66
|
-
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
67
67
|
import { existsSync, readFileSync } from "node:fs";
|
|
68
68
|
import { readFile } from "node:fs/promises";
|
|
69
69
|
//#region src/agent/service.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
2
|
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
3
|
+
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
3
4
|
import { getSkillsLockEntry, recordSkillsHubInstall } from "./hub-lock.js";
|
|
4
5
|
import { installSkillFromZip, isIgnorableZipEntry, isValidSkillId, prepareManagedSkillTempDir, promoteManagedSkillTempDir } from "./managed-store.js";
|
|
5
|
-
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { basename, dirname, join, normalize, resolve, sep } from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -5,6 +5,8 @@ export declare function loadSkills(options: {
|
|
|
5
5
|
builtinDir?: string;
|
|
6
6
|
extraDirs?: string[];
|
|
7
7
|
}): LoadSkillsResult;
|
|
8
|
+
/** Discover only skills owned by a workspace, without global or bundled skills. */
|
|
9
|
+
export declare function loadWorkspaceSkills(workspaceDir: string): LoadSkillsResult;
|
|
8
10
|
export interface SkillLoader {
|
|
9
11
|
init: (workspace: string, builtin: string | null) => LoadSkillsResult;
|
|
10
12
|
load: () => LoadSkillsResult;
|
|
@@ -5,12 +5,12 @@ import { init_paths } from "../../config/paths.js";
|
|
|
5
5
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
6
6
|
import { findInstallSpec, getDefaultInstallerPreferences, hasBinary, installSkill } from "./installer.js";
|
|
7
7
|
import { applySkillEnvOverrides, createSkillConfigManager, getSkillEnvironment, isSkillEnabled, resolveSkillConfig, validateSkillConfig } from "./config.js";
|
|
8
|
-
import { collectSkillInstallWarnings, formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
9
|
-
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
10
8
|
import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
9
|
+
import { formatSkillsForPrompt } from "./format-skills-prompt.js";
|
|
11
10
|
import { parseRequiredEnvVarNames } from "./required-env-vars.js";
|
|
12
11
|
import { parseSkillMetadata } from "./parse-skill-metadata.js";
|
|
13
|
-
import {
|
|
12
|
+
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
13
|
+
import { collectSkillInstallWarnings, formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
14
14
|
import { SkillTestFramework, SkillTestRunner, formatTestResults, formatTestResultsJson, formatTestResultsTap } from "./test-framework.js";
|
|
15
15
|
import { basename, dirname, join, relative, sep } from "path";
|
|
16
16
|
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
@@ -193,7 +193,7 @@ function loadSkills(options) {
|
|
|
193
193
|
for (const skill of discovered.skills) skillMap.set(skill.name, skill);
|
|
194
194
|
}
|
|
195
195
|
if (workspaceDir) {
|
|
196
|
-
const discovered =
|
|
196
|
+
const discovered = loadWorkspaceSkills(workspaceDir);
|
|
197
197
|
diagnostics.push(...discovered.diagnostics);
|
|
198
198
|
const workspaceSkills = discovered.skills;
|
|
199
199
|
for (const skill of workspaceSkills) skillMap.set(skill.name, skill);
|
|
@@ -211,6 +211,15 @@ function loadSkills(options) {
|
|
|
211
211
|
diagnostics
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
+
/** Discover only skills owned by a workspace, without global or bundled skills. */
|
|
215
|
+
function loadWorkspaceSkills(workspaceDir) {
|
|
216
|
+
const discovered = discoverSkills(resolveWorkspaceSkillsDir(workspaceDir), "workspace");
|
|
217
|
+
return {
|
|
218
|
+
skills: discovered.skills,
|
|
219
|
+
prompt: formatSkillsForPrompt(discovered.skills),
|
|
220
|
+
diagnostics: discovered.diagnostics
|
|
221
|
+
};
|
|
222
|
+
}
|
|
214
223
|
function createSkillLoader() {
|
|
215
224
|
let cachedSkills = [];
|
|
216
225
|
let cachedPrompt = "";
|
|
@@ -270,4 +279,4 @@ function createSkillLoader() {
|
|
|
270
279
|
};
|
|
271
280
|
}
|
|
272
281
|
//#endregion
|
|
273
|
-
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getDefaultInstallerPreferences, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills, resolveSkillConfig, scanSkillDirectory, validateSkillConfig };
|
|
282
|
+
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getDefaultInstallerPreferences, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills, loadWorkspaceSkills, resolveSkillConfig, scanSkillDirectory, validateSkillConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
2
1
|
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
2
|
+
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/agent/skills/marketplace/adapters/store/store-api-client.ts
|
|
5
5
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
2
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
3
3
|
import { fuzzyFindText, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings } from "../tools/edit-diff.js";
|
|
4
|
-
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
4
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
5
|
+
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
6
6
|
import { join, resolve, sep } from "path";
|
|
7
7
|
import { existsSync, realpathSync } from "fs";
|
|
8
8
|
import { mkdir, writeFile } from "fs/promises";
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
4
4
|
import { hasBinary } from "./installer.js";
|
|
5
|
-
import { scanSkillDirectory } from "./scanner.js";
|
|
6
5
|
import { parseSkillMetadata } from "./parse-skill-metadata.js";
|
|
6
|
+
import { scanSkillDirectory } from "./scanner.js";
|
|
7
7
|
import { basename, join, relative } from "path";
|
|
8
8
|
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
9
9
|
//#region src/agent/skills/test-framework.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_AUTOMATION_TIMEOUT_SECONDS = 300;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_AUTOMATION_TIMEOUT_SECONDS } from "./defaults.js";
|
|
1
2
|
import { computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, timerDelayUntil } from "./schedule.js";
|
|
2
3
|
import { AutomationActionSchema, AutomationAfterRunSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema } from "./validation.js";
|
|
3
|
-
export { AutomationActionSchema, AutomationAfterRunSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, timerDelayUntil };
|
|
4
|
+
export { AutomationActionSchema, AutomationAfterRunSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, DEFAULT_AUTOMATION_TIMEOUT_SECONDS, UpdateAutomationSchema, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, timerDelayUntil };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { onAutomationProductEvent, publishAutomationProductEvent } from "./product-events.js";
|
|
2
|
+
import { DEFAULT_AUTOMATION_TIMEOUT_SECONDS } from "./domain/defaults.js";
|
|
2
3
|
import { computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, timerDelayUntil } from "./domain/schedule.js";
|
|
3
4
|
import { AutomationActionSchema, AutomationAfterRunSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema } from "./domain/validation.js";
|
|
4
5
|
import "./domain/index.js";
|
|
5
6
|
import { AutomationActionExecutor } from "./service/action-executor.js";
|
|
6
7
|
import { AutomationAlreadyRunningError, AutomationService } from "./service/automation-service.js";
|
|
7
8
|
import "./service/index.js";
|
|
8
|
-
export { AutomationActionExecutor, AutomationActionSchema, AutomationAfterRunSchema, AutomationAlreadyRunningError, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationService, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, onAutomationProductEvent, publishAutomationProductEvent, timerDelayUntil };
|
|
9
|
+
export { AutomationActionExecutor, AutomationActionSchema, AutomationAfterRunSchema, AutomationAlreadyRunningError, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationService, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, DEFAULT_AUTOMATION_TIMEOUT_SECONDS, UpdateAutomationSchema, computeNextAutomationRunAtMs, computeNextScheduleRunAtMs, onAutomationProductEvent, publishAutomationProductEvent, timerDelayUntil };
|
|
@@ -2,13 +2,13 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_agent_scope, normalizeAgentId } from "../../agent/agent-scope.js";
|
|
4
4
|
import { buildSessionKey, init_session_key } from "../../routing/session-key.js";
|
|
5
|
+
import "../domain/defaults.js";
|
|
5
6
|
import crypto from "node:crypto";
|
|
6
7
|
//#region src/automations/service/action-executor.ts
|
|
7
8
|
init_agent_scope();
|
|
8
9
|
init_session_key();
|
|
9
10
|
init_logger();
|
|
10
11
|
const log = createLogger("Automation:ActionExecutor");
|
|
11
|
-
const DEFAULT_TIMEOUT_MS = 18e4;
|
|
12
12
|
function withTimeout(promise, timeoutMs, signal) {
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
14
|
if (signal.aborted) {
|
|
@@ -41,7 +41,7 @@ var AutomationActionExecutor = class {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
async execute(automation, run, signal) {
|
|
44
|
-
const timeoutMs = (automation.action.timeoutSeconds ?? automation.reliability?.timeoutSeconds ?? 0) > 0 ? (automation.action.timeoutSeconds ?? automation.reliability?.timeoutSeconds) * 1e3 :
|
|
44
|
+
const timeoutMs = (automation.action.timeoutSeconds ?? automation.reliability?.timeoutSeconds ?? 0) > 0 ? (automation.action.timeoutSeconds ?? automation.reliability?.timeoutSeconds) * 1e3 : 300 * 1e3;
|
|
45
45
|
return withTimeout(this.executeWithoutTimeout(automation, run, signal), timeoutMs, signal).catch((err) => {
|
|
46
46
|
const message = err instanceof Error ? err.message : String(err);
|
|
47
47
|
return {
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v67).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
4
|
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
|
+
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
@@ -3,8 +3,8 @@ import { init_paths, resolveBundledSkillsDir, resolveSkillsLockPath } from "../.
|
|
|
3
3
|
import { findInstallSpec, getDefaultInstallerPreferences, hasBinary, installSkill } from "../../agent/skills/installer.js";
|
|
4
4
|
import { createSkillConfigManager, isSkillEnabled } from "../../agent/skills/config.js";
|
|
5
5
|
import { formatScanSummary, scanSkillDirectory } from "../../agent/skills/scanner.js";
|
|
6
|
-
import { loadSkillsLock } from "../../agent/skills/hub-lock.js";
|
|
7
6
|
import { createSkillLoader } from "../../agent/skills/index.js";
|
|
7
|
+
import { loadSkillsLock } from "../../agent/skills/hub-lock.js";
|
|
8
8
|
import { pullSkillFromSource, updateSkillFromLock } from "../../agent/skills/hub-pull.js";
|
|
9
9
|
import { register } from "../registry.js";
|
|
10
10
|
import { createSkillsTestCommand } from "./skills-test.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
1
2
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
3
|
import "../agent-manifest/index.js";
|
|
3
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
4
4
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
//#region src/config/agent-profile.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
+
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.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,7 +1,19 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
+
import { type HomeAttentionSubjectKind } from '../../../storage/sqlite/index.js';
|
|
2
3
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
-
type HomeDecisionKind = 'work_item' | 'goal' | '
|
|
4
|
-
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | '
|
|
4
|
+
type HomeDecisionKind = 'work_item' | 'goal' | 'connector_approval' | 'goal_evidence';
|
|
5
|
+
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | 'approval_required';
|
|
6
|
+
type HomeAttention = {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: HomeAttentionSubjectKind;
|
|
9
|
+
runId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
detail: string;
|
|
12
|
+
reason: 'run_failed' | 'run_timeout';
|
|
13
|
+
href: string;
|
|
14
|
+
updatedAt: number;
|
|
15
|
+
sessionKey?: string;
|
|
16
|
+
};
|
|
5
17
|
type HomeDecision = {
|
|
6
18
|
id: string;
|
|
7
19
|
kind: HomeDecisionKind;
|
|
@@ -39,6 +51,7 @@ type HomeAutomation = {
|
|
|
39
51
|
export declare function buildHomeBriefing(input: {
|
|
40
52
|
locale?: string;
|
|
41
53
|
decisions: HomeDecision[];
|
|
54
|
+
attention: HomeAttention[];
|
|
42
55
|
activeWorkCount: number;
|
|
43
56
|
activeWorkflowCount: number;
|
|
44
57
|
activeGoalCount: number;
|
|
@@ -68,7 +81,7 @@ export declare function buildHomeBriefing(input: {
|
|
|
68
81
|
* - recentSessions: last 5 active AI sessions (threads)
|
|
69
82
|
* - activeAgent: default agent identity for this gateway
|
|
70
83
|
* - gateway: readiness + public tunnel status
|
|
71
|
-
* - workflowRuns: active
|
|
84
|
+
* - workflowRuns: active and recent workflow runs
|
|
72
85
|
* - upcomingAutomations: upcoming enabled automations
|
|
73
86
|
* - recentAutomationRuns: latest automation executions
|
|
74
87
|
*/
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { acknowledgeHomeAttention, isHomeAttentionAcknowledged } from "../../../storage/sqlite/home-attention-repository.js";
|
|
1
2
|
import { decideConnectorApproval, listConnectorApprovals } from "../../../storage/sqlite/connector-repository.js";
|
|
2
3
|
import "../../../storage/sqlite/index.js";
|
|
3
4
|
import { GoalService } from "../../../goals/goal-service.js";
|
|
4
5
|
import "../../../goals/index.js";
|
|
6
|
+
import "../../../automations/domain/defaults.js";
|
|
7
|
+
import "../../../automations/index.js";
|
|
5
8
|
import { listGatewayAgents } from "../../agents-admin.js";
|
|
6
9
|
import { WorkItemService } from "../../../work-items/work-item-service.js";
|
|
7
10
|
import "../../../work-items/index.js";
|
|
@@ -83,6 +86,19 @@ function toHomeAutomationRun(run) {
|
|
|
83
86
|
workflowRunId: run.workflowRunId
|
|
84
87
|
};
|
|
85
88
|
}
|
|
89
|
+
function effectiveAutomationTimeoutSeconds(run, automation) {
|
|
90
|
+
return run.actionSnapshot.timeoutSeconds ?? automation?.reliability?.timeoutSeconds ?? 300;
|
|
91
|
+
}
|
|
92
|
+
function attentionDetail(kind, status, locale, timeoutSeconds) {
|
|
93
|
+
const isChinese = locale?.toLowerCase().startsWith("zh") ?? false;
|
|
94
|
+
if (status === "timeout") {
|
|
95
|
+
const seconds = timeoutSeconds ?? 300;
|
|
96
|
+
const duration = seconds % 60 === 0 ? `${seconds / 60} ${isChinese ? "分钟" : seconds === 60 ? "minute" : "minutes"}` : `${seconds} ${isChinese ? "秒" : seconds === 1 ? "second" : "seconds"}`;
|
|
97
|
+
return isChinese ? `运行超过 ${duration},系统已停止本次执行。` : `The run exceeded ${duration} and was stopped.`;
|
|
98
|
+
}
|
|
99
|
+
if (isChinese) return kind === "automation_run" ? "自动化未能完成,请查看详情后重试。" : "工作流未能完成,请查看详情后重试。";
|
|
100
|
+
return kind === "automation_run" ? "The automation did not complete. Review the details and retry." : "The workflow did not complete. Review the details and retry.";
|
|
101
|
+
}
|
|
86
102
|
function decisionFromGoal(goal, projectName) {
|
|
87
103
|
if (goal.status !== "needs_input" && goal.status !== "blocked") return null;
|
|
88
104
|
return {
|
|
@@ -124,7 +140,8 @@ function decisionFromWorkItem(item, projectName, nowMs) {
|
|
|
124
140
|
function buildHomeBriefing(input) {
|
|
125
141
|
const isChinese = input.locale?.toLowerCase().startsWith("zh") ?? false;
|
|
126
142
|
const movingCount = input.activeWorkCount + input.activeWorkflowCount + input.activeGoalCount;
|
|
127
|
-
const
|
|
143
|
+
const attentionCount = input.decisions.length + input.attention.length;
|
|
144
|
+
const summary = attentionCount > 0 ? isChinese ? movingCount > 0 ? `有 ${attentionCount} 件事需要你处理;我正在继续推进 ${movingCount} 件工作。` : `有 ${attentionCount} 件事需要你处理。` : movingCount > 0 ? `${attentionCount} ${attentionCount === 1 ? "item needs" : "items need"} your attention; I’m continuing ${movingCount} in the background.` : `${attentionCount} ${attentionCount === 1 ? "item needs" : "items need"} your attention.` : movingCount > 0 ? isChinese ? `目前没有事情需要你处理;我正在继续推进 ${movingCount} 件工作。` : `Nothing needs you right now; I’m continuing ${movingCount} ${movingCount === 1 ? "item" : "items"} in the background.` : isChinese ? "今天还没有正在推进的事项。把想要的结果交给我,我会从这里开始。" : "Nothing is moving yet today. Hand me an outcome and I’ll take it from here.";
|
|
128
145
|
return {
|
|
129
146
|
generatedAt: input.nowMs,
|
|
130
147
|
summary,
|
|
@@ -149,7 +166,7 @@ function buildHomeBriefing(input) {
|
|
|
149
166
|
* - recentSessions: last 5 active AI sessions (threads)
|
|
150
167
|
* - activeAgent: default agent identity for this gateway
|
|
151
168
|
* - gateway: readiness + public tunnel status
|
|
152
|
-
* - workflowRuns: active
|
|
169
|
+
* - workflowRuns: active and recent workflow runs
|
|
153
170
|
* - upcomingAutomations: upcoming enabled automations
|
|
154
171
|
* - recentAutomationRuns: latest automation executions
|
|
155
172
|
*/
|
|
@@ -222,33 +239,14 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
222
239
|
const currentWorkItems = activeWorkItems.slice(0, 30).map((item) => toHomeWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project"));
|
|
223
240
|
const recentlyCompletedWorkItems = allWorkItems.items.filter((item) => item.status === "done").sort((left, right) => (right.completedAt ?? right.updatedAt) - (left.completedAt ?? left.updatedAt)).slice(0, 8).map((item) => toHomeWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project"));
|
|
224
241
|
const activeWorkflowRuns = workflowRuns.filter((run) => run.status === "queued" || run.status === "running").slice(0, 5).map(toHomeWorkflowRun);
|
|
225
|
-
const
|
|
242
|
+
const failedWorkflowRuns = workflowRuns.filter((run) => run.status === "failed" || run.status === "timeout").slice(0, 5).map(toHomeWorkflowRun);
|
|
226
243
|
const recentWorkflowRuns = workflowRuns.slice(0, 5).map(toHomeWorkflowRun);
|
|
227
244
|
const upcomingAutomations = automations.map(toHomeAutomation).filter((automation) => Boolean(automation)).sort((a, b) => Date.parse(a.nextRunAt) - Date.parse(b.nextRunAt)).slice(0, 5);
|
|
228
245
|
const latestAutomationRuns = [...automationRuns].sort((left, right) => right.createdAtMs - left.createdAtMs).filter((run, index, all) => all.findIndex((candidate) => candidate.automationId === run.automationId) === index);
|
|
246
|
+
const automationsById = new Map(automations.map((automation) => [automation.id, automation]));
|
|
229
247
|
const decisions = [
|
|
230
248
|
...activeWorkItems.map((item) => decisionFromWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project", nowMs)).filter((item) => Boolean(item)),
|
|
231
249
|
...activeGoals.map((goal) => decisionFromGoal(goal, goal.projectId ? projectsById.get(goal.projectId)?.name : void 0)).filter((item) => Boolean(item)),
|
|
232
|
-
...attentionWorkflowRuns.map((run) => ({
|
|
233
|
-
id: `workflow:${run.id}`,
|
|
234
|
-
kind: "workflow_run",
|
|
235
|
-
title: run.title,
|
|
236
|
-
detail: run.status,
|
|
237
|
-
reason: "run_failed",
|
|
238
|
-
urgency: "now",
|
|
239
|
-
href: `/workflows?runId=${encodeURIComponent(run.id)}`,
|
|
240
|
-
updatedAt: run.completedAtMs ?? run.startedAtMs ?? run.createdAtMs
|
|
241
|
-
})),
|
|
242
|
-
...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").map((run) => ({
|
|
243
|
-
id: `automation:${run.id}`,
|
|
244
|
-
kind: "automation_run",
|
|
245
|
-
title: run.automationName || run.automationId,
|
|
246
|
-
detail: run.error || run.summary,
|
|
247
|
-
reason: "run_failed",
|
|
248
|
-
urgency: "now",
|
|
249
|
-
href: "/automations",
|
|
250
|
-
updatedAt: run.endedAtMs ?? run.startedAtMs ?? run.createdAtMs
|
|
251
|
-
})),
|
|
252
250
|
...connectorApprovals.filter((approval) => Date.parse(approval.expiresAt) > nowMs).map((approval) => ({
|
|
253
251
|
id: `connector-approval:${approval.id}`,
|
|
254
252
|
kind: "connector_approval",
|
|
@@ -283,6 +281,28 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
283
281
|
].sort((left, right) => {
|
|
284
282
|
return (left.urgency === "now" ? 0 : 1) - (right.urgency === "now" ? 0 : 1) || right.updatedAt - left.updatedAt;
|
|
285
283
|
}).slice(0, 20);
|
|
284
|
+
const locale = c.req.query("locale");
|
|
285
|
+
const attention = [...failedWorkflowRuns.filter((run) => !isHomeAttentionAcknowledged("workflow_run", run.id)).map((run) => ({
|
|
286
|
+
id: `workflow_run:${run.id}`,
|
|
287
|
+
kind: "workflow_run",
|
|
288
|
+
runId: run.id,
|
|
289
|
+
title: run.title,
|
|
290
|
+
detail: attentionDetail("workflow_run", run.status === "timeout" ? "timeout" : "failed", locale),
|
|
291
|
+
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
292
|
+
href: `/workflows?runId=${encodeURIComponent(run.id)}`,
|
|
293
|
+
updatedAt: run.completedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
294
|
+
sessionKey: run.sessionKey
|
|
295
|
+
})), ...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").filter((run) => !isHomeAttentionAcknowledged("automation_run", run.id)).map((run) => ({
|
|
296
|
+
id: `automation_run:${run.id}`,
|
|
297
|
+
kind: "automation_run",
|
|
298
|
+
runId: run.id,
|
|
299
|
+
title: run.automationName || run.automationId,
|
|
300
|
+
detail: attentionDetail("automation_run", run.status === "timeout" ? "timeout" : "failed", locale, effectiveAutomationTimeoutSeconds(run, automationsById.get(run.automationId))),
|
|
301
|
+
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
302
|
+
href: `/automations?run=${encodeURIComponent(run.id)}`,
|
|
303
|
+
updatedAt: run.endedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
304
|
+
sessionKey: run.sessionKey
|
|
305
|
+
}))].sort((left, right) => right.updatedAt - left.updatedAt).slice(0, 10);
|
|
286
306
|
const wins = [
|
|
287
307
|
...recentlyCompletedWorkItems.map((item) => ({
|
|
288
308
|
id: `work:${item.id}`,
|
|
@@ -307,8 +327,9 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
307
327
|
}))
|
|
308
328
|
].sort((left, right) => right.completedAt - left.completedAt);
|
|
309
329
|
const briefing = buildHomeBriefing({
|
|
310
|
-
locale
|
|
330
|
+
locale,
|
|
311
331
|
decisions,
|
|
332
|
+
attention,
|
|
312
333
|
activeWorkCount: activeWorkItems.filter((item) => item.status === "in_progress").length,
|
|
313
334
|
activeWorkflowCount: activeWorkflowRuns.length,
|
|
314
335
|
activeGoalCount: activeGoals.filter((goal) => goal.status === "active").length,
|
|
@@ -341,11 +362,11 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
341
362
|
},
|
|
342
363
|
workflowRuns: {
|
|
343
364
|
active: activeWorkflowRuns,
|
|
344
|
-
attention: attentionWorkflowRuns,
|
|
345
365
|
recent: recentWorkflowRuns
|
|
346
366
|
},
|
|
347
367
|
briefing,
|
|
348
368
|
decisions,
|
|
369
|
+
attention,
|
|
349
370
|
chats: {
|
|
350
371
|
running: workChats.filter((chat) => chat.active),
|
|
351
372
|
recent: workChats.filter((chat) => !chat.active).slice(0, 8)
|
|
@@ -412,6 +433,58 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
412
433
|
error: "Unsupported decision kind"
|
|
413
434
|
}, 400);
|
|
414
435
|
});
|
|
436
|
+
authenticated.post("/api/home/attention/acknowledge", deps.strictRateLimitMiddleware, async (c) => {
|
|
437
|
+
const body = await c.req.json().catch(() => ({}));
|
|
438
|
+
const kind = body.kind === "automation_run" || body.kind === "workflow_run" ? body.kind : void 0;
|
|
439
|
+
const runId = typeof body.runId === "string" ? body.runId.trim() : "";
|
|
440
|
+
if (!kind || !runId) return c.json({
|
|
441
|
+
ok: false,
|
|
442
|
+
error: "kind and runId are required"
|
|
443
|
+
}, 400);
|
|
444
|
+
acknowledgeHomeAttention(kind, runId);
|
|
445
|
+
return c.json({
|
|
446
|
+
ok: true,
|
|
447
|
+
status: "acknowledged"
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
authenticated.post("/api/home/attention/retry", deps.strictRateLimitMiddleware, async (c) => {
|
|
451
|
+
const body = await c.req.json().catch(() => ({}));
|
|
452
|
+
const kind = body.kind === "automation_run" || body.kind === "workflow_run" ? body.kind : void 0;
|
|
453
|
+
const runId = typeof body.runId === "string" ? body.runId.trim() : "";
|
|
454
|
+
if (!kind || !runId) return c.json({
|
|
455
|
+
ok: false,
|
|
456
|
+
error: "kind and runId are required"
|
|
457
|
+
}, 400);
|
|
458
|
+
if (kind === "automation_run") try {
|
|
459
|
+
const run = await service.automationServiceInstance.rerunFromRun(runId);
|
|
460
|
+
acknowledgeHomeAttention(kind, runId);
|
|
461
|
+
return c.json({
|
|
462
|
+
ok: true,
|
|
463
|
+
runId: run.id
|
|
464
|
+
}, 202);
|
|
465
|
+
} catch (error) {
|
|
466
|
+
return c.json({
|
|
467
|
+
ok: false,
|
|
468
|
+
error: error instanceof Error ? error.message : "Failed to retry automation"
|
|
469
|
+
}, 400);
|
|
470
|
+
}
|
|
471
|
+
const agentId = (await listGatewayAgents(service.currentConfig)).defaultId;
|
|
472
|
+
const result = await service.createWorkflowRunService().retryWorkflowRun({
|
|
473
|
+
agentId,
|
|
474
|
+
runId
|
|
475
|
+
});
|
|
476
|
+
if (result.ok === false) return c.json({
|
|
477
|
+
ok: false,
|
|
478
|
+
error: result.message,
|
|
479
|
+
code: result.code
|
|
480
|
+
}, result.httpStatus);
|
|
481
|
+
acknowledgeHomeAttention(kind, runId);
|
|
482
|
+
return c.json({
|
|
483
|
+
ok: true,
|
|
484
|
+
runId: result.runId,
|
|
485
|
+
sessionKey: result.sessionKey
|
|
486
|
+
}, 202);
|
|
487
|
+
});
|
|
415
488
|
}
|
|
416
489
|
//#endregion
|
|
417
490
|
export { buildHomeBriefing, registerHomeRoutes };
|
|
@@ -4,6 +4,7 @@ import { registerSessionsRoutes } from "./sessions.js";
|
|
|
4
4
|
import { registerStatusRoutes } from "./status.js";
|
|
5
5
|
import { registerMemoryRoutes } from "./memory.js";
|
|
6
6
|
import { registerProjectsRoutes } from "./projects.js";
|
|
7
|
+
import { registerProjectSkillRoutes } from "./project-skills.js";
|
|
7
8
|
import { registerSearchRoutes } from "./search.js";
|
|
8
9
|
import { registerMobileRoutes } from "./mobile.js";
|
|
9
10
|
import { registerTaskOutcomeRoutes } from "./task-outcomes.js";
|
|
@@ -21,6 +22,7 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
21
22
|
registerMemoryRoutes(authenticated, deps);
|
|
22
23
|
registerActivityRoutes(authenticated, deps);
|
|
23
24
|
registerProjectsRoutes(authenticated, deps);
|
|
25
|
+
registerProjectSkillRoutes(authenticated, deps);
|
|
24
26
|
registerLocalAppsRoutes(authenticated, deps);
|
|
25
27
|
registerWorkDiscoveryRoutes(authenticated, deps);
|
|
26
28
|
registerFocusRoutes(authenticated, deps);
|