@xopcai/xopc 0.0.151 → 0.0.152
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/{agent-avatar-dicebear-BuO-OVfD.js → agent-avatar-dicebear-CXe2KDZj.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Bpv3h31T.js → agents-BjLxhsVX.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B6OU3Eol.js → app-management-settings-panel-DekP2_hC.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BaP4GFvN.js → appearance-settings-Cfd5YavF.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DZKNIMRg.js → apps-page-PS-uUoSk.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CJX3zIh_.js → archive-plugin-DWglUgbp.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CI1ejk_l.js → attachment-load-BJdxo2Vn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-CjmhICbv.js → automation-suggestion-card-B-TfxjJF.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BtZl3B8m.js → automations-page-CtNevo3y.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CZ8nOXqK.js → binary-plugins-DwrYsL8l.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BoSfyS_j.js → block-editor-CIxjL5Kp.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CL1UiPcb.js → browser-settings-page-QncZ-2vS.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-XzDKxPZ8.js → capability-presets-api-ChR2rMfo.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Dc_uHYgl.js → capability-presets-settings-panel-_JBmJl5A.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-mALvXpJj.js → channels-settings-Bz3tyWpH.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-logo-BSjlInHT.js → connector-logo-KsRvub5G.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Cm_E3mmI.js → connectors-page-_pT0aE0S.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DcJc91-C.js → desktop-pet-CRCERvWy.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CdeqTa3Q.js → desktop-pet-settings-vGrxshsU.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Cp3fpm0k.js → directory-picker-path-field-BGPYrtx6.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-Bwj1O3zr.js → dreaming-settings-B5pzvNgs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-D_1xpKbZ.js → extension-debug-page-BaCko1XU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CqZNCj96.js → extension-page-TTXKCMtb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-5MWbtQaQ.js → extension-settings-page-CEMb3uXY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Co_IaS34.js → gateway-config-api-Bf37OGhQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-kmeWm2Pt.js → gateway-settings-cu-vyeNk.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-FoO-R4_U.js → goal-create-dialog-C-bL8rj8.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CkJq7N5g.js → goal-detail-page-p5zPrlTq.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-DrtsYjXz.js → goals-config-api-D2pEoiiO.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-DRAN-R64.js → goals-page-D-H2u2-J.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-wq9TKhIZ.js → goals-settings-BVZaBqPa.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-B5zDoHbo.js → heartbeat-settings-B-AC_uwa.js} +1 -1
- package/dist/gateway/static/root/assets/{index-apLU0Hun.js → index-DSydVlxZ.js} +6 -6
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-3tC9iD21.js → keyboard-shortcuts-settings-w0yIP0UB.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CT-vDTLK.js → local-app-workbench-page-CTq0TIH4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-B9ruF9GV.js → local-apps-page-srIyxJuy.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Ca1X8X2P.js → logs-page-MQB6-NKt.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CzuhSQAB.js → markdown-split-Du5yPuDb.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-a3R4y-EL.js → media-plugins-Cd1Rmw15.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-panel-CbTlz9Of.js → models-hub-panel-BMg_Xqd9.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BCxDy2dV.js → notes-page-DhfrFd89.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-z6sBX9B2.js → notes-workbench-CwJk-D7Y.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-CJfk6M78.js → page-tabs-HACawonJ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-MFopTSgF.js → preview-open-alternatives-CjEZt_F5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DU29deIr.js → project-detail-page-Dut_micj.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Ck3DLTlZ.js → projects-page-sTRlCEZ5.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-gLsLyAyi.js → remote-access-hub-Fx81YH7S.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-D0uhU3Z8.js → save-bar-controls-CbktHUqt.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-NGOH-7wV.js → schedule-field-BGx_Nb45.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BJz5LoqG.js → schema-form-Cg-LJVvG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-TmNoWpa_.js → sessions-page-DFnmyBpj.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BlWxQ6Ea.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-oDnUHnX_.js → settings-collapsible-section-yYK4O-5E.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DND90dDt.js → settings-form-section-DPSA8tG8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CEJtaoQp.js → settings-loading-skeleton-ClHNJwRL.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B1LJlRi9.js → settings-page-lPM7md10.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CsrLuDsW.js → settings-page-layout-B_-VepeK.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BPCJPHHY.js → setup-status-panel-hORJvGAQ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C1PwLh-p.js → share-preview-page-DyzplAEL.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DCuqr7js.js → shares-settings-DO3IIgcC.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-kn1Vypcy.js → skill-reload-api-C9BqzDjZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-k6VIqTkK.js → skills-page-CvOIrcCJ.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BEsrEkSx.js → system-settings-panel-eIyklo0K.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-dOypdlMf.js → typed-models-lib-BgOpEx3h.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-B9Y_Ciav.js → user-context-page-BG_1IrIJ.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-fields-editor-DGC38Lx7.js → user-profile-fields-editor-CfLUK6MT.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-DFkZ-tan.js → user-profile-settings-panel-BmzPREhJ.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-CEIYZihF.js → utils-DbFnvDPi.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DK6gaQsA.js → voice-api-key-field-1xyza74n.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DSJb9Kq7.js → work-discovery-page-Dhyk4LHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-DVavwV3D.js → work-item-detail-page-CxBRnWeQ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-foJDp0nz.js → work-page-Btq3YeCH.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BYqZpFCC.js → workflow-run-setup-panel-8HLqUALq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DgO0WAzs.js → workflows-page-D48bPgLI.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- 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/gateway/agents-admin.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/package.json +9 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CtPhh2m9.js +0 -1
|
@@ -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</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DSydVlxZ.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">
|
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
|
|
@@ -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,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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.152",
|
|
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",
|
|
@@ -219,6 +219,14 @@
|
|
|
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{si as e}from"./index-apLU0Hun.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
|