@xopcai/xopc 0.0.359 → 0.0.360
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-D-yhlYSG.js → agent-avatar-dicebear-CQTERenW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CPF0lunJ.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BjDaZlKy.js +1 -0
- package/dist/gateway/static/root/assets/agents-XopBILLB.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CiSdkzuX.js → app-management-settings-panel-V5QVeMvW.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-SdlCHKg8.js → appearance-settings-BDkRcoI6.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-ntyBe6mP.js → apps-page-DzCyL89L.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DU0R5C65.js → automations-page-DOu1wMOV.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CiY_2otj.js +7 -0
- package/dist/gateway/static/root/assets/{block-editor-CLejMPkV.js → block-editor-K6is5GrS.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automations-page-BjGswNM0.js → browser-automations-page-B8IiXEBs.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-DBcYssNQ.js → browser-settings-page-Cms2Bu3Q.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-page-CsTpcrPP.js → capabilities-page-BAFRNHQv.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cws6od1d.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-B0Xiav_-.js → capability-header-actions-wh3Nr0qS.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DxwismTc.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C9pMFB6k.js → chat-terminal-dock-BU-X9nu1.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-MyXsSqFJ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-OyQKwHNr.js → connector-service-page-DyxPM_MZ.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C7-OC3MW.js +2 -0
- package/dist/gateway/static/root/assets/{constants-Co2_smKQ.js → constants-Dy8Gw0sF.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DxGsweV_.js → date-picker-WRFvi7Pu.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-D9ZfAJwn.js → dependency-picker-CLun5Tst.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DFgK1z5i.js → desktop-pet-iaVa9vVM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CyFW0raW.js → desktop-pet-settings-0RS3sP3Z.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DVAGb04L.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-2nrl6Exh.js → directory-picker-path-field-Btlldlt3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BodxNAys.js → extension-debug-page-BImQT4PU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DMb2YFlb.js → extension-page-BmuLv-ET.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-aigS3RJu.js → extension-provider-Dg7cRxDX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-D3hvXtxi.js → extension-settings-page-7Kr8UJK4.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-DsXySQVF.js → fallback-models-B0w1lumZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-DmPvmwYp.js +1 -0
- package/dist/gateway/static/root/assets/home-page-N0Mp-eTJ.js +1 -0
- package/dist/gateway/static/root/assets/{imports-page-Czzsa_Eu.js → imports-page-BLOJY67-.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DUgsBdV3.css → index-B7AHDHSO.css} +1 -1
- package/dist/gateway/static/root/assets/{index-DUU_2HF0.js → index-BXrBL_Hb.js} +41 -41
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DqsFlXlp.js → keyboard-shortcuts-settings-Dlbsip2R.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BcDFXc1k.js → local-app-workbench-page-nyWeTK0r.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BaxqXA1-.js → local-apps-page-CfEpFLs0.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DmJjZ0Uk.js → logs-page-A38cawkA.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-1O7zsu4t.js → management-settings-Cse9K61x.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BLvVlQG8.js → note-detail-panel-CUGVyo2V.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-Dk89l5dC.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-gL3453SU.js → page-context-capture-button-C72qIgBg.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DCtduzh8.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Dw8JPizo.js → product-open-page-CT98FsVl.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-Zg4KZ0vK.js → project-detail-page-BlqOVwKP.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-B33uj1lz.js → projects-page-DVN2q_yR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BP5kUgIN.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BLNXzyeh.js → runtime-tools-settings-panel-ry0jprz7.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-D868Zuj9.js → scenes-page-CV1GkOj6.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-5z33VTce.js → schema-form-C5zMrxgR.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-OaBPDJ9E.js → send-session-input-Dt0t5SoR.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-DDR-gv_e.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BXtGeOsR.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CvFVkELy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-BG_dOYMq.js → settings-page-C88fsfZF.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DNj1hD_H.js → setup-status-panel-DESlRgZS.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-M_rAQR60.js → share-preview-page-D5Gey-6E.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-btoP07Fx.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BBaKs-Xx.js → skill-api-1hbX3qDC.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DYJbwwBT.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DKjsZo49.js → system-settings-panel-DbNk-Jwq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DSvaiKGb.js → task-detail-page-DoLKOJrE.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DR8Qu6R_.js → tunnel-api-H3FheXYH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CAIqAduR.js → usage-page-DGbqcsV6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-CUaywGe0.js → use-composer-attachments-pzPAUV_o.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D809I8ur.js → use-file-preview-expanded-DNhXjL0W.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-7pW4Pazn.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-wGFcle2p.js → work-discovery-overlay-DfyI9kVf.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CewS2IbN.js → workflow-run-setup-panel-De80GODZ.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BuH3pC1C.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-BtXzxf_w.js → workspace-api-Dwa8kHdY.js} +2 -2
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +30 -0
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/context/workspace-templates/SOUL.md +2 -0
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +41 -1
- 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/prompt/sections/behavior.js +4 -1
- package/dist/src/agent/prompt/sections/memory-skills.js +2 -0
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-config-service.js +11 -3
- package/dist/src/agent/skills/hub-lock.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/factory.js +32 -6
- package/dist/src/agent/tools/personal-preference-tool.js +11 -0
- package/dist/src/agent/tools/personal-request-result-tool.d.ts +22 -0
- package/dist/src/agent/tools/personal-request-result-tool.js +84 -0
- package/dist/src/agent/tools/personal-request-tool.d.ts +3 -0
- package/dist/src/agent/tools/personal-request-tool.js +100 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +6 -0
- package/dist/src/agent/tools/personal-task-tool.js +12 -10
- package/dist/src/agent/tools/tool-media.js +2 -3
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.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/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/templates.js +4 -0
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -0
- package/dist/src/connectors/connection-recovery-service.js +23 -5
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +4 -3
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.js +68 -0
- 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 +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +46 -5
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media/index.js +2 -2
- package/dist/src/media/session-references.d.ts +2 -0
- package/dist/src/media/session-references.js +22 -2
- package/dist/src/media/store.d.ts +1 -0
- package/dist/src/media/store.js +2 -1
- package/dist/src/personal-agent/capability-service.d.ts +14 -0
- package/dist/src/personal-agent/capability-service.js +63 -0
- package/dist/src/personal-agent/communication.d.ts +4 -0
- package/dist/src/personal-agent/communication.js +24 -0
- package/dist/src/personal-agent/model-config.d.ts +5 -0
- package/dist/src/personal-agent/model-config.js +59 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +2 -0
- package/dist/src/personal-agent/repository.d.ts +1 -0
- package/dist/src/personal-agent/repository.js +3 -1
- package/dist/src/personal-agent/request-delivery.d.ts +4 -0
- package/dist/src/personal-agent/request-delivery.js +159 -0
- package/dist/src/personal-agent/request-repository.d.ts +33 -0
- package/dist/src/personal-agent/request-repository.js +71 -0
- package/dist/src/personal-agent/request-result.d.ts +21 -0
- package/dist/src/personal-agent/request-result.js +45 -0
- package/dist/src/personal-agent/request-service.d.ts +18 -0
- package/dist/src/personal-agent/request-service.js +308 -0
- package/dist/src/personal-agent/service.js +30 -7
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/session/client-history.d.ts +2 -1
- package/dist/src/session/client-history.js +40 -0
- package/dist/src/session/compact-history.js +9 -5
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/session-context-for-llm.js +55 -0
- package/dist/src/session/store.js +2 -0
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +5 -1
- package/dist/src/storage/sqlite/connection-wait-repository.js +38 -8
- package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +32 -0
- package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +28 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +33 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +7 -0
- package/dist/src/tasks/task-context-assembler.js +1 -0
- package/dist/src/tasks/task-main-update-delivery.js +32 -1
- package/dist/src/tasks/task-result-delivery-repository.d.ts +18 -0
- package/dist/src/tasks/task-result-delivery-repository.js +144 -0
- package/dist/src/tasks/task-result-delivery-service.d.ts +4 -0
- package/dist/src/tasks/task-result-delivery-service.js +128 -0
- package/dist/src/tasks/task-run-coordinator.js +6 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +22 -3
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CYq-3pbE.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-Cx3UbhqT.js +0 -1
- package/dist/gateway/static/root/assets/agents-Ce9uvui7.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BaHJml4R.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BXlVwnMr.js +0 -8
- package/dist/gateway/static/root/assets/channels-TPqwcbZ4.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-BJOn14Ow.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DBWH5bVr.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-C6Co5dT3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CubM1m6Z.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CQ9y_LMT.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-AWU_G61i.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-BPy5m3QR.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BZoUVzgS.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-BK5IvdGz.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-Du7ueBFc.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CaxCsIIZ.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Cr_Ut6FE.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DU7fV5pc.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-C--t6SLp.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CxfsWFL5.js +0 -6
|
@@ -6,6 +6,7 @@ import { init_providers, isProviderConfiguredSync, resolveModel } from "../../pr
|
|
|
6
6
|
import { TaskOriginRepository } from "../../tasks/task-origin-repository.js";
|
|
7
7
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
8
8
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
9
|
+
import { PERSONAL_WORKER_RESULT_GUIDANCE } from "../../personal-agent/communication.js";
|
|
9
10
|
import { randomUUID } from "node:crypto";
|
|
10
11
|
import { Type } from "@sinclair/typebox";
|
|
11
12
|
//#region src/agent/tools/personal-task-tool.ts
|
|
@@ -49,14 +50,16 @@ const DISCOVERY_TOOLS = [
|
|
|
49
50
|
"workflow",
|
|
50
51
|
"xopc_use",
|
|
51
52
|
"xopc_tool_search",
|
|
53
|
+
"xopc_tool_describe",
|
|
54
|
+
"xopc_tool_execute",
|
|
52
55
|
"computer_use",
|
|
53
56
|
"send_message",
|
|
54
57
|
"text_to_speech"
|
|
55
58
|
];
|
|
56
|
-
function
|
|
59
|
+
function getAvailablePersonalAgentTools(config, deps) {
|
|
57
60
|
return (config.toolAllowlist ? [...new Set([...DISCOVERY_TOOLS, ...config.toolAllowlist])] : DISCOVERY_TOOLS).filter((name) => (name !== "browser_use" || deps.getConfig?.()?.browser?.enabled !== false) && (!config.toolAllowlist || config.toolAllowlist.includes(name)) && config.tools[name]?.mode !== "deny");
|
|
58
61
|
}
|
|
59
|
-
function
|
|
62
|
+
function personalAgentModelAvailability(config) {
|
|
60
63
|
for (const ref of [config.models.chat.primary, ...config.models.chat.fallbacks]) try {
|
|
61
64
|
if (isProviderConfiguredSync(resolveModel(ref).provider)) return { available: true };
|
|
62
65
|
} catch {}
|
|
@@ -72,11 +75,10 @@ function buildPersonalTaskBrief(input) {
|
|
|
72
75
|
const title = firstClause.length > MAX_PERSONAL_TASK_TITLE ? `${firstClause.slice(0, MAX_PERSONAL_TASK_TITLE - 1).trimEnd()}…` : firstClause;
|
|
73
76
|
const objective = fullObjective.length > 120 ? title : fullObjective;
|
|
74
77
|
const description = input.description?.trim();
|
|
75
|
-
const body = fullObjective !== objective ? [fullObjective, description].filter(Boolean).join("\n\n") : description;
|
|
76
78
|
return {
|
|
77
79
|
title,
|
|
78
80
|
objective,
|
|
79
|
-
|
|
81
|
+
body: [fullObjective !== objective ? [fullObjective, description].filter(Boolean).join("\n\n") : description, PERSONAL_WORKER_RESULT_GUIDANCE].filter(Boolean).join("\n\n")
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
84
|
/** A narrow Task surface for the fast personal conversation. */
|
|
@@ -89,7 +91,7 @@ function createPersonalTaskTool(deps) {
|
|
|
89
91
|
parameters: PersonalTaskSchema,
|
|
90
92
|
mutatesWorkspace: true,
|
|
91
93
|
mutationScope: "external",
|
|
92
|
-
requiresExclusiveWorkspaceLock:
|
|
94
|
+
requiresExclusiveWorkspaceLock: false,
|
|
93
95
|
finalGuardRelevant: true,
|
|
94
96
|
async execute(toolCallId, input, signal) {
|
|
95
97
|
const conversationId = deps.getCurrentConversationId?.();
|
|
@@ -103,13 +105,13 @@ function createPersonalTaskTool(deps) {
|
|
|
103
105
|
defaults: catalog.defaults,
|
|
104
106
|
agent
|
|
105
107
|
}).config;
|
|
106
|
-
const availableTools =
|
|
108
|
+
const availableTools = getAvailablePersonalAgentTools(config, deps);
|
|
107
109
|
return {
|
|
108
110
|
id: agent.id,
|
|
109
111
|
name: agent.profile?.name ?? agent.id,
|
|
110
112
|
description: agent.profile?.description ?? "",
|
|
111
113
|
availableTools,
|
|
112
|
-
model:
|
|
114
|
+
model: personalAgentModelAvailability(config)
|
|
113
115
|
};
|
|
114
116
|
}).filter((agent) => requiredTools.every((tool) => agent.availableTools.includes(tool)));
|
|
115
117
|
return {
|
|
@@ -130,9 +132,9 @@ function createPersonalTaskTool(deps) {
|
|
|
130
132
|
const specialist = new AgentCatalogRepository().get(agentId);
|
|
131
133
|
if (!specialist || specialist.enabled === false || specialist.provisioningState !== "ready") throw new Error(`Specialist Agent is unavailable: ${agentId}`);
|
|
132
134
|
const config = resolveEffectiveAgentConfigForAgent(agentId).config;
|
|
133
|
-
const model =
|
|
135
|
+
const model = personalAgentModelAvailability(config);
|
|
134
136
|
if (!model.available) throw new Error(`Agent ${agentId} cannot start: ${model.reason}. Find another available Agent.`);
|
|
135
|
-
const availableTools =
|
|
137
|
+
const availableTools = getAvailablePersonalAgentTools(config, deps);
|
|
136
138
|
const missingTools = (input.requiredTools ?? []).filter((tool) => !availableTools.includes(tool));
|
|
137
139
|
if (missingTools.length > 0) throw new Error(`Agent ${agentId} lacks required tools: ${missingTools.join(", ")}. Find another Agent or approach.`);
|
|
138
140
|
args = {
|
|
@@ -181,4 +183,4 @@ function createPersonalTaskTool(deps) {
|
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
185
|
//#endregion
|
|
184
|
-
export { buildPersonalTaskBrief, createPersonalTaskTool };
|
|
186
|
+
export { buildPersonalTaskBrief, createPersonalTaskTool, getAvailablePersonalAgentTools, personalAgentModelAvailability };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { sniffImageMimeType } from "../image/generation/image-assets.js";
|
|
2
|
-
import { mimeTypeFromMediaPath, saveMediaBuffer } from "../../media/store.js";
|
|
2
|
+
import { MEDIA_ARTIFACT_MAX_BYTES, mimeTypeFromMediaPath, saveMediaBuffer } from "../../media/store.js";
|
|
3
3
|
import { basename } from "node:path";
|
|
4
4
|
//#region src/agent/tools/tool-media.ts
|
|
5
|
-
const MAX_TOOL_MEDIA_BYTES = 50 * 1024 * 1024;
|
|
6
5
|
function hasImageMagic(buffer) {
|
|
7
6
|
if (buffer.length >= 8 && buffer.subarray(0, 8).equals(Buffer.from([
|
|
8
7
|
137,
|
|
@@ -41,7 +40,7 @@ async function persistToolMedia(params) {
|
|
|
41
40
|
bucket: "outbound",
|
|
42
41
|
contentType: mimeType,
|
|
43
42
|
originalFilename: name,
|
|
44
|
-
maxBytes:
|
|
43
|
+
maxBytes: MEDIA_ARTIFACT_MAX_BYTES
|
|
45
44
|
});
|
|
46
45
|
return {
|
|
47
46
|
id: saved.id,
|
|
@@ -10,10 +10,10 @@ import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
|
10
10
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
11
11
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
12
12
|
import "../../activity/index.js";
|
|
13
|
-
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
14
|
-
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
15
13
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
16
14
|
import "../../capabilities/runtime/dispatcher.js";
|
|
15
|
+
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
16
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
17
17
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
18
18
|
import "../../projects/index.js";
|
|
19
19
|
import { TaskDeletionService } from "../../tasks/task-deletion-service.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentEntrySchema, EffectiveAgentConfigSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
-
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
5
|
-
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
4
|
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
7
5
|
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
6
|
+
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
7
|
+
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
8
8
|
import { AgentCatalogService } from "./service.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/agent-catalog/capabilities.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
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_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
5
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
6
|
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
6
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
@@ -3,8 +3,8 @@ import { init_paths, resolveOAuthPath } from "../config/paths.js";
|
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { dirname } from "node:path";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { setTimeout } from "node:timers/promises";
|
|
7
6
|
import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
|
|
7
|
+
import { setTimeout } from "node:timers/promises";
|
|
8
8
|
//#region src/auth/oauth-provider-lock.ts
|
|
9
9
|
function lockPath(providerId) {
|
|
10
10
|
return `${resolveOAuthPath(providerId.toLowerCase())}.lock`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
@@ -3,10 +3,10 @@ import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
|
3
3
|
import { init_trust_policy, resolveAutomationSafetyForTrust } from "../../user-context/trust-policy.js";
|
|
4
4
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
5
5
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
6
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
7
6
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
7
|
import { ExternalEffectNotAppliedError } from "../../capabilities/runtime/external-operations.js";
|
|
9
8
|
import { defineExternalCapability, defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
10
10
|
import { AutomationCreateCapabilityInputSchema } from "./write.js";
|
|
11
11
|
import { simulateAutomation } from "../draft/automation-draft-validator.js";
|
|
12
12
|
import { AutomationDraftService } from "../draft/automation-draft-service.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
3
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
|
-
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
5
4
|
import { cutoverLegacyAgentConfig } from "../agent-catalog/migrations/legacy-config-cutover.js";
|
|
6
5
|
import "../agent-catalog/index.js";
|
|
6
|
+
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
7
7
|
import { migrateIdentityMarkdownToCatalog } from "../agent-catalog/migrations/identity-markdown-cutover.js";
|
|
8
8
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
9
9
|
//#region src/bootstrap/application-state.ts
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { resolveStateDir } from "../../config/paths-state.js";
|
|
3
3
|
import { createLogger } from "../../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../../utils/logger.js";
|
|
5
|
-
import { init_paths, resolveBinDir, resolveConfigPath } from "../../config/paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveBinDir, resolveConfigPath } from "../../config/paths.js";
|
|
7
7
|
import { assertCacheDir } from "../cache-dir-policy.js";
|
|
8
8
|
import { BROWSER_EXTENSION_ID, BROWSER_NATIVE_HOST_NAME } from "../extension-identity.js";
|
|
9
9
|
import "../native-messaging-host.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SqliteCommitEffectError, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
+
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
2
3
|
import { CapabilityError } from "./errors.js";
|
|
3
4
|
import { executeExternalOperation } from "./external-operations.js";
|
|
4
|
-
import { OperationConflictError, executeAtomicOperation } from "./atomic-operations.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/capabilities/runtime/dispatcher.ts
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
3
|
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
|
+
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
5
5
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
6
6
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
7
7
|
import "../../extensions/index.js";
|
|
@@ -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();
|
|
@@ -53,7 +53,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
53
53
|
id: "database-schema",
|
|
54
54
|
label: "Database schema",
|
|
55
55
|
status: "pass",
|
|
56
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
56
|
+
message: `SQLite schema v${status.dbVersion} (current release v232).`,
|
|
57
57
|
hints: []
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -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 { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
3
4
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.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 { loadConfig } from "../../config/loader.js";
|
|
7
7
|
import { formatExamples, register } from "../registry.js";
|
|
8
8
|
import { getContextWithOpts } from "../context.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
2
|
+
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
2
3
|
import { getAgentDefaultModelRef, init_schema } from "../../../config/schema.js";
|
|
3
4
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
5
|
import { init_models_json, loadModelsJson, saveModelsJson } from "../../../config/models-json.js";
|
|
@@ -6,7 +7,6 @@ import { getApiKeyFromEnv } from "../../../providers/env-keys.js";
|
|
|
6
7
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
7
8
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.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";
|
|
@@ -97,6 +97,10 @@ _You're not a chatbot. You're becoming someone._
|
|
|
97
97
|
- Earn trust through competence
|
|
98
98
|
- Remember you're a guest
|
|
99
99
|
|
|
100
|
+
## Vibe
|
|
101
|
+
|
|
102
|
+
Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user's language and communication preferences.
|
|
103
|
+
|
|
100
104
|
## Boundaries
|
|
101
105
|
|
|
102
106
|
- Private things stay private
|
|
@@ -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";
|
package/dist/src/config/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXopcCloudCatalogCachePath, resolveXopcDatabasePath } from "./paths-state.js";
|
|
2
|
+
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
3
|
+
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
4
|
+
import { resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
2
5
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
6
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
7
|
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewayScenesConfigSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
8
|
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
6
|
-
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
|
-
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
|
-
import { resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
9
|
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
10
|
import { FILENAMES, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
11
11
|
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
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";
|
|
3
4
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
4
5
|
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
5
6
|
import { init_resolution, setActivePlatformDiscovery } from "../platform/resolution.js";
|
|
6
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
7
7
|
import { assertChannelPluginConfigs } from "./validate-channel-configs.js";
|
|
8
8
|
import { isGatewayConfigLockedByAnotherProcessSync } from "../gateway/lock.js";
|
|
9
9
|
import { dirname } from "path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
2
3
|
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
4
|
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { init_model_policy, isComputerModel } from "../computer/model-policy.js";
|
|
6
6
|
import { existsSync, readFileSync } from "fs";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
3
2
|
import { AgentModelsOverrideSchema, ImageGenerationRouteSchema, ModelRouteSchema } from "../agent-config/schema.js";
|
|
4
3
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
5
4
|
import { init_agent_config } from "../agent-config/index.js";
|
|
6
5
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
6
|
+
import { ComputerConfigSchema, init_config } from "../computer/config.js";
|
|
7
7
|
import { DEFAULT_CONTEXT_COMPACTION_POLICY, UserContextConfigSchema, init_config as init_config$1 } from "../user-context/config.js";
|
|
8
8
|
import { init_public_url, validatePublicUrl } from "./public-url.js";
|
|
9
9
|
import { PlatformConfigSchema, init_contracts } from "../platform/contracts.js";
|
|
@@ -20,6 +20,7 @@ export declare class ConnectionRecoveryService {
|
|
|
20
20
|
private readonly deps;
|
|
21
21
|
private readonly busy;
|
|
22
22
|
private timer?;
|
|
23
|
+
private deliveryTimer?;
|
|
23
24
|
private polling;
|
|
24
25
|
start(): void;
|
|
25
26
|
stop(): void;
|
|
@@ -31,6 +32,7 @@ export declare class ConnectionRecoveryService {
|
|
|
31
32
|
error?: string;
|
|
32
33
|
}>;
|
|
33
34
|
drain: (conversationId: string) => void;
|
|
35
|
+
onPersonalRequestDelivered?: (conversationId: string, requestId: string) => void;
|
|
34
36
|
adapter?: ComposioSessionsAdapter;
|
|
35
37
|
pluginMcp?: PluginMcpRecovery;
|
|
36
38
|
});
|
|
@@ -3,6 +3,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
4
4
|
import { readCurrentTranscriptId } from "../storage/sqlite/session-instance-repository.js";
|
|
5
5
|
import { getSessionInputState, init_session_input_repository } from "../storage/sqlite/session-input-repository.js";
|
|
6
|
+
import { init_request_repository, personalRequestForWait } from "../personal-agent/request-repository.js";
|
|
6
7
|
import { getConnectorAccount, init_connector_account_repository } from "../storage/sqlite/connector-account-repository.js";
|
|
7
8
|
import { getConnectorConnection, getConnectorInstallation, init_connector_repository, listConnectorConnections, upsertConnectorInstallation } from "../storage/sqlite/connector-repository.js";
|
|
8
9
|
import { cancelConnectionObjective, getActiveConnectionWait, getConnectionWait, init_connection_wait_repository, listConnectionWaitsToCheck, publishConnectionWait, queueConnectionResolution, updateConnectionWait } from "../storage/sqlite/connection-wait-repository.js";
|
|
@@ -18,7 +19,9 @@ import { connectorPrincipalForSession } from "./principal.js";
|
|
|
18
19
|
import { capabilityActions, isToolInputSchema, missingConnectionCapabilities } from "./connection-capabilities.js";
|
|
19
20
|
import { installConnector } from "./install.js";
|
|
20
21
|
import { resolveConnectionCandidate } from "./connection-candidates.js";
|
|
22
|
+
import { cancelPersonalRequest, resolvePersonalRequestConnection } from "../personal-agent/request-service.js";
|
|
21
23
|
import { persistConfigMutation } from "../config/config-mutation.js";
|
|
24
|
+
import { drainPersonalRequestContinuations, drainPersonalRequestResults } from "../personal-agent/request-delivery.js";
|
|
22
25
|
import { HostPluginMcpRecovery } from "./plugin-mcp-recovery.js";
|
|
23
26
|
import { randomUUID } from "node:crypto";
|
|
24
27
|
//#region src/connectors/connection-recovery-service.ts
|
|
@@ -29,6 +32,7 @@ init_connection_wait_repository();
|
|
|
29
32
|
init_connector_repository();
|
|
30
33
|
init_connector_account_repository();
|
|
31
34
|
init_logger();
|
|
35
|
+
init_request_repository();
|
|
32
36
|
const log = createLogger("Connectors:Recovery");
|
|
33
37
|
const SCOPE_ORDER = {
|
|
34
38
|
read: 1,
|
|
@@ -44,6 +48,7 @@ function isConnectorNeed(need) {
|
|
|
44
48
|
var ConnectionRecoveryService = class {
|
|
45
49
|
busy = /* @__PURE__ */ new Set();
|
|
46
50
|
timer;
|
|
51
|
+
deliveryTimer;
|
|
47
52
|
polling = false;
|
|
48
53
|
start() {
|
|
49
54
|
if (this.timer) return;
|
|
@@ -51,16 +56,25 @@ var ConnectionRecoveryService = class {
|
|
|
51
56
|
this.poll();
|
|
52
57
|
}, 5e3);
|
|
53
58
|
this.timer.unref();
|
|
59
|
+
this.deliveryTimer = setInterval(() => {
|
|
60
|
+
drainPersonalRequestContinuations(this.deps.onPersonalRequestDelivered);
|
|
61
|
+
drainPersonalRequestResults(this.deps.onPersonalRequestDelivered);
|
|
62
|
+
}, 1e3);
|
|
63
|
+
this.deliveryTimer.unref();
|
|
54
64
|
this.poll();
|
|
55
65
|
}
|
|
56
66
|
stop() {
|
|
57
67
|
clearInterval(this.timer);
|
|
58
68
|
this.timer = void 0;
|
|
69
|
+
clearInterval(this.deliveryTimer);
|
|
70
|
+
this.deliveryTimer = void 0;
|
|
59
71
|
}
|
|
60
72
|
async poll() {
|
|
61
73
|
if (this.polling) return;
|
|
62
74
|
this.polling = true;
|
|
63
75
|
try {
|
|
76
|
+
drainPersonalRequestContinuations(this.deps.onPersonalRequestDelivered);
|
|
77
|
+
drainPersonalRequestResults(this.deps.onPersonalRequestDelivered);
|
|
64
78
|
for (const wait of listConnectionWaitsToCheck()) {
|
|
65
79
|
if (this.busy.has(wait.conversationId)) continue;
|
|
66
80
|
await this.act(wait.conversationId, {
|
|
@@ -383,8 +397,11 @@ var ConnectionRecoveryService = class {
|
|
|
383
397
|
action: action.action
|
|
384
398
|
}
|
|
385
399
|
};
|
|
386
|
-
if (action.action === "cancel")
|
|
387
|
-
|
|
400
|
+
if (action.action === "cancel") {
|
|
401
|
+
const request = personalRequestForWait(wait.id);
|
|
402
|
+
if (request) cancelPersonalRequest(request);
|
|
403
|
+
else cancelConnectionObjective(conversationId);
|
|
404
|
+
} else if (action.action === "replace_source") {
|
|
388
405
|
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
389
406
|
if (!need || !this.view(wait).needs.find((item) => item.key === need.key)?.alternatives?.some((item) => item.candidateRef === action.candidateRef)) throw new Error("Unsupported replacement.");
|
|
390
407
|
const replacement = resolveConnectionCandidate(action.candidateRef);
|
|
@@ -399,7 +416,7 @@ var ConnectionRecoveryService = class {
|
|
|
399
416
|
queueConnectionResolution({
|
|
400
417
|
...wait,
|
|
401
418
|
intent: void 0
|
|
402
|
-
}, "skipped");
|
|
419
|
+
}, "skipped", resolvePersonalRequestConnection);
|
|
403
420
|
this.deps.drain(conversationId);
|
|
404
421
|
} else if (action.action === "install_complete") {
|
|
405
422
|
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
@@ -436,7 +453,7 @@ var ConnectionRecoveryService = class {
|
|
|
436
453
|
queueConnectionResolution({
|
|
437
454
|
...wait,
|
|
438
455
|
needs: view.needs.map(({ phase: _phase, accounts: _accounts, reason: _reason, alternatives: _alternatives, ...item }) => item)
|
|
439
|
-
}, "continued");
|
|
456
|
+
}, "continued", resolvePersonalRequestConnection);
|
|
440
457
|
log.info({
|
|
441
458
|
conversationId,
|
|
442
459
|
waitId: wait.id,
|
|
@@ -648,7 +665,7 @@ var ConnectionRecoveryService = class {
|
|
|
648
665
|
wait = queueConnectionResolution({
|
|
649
666
|
...wait,
|
|
650
667
|
needs: view.needs.map(({ phase: _phase, accounts: _accounts, reason: _reason, alternatives: _alternatives, ...need }) => need)
|
|
651
|
-
}, "continued");
|
|
668
|
+
}, "continued", resolvePersonalRequestConnection);
|
|
652
669
|
log.info({
|
|
653
670
|
conversationId,
|
|
654
671
|
waitId: wait.id,
|
|
@@ -658,6 +675,7 @@ var ConnectionRecoveryService = class {
|
|
|
658
675
|
this.deps.drain(conversationId);
|
|
659
676
|
}
|
|
660
677
|
}
|
|
678
|
+
drainPersonalRequestContinuations(this.deps.onPersonalRequestDelivered);
|
|
661
679
|
publishConnectionWait(conversationId);
|
|
662
680
|
return { snapshot: this.snapshot(conversationId) };
|
|
663
681
|
} catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
5
4
|
import yaml from "js-yaml";
|
|
5
|
+
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
6
6
|
//#region src/extensions/agent-plugins/validation.ts
|
|
7
7
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
8
8
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
@@ -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_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync, lstatSync, readFileSync, readdirSync, readlinkSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -277,4 +277,4 @@ export declare const GATEWAY_BUILTIN_TOOLS: readonly [{
|
|
|
277
277
|
readonly zh: "使用已验证的参数执行选定的外部工具。";
|
|
278
278
|
};
|
|
279
279
|
}];
|
|
280
|
-
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "image" | "knowledge_search" | "knowledge_get" | "knowledge_write" | "user_context_search" | "user_context_get" | "user_context_update" | "web_search" | "web_fetch" | "browser_use" | "grep" | "session_search" | "read_file" | "list_dir" | "write_file" | "apply_patch" | "exec_command" | "update_plan" | "todo" | "clarify" | "xopc_tool_execute" | "web_extract" | "image_generate" | "skills_list" | "skill_view" | "skill_manage" | "skills_marketplace_search" | "
|
|
280
|
+
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "image" | "knowledge_search" | "knowledge_get" | "knowledge_write" | "user_context_search" | "user_context_get" | "user_context_update" | "web_search" | "web_fetch" | "browser_use" | "grep" | "session_search" | "read_file" | "list_dir" | "write_file" | "apply_patch" | "exec_command" | "update_plan" | "todo" | "clarify" | "xopc_tool_execute" | "web_extract" | "image_generate" | "skills_list" | "skill_view" | "skill_manage" | "skills_marketplace_search" | "computer_use" | "session_status" | "memory_maintenance" | "tool_manual" | "skill_install" | "send_message" | "send_media" | "read_media" | "create_share" | "text_to_speech" | "delegate_task" | "execute_code" | "create_desktop_pet" | "xopc_tool_search" | "xopc_tool_describe")[];
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
4
3
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
+
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
5
5
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
2
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
|
+
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
3
4
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
4
5
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
5
6
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mimeTypeFromMediaPath, saveMediaBuffer } from "../../../media/store.js";
|
|
1
|
+
import { MEDIA_ARTIFACT_MAX_BYTES, mimeTypeFromMediaPath, saveMediaBuffer } from "../../../media/store.js";
|
|
2
2
|
import { readMediaReference } from "../../../media/media-reference.js";
|
|
3
3
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../../chat-limits.js";
|
|
4
4
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
@@ -70,10 +70,11 @@ function registerMediaRoutes(authenticated, deps) {
|
|
|
70
70
|
error: { message: "Missing media scope" }
|
|
71
71
|
}, 400);
|
|
72
72
|
try {
|
|
73
|
-
const
|
|
73
|
+
const parsed = await resolveScopedMediaReference(deps.service, uriRaw.trim(), {
|
|
74
74
|
conversationId,
|
|
75
75
|
taskId
|
|
76
|
-
})
|
|
76
|
+
});
|
|
77
|
+
const { buffer, path } = await readMediaReference(parsed.uri, parsed.bucket === "outbound" ? MEDIA_ARTIFACT_MAX_BYTES : MAX_WEBCHAT_ATTACHMENT_FILE_BYTES);
|
|
77
78
|
const contentType = mimeTypeFromMediaPath(path);
|
|
78
79
|
const range = parseByteRange(c.req.header("Range"), buffer.byteLength);
|
|
79
80
|
const commonHeaders = {
|
|
@@ -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";
|