@xopcai/xopc 0.0.370 → 0.0.372
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-C61i1QbX.js → agent-avatar-dicebear-D4iAZErG.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-0fCR1DHx.js → agent-defaults-settings-panel-BdxzGSiO.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-Di99mUTT.js → agent-plugin-dialog-BYB0G2aF.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BRZZmYH_.js → agents-D0JBkZPV.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-noqqxkds.js → app-management-settings-panel-C1tQxHaP.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DG8QN0gR.js → appearance-settings-BfavIBbb.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CgiyzFYo.js → apps-page-CUS5S1qa.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CgAcRFDS.js → automations-page-iY0KMPSa.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BIkxIpab.js → automations-workspace-LQsa5ohY.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B1VE-jAe.js → block-editor-Cft0fd_O.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CIjyMS6f.js → browser-automations-page-C6EWx_Y4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BMAivBfp.js → browser-settings-page-CKlt_8IS.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DRdcfo68.js → capabilities-page-UrQ8EY_o.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-ZuL6pWjM.js → capabilities-settings-panel-C9HIr2CZ.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-D0GC1FEv.js → capability-header-actions-uxIiW_2_.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CgE22Pzd.js → channels-By3dmQ4Y.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CEjh1utz.js → chat-terminal-dock-DeDTSl64.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-vFHJAmQr.js → computer-settings-page-Cw1Z1epy.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DTrwZ4kV.js → connector-service-page-D664WEhj.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DRcMiTWu.js → connectors-page-sjyjY7Fl.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-NfGIPSYY.js → date-picker-BVmFrPfX.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CqguveUi.js → dependency-picker-YIoP-e5-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CTx1zkJm.js → desktop-pet-CzS468vR.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BRDS3EGc.js → desktop-pet-settings-BPcgZUcK.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Du4Ciuyw.js → device-pairing-wizard-Cgba-4m9.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CjstlxFl.js → directory-picker-path-field-_nHmZtnY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BfAtjhoK.js → extension-debug-page-IIky9Iqr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BJmudejr.js → extension-page-C-7ngTTj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-Br6LXyIj.js → extension-provider-VFWspV08.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-UvmHniyz.js → extension-settings-page-_hovFCWi.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-euw9MGdt.js → fallback-models-CUHrPpGV.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-BwX_fHUS.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-C7roPHh1.js → gateway-settings-sbaOzlEH.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-BGNCTtM3.js → home-page-DjquRIFR.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DxCoT0VV.js → imports-page-xWWIeT_t.js} +1 -1
- package/dist/gateway/static/root/assets/{index-FCEE325-.js → index-BWDK2eIj.js} +6 -6
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CnLln9Ds.js → keyboard-shortcuts-settings-DWazrDgz.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-yXRkSrEj.js → local-app-workbench-page-CkxDdlYU.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-D46buzTk.js → local-apps-page-BISZ4bi5.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DmcCHnH0.js → logs-page-GiCulc9k.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-khN1ThNL.js → management-settings-GUpOcTqa.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-C_t58yha.js → note-detail-panel-CqealmSc.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-BJ0QS6xx.js → notes-page-BtTU5mnS.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-DfRODHv1.js → page-context-capture-button-Yt-BpPRh.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CiiXwwQE.js → personal-page-C8SEQpEu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-_Bp6HRmm.js → product-open-page-etM6Ijfe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-BUdiO0Ct.js → product-preview-content-C6aeRrWe.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-Clb-fXYk.js → project-detail-page-K4ASOTki.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D9JEEqhh.js → projects-page-BssImjwl.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CmyTq3_l.js → remote-access-hub-BznC_5H0.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B1_inj8L.js → runtime-tools-settings-panel-BJAzqQik.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-CUNAZN2_.js → scenes-page-uZUXm03X.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CfT-9UVw.js → schema-form-SA3Ld7zf.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-BW40VHiL.js → send-session-input-Di3Q846r.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BqlvrjPE.js → session-manager-CWjhJxJs.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CXZKScvu.js → sessions-page-DdL8zVrF.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DmawLOHR.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-1h3vyueg.js → settings-page-CUJQMNF7.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cqc7UlZy.js → setup-status-panel-BGBWC0Bc.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Ce6FNWt1.js → share-preview-page-DJmyACyp.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Dh5jisCK.js → shares-settings-BzqcGh7W.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-deDZeQS8.js → skill-api-9XSn7R8L.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DZozl9U_.js → skills-page-DwyDfh9g.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CtzyMxqq.js → system-settings-panel-B6axBPLO.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-5f_V0h-p.js → task-detail-page-ftCTqBDB.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-vMtlbJ-m.js → tunnel-api-BYU2v0im.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-B1-BCW8U.js → usage-page-BvPcpxTQ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DJya1hIL.js → use-composer-attachments-OFlldkKg.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-C5ONO7sF.js → use-file-preview-expanded-BF1TeNXP.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D4BSq9HJ.js → user-model-page-CqnGITYf.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CjiNYJV5.js → work-discovery-overlay-BDM7BEKH.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DJOetXvm.js → workflow-run-setup-panel-BBwx-tUb.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CcAPFh2R.js → workflows-page-BHigZn6E.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-WhbMvdBE.js → workspace-api-CTm8s6Jr.js} +2 -2
- package/dist/gateway/static/root/index.html +8 -8
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +6 -110
- package/dist/packages/endpoint-tools-protocol/src/personal.js +149 -0
- package/dist/packages/endpoint-tools-protocol/src/shared-schemas.js +116 -0
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +38 -9
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/endpoint-tools/capability-catalog.js +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +20 -7
- package/dist/src/endpoint-tools/policy.js +7 -1
- package/dist/src/endpoint-tools/upload-service.d.ts +4 -2
- package/dist/src/endpoint-tools/upload-service.js +29 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +17 -0
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/gateway-realtime-F6D4A7N5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B2vKXmzg.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CapabilityError } from "./errors.js";
|
|
2
2
|
import { CapabilityDispatcher } from "./dispatcher.js";
|
|
3
|
+
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
3
4
|
import { registerLocalAppReadCapabilities } from "../../local-apps/capabilities/read.js";
|
|
4
5
|
import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
|
|
5
6
|
import { registerNoteWriteCapabilities } from "../../notes/capabilities/write.js";
|
|
@@ -18,7 +19,6 @@ import { registerSceneReadCapabilities } from "../../scenes/capabilities/read.js
|
|
|
18
19
|
import { registerSceneWriteCapabilities } from "../../scenes/capabilities/write.js";
|
|
19
20
|
import { registerSettingsCapability } from "./settings.js";
|
|
20
21
|
import { registerAppContextCapability } from "./app-context.js";
|
|
21
|
-
import { registerAgentCapabilities } from "../../agent-catalog/capabilities.js";
|
|
22
22
|
//#region src/capabilities/runtime/product.ts
|
|
23
23
|
function createProductDispatcher(getNotes, taskWrites) {
|
|
24
24
|
const dispatcher = new CapabilityDispatcher();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
-
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
5
4
|
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
5
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
//#region src/cli/commands/agents.ts
|
|
8
8
|
init_repository();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PROVIDER_ENV_MAP, init_env_keys } from "../../../../providers/env-keys.js";
|
|
2
1
|
import { AgentCatalogRepository, init_repository } from "../../../../agent-catalog/repository.js";
|
|
2
|
+
import { PROVIDER_ENV_MAP, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
3
|
import { getModelOAuthProviderIds, init_registry } from "../../../../auth/oauth/registry.js";
|
|
4
4
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
5
5
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
2
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
2
3
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
5
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
5
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
6
6
|
import { listImageProviderSpecs } from "../../../packages/image-providers/src/catalog.js";
|
|
7
7
|
import "../../../packages/image-providers/src/index.js";
|
|
8
8
|
import { loadConfig } from "../../config/loader.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getApiKeyFromEnv } from "../../../providers/env-keys.js";
|
|
2
1
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
2
|
+
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
3
|
+
import { getApiKeyFromEnv } from "../../../providers/env-keys.js";
|
|
3
4
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
5
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
5
6
|
import { getAgentDefaultModelRef, init_schema } from "../../../config/schema.js";
|
|
6
7
|
import { init_models_json, loadModelsJson, saveModelsJson } from "../../../config/models-json.js";
|
|
7
8
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
8
9
|
import { getAllProviders, getModelsByProvider, getProviderDisplayName, init_providers, providerSupportsApiKey, providerSupportsOAuth } from "../../../providers/index.js";
|
|
9
|
-
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
10
10
|
import { prepareUpdateGlobalDefaults } from "../../../gateway/global-defaults-admin.js";
|
|
11
11
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
12
12
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
2
|
-
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
3
2
|
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
3
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
4
4
|
import { assertConfigRewriteSafeForRunningGateway, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { ensureStarterAgentsInitialized } from "../../agent/starter-agents.js";
|
|
6
6
|
import { bootstrapApplicationStateSync } from "../../bootstrap/application-state.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
1
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
2
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
|
+
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
5
|
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
6
|
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/endpoint-tools/capability-catalog.ts
|
|
2
2
|
/** Server-owned targeting rules; device descriptors cannot change these defaults. */
|
|
3
3
|
function deviceCapabilityTarget(toolName) {
|
|
4
|
-
if (/^(mobile|desktop|web|browser)\.device\./.test(toolName) || toolName === "web.page.get_selection") return "turn_origin";
|
|
4
|
+
if (/^(mobile|desktop|web|browser)\.device\./.test(toolName) || /^(mobile|desktop|web)\.(file\.pick|media\.pick|camera\.capture|contacts\.(pick|search|get)|calendar\.query_(events|free_busy))$/.test(toolName) || toolName === "desktop.clipboard.read" || toolName === "web.page.get_selection") return "turn_origin";
|
|
5
5
|
return "session_bound";
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
@@ -33,8 +33,10 @@ var EndpointInvocationService = class {
|
|
|
33
33
|
const tool = this.registry.getTool(params.endpointId, params.toolName);
|
|
34
34
|
if (!tool) return Promise.reject(this.error("TOOL_NOT_FOUND", "Endpoint tool is unavailable"));
|
|
35
35
|
if (tool.revision !== params.descriptorRevision) return Promise.reject(this.error("TOOL_REVISION_MISMATCH", "Endpoint tool contract changed"));
|
|
36
|
-
if (params.
|
|
37
|
-
|
|
36
|
+
if (!this.ajv.compile(tool.descriptor.inputSchema)(params.arguments)) return Promise.reject(this.error("INVALID_ARGUMENTS", "Invalid endpoint tool arguments"));
|
|
37
|
+
if (params.toolName.startsWith("mobile.calendar.")) {
|
|
38
|
+
const { startAt, endAt } = params.arguments;
|
|
39
|
+
if (typeof startAt !== "number" || typeof endAt !== "number" || endAt <= startAt || endAt - startAt > 7 * 864e5) return Promise.reject(this.error("INVALID_ARGUMENTS", "Calendar range must be positive and at most seven days"));
|
|
38
40
|
}
|
|
39
41
|
let confirmationRequired;
|
|
40
42
|
try {
|
|
@@ -45,11 +47,12 @@ var EndpointInvocationService = class {
|
|
|
45
47
|
}
|
|
46
48
|
if (params.signal?.aborted) return Promise.reject(this.error("TOOL_CANCELLED", "Endpoint tool call was cancelled"));
|
|
47
49
|
const endpointPending = [...this.pending.values()].filter((item) => item.endpointId === params.endpointId);
|
|
50
|
+
if (tool.descriptor.sensitivity === "personal" && tool.descriptor.requiresForeground && endpointPending.some((item) => item.descriptor.sensitivity === "personal" && item.descriptor.requiresForeground)) return Promise.reject(this.error("TOOL_BUSY", "A personal device request is already awaiting user participation"));
|
|
48
51
|
if (endpointPending.length >= 4) return Promise.reject(this.error("TOOL_BUSY", "Endpoint has reached its invocation limit"));
|
|
49
52
|
if (endpointPending.filter((item) => item.toolName === params.toolName).length >= tool.descriptor.maxConcurrency) return Promise.reject(this.error("TOOL_BUSY", "Endpoint tool has reached its invocation limit"));
|
|
50
53
|
const invocationId = crypto.randomUUID();
|
|
51
54
|
const startedAt = Date.now();
|
|
52
|
-
const uploadGrant = tool.descriptor.resultKinds.includes("file") ? this.options.uploads?.createGrant(invocationId, params.endpointId, startedAt, params.toolName === "desktop.computer.control" ? "computer-frame" : "durable") : void 0;
|
|
55
|
+
const uploadGrant = tool.descriptor.resultKinds.includes("file") ? this.options.uploads?.createGrant(invocationId, params.endpointId, startedAt, params.toolName === "desktop.computer.control" ? "computer-frame" : params.toolName.startsWith("mobile.") ? "personal" : "durable", endpoint.principalId) : void 0;
|
|
53
56
|
try {
|
|
54
57
|
this.options.audit?.started({
|
|
55
58
|
id: invocationId,
|
|
@@ -72,6 +75,7 @@ var EndpointInvocationService = class {
|
|
|
72
75
|
endpointId: params.endpointId,
|
|
73
76
|
toolName: params.toolName,
|
|
74
77
|
descriptor: tool.descriptor,
|
|
78
|
+
arguments: params.arguments,
|
|
75
79
|
state: "sent",
|
|
76
80
|
receiptTimer: setTimeout(() => {
|
|
77
81
|
this.fail(invocationId, this.error("TOOL_TIMEOUT", "Endpoint did not receive the invocation"));
|
|
@@ -116,7 +120,7 @@ var EndpointInvocationService = class {
|
|
|
116
120
|
clearTimeout(pending.receiptTimer);
|
|
117
121
|
return;
|
|
118
122
|
case "tool.progress":
|
|
119
|
-
if (pending.
|
|
123
|
+
if (pending.descriptor.sensitivity === "personal" && pending.descriptor.effect === "read") return;
|
|
120
124
|
if (pending.state !== "running") return;
|
|
121
125
|
pending.onProgress?.({
|
|
122
126
|
...message.payload.message === void 0 ? {} : { message: message.payload.message },
|
|
@@ -128,18 +132,27 @@ var EndpointInvocationService = class {
|
|
|
128
132
|
try {
|
|
129
133
|
const validate = this.ajv.compile(pending.descriptor.outputSchema);
|
|
130
134
|
if (!validate(message.payload.content)) throw new Error(`Endpoint result does not match its contract: ${this.ajv.errorsText(validate.errors)}`);
|
|
135
|
+
const reading = message.payload.content[0];
|
|
136
|
+
if (pending.toolName.startsWith("mobile.calendar.") && reading?.type === "json") {
|
|
137
|
+
const value = reading.value;
|
|
138
|
+
if (value.startAt !== pending.arguments.startAt || value.endAt !== pending.arguments.endAt || value.events.some((event) => event.endAt <= event.startAt || event.endAt <= value.startAt || event.startAt >= value.endAt) || pending.toolName.endsWith("free_busy") && value.events.some((event) => event.title !== void 0)) throw new Error("Calendar result exceeded the approved scope");
|
|
139
|
+
}
|
|
140
|
+
if (pending.toolName === "mobile.contacts.pick" && reading?.type === "json" && pending.arguments.field) {
|
|
141
|
+
const value = reading.value;
|
|
142
|
+
if (pending.arguments.field === "phone" && (value.phones.length > 1 || value.emails.length) || pending.arguments.field === "email" && (value.emails.length > 1 || value.phones.length)) throw new Error("Contact result exceeded the selected field");
|
|
143
|
+
}
|
|
131
144
|
this.options.uploads?.validateAndClose(invocationId, message.payload.content);
|
|
132
145
|
} catch (error) {
|
|
133
|
-
this.fail(invocationId, this.error("PROTOCOL_ERROR", pending.
|
|
146
|
+
this.fail(invocationId, this.error("PROTOCOL_ERROR", pending.descriptor.sensitivity === "personal" && pending.descriptor.effect === "read" ? "Invalid personal device result" : error instanceof Error ? error.message : String(error)));
|
|
134
147
|
return;
|
|
135
148
|
}
|
|
136
149
|
this.succeed(invocationId, {
|
|
137
150
|
content: message.payload.content,
|
|
138
|
-
...message.payload.details === void 0 ? {} : { details: message.payload.details }
|
|
151
|
+
...message.payload.details === void 0 || pending.descriptor.sensitivity === "personal" && pending.descriptor.effect === "read" ? {} : { details: message.payload.details }
|
|
139
152
|
});
|
|
140
153
|
return;
|
|
141
154
|
case "tool.error":
|
|
142
|
-
this.fail(invocationId, this.error(message.payload.code, pending.
|
|
155
|
+
this.fail(invocationId, this.error(message.payload.code, pending.descriptor.sensitivity === "personal" && pending.descriptor.effect === "read" ? `Personal device request failed: ${message.payload.code}` : message.payload.message));
|
|
143
156
|
return;
|
|
144
157
|
case "tool.cancelled": this.fail(invocationId, this.error("TOOL_CANCELLED", "Endpoint cancelled the tool call"));
|
|
145
158
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { DEVICE_EMPTY_INPUT_SCHEMA, ENDPOINT_CONTACT_LIST_OUTPUT_SCHEMA, ENDPOINT_CONTACT_OUTPUT_SCHEMA, ENDPOINT_FILE_OUTPUT_SCHEMA } from "../../packages/endpoint-tools-protocol/src/shared-schemas.js";
|
|
1
2
|
import { BRIDGE_LIST_OUTPUT_SCHEMA, BRIDGE_READ_INPUT_SCHEMA, BRIDGE_READ_OUTPUT_SCHEMA } from "../../packages/endpoint-tools-protocol/src/bridge.js";
|
|
2
3
|
import { LOCATION_INPUT_SCHEMA, LOCATION_OUTPUT_SCHEMA } from "../../packages/endpoint-tools-protocol/src/location.js";
|
|
3
|
-
import {
|
|
4
|
+
import { PERSONAL_TOOL_NAMES, personalDescriptor } from "../../packages/endpoint-tools-protocol/src/personal.js";
|
|
5
|
+
import { DEVICE_POWER_OUTPUT_SCHEMA, DEVICE_STATE_OUTPUT_SCHEMA, ENDPOINT_TEXT_OUTPUT_SCHEMA, canonicalJson, init_src } from "../../packages/endpoint-tools-protocol/src/index.js";
|
|
4
6
|
import { COMPUTER_INPUT_SCHEMA, COMPUTER_OUTPUT_SCHEMA, init_src as init_src$1 } from "../../packages/computer-control-contract/src/index.js";
|
|
5
7
|
import { BROWSER_CONTROL_ENDPOINT_DESCRIPTOR, BROWSER_CONTROL_ENDPOINT_INPUT_SCHEMA, BROWSER_CONTROL_ENDPOINT_OUTPUT_SCHEMA, BROWSER_RECORDING_ENDPOINT_DESCRIPTOR, BROWSER_RECORDING_ENDPOINT_INPUT_SCHEMA } from "../../packages/browser-control-contract/src/index.js";
|
|
6
8
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
@@ -48,6 +50,10 @@ const POLICY_BY_TOOL = {
|
|
|
48
50
|
"mobile.contacts.search": contract("personal.foreground-read", ENDPOINT_CONTACT_LIST_OUTPUT_SCHEMA, ["json"], ["contacts-read"]),
|
|
49
51
|
"mobile.contacts.get": contract("personal.foreground-read", ENDPOINT_CONTACT_OUTPUT_SCHEMA, ["json"], ["contacts-read"]),
|
|
50
52
|
"mobile.file.pick": contract("personal.foreground-mediated-read", ENDPOINT_FILE_OUTPUT_SCHEMA, ["file"], ["file-read"], ["personal.foreground-read"]),
|
|
53
|
+
...Object.fromEntries(PERSONAL_TOOL_NAMES.map((name) => {
|
|
54
|
+
const descriptor = personalDescriptor(name);
|
|
55
|
+
return [name, contract(descriptor.policyId, descriptor.outputSchema, descriptor.resultKinds, descriptor.requiredPermissions, ["mobile.file.pick", "mobile.contacts.pick"].includes(name) ? ["personal.foreground-read"] : [], ["mobile.file.pick", "mobile.contacts.pick"].includes(name) ? void 0 : descriptor.inputSchema)];
|
|
56
|
+
})),
|
|
51
57
|
"mobile.file.share": contract("user.foreground-mediated-write", ENDPOINT_TEXT_OUTPUT_SCHEMA, ["text"], ["file-share"], ["user.foreground-write"]),
|
|
52
58
|
"mobile.notification.show": contract("user.foreground-write", ENDPOINT_TEXT_OUTPUT_SCHEMA, ["text"], ["notifications"]),
|
|
53
59
|
"mobile.device.get_info": contract("public.background-read", ENDPOINT_TEXT_OUTPUT_SCHEMA, ["text"], []),
|
|
@@ -3,6 +3,8 @@ export declare const ENDPOINT_UPLOAD_MAX_BYTES: number;
|
|
|
3
3
|
export interface EndpointUploadedFile {
|
|
4
4
|
fileId: string;
|
|
5
5
|
invocationId: string;
|
|
6
|
+
endpointId: string;
|
|
7
|
+
principalId?: string;
|
|
6
8
|
name: string;
|
|
7
9
|
mimeType: string;
|
|
8
10
|
size: number;
|
|
@@ -28,7 +30,7 @@ export declare class EndpointUploadService {
|
|
|
28
30
|
private readonly pruneTimer;
|
|
29
31
|
private readonly validatingFrames;
|
|
30
32
|
constructor(rootDir: string);
|
|
31
|
-
createGrant(invocationId: string, endpointId: string, now?: number, profile?: 'durable' | 'computer-frame'): EndpointUploadGrant;
|
|
33
|
+
createGrant(invocationId: string, endpointId: string, now?: number, profile?: 'durable' | 'computer-frame' | 'personal', principalId?: string): EndpointUploadGrant;
|
|
32
34
|
upload(params: {
|
|
33
35
|
invocationId: string;
|
|
34
36
|
endpointId: string;
|
|
@@ -45,7 +47,7 @@ export declare class EndpointUploadService {
|
|
|
45
47
|
readFile(fileId: string): Uint8Array | undefined;
|
|
46
48
|
getGrantLimits(invocationId: string, endpointId: string, token: string): {
|
|
47
49
|
maxBytes: number;
|
|
48
|
-
profile: "durable" | "computer-frame";
|
|
50
|
+
profile: "personal" | "durable" | "computer-frame";
|
|
49
51
|
};
|
|
50
52
|
uploadValidated(params: Parameters<EndpointUploadService['upload']>[0]): Promise<EndpointUploadedFile>;
|
|
51
53
|
/** Single-consumer handoff, inaccessible through generic attachment routes. */
|
|
@@ -31,16 +31,17 @@ var EndpointUploadService = class {
|
|
|
31
31
|
this.pruneTimer = setInterval(() => this.pruneFrames(Date.now()), 1e3);
|
|
32
32
|
this.pruneTimer.unref();
|
|
33
33
|
}
|
|
34
|
-
createGrant(invocationId, endpointId, now = Date.now(), profile = "durable") {
|
|
34
|
+
createGrant(invocationId, endpointId, now = Date.now(), profile = "durable", principalId) {
|
|
35
35
|
const token = crypto.randomUUID();
|
|
36
36
|
const grant = {
|
|
37
37
|
profile,
|
|
38
|
+
principalId,
|
|
38
39
|
invocationId,
|
|
39
40
|
endpointId,
|
|
40
41
|
token,
|
|
41
42
|
expiresAt: now + GRANT_TTL_MS,
|
|
42
|
-
maxBytes: profile === "computer-frame" ? COMPUTER_FRAME_MAX_BYTES : ENDPOINT_UPLOAD_MAX_BYTES,
|
|
43
|
-
maxFiles: profile === "
|
|
43
|
+
maxBytes: profile === "computer-frame" ? COMPUTER_FRAME_MAX_BYTES : profile === "personal" ? 10 * 1024 * 1024 : ENDPOINT_UPLOAD_MAX_BYTES,
|
|
44
|
+
maxFiles: profile === "durable" ? DEFAULT_MAX_FILES : 1,
|
|
44
45
|
uploadedFileIds: []
|
|
45
46
|
};
|
|
46
47
|
this.grants.set(invocationId, grant);
|
|
@@ -66,7 +67,7 @@ var EndpointUploadService = class {
|
|
|
66
67
|
const fileId = crypto.randomUUID();
|
|
67
68
|
const path = join(this.rootDir, fileId);
|
|
68
69
|
const sha256 = crypto.createHash("sha256").update(params.bytes).digest("hex");
|
|
69
|
-
if (grant.profile
|
|
70
|
+
if (grant.profile !== "computer-frame") writeFileSync(path, params.bytes, {
|
|
70
71
|
flag: "wx",
|
|
71
72
|
mode: 384
|
|
72
73
|
});
|
|
@@ -83,6 +84,8 @@ var EndpointUploadService = class {
|
|
|
83
84
|
const file = {
|
|
84
85
|
fileId,
|
|
85
86
|
invocationId: params.invocationId,
|
|
87
|
+
endpointId: params.endpointId,
|
|
88
|
+
principalId: grant.principalId,
|
|
86
89
|
name: params.name,
|
|
87
90
|
mimeType: params.mimeType,
|
|
88
91
|
size: params.bytes.byteLength,
|
|
@@ -154,6 +157,28 @@ var EndpointUploadService = class {
|
|
|
154
157
|
validatedFrame: true
|
|
155
158
|
});
|
|
156
159
|
}
|
|
160
|
+
if (grant.profile === "personal" && params.mimeType.startsWith("image/")) try {
|
|
161
|
+
const image = sharp(params.bytes, {
|
|
162
|
+
limitInputPixels: 4e7,
|
|
163
|
+
failOn: "warning"
|
|
164
|
+
});
|
|
165
|
+
if (((await image.metadata()).pages ?? 1) !== 1) throw new Error("Animated images are unsupported");
|
|
166
|
+
const bytes = await image.rotate().resize({
|
|
167
|
+
width: 2048,
|
|
168
|
+
height: 2048,
|
|
169
|
+
fit: "inside",
|
|
170
|
+
withoutEnlargement: true
|
|
171
|
+
}).jpeg({ quality: 85 }).toBuffer();
|
|
172
|
+
return this.upload({
|
|
173
|
+
...params,
|
|
174
|
+
bytes,
|
|
175
|
+
name: params.name.replace(/\.[^.]*$/, "").slice(0, 251) + ".jpg",
|
|
176
|
+
mimeType: "image/jpeg"
|
|
177
|
+
});
|
|
178
|
+
} catch (error) {
|
|
179
|
+
if (error instanceof EndpointUploadError) throw error;
|
|
180
|
+
throw new EndpointUploadError("Selected image could not be decoded");
|
|
181
|
+
}
|
|
157
182
|
return this.upload(params);
|
|
158
183
|
}
|
|
159
184
|
/** Single-consumer handoff, inaccessible through generic attachment routes. */
|
|
@@ -2,8 +2,8 @@ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
6
5
|
import yaml from "js-yaml";
|
|
6
|
+
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
7
7
|
//#region src/extensions/agent-plugins/validation.ts
|
|
8
8
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
9
9
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
|
-
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
5
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
7
|
+
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
1
|
import { AgentEntrySchema, AgentModelsOverrideSchema, AgentProfileSchema, RuntimePolicySchema, SkillOverrideSchema, ToolPoliciesSchema, WorkflowPolicySchema } from "../../../agent-config/schema.js";
|
|
3
2
|
import { init_agent_config } from "../../../agent-config/index.js";
|
|
3
|
+
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
4
4
|
import { init_agent_scope } from "../../../agent/agent-scope.js";
|
|
5
5
|
import { createGatewayAgent, deleteAgentAvatarFile, deleteGatewayAgent, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, readAgentAvatarFile, readAgentProfileFile, resolveAgentAvatarImage, updateGatewayAgent, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
6
6
|
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
2
3
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
3
4
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
4
5
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
6
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
7
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -22,6 +22,7 @@ function registerEndpointCompatibilityRoutes(authenticated) {
|
|
|
22
22
|
deviceStateToolsV1: true,
|
|
23
23
|
hardwareBridgeV1: true,
|
|
24
24
|
deviceLocationTasksV1: true,
|
|
25
|
+
mobilePersonalToolsV1: true,
|
|
25
26
|
...principal.kind === "device" ? { deviceId: principal.deviceId } : {},
|
|
26
27
|
endpointProtocolVersion: 2,
|
|
27
28
|
computerControl: COMPUTER_DESCRIPTOR,
|
|
@@ -308,6 +308,15 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
308
308
|
message: "Uploaded file is too large"
|
|
309
309
|
}
|
|
310
310
|
}, 413);
|
|
311
|
+
const actor = getGatewayPrincipal(c);
|
|
312
|
+
const endpoint = deps.service.endpointTools.registry.get(endpointId);
|
|
313
|
+
if (actor.kind !== "owner" && !(actor.kind === "device" && actor.deviceId === endpoint?.principalId)) return c.json({
|
|
314
|
+
ok: false,
|
|
315
|
+
error: {
|
|
316
|
+
code: "FORBIDDEN",
|
|
317
|
+
message: "Upload belongs to another device"
|
|
318
|
+
}
|
|
319
|
+
}, 403);
|
|
311
320
|
let bytes;
|
|
312
321
|
try {
|
|
313
322
|
const limits = deps.service.endpointTools.uploads.getGrantLimits(invocationId, endpointId, token);
|
|
@@ -356,6 +365,14 @@ function registerEndpointToolRoutes(authenticated, deps) {
|
|
|
356
365
|
});
|
|
357
366
|
authenticated.get("/api/endpoint-tools/files/:fileId", (c) => {
|
|
358
367
|
const file = deps.service.endpointTools.uploads.getFile(c.req.param("fileId"));
|
|
368
|
+
const actor = getGatewayPrincipal(c);
|
|
369
|
+
if (file && actor.kind !== "owner" && !(actor.kind === "device" && actor.deviceId === file.principalId)) return c.json({
|
|
370
|
+
ok: false,
|
|
371
|
+
error: {
|
|
372
|
+
code: "FORBIDDEN",
|
|
373
|
+
message: "Endpoint file is not accessible"
|
|
374
|
+
}
|
|
375
|
+
}, 403);
|
|
359
376
|
const bytes = file && deps.service.endpointTools.uploads.readFile(file.fileId);
|
|
360
377
|
if (!file || !bytes) return c.json({
|
|
361
378
|
ok: false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
4
|
-
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
3
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
4
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
|
+
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
|
+
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
7
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
8
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
9
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
@@ -7,12 +7,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
7
7
|
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
8
8
|
import { ActivityService } from "../../../activity/service.js";
|
|
9
9
|
import "../../../activity/index.js";
|
|
10
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
12
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
11
13
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
12
14
|
import "../../../knowledge-memory/index.js";
|
|
13
15
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
15
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
16
16
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
17
17
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
18
18
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -5,9 +5,9 @@ import { endpointContextSchema } from "../../../../packages/gateway-contract/src
|
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
9
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
9
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
11
11
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
12
12
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
13
13
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
@@ -6,9 +6,9 @@ import { hasGatewayScope, init_gateway_scopes } from "../../security/gateway-sco
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
10
9
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
10
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
12
12
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
13
13
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
14
14
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
5
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
5
6
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
6
7
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
7
8
|
import "../media-shared/http/index.js";
|
|
8
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
|
@@ -91,6 +91,10 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
91
91
|
import "../discussions/index.js";
|
|
92
92
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
93
93
|
import "../endpoint-tools/index.js";
|
|
94
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
95
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
96
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
97
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
94
98
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
95
99
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
96
100
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
@@ -155,10 +159,6 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
|
|
|
155
159
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
156
160
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
157
161
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
158
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
159
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
160
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
161
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
162
162
|
import crypto from "node:crypto";
|
|
163
163
|
//#region src/gateway/service.ts
|
|
164
164
|
init_session_repository();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
2
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
2
3
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
3
4
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
4
5
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
6
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
7
7
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
8
8
|
init_repository();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
4
3
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
6
4
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
7
5
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -5,10 +5,10 @@ import { currentOperationId, init_operation_context } from "../infra/operation-c
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
8
9
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
9
10
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
10
11
|
import { LocalAppStore } from "./store.js";
|
|
11
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getNoteAgentContextRecord, upsertNoteAgentContextRecord } from "../storage/sqlite/note-agent-context-repository.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
|
+
import { extractDocumentText } from "../document-understanding/extract.js";
|
|
3
4
|
import { resolveImageModelConfigForTool } from "../agent/image/tool-model-config.js";
|
|
4
5
|
import { describeImagesWithFallback } from "../agent/image/understanding/runtime.js";
|
|
5
|
-
import { extractDocumentText } from "../document-understanding/extract.js";
|
|
6
6
|
import { transcribe } from "../voice/stt/transcribe-core.js";
|
|
7
7
|
import { isSTTAvailable } from "../voice/stt/availability.js";
|
|
8
8
|
import { mergeSttConfigFromAppConfig } from "../voice/stt/config.js";
|
|
@@ -4,12 +4,12 @@ import { init_config_repository, setSessionConfig } from "../storage/sqlite/conf
|
|
|
4
4
|
import { ResponsePreferencesSchema } from "../agent-config/schema.js";
|
|
5
5
|
import { init_agent_config } from "../agent-config/index.js";
|
|
6
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
7
8
|
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
8
9
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
9
10
|
import { DEFAULT_PERSONAL_PREFERENCES, getPersonalAgent, personalAgentId } from "./repository.js";
|
|
10
11
|
import { PERSONAL_MAIN_TOOL_IDS, PERSONAL_READ_TOOL_ALIASES } from "./policy.js";
|
|
11
12
|
import { getModelThinking } from "../providers/model-thinking.js";
|
|
12
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
13
13
|
import { personalInstructions, upgradePersonalInstructions } from "./prompts.js";
|
|
14
14
|
import { completePersonalOnboarding } from "./onboarding.js";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -2,10 +2,10 @@ import { ProductReadContracts } from "../../../packages/gateway-contract/src/cap
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
6
|
-
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
7
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
6
|
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
+
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
8
|
+
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
9
9
|
import { TaskContextRepository } from "../task-context-repository.js";
|
|
10
10
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
11
11
|
import { TaskCriterionReviewRepository } from "../task-criterion-review-repository.js";
|
|
@@ -10,6 +10,7 @@ import { getSessionMetadata } from "../../storage/sqlite/session-read-repository
|
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
11
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
12
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
13
14
|
import { init_paths } from "../../config/paths.js";
|
|
14
15
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
15
16
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
@@ -22,7 +23,6 @@ import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
|
22
23
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
23
24
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
24
25
|
import { evictEmbeddedSessionRunner } from "../../agent/embedded/session-runner.js";
|
|
25
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
26
26
|
import { SessionIndex } from "../../session/manager.js";
|
|
27
27
|
import "../../session/index.js";
|
|
28
28
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
2
|
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.372",
|
|
4
4
|
"description": "Local-first personal AI with Ada, task delegation, files, projects, workflows, and automations. Use cloud or local models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -165,14 +165,14 @@
|
|
|
165
165
|
"vitepress": "^1.6.4",
|
|
166
166
|
"vitest": "4.1.5",
|
|
167
167
|
"vue": "^3.5.35",
|
|
168
|
-
"@xopcai/browser-control-contract": "0.1.0",
|
|
169
168
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
169
|
+
"@xopcai/browser-control-contract": "0.1.0",
|
|
170
170
|
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
171
171
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
172
|
-
"@xopcai/image-providers": "0.1.0",
|
|
173
172
|
"@xopcai/gateway-contract": "0.0.0",
|
|
174
|
-
"@xopcai/
|
|
175
|
-
"@xopcai/realtime-protocol": "0.0.0"
|
|
173
|
+
"@xopcai/image-providers": "0.1.0",
|
|
174
|
+
"@xopcai/realtime-protocol": "0.0.0",
|
|
175
|
+
"@xopcai/realtime-client": "0.0.0"
|
|
176
176
|
},
|
|
177
177
|
"scripts": {
|
|
178
178
|
"generate:device-tools": "tsx scripts/devices/generate-mobile-tools.mts",
|