@xopcai/xopc 0.0.291 → 0.0.293
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/dist/assets/{auth-B2CDTr_F.js → auth-C8gJZEsn.js} +13 -2
- package/dist/browser-ext/dist/background.js +5 -2
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- 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-BCtrkF15.js → agent-avatar-dicebear-DBoiUaYJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D2eYNelh.js → agent-defaults-settings-panel-BBBTq1DQ.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BedA5XwI.js → agents-DLyyYg6o.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Md562Fo-.js → app-management-settings-panel-Dt33QQO_.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BiBFI4BM.js → appearance-settings-TbZePT0h.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Corla83b.js → apps-page-D1xQLM8o.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-A_Unp751.js → archive-plugin-BlhqSDGJ.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D6idSUyP.js → attachment-load-DYN6uTdY.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C6j71Lgs.js → automations-page-vR2Ox-54.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DjZdhLQ5.js → automations-workspace-Bq2HWxpx.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BkKYh-8v.js → binary-plugins-BwJI5t0J.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CDcMvaku.js → block-editor-CSVyQoll.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-C64k4TBH.js → browser-automations-page-BZ3-XyQW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-1k5rj_qR.js → browser-settings-page-BIJNmJgx.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-B2NvoTYb.js → capabilities-settings-panel-B9gmXaV6.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-DExixzp4.js → channels-settings-CVbrTHRw.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B9eKFkbg.js → chat-terminal-dock-BraLmomg.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-model-settings-DW6j2lsn.js → computer-model-settings-DgLCyFBM.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-C2Qyw63Q.js → computer-settings-page-BnbrU0bt.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-C3ubZz7K.js → connectors-page-D1fqQ8a3.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BdxjXVKL.js → date-picker-C2z8-QnA.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CXOa4uh4.js → dependency-picker-BsC_4LIh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CBWiAaSv.js → desktop-pet-Dk0QTgXU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BX1aILDK.js → desktop-pet-settings-Dj7bIWMk.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-bqm_Yf4i.js → device-pairing-wizard-BpJkOK07.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-B4MMerja.js → extension-debug-page-C-A8q7eR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-B3ZtINak.js → extension-page-BQitxYaL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-8BkQVh0z.js → extension-settings-page-C1TqQn1x.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ZyhacQX5.js → gateway-settings-B6zLZO7B.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Bllcxm2A.js → heartbeat-settings-CB9zJjx1.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Cv2e8XBR.js → home-page-C5CwdYuu.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BD5uNzie.css → index-Ds8Q4MZJ.css} +1 -1
- package/dist/gateway/static/root/assets/{index-B7EieIE4.js → index-im9qTn_e.js} +43 -43
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-6A6JOHTI.js → keyboard-shortcuts-settings-DpmGojOS.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Cipj52Zq.js → local-app-workbench-page-BAnnVjV6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-bD-m7YHJ.js → local-apps-page-DVWnUNKI.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-D5feO2yw.js → logs-page-BuuEU9H4.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-B7mz0_44.js → management-settings-DuPqqO2p.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DQ2HfMeG.js → media-plugins-C1mHdgxN.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DhYJigb3.js → note-detail-panel-CqJWQqLq.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-Bg5NPUdf.js → notes-page-Dx4LmFQv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-DmG_Qjl8.js → page-tabs-3VB72Q2A.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Y9J1kjKC.js → preview-open-alternatives-C3gIPd87.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-Duc_NQ8l.js → proactive-page-BoXPVmE5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DVOiucVA.js → project-detail-page-tD7h3hb1.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Dr_kDoCJ.js → projects-page-COURhAyP.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-hyJ2KKKK.js → remote-access-hub-DW0sfbOM.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DB7J9opJ.js → runtime-tools-settings-panel-Clq1U2Bs.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CMYuPOlE.js → schema-form-D29HClcq.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-DGsnYcoh.js → sessions-page-CN9mE6lf.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BAkTtjLG.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BayJP08a.js → settings-form-section-BLX6yLkO.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CWBqZtt6.js → settings-page-BVrp_njx.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-C97S5g5c.js → setup-status-panel-BT8UzHXg.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Wn5bQA-5.js → share-preview-page-DSooDmlI.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-pfVzP8F7.js → shares-settings-BQvk7HB9.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-DDJ0ZKx3.js → skill-reload-api-DPhl0o2K.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DbDpLjDW.js → skills-page-BTZgqlu5.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DCHY_kou.js → skills-page.utils-DUL2MSIF.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DhgITgId.js → system-settings-panel-CLQ0kUhx.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-UqwtiHYu.js → task-detail-page-D-mE7_Y9.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DJ3gz2tM.js → tunnel-api-Ct6uU5aE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-htvgT192.js → use-autosave-BM4VIISj.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-xOsXY_2W.js → user-model-page-BeF3xmRU.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BviJF3Oa.js → voice-api-key-field-Di5bEpbR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BOBVNEYZ.js → work-discovery-overlay-BvUDSW1e.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D1N9uUyM.js → workflow-run-setup-panel-4_qbvODo.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-2ylzlgkG.js → workflows-page-Dn15wZnh.js} +1 -1
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +23 -3
- package/dist/packages/realtime-client/src/index.js +9 -2
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +3 -3
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +5 -3
- package/dist/src/agent/tools/computer-use-tool.js +20 -10
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/computer/broker.js +20 -5
- package/dist/src/computer/control-guard.d.ts +2 -0
- package/dist/src/computer/control-guard.js +9 -1
- package/dist/src/computer/errors.d.ts +17 -0
- package/dist/src/computer/errors.js +35 -1
- package/dist/src/computer/evaluation.d.ts +66 -0
- package/dist/src/computer/evaluation.js +84 -0
- package/dist/src/computer/model-adapter.d.ts +56 -14
- package/dist/src/computer/model-adapter.js +86 -15
- package/dist/src/computer/model-policy.d.ts +11 -0
- package/dist/src/computer/model-policy.js +11 -1
- package/dist/src/computer/runtime.d.ts +51 -2
- package/dist/src/computer/runtime.js +219 -89
- package/dist/src/computer/task-state.d.ts +35 -0
- package/dist/src/computer/task-state.js +68 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/endpoint-tools/upload-service.d.ts +3 -0
- package/dist/src/endpoint-tools/upload-service.js +29 -11
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/app.js +4 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/endpoint-compatibility.d.ts +2 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +21 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +37 -14
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/realtime/runtime.js +9 -0
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DuzZqQMn.js +0 -1
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { ENDPOINT_MAX_FILE_BYTES, init_src } from "../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { COMPUTER_FRAME_MAX_BYTES, COMPUTER_FRAME_MAX_PIXELS, init_src as init_src$1 } from "../../packages/computer-control-contract/src/index.js";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
5
|
import crypto from "node:crypto";
|
|
5
6
|
import sharp from "sharp";
|
|
6
7
|
//#region src/endpoint-tools/upload-service.ts
|
|
8
|
+
init_src$1();
|
|
7
9
|
init_src();
|
|
8
10
|
const GRANT_TTL_MS = 5 * 6e4;
|
|
9
11
|
const ENDPOINT_UPLOAD_MAX_BYTES = ENDPOINT_MAX_FILE_BYTES;
|
|
10
12
|
const DEFAULT_MAX_FILES = 8;
|
|
11
|
-
var EndpointUploadError = class extends Error {
|
|
13
|
+
var EndpointUploadError = class extends Error {
|
|
14
|
+
constructor(message, code = "INVALID_UPLOAD_GRANT") {
|
|
15
|
+
super(message);
|
|
16
|
+
this.code = code;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
12
19
|
var EndpointUploadService = class {
|
|
13
20
|
grants = /* @__PURE__ */ new Map();
|
|
14
21
|
files = /* @__PURE__ */ new Map();
|
|
15
22
|
frames = /* @__PURE__ */ new Map();
|
|
16
23
|
pruneTimer;
|
|
24
|
+
validatingFrames = /* @__PURE__ */ new Set();
|
|
17
25
|
constructor(rootDir) {
|
|
18
26
|
this.rootDir = rootDir;
|
|
19
27
|
mkdirSync(rootDir, {
|
|
@@ -31,7 +39,7 @@ var EndpointUploadService = class {
|
|
|
31
39
|
endpointId,
|
|
32
40
|
token,
|
|
33
41
|
expiresAt: now + GRANT_TTL_MS,
|
|
34
|
-
maxBytes: profile === "computer-frame" ?
|
|
42
|
+
maxBytes: profile === "computer-frame" ? COMPUTER_FRAME_MAX_BYTES : ENDPOINT_UPLOAD_MAX_BYTES,
|
|
35
43
|
maxFiles: profile === "computer-frame" ? 1 : DEFAULT_MAX_FILES,
|
|
36
44
|
uploadedFileIds: []
|
|
37
45
|
};
|
|
@@ -53,7 +61,7 @@ var EndpointUploadService = class {
|
|
|
53
61
|
if (grant.expiresAt <= now) throw new EndpointUploadError("Upload grant expired");
|
|
54
62
|
if (grant.profile === "computer-frame" && !params.validatedFrame) throw new EndpointUploadError("Computer frame requires image validation");
|
|
55
63
|
if (grant.uploadedFileIds.length >= grant.maxFiles) throw new EndpointUploadError("Upload grant file limit exceeded");
|
|
56
|
-
if (params.bytes.byteLength > grant.maxBytes) throw new EndpointUploadError("Uploaded file is too large");
|
|
64
|
+
if (params.bytes.byteLength > grant.maxBytes) throw new EndpointUploadError("Uploaded file is too large", "UPLOAD_TOO_LARGE");
|
|
57
65
|
if (!params.name || params.name.length > 255 || !params.mimeType || params.mimeType.length > 255) throw new EndpointUploadError("Uploaded file metadata is invalid");
|
|
58
66
|
const fileId = crypto.randomUUID();
|
|
59
67
|
const path = join(this.rootDir, fileId);
|
|
@@ -115,6 +123,7 @@ var EndpointUploadService = class {
|
|
|
115
123
|
const grant = this.grants.get(invocationId);
|
|
116
124
|
const actual = Buffer.from(token), expected = Buffer.from(grant?.token ?? "");
|
|
117
125
|
if (!grant || grant.endpointId !== endpointId || actual.length !== expected.length || !crypto.timingSafeEqual(actual, expected) || grant.expiresAt <= Date.now()) throw new EndpointUploadError("Upload grant is invalid or expired");
|
|
126
|
+
if (grant.uploadedFileIds.length >= grant.maxFiles) throw new EndpointUploadError("Upload grant file limit exceeded");
|
|
118
127
|
return {
|
|
119
128
|
maxBytes: grant.maxBytes,
|
|
120
129
|
profile: grant.profile
|
|
@@ -122,15 +131,24 @@ var EndpointUploadService = class {
|
|
|
122
131
|
}
|
|
123
132
|
async uploadValidated(params) {
|
|
124
133
|
const grant = this.getGrantLimits(params.invocationId, params.endpointId, params.token);
|
|
125
|
-
if (params.bytes.length > grant.maxBytes) throw new EndpointUploadError("Uploaded file is too large");
|
|
134
|
+
if (params.bytes.length > grant.maxBytes) throw new EndpointUploadError("Uploaded file is too large", "UPLOAD_TOO_LARGE");
|
|
126
135
|
if (grant.profile === "computer-frame") {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
if (this.validatingFrames.has(params.invocationId) || this.validatingFrames.size >= 2) throw new EndpointUploadError("Computer frame validation is busy", "UPLOAD_BUSY");
|
|
137
|
+
this.validatingFrames.add(params.invocationId);
|
|
138
|
+
try {
|
|
139
|
+
const metadata = await sharp(params.bytes, { limitInputPixels: COMPUTER_FRAME_MAX_PIXELS }).metadata();
|
|
140
|
+
const format = params.mimeType === "image/png" ? "png" : params.mimeType === "image/jpeg" ? "jpeg" : void 0;
|
|
141
|
+
if (!format || metadata.format !== format || !metadata.width || !metadata.height || metadata.width * metadata.height > 16e6 || (metadata.pages ?? 1) !== 1) throw new EndpointUploadError("Invalid computer frame image", "INVALID_COMPUTER_FRAME");
|
|
142
|
+
(await sharp(params.bytes, {
|
|
143
|
+
limitInputPixels: COMPUTER_FRAME_MAX_PIXELS,
|
|
144
|
+
failOn: "warning"
|
|
145
|
+
}).raw().toBuffer()).fill(0);
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (error instanceof EndpointUploadError) throw error;
|
|
148
|
+
throw new EndpointUploadError("Computer frame could not be decoded", "INVALID_COMPUTER_FRAME");
|
|
149
|
+
} finally {
|
|
150
|
+
this.validatingFrames.delete(params.invocationId);
|
|
151
|
+
}
|
|
134
152
|
return this.upload({
|
|
135
153
|
...params,
|
|
136
154
|
validatedFrame: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
-
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
3
|
+
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
4
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
5
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
6
6
|
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
3
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { listDevices } from "../../storage/sqlite/device-access-repository.js";
|
|
4
|
+
import { ENDPOINT_MAX_FILE_BYTES, init_src } from "../../../packages/endpoint-tools-protocol/src/index.js";
|
|
4
5
|
import { resolveAllowedBrowserOrigins, resolveGatewayServiceListenPort } from "../host.js";
|
|
5
6
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
6
7
|
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
@@ -31,6 +32,7 @@ import { createMiddleware } from "hono/factory";
|
|
|
31
32
|
import { bodyLimit } from "hono/body-limit";
|
|
32
33
|
import { getConnInfo } from "@hono/node-server/conninfo";
|
|
33
34
|
//#region src/gateway/hono/app.ts
|
|
35
|
+
init_src();
|
|
34
36
|
init_logger();
|
|
35
37
|
const log = createLogger("Gateway:App");
|
|
36
38
|
/**
|
|
@@ -200,7 +202,8 @@ function createHonoApp(config) {
|
|
|
200
202
|
}));
|
|
201
203
|
app.use("/api/*", async (c, next) => {
|
|
202
204
|
const contentType = c.req.header("content-type");
|
|
203
|
-
const
|
|
205
|
+
const isAttachmentInputRequest = c.req.method === "POST" && c.req.path === "/api/tasks" || c.req.method === "POST" && /^\/api\/sessions\/[^/]+\/inputs$/.test(c.req.path) || c.req.method === "POST" && /^\/api\/tasks\/[^/]+\/inputs$/.test(c.req.path) || c.req.method === "PATCH" && /^\/api\/sessions\/[^/]+\/inputs\/[^/]+$/.test(c.req.path);
|
|
206
|
+
const maxSize = c.req.method === "POST" && /^\/api\/endpoint-tools\/invocations\/[^/]+\/files$/.test(c.req.path) ? ENDPOINT_MAX_FILE_BYTES : isAttachmentInputRequest ? SESSION_INPUT_BODY_MAX : c.req.path === "/api/skills/upload" ? SKILL_UPLOAD_BODY_MAX : c.req.path === "/api/voice/transcriptions" ? VOICE_TRANSCRIBE_BODY_MAX : c.req.path === "/api/media" && c.req.method === "POST" ? MEDIA_UPLOAD_BODY_MAX : isNoteMediaUploadRequest(c.req.path, c.req.method, contentType) ? NOTE_MEDIA_BODY_MAX : isFileUploadRequest(c.req.path, c.req.method, contentType) ? NOTE_MEDIA_BODY_MAX : discussionUploadBodyMax(c.req.path, c.req.method, contentType) ?? DEFAULT_API_BODY_MAX;
|
|
204
207
|
const maxSizeMb = Math.ceil(maxSize / (1024 * 1024));
|
|
205
208
|
return bodyLimit({
|
|
206
209
|
maxSize,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
4
5
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
5
6
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
9
|
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { COMPUTER_DESCRIPTOR, COMPUTER_FRAME_MAX_BYTES, init_src as init_src$1 } from "../../../../packages/computer-control-contract/src/index.js";
|
|
3
|
+
//#region src/gateway/hono/routes/endpoint-compatibility.ts
|
|
4
|
+
init_src$1();
|
|
5
|
+
init_src();
|
|
6
|
+
function registerEndpointCompatibilityRoutes(authenticated) {
|
|
7
|
+
authenticated.get("/api/endpoint-tools/compatibility", (c) => {
|
|
8
|
+
c.header("Cache-Control", "no-store");
|
|
9
|
+
return c.json({
|
|
10
|
+
ok: true,
|
|
11
|
+
payload: {
|
|
12
|
+
realtimeProtocolVersion: 2,
|
|
13
|
+
endpointProtocolVersion: 2,
|
|
14
|
+
computerControl: COMPUTER_DESCRIPTOR,
|
|
15
|
+
computerFrameUploadMaxBytes: COMPUTER_FRAME_MAX_BYTES
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { registerEndpointCompatibilityRoutes };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../../utils/logger.js";
|
|
1
3
|
import { getDevice } from "../../../storage/sqlite/device-access-repository.js";
|
|
2
4
|
import { endpointPrincipalRegistrationSchema, endpointSessionBindingRequestSchema, init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
3
5
|
import { createEndpointPrincipal, getEndpointPrincipal, listEndpointPrincipals, revokeEndpointPrincipal } from "../../../storage/sqlite/endpoint-principal-repository.js";
|
|
@@ -8,6 +10,8 @@ import { ENDPOINT_UPLOAD_MAX_BYTES, EndpointUploadError } from "../../../endpoin
|
|
|
8
10
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
11
|
//#region src/gateway/hono/routes/endpoint-tools.ts
|
|
10
12
|
init_src();
|
|
13
|
+
init_logger();
|
|
14
|
+
const log = createLogger("EndpointUpload");
|
|
11
15
|
async function readBoundedBody(body, maxBytes) {
|
|
12
16
|
if (!body) return new Uint8Array();
|
|
13
17
|
const reader = body.getReader();
|
|
@@ -18,19 +22,24 @@ async function readBoundedBody(body, maxBytes) {
|
|
|
18
22
|
const { done, value } = await reader.read();
|
|
19
23
|
if (done) break;
|
|
20
24
|
size += value.byteLength;
|
|
21
|
-
if (size > maxBytes)
|
|
25
|
+
if (size > maxBytes) {
|
|
26
|
+
value.fill(0);
|
|
27
|
+
throw new EndpointUploadError("Uploaded file is too large", "UPLOAD_TOO_LARGE");
|
|
28
|
+
}
|
|
22
29
|
chunks.push(value);
|
|
23
30
|
}
|
|
31
|
+
const bytes = new Uint8Array(size);
|
|
32
|
+
let offset = 0;
|
|
33
|
+
for (const chunk of chunks) {
|
|
34
|
+
bytes.set(chunk, offset);
|
|
35
|
+
offset += chunk.byteLength;
|
|
36
|
+
}
|
|
37
|
+
return bytes;
|
|
24
38
|
} finally {
|
|
39
|
+
await reader.cancel().catch(() => {});
|
|
40
|
+
for (const chunk of chunks) chunk.fill(0);
|
|
25
41
|
reader.releaseLock();
|
|
26
42
|
}
|
|
27
|
-
const bytes = new Uint8Array(size);
|
|
28
|
-
let offset = 0;
|
|
29
|
-
for (const chunk of chunks) {
|
|
30
|
-
bytes.set(chunk, offset);
|
|
31
|
-
offset += chunk.byteLength;
|
|
32
|
-
}
|
|
33
|
-
return bytes;
|
|
34
43
|
}
|
|
35
44
|
function registerEndpointToolRoutes(authenticated, deps) {
|
|
36
45
|
authenticated.get("/api/endpoint-tools/principals", (c) => {
|
|
@@ -228,16 +237,19 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
228
237
|
const token = c.req.header("x-endpoint-upload-token") ?? "";
|
|
229
238
|
const name = c.req.query("name") ?? "";
|
|
230
239
|
const mimeType = c.req.header("content-type")?.split(";", 1)[0]?.trim() ?? "";
|
|
231
|
-
|
|
240
|
+
const declaredLength = Number(c.req.header("content-length") ?? 0);
|
|
241
|
+
if (declaredLength > ENDPOINT_UPLOAD_MAX_BYTES) return c.json({
|
|
232
242
|
ok: false,
|
|
233
243
|
error: {
|
|
234
244
|
code: "RESULT_TOO_LARGE",
|
|
235
245
|
message: "Uploaded file is too large"
|
|
236
246
|
}
|
|
237
247
|
}, 413);
|
|
248
|
+
let bytes;
|
|
238
249
|
try {
|
|
239
250
|
const limits = deps.service.endpointTools.uploads.getGrantLimits(invocationId, endpointId, token);
|
|
240
|
-
|
|
251
|
+
if (declaredLength > limits.maxBytes) throw new EndpointUploadError("Uploaded file is too large", "UPLOAD_TOO_LARGE");
|
|
252
|
+
bytes = await readBoundedBody(c.req.raw.body, limits.maxBytes);
|
|
241
253
|
const file = await deps.service.endpointTools.uploads.uploadValidated({
|
|
242
254
|
invocationId,
|
|
243
255
|
endpointId,
|
|
@@ -258,14 +270,25 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
258
270
|
}
|
|
259
271
|
}, 201);
|
|
260
272
|
} catch (error) {
|
|
261
|
-
const
|
|
273
|
+
const code = error instanceof EndpointUploadError ? error.code : "UPLOAD_FAILED";
|
|
274
|
+
const status = code === "UPLOAD_TOO_LARGE" ? 413 : code === "UPLOAD_BUSY" ? 429 : 400;
|
|
275
|
+
log.warn({
|
|
276
|
+
invocationId,
|
|
277
|
+
endpointId,
|
|
278
|
+
phase: "frame_upload",
|
|
279
|
+
errorCode: code,
|
|
280
|
+
httpStatus: status,
|
|
281
|
+
size: bytes?.byteLength ?? declaredLength
|
|
282
|
+
}, `Endpoint upload rejected: ${code}`);
|
|
262
283
|
return c.json({
|
|
263
284
|
ok: false,
|
|
264
285
|
error: {
|
|
265
|
-
code
|
|
266
|
-
message
|
|
286
|
+
code,
|
|
287
|
+
message: error instanceof EndpointUploadError ? error.message : "Endpoint upload failed"
|
|
267
288
|
}
|
|
268
|
-
},
|
|
289
|
+
}, status);
|
|
290
|
+
} finally {
|
|
291
|
+
bytes?.fill(0);
|
|
269
292
|
}
|
|
270
293
|
});
|
|
271
294
|
authenticated.get("/api/endpoint-tools/files/:fileId", (c) => {
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "endpoint-compatibility",
|
|
8
|
+
match: (path) => path === "/api/endpoint-tools/compatibility",
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerEndpointCompatibilityRoutes } = await import("./endpoint-compatibility.js");
|
|
11
|
+
return { register: registerEndpointCompatibilityRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "imports",
|
|
8
16
|
match: (path) => startsWithAny(path, ["/api/imports"]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
3
3
|
import { computerModelProfile, init_model_policy } from "../../../computer/model-policy.js";
|
|
4
4
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
5
5
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
3
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
|
+
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
@@ -13,17 +13,17 @@ import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
|
13
13
|
import "../storage/sqlite/index.js";
|
|
14
14
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
15
15
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
16
|
+
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
17
|
+
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
18
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
19
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
16
20
|
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
17
|
-
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
18
21
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
19
22
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
20
23
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
21
24
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
22
|
-
import {
|
|
23
|
-
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
24
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
25
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
25
26
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
26
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
27
27
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
28
28
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
29
29
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
1
|
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
|
+
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
5
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
6
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
5
7
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
7
8
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths_state, resolveXopcCloudCatalogCachePath } from "../config/paths-state.js";
|
|
3
|
-
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
5
5
|
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
6
6
|
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
7
7
|
import { readFileSync, rmSync } from "node:fs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
|
+
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
2
|
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
|
+
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { hasGatewayScope } from "../gateway/security/gateway-scopes.js";
|
|
4
|
+
import { EndpointToolPolicyError } from "../endpoint-tools/policy.js";
|
|
4
5
|
import { REALTIME_HEARTBEAT_INTERVAL_MS, REALTIME_HEARTBEAT_TIMEOUT_MS, REALTIME_HELLO_TIMEOUT_MS, REALTIME_MAX_CLIENT_FRAME_BYTES, parseClientRealtimeJsonFrame, parseClientRealtimeMessage } from "../../packages/realtime-protocol/src/index.js";
|
|
5
6
|
import { createPreauthConnectionBudget } from "../gateway/security/preauth-connection-budget.js";
|
|
6
7
|
import { RealtimeBroker } from "./broker.js";
|
|
@@ -246,6 +247,14 @@ var RealtimeRuntime = class {
|
|
|
246
247
|
turnToken: registration.turnToken
|
|
247
248
|
};
|
|
248
249
|
} catch (error) {
|
|
250
|
+
if (error instanceof EndpointToolPolicyError) {
|
|
251
|
+
log.warn({
|
|
252
|
+
err: error,
|
|
253
|
+
principalId: message.payload.endpoint.principalId
|
|
254
|
+
}, "Realtime endpoint contract is incompatible");
|
|
255
|
+
socket.close(4409, "GATEWAY_PROTOCOL_INCOMPATIBLE");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
249
258
|
log.warn({
|
|
250
259
|
err: error,
|
|
251
260
|
principalId: message.payload.endpoint.principalId
|
|
@@ -6,9 +6,9 @@ import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
|
6
6
|
import "../../storage/sqlite/index.js";
|
|
7
7
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
8
8
|
import { init_agent_scope, listAgentEntries, normalizeAgentId } from "../../agent/agent-scope.js";
|
|
9
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
10
9
|
import { createConversation, init_conversation_repository } from "../../storage/sqlite/conversation-repository.js";
|
|
11
10
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
11
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
12
12
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
13
13
|
import { ProjectService } from "../../projects/project-service.js";
|
|
14
14
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { closeXopcDatabase, isXopcDatabaseOpen, openXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
3
3
|
import "../storage/sqlite/index.js";
|
|
4
|
+
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
4
5
|
import { resolveConfigPath } from "../config/paths.js";
|
|
5
6
|
import { loadConfig } from "../config/loader.js";
|
|
6
|
-
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
7
7
|
import { init_providers, providerSupportsOAuth } from "../providers/index.js";
|
|
8
8
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
9
9
|
import { ProjectService } from "../projects/project-service.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
|
+
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
6
|
import { loadSkills } from "../agent/skills/index.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { version } from "../../package.js";
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
|
+
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
4
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
5
|
import { init_paths } from "../config/paths.js";
|
|
4
6
|
import { loadConfig } from "../config/loader.js";
|
|
5
|
-
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
6
7
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
7
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
8
8
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
9
9
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
10
10
|
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
@@ -7,14 +7,14 @@ import { ActivityService } from "../activity/service.js";
|
|
|
7
7
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
8
8
|
import { init_session_key, resolveConversationId } from "../routing/session-key.js";
|
|
9
9
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
10
|
-
import { init_providers, resolveModel } from "../providers/index.js";
|
|
11
|
-
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
12
10
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
11
|
+
import { init_providers, resolveModel } from "../providers/index.js";
|
|
13
12
|
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
14
13
|
import "../knowledge-memory/index.js";
|
|
15
14
|
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
16
15
|
import { getAssertionSlot, getUserAssertion, linkAssertionEvidence, reconcileAssertion, setAssertionStatus } from "../user-model/repository.js";
|
|
17
16
|
import "../user-model/index.js";
|
|
17
|
+
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
18
18
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
19
19
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
20
20
|
import { createUnderstandingSourceRun, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
2
2
|
import { init_conversation_repository, resolveRoutedConversation } from "../../storage/sqlite/conversation-repository.js";
|
|
3
3
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
4
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
4
|
import { extractProfileAgentId, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
7
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.293",
|
|
4
4
|
"description": "Local-first personal AI assistant with reviewable user understanding, durable tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{xn as e}from"./index-B7EieIE4.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
|