@xopcai/xopc 0.0.151 → 0.0.153
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-uu1xu9Pl.js → activity-store-XA9328eM.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BuO-OVfD.js → agent-avatar-dicebear-E09Jv6kW.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Bpv3h31T.js → agents-BA46Lyc7.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CwL38LEV.js → api-kQEpNIa-.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B6OU3Eol.js → app-management-settings-panel-BzrND8g7.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BaP4GFvN.js → appearance-settings-CKMCWf75.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DZKNIMRg.js → apps-page-DPP_gFCc.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CJX3zIh_.js → archive-plugin-DNOroxSq.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CI1ejk_l.js → attachment-load-PtKuOOfL.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-CjmhICbv.js → automation-suggestion-card-C7HQ5bAK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BtZl3B8m.js → automations-page-BuMTtTYy.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CZ8nOXqK.js → binary-plugins-DDFoTNKm.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BoSfyS_j.js → block-editor-CH_e8EXF.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CL1UiPcb.js → browser-settings-page-43uOCSrE.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-XzDKxPZ8.js → capability-presets-api-Cby6Utaf.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Dc_uHYgl.js → capability-presets-settings-panel-BZvp3H2p.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-DYLBAhFF.js → channel-recipient-api-COdmaOO4.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-mALvXpJj.js → channels-settings-BAPRTSF4.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DvB_8J5B.js +1 -0
- package/dist/gateway/static/root/assets/chunk-KS7C4IRE-uQ0fehio.js +4 -0
- package/dist/gateway/static/root/assets/{connector-logo-BSjlInHT.js → connector-logo-CinEws2y.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Cm_E3mmI.js → connectors-page-P-Ur9mlf.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DcJc91-C.js → desktop-pet-O3wyOYRG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CdeqTa3Q.js → desktop-pet-settings-nbvEKluo.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Cp3fpm0k.js → directory-picker-path-field-DyZJo5xz.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-Bwj1O3zr.js → dreaming-settings-CruD-NNs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-D_1xpKbZ.js → extension-debug-page-CV7SDe48.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CqZNCj96.js → extension-page-DJCYwgB_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-5MWbtQaQ.js → extension-settings-page-6kJQVKbq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Co_IaS34.js → gateway-config-api-DOewYtbP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-kmeWm2Pt.js → gateway-settings-BjjXod61.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BM_xvzl0.js → gateway-startup-retry-ewVb05iS.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-FoO-R4_U.js → goal-create-dialog-BStw0m9M.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CkJq7N5g.js → goal-detail-page-BOChQ7i7.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-DrtsYjXz.js → goals-config-api-CYNvVerg.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-DRAN-R64.js → goals-page-BrNRDv8T.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-wq9TKhIZ.js → goals-settings-CHZcm6es.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-B5zDoHbo.js → heartbeat-settings-B5oMLvbo.js} +1 -1
- package/dist/gateway/static/root/assets/index-B5cSZcER.js +196 -0
- package/dist/gateway/static/root/assets/index-CNr0KWZU.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-3tC9iD21.js → keyboard-shortcuts-settings-Eb8IqcMd.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CT-vDTLK.js → local-app-workbench-page-L-MQ_dJY.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-B9ruF9GV.js → local-apps-page-Zb0f5eNc.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-GfSwnwIZ.js → locale-store-CQDaFvDN.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Ca1X8X2P.js → logs-page-ToUMpW7t.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CzuhSQAB.js → markdown-split-RnzQRPvB.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-a3R4y-EL.js → media-plugins-BoX0SWrl.js} +1 -1
- package/dist/gateway/static/root/assets/messages--cnUi8Ld.js +5 -0
- package/dist/gateway/static/root/assets/{models-hub-panel-CbTlz9Of.js → models-hub-panel-BQuynkNz.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BCxDy2dV.js → notes-page-CSOXTk0P.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-z6sBX9B2.js → notes-workbench-B7NIQBqd.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-CJfk6M78.js → page-tabs-Dl9G6Pm3.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-MFopTSgF.js → preview-open-alternatives-B8R5o1uN.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DU29deIr.js → project-detail-page-DoN-qkzc.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Ck3DLTlZ.js → projects-page-BBOW0A-s.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-gLsLyAyi.js → remote-access-hub-BzXHX9bU.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-D0uhU3Z8.js → save-bar-controls-D6OGeVDa.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-NGOH-7wV.js → schedule-field-CKrch41X.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BJz5LoqG.js → schema-form-FroNrvKO.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-TmNoWpa_.js → sessions-page-c4n4TLc2.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BEsX3iAM.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-oDnUHnX_.js → settings-collapsible-section-1SeKT26L.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DND90dDt.js → settings-form-section-Cz4xOOt4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CEJtaoQp.js → settings-loading-skeleton-rBI7xqmM.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B1LJlRi9.js → settings-page-7SlGFgmR.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CsrLuDsW.js → settings-page-layout-C7B19AHf.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BPCJPHHY.js → setup-status-panel-_x53a0I_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C1PwLh-p.js → share-preview-page-DwcX1sXG.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DCuqr7js.js → shares-settings-BwfS4kkk.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BkjO4n_a.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-k6VIqTkK.js → skills-page-sCuywwN5.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BEsrEkSx.js → system-settings-panel-CZkASLIv.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Bi6hMBDb.js → theme-store-DP5WlsZg.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-dOypdlMf.js → typed-models-lib-C2TbyW3H.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-f8A-PVuq.js → use-channel-catalog-4WYXfEXk.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-B9Y_Ciav.js → user-context-page-0MO96b3-.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-fields-editor-DGC38Lx7.js → user-profile-fields-editor-Cqalx8iJ.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-DFkZ-tan.js → user-profile-settings-panel-CVbTC44o.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-CEIYZihF.js → utils-DOvyuYat.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DK6gaQsA.js → voice-api-key-field-ClOb2PfC.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DSJb9Kq7.js → work-discovery-page-Ci_rGhsb.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-DVavwV3D.js → work-item-detail-page-DnJeDqJB.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-foJDp0nz.js → work-page-n9XZM9PY.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BYqZpFCC.js → workflow-run-setup-panel-pNCz37MS.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DgO0WAzs.js → workflows-page-BFTxMEH6.js} +1 -1
- package/dist/gateway/static/root/index.html +8 -8
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/product-delivery.js +63 -0
- package/dist/src/agent/code-intelligence/tool-gating.d.ts +5 -0
- package/dist/src/agent/code-intelligence/tool-gating.js +6 -0
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/goal-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/paths.d.ts +1 -0
- package/dist/src/config/paths.js +10 -3
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/status.d.ts +8 -0
- package/dist/src/gateway/hono/routes/status.js +71 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/package.json +15 -6
- package/dist/gateway/static/root/assets/channels-status-swr-CZuEsO5b.js +0 -1
- package/dist/gateway/static/root/assets/chunk-QUQL4437-DXsxWP7r.js +0 -4
- package/dist/gateway/static/root/assets/index-DIlxvrlG.css +0 -1
- package/dist/gateway/static/root/assets/index-apLU0Hun.js +0 -196
- package/dist/gateway/static/root/assets/messages-B0B40tpO.js +0 -5
- package/dist/gateway/static/root/assets/settings-advanced-gate-CtPhh2m9.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-kn1Vypcy.js +0 -1
|
@@ -11,28 +11,28 @@
|
|
|
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</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-B5cSZcER.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">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/dist-CxGUk8J-.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/Combination-14nmIgxH.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/dist-C230izr8.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/chunk-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-uQ0fehio.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/cn-BQ_8x0bT.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-BODqo66o.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/circle-alert-RzVebuX2.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--cnUi8Ld.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-CQDaFvDN.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
35
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-ewVb05iS.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-XA9328eM.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DP5WlsZg.js">
|
|
35
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CNr0KWZU.css">
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
38
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ProductReferenceKindSchema = z.enum([
|
|
3
|
+
"project",
|
|
4
|
+
"note",
|
|
5
|
+
"work_item",
|
|
6
|
+
"goal",
|
|
7
|
+
"workflow_definition",
|
|
8
|
+
"workflow_run",
|
|
9
|
+
"automation",
|
|
10
|
+
"local_app",
|
|
11
|
+
"file",
|
|
12
|
+
"session",
|
|
13
|
+
"settings"
|
|
14
|
+
]);
|
|
15
|
+
const ProductCapabilitySchema = z.enum([
|
|
16
|
+
"open",
|
|
17
|
+
"preview",
|
|
18
|
+
"edit",
|
|
19
|
+
"continue_in_chat",
|
|
20
|
+
"run",
|
|
21
|
+
"pause",
|
|
22
|
+
"resume",
|
|
23
|
+
"share",
|
|
24
|
+
"reveal",
|
|
25
|
+
"configure"
|
|
26
|
+
]);
|
|
27
|
+
const ProductReferenceSchema = z.object({
|
|
28
|
+
kind: ProductReferenceKindSchema,
|
|
29
|
+
id: z.string().min(1),
|
|
30
|
+
title: z.string().min(1),
|
|
31
|
+
summary: z.string().optional(),
|
|
32
|
+
status: z.string().optional(),
|
|
33
|
+
revision: z.string().optional(),
|
|
34
|
+
projectId: z.string().optional(),
|
|
35
|
+
capabilities: z.array(ProductCapabilitySchema).default([])
|
|
36
|
+
});
|
|
37
|
+
const ProductDeliveryOperationSchema = z.enum([
|
|
38
|
+
"created",
|
|
39
|
+
"updated",
|
|
40
|
+
"opened",
|
|
41
|
+
"started",
|
|
42
|
+
"completed",
|
|
43
|
+
"failed"
|
|
44
|
+
]);
|
|
45
|
+
z.object({
|
|
46
|
+
version: z.literal(1),
|
|
47
|
+
operation: ProductDeliveryOperationSchema,
|
|
48
|
+
primary: ProductReferenceSchema.optional(),
|
|
49
|
+
related: z.array(ProductReferenceSchema).optional()
|
|
50
|
+
});
|
|
51
|
+
const PRODUCT_DELIVERY_TEXT_PREFIX = "xopc-product-delivery:";
|
|
52
|
+
function appendProductDeliveryText(text, delivery) {
|
|
53
|
+
if (!delivery) return text;
|
|
54
|
+
return `${text}${delivery.primary ? `\nOpen in xopc: [Open](${productReferenceDeepLink(delivery.primary)})` : ""}\n${PRODUCT_DELIVERY_TEXT_PREFIX}${encodeURIComponent(JSON.stringify(delivery))}`;
|
|
55
|
+
}
|
|
56
|
+
function productReferenceDeepLink(reference) {
|
|
57
|
+
return `xopc://open?${new URLSearchParams({
|
|
58
|
+
kind: reference.kind,
|
|
59
|
+
id: reference.id
|
|
60
|
+
}).toString()}`;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { appendProductDeliveryText };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/agent/code-intelligence/tool-gating.ts
|
|
2
|
+
function isCodeIntelligenceEnabledForAgent(config, agentId) {
|
|
3
|
+
return config?.enabled === true && agentId !== void 0 && config.agentIds?.includes(agentId) === true;
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { isCodeIntelligenceEnabledForAgent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
1
2
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { appendProductDeliveryText } from "@xopcai/gateway-contract";
|
|
3
3
|
//#region src/agent/tools/automation-tool.ts
|
|
4
4
|
const AutomationToolSchema = Type.Object({
|
|
5
5
|
action: Type.Union([
|
|
@@ -53,6 +53,7 @@ import { createTextToSpeechTool } from "./tts-tool.js";
|
|
|
53
53
|
import { createGoalEvidenceRecorder } from "./goal-evidence-recorder.js";
|
|
54
54
|
import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
|
|
55
55
|
import "../capabilities/index.js";
|
|
56
|
+
import { isCodeIntelligenceEnabledForAgent } from "../code-intelligence/tool-gating.js";
|
|
56
57
|
//#region src/agent/tools/factory.ts
|
|
57
58
|
init_logger();
|
|
58
59
|
const log = createLogger("AgentToolsFactory");
|
|
@@ -175,7 +176,7 @@ var AgentToolsFactory = class {
|
|
|
175
176
|
});
|
|
176
177
|
const codeIntelligenceConfig = cfg?.codeIntelligence;
|
|
177
178
|
const agentId = options?.agentId;
|
|
178
|
-
const codeIntelligenceTools = codeIntelligenceConfig
|
|
179
|
+
const codeIntelligenceTools = isCodeIntelligenceEnabledForAgent(codeIntelligenceConfig, agentId) && this.deps.getCodeIntelligenceRuntime ? createCodeIntelligenceTools({ getRuntime: () => this.deps.getCodeIntelligenceRuntime(workspace) }) : [];
|
|
179
180
|
const optionalTools = [
|
|
180
181
|
imageTool,
|
|
181
182
|
imageGenerateTool,
|
|
@@ -2,8 +2,8 @@ import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
|
2
2
|
import "../../storage/sqlite/index.js";
|
|
3
3
|
import { GoalService } from "../../goals/goal-service.js";
|
|
4
4
|
import "../../goals/index.js";
|
|
5
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
5
6
|
import { Type } from "@sinclair/typebox";
|
|
6
|
-
import { appendProductDeliveryText } from "@xopcai/gateway-contract";
|
|
7
7
|
//#region src/agent/tools/goal-tool.ts
|
|
8
8
|
const GoalToolSchema = Type.Object({
|
|
9
9
|
action: Type.Union([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
4
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
4
5
|
import { Type } from "@sinclair/typebox";
|
|
5
|
-
import { appendProductDeliveryText } from "@xopcai/gateway-contract";
|
|
6
6
|
//#region src/agent/tools/workflow-tool.ts
|
|
7
7
|
/**
|
|
8
8
|
* `workflow` — starts a persisted workflow run in a dedicated chat session.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
2
2
|
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
3
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
3
4
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
4
5
|
import { basename, dirname } from "path";
|
|
5
6
|
import { mkdir, writeFile } from "fs/promises";
|
|
6
7
|
import { Type } from "@sinclair/typebox";
|
|
7
|
-
import { appendProductDeliveryText } from "@xopcai/gateway-contract";
|
|
8
8
|
//#region src/agent/tools/write.ts
|
|
9
9
|
const MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
10
10
|
const WriteFileSchema = Type.Object({
|
|
@@ -2,10 +2,10 @@ import { runWithActivityContext } from "../../activity/context.js";
|
|
|
2
2
|
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
3
3
|
import "../../storage/sqlite/index.js";
|
|
4
4
|
import "../../activity/index.js";
|
|
5
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
5
6
|
import { isValidProjectAgentId, normalizeProjectAgentId } from "../../projects/project-agent.js";
|
|
6
7
|
import "../../projects/index.js";
|
|
7
8
|
import { Type } from "@sinclair/typebox";
|
|
8
|
-
import { appendProductDeliveryText } from "@xopcai/gateway-contract";
|
|
9
9
|
//#region src/agent/tools/xopc-use-tool.ts
|
|
10
10
|
const XopcUseToolSchema = Type.Object({
|
|
11
11
|
mode: Type.Union([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
2
|
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
|
package/dist/src/config/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir,
|
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
8
|
import { resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
9
|
import { extractProfileAgentId, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
|
-
import { FILENAMES, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, WORKSPACE_FILES, existsSync, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
10
|
+
import { FILENAMES, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
11
11
|
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
12
|
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
13
|
import { CustomModelSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
@@ -27,4 +27,4 @@ init_workspace_path();
|
|
|
27
27
|
init_models_json();
|
|
28
28
|
init_resolve_config_value();
|
|
29
29
|
//#endregion
|
|
30
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
30
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
@@ -185,6 +185,7 @@ export declare function resolveSkillsCachePath(config: Config, agentId: string):
|
|
|
185
185
|
* - `src/config` → `dist/extensions` when built, else `extensions/` (dev, tsx)
|
|
186
186
|
* - `out/server` → `dist/electron/extensions` (Electron extension bundles)
|
|
187
187
|
*/
|
|
188
|
+
export declare function hasBundledExtensionManifest(dir: string): boolean;
|
|
188
189
|
export declare function resolveBundledExtensionsDir(): string | null;
|
|
189
190
|
/**
|
|
190
191
|
* Resolve the bundled skills directory (shipped with xopc)
|
package/dist/src/config/paths.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ENV_VARS, XOPC_DB_FILENAME, init_paths_state, resolveHomeDir, resolveSt
|
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
4
4
|
import { init_agent_scope, resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentProfileDir as resolveAgentProfileDir$1, resolveAgentProfileMarkdownPath as resolveAgentProfileMarkdownPath$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
5
5
|
import { dirname, join, sep } from "path";
|
|
6
|
-
import { existsSync } from "fs";
|
|
6
|
+
import { existsSync, readdirSync, statSync } from "fs";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
//#region src/config/paths.ts
|
|
9
9
|
/**
|
|
@@ -242,6 +242,13 @@ function resolveSkillsCachePath(config, agentId) {
|
|
|
242
242
|
* - `src/config` → `dist/extensions` when built, else `extensions/` (dev, tsx)
|
|
243
243
|
* - `out/server` → `dist/electron/extensions` (Electron extension bundles)
|
|
244
244
|
*/
|
|
245
|
+
function hasBundledExtensionManifest(dir) {
|
|
246
|
+
try {
|
|
247
|
+
return readdirSync(dir, { withFileTypes: true }).some((entry) => entry.isDirectory() && statSync(join(dir, entry.name, "xopc.extension.json"), { throwIfNoEntry: false })?.isFile() === true);
|
|
248
|
+
} catch {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
245
252
|
function resolveBundledExtensionsDir() {
|
|
246
253
|
const envDir = process.env[ENV_BUNDLED_EXTENSIONS_ROOT];
|
|
247
254
|
if (envDir && existsSync(envDir)) return envDir;
|
|
@@ -253,7 +260,7 @@ function resolveBundledExtensionsDir() {
|
|
|
253
260
|
join(srcDir, "..", "..", "..", "dist", "extensions"),
|
|
254
261
|
join(srcDir, "..", "..", "..", "extensions")
|
|
255
262
|
];
|
|
256
|
-
for (const dir of candidates) if (existsSync(dir)) return dir;
|
|
263
|
+
for (const dir of candidates) if (existsSync(dir) && hasBundledExtensionManifest(dir)) return dir;
|
|
257
264
|
return null;
|
|
258
265
|
} catch {
|
|
259
266
|
return null;
|
|
@@ -327,4 +334,4 @@ var init_paths = __esmMin((() => {
|
|
|
327
334
|
}));
|
|
328
335
|
//#endregion
|
|
329
336
|
init_paths();
|
|
330
|
-
export { ENV_VARS, FILENAMES, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, WORKSPACE_FILES, XOPC_DB_FILENAME, existsSync, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath };
|
|
337
|
+
export { ENV_VARS, FILENAMES, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, WORKSPACE_FILES, XOPC_DB_FILENAME, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath };
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
5
4
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
6
5
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
+
export declare function buildEvalRuntimeIdentity(service: AuthenticatedRouteDeps['service'], agentId: string): {
|
|
4
|
+
ok: true;
|
|
5
|
+
payload: Record<string, unknown>;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: string;
|
|
9
|
+
status: number;
|
|
10
|
+
};
|
|
3
11
|
export declare function registerStatusRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -2,8 +2,62 @@ import { getDefaultModelSync, init_providers, resolveModel } from "../../../prov
|
|
|
2
2
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
3
3
|
import "../../../voice/stt/index.js";
|
|
4
4
|
import { mergeSttConfigFromAppConfig } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
5
|
+
import { getGatewayAgentEffectiveManifest } from "../../agents-admin.js";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
5
7
|
//#region src/gateway/hono/routes/status.ts
|
|
6
8
|
init_providers();
|
|
9
|
+
function stableValue(value) {
|
|
10
|
+
if (Array.isArray(value)) return value.map(stableValue);
|
|
11
|
+
if (!value || typeof value !== "object") return value;
|
|
12
|
+
return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, child]) => [key, stableValue(child)]));
|
|
13
|
+
}
|
|
14
|
+
function contentHash(value) {
|
|
15
|
+
return createHash("sha256").update(JSON.stringify(stableValue(value))).digest("hex");
|
|
16
|
+
}
|
|
17
|
+
function asRecord(value) {
|
|
18
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
19
|
+
}
|
|
20
|
+
function buildEvalRuntimeIdentity(service, agentId) {
|
|
21
|
+
const config = service.currentConfig;
|
|
22
|
+
if (!config) return {
|
|
23
|
+
ok: false,
|
|
24
|
+
error: "Gateway configuration is unavailable",
|
|
25
|
+
status: 503
|
|
26
|
+
};
|
|
27
|
+
const effective = getGatewayAgentEffectiveManifest(config, agentId);
|
|
28
|
+
if ("error" in effective) return {
|
|
29
|
+
ok: false,
|
|
30
|
+
error: effective.error,
|
|
31
|
+
status: effective.status ?? 400
|
|
32
|
+
};
|
|
33
|
+
const manifest = asRecord(effective.data.manifest);
|
|
34
|
+
const models = asRecord(manifest.models);
|
|
35
|
+
const tools = asRecord(manifest.tools);
|
|
36
|
+
const skills = manifest.skills ?? [];
|
|
37
|
+
const codeIntelligence = config.codeIntelligence;
|
|
38
|
+
return {
|
|
39
|
+
ok: true,
|
|
40
|
+
payload: {
|
|
41
|
+
schemaVersion: 1,
|
|
42
|
+
version: service.getHealth().version,
|
|
43
|
+
buildCommit: process.env.XOPC_BUILD_COMMIT?.trim() || process.env.GITHUB_SHA?.trim() || null,
|
|
44
|
+
agentId,
|
|
45
|
+
modelRef: models.primary ?? null,
|
|
46
|
+
thinkingLevel: manifest.thinkingDefault ?? null,
|
|
47
|
+
manifestHash: contentHash(effective.data.manifest),
|
|
48
|
+
systemPromptConfigHash: contentHash(manifest.systemPrompt ?? null),
|
|
49
|
+
toolPolicyHash: contentHash(tools),
|
|
50
|
+
skillPolicyHash: contentHash(skills),
|
|
51
|
+
codeIntelligence: {
|
|
52
|
+
enabled: codeIntelligence?.enabled === true,
|
|
53
|
+
configuredForAgent: codeIntelligence?.agentIds?.includes(agentId) === true,
|
|
54
|
+
indexMode: codeIntelligence?.indexMode ?? null,
|
|
55
|
+
configHash: contentHash(codeIntelligence ?? null)
|
|
56
|
+
},
|
|
57
|
+
presetChain: effective.data.sources
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
7
61
|
function isRefineAvailable(config) {
|
|
8
62
|
if (!config) return false;
|
|
9
63
|
for (const candidate of [
|
|
@@ -53,6 +107,22 @@ function registerStatusRoutes(authenticated, deps) {
|
|
|
53
107
|
const handler = (c) => c.json(buildStatusPayload(service));
|
|
54
108
|
authenticated.get("/status", handler);
|
|
55
109
|
authenticated.get("/api/status", handler);
|
|
110
|
+
authenticated.get("/api/eval/runtime-identity", (c) => {
|
|
111
|
+
const agentId = c.req.query("agentId")?.trim();
|
|
112
|
+
if (!agentId) return c.json({
|
|
113
|
+
ok: false,
|
|
114
|
+
error: "agentId is required"
|
|
115
|
+
}, 400);
|
|
116
|
+
const result = buildEvalRuntimeIdentity(service, agentId);
|
|
117
|
+
if ("error" in result) {
|
|
118
|
+
const status = result.status === 404 ? 404 : result.status === 503 ? 503 : 400;
|
|
119
|
+
return c.json({
|
|
120
|
+
ok: false,
|
|
121
|
+
error: result.error
|
|
122
|
+
}, status);
|
|
123
|
+
}
|
|
124
|
+
return c.json(result);
|
|
125
|
+
});
|
|
56
126
|
/**
|
|
57
127
|
* POST /api/gateway/restart — respawn gateway process when supported (foreground `xopc gateway`).
|
|
58
128
|
*/
|
|
@@ -70,4 +140,4 @@ function registerStatusRoutes(authenticated, deps) {
|
|
|
70
140
|
});
|
|
71
141
|
}
|
|
72
142
|
//#endregion
|
|
73
|
-
export { registerStatusRoutes };
|
|
143
|
+
export { buildEvalRuntimeIdentity, registerStatusRoutes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.153",
|
|
4
4
|
"description": "Local-first AI system that remembers context, coordinates AI, and sustains long-term progress.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -103,8 +103,7 @@
|
|
|
103
103
|
"undici": "^8.5.0",
|
|
104
104
|
"uuid": "^14.0.0",
|
|
105
105
|
"ws": "^8.21.0",
|
|
106
|
-
"zod": "^4.4.3"
|
|
107
|
-
"@xopcai/gateway-contract": "0.0.0"
|
|
106
|
+
"zod": "^4.4.3"
|
|
108
107
|
},
|
|
109
108
|
"peerDependencies": {
|
|
110
109
|
"@composio/core": "0.14.0",
|
|
@@ -153,8 +152,8 @@
|
|
|
153
152
|
"cross-env": "^10.1.0",
|
|
154
153
|
"dependency-cruiser": "^17.4.3",
|
|
155
154
|
"electron": "^42.4.1",
|
|
156
|
-
"electron-builder": "^26.
|
|
157
|
-
"electron-updater": "6.8.
|
|
155
|
+
"electron-builder": "^26.15.3",
|
|
156
|
+
"electron-updater": "6.8.9",
|
|
158
157
|
"electron-vite": "^6.0.0-beta.1",
|
|
159
158
|
"esbuild": "^0.28.1",
|
|
160
159
|
"eslint": "^10.4.0",
|
|
@@ -171,7 +170,8 @@
|
|
|
171
170
|
"vite": "^8.0.16",
|
|
172
171
|
"vitepress": "^1.6.4",
|
|
173
172
|
"vitest": "4.1.5",
|
|
174
|
-
"vue": "^3.5.35"
|
|
173
|
+
"vue": "^3.5.35",
|
|
174
|
+
"@xopcai/gateway-contract": "0.0.0"
|
|
175
175
|
},
|
|
176
176
|
"scripts": {
|
|
177
177
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|
|
@@ -219,10 +219,19 @@
|
|
|
219
219
|
"test:startup:gateway": "node --import tsx scripts/bench-gateway-startup.ts",
|
|
220
220
|
"test:startup:gateway:check": "node --import tsx scripts/bench-gateway-startup.ts --runs 2 --warmup 0 --ready-budget-ms 20000",
|
|
221
221
|
"test:startup:imports": "node scripts/check-cli-bootstrap-imports.mjs",
|
|
222
|
+
"eval:coder": "tsx evals/coder/apps/cli/src/main.ts",
|
|
223
|
+
"eval:coder:check": "pnpm -C evals/coder run check",
|
|
224
|
+
"eval:coder:smoke": "pnpm -C evals/coder run smoke",
|
|
225
|
+
"eval:coder:web": "tsx evals/coder/apps/web/src/server.ts",
|
|
226
|
+
"eval:coder:xopc:prepare": "tsx evals/coder/scripts/prepare-xopc-cbm-config.ts",
|
|
227
|
+
"eval:coder:xopc:pilot-checks": "tsx evals/coder/scripts/check-xopc-cbm-hidden.ts",
|
|
228
|
+
"eval:coder:xopc:fixture-check": "tsx evals/coder/scripts/check-xopc-cbm-fixtures.ts",
|
|
229
|
+
"eval:coder:github:experiment": "tsx evals/coder/scripts/prepare-github-experiment.ts",
|
|
222
230
|
"tunnel:broker-tls:verify": "node scripts/tunnel-broker-tls-verify.mjs",
|
|
223
231
|
"release:patch": "bash scripts/release-patch.sh",
|
|
224
232
|
"growth:snapshot": "node scripts/growth-snapshot.mjs",
|
|
225
233
|
"growth:github-community": "node scripts/growth-github-community.mjs",
|
|
234
|
+
"release:check-package": "node scripts/check-publish-manifest.mjs",
|
|
226
235
|
"docs:dev": "vitepress dev docs",
|
|
227
236
|
"docs:check": "node scripts/check-docs.mjs",
|
|
228
237
|
"docs:build": "pnpm run docs:check && vitepress build docs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./locale-store-GfSwnwIZ.js";import{n as t}from"./channel-recipient-api-DYLBAhFF.js";function n(){return e(`/api/channels/status`)}var r=t;export{r as n,n as t};
|