@xopcai/xopc 0.0.155 → 0.0.157
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/action-boundary-settings-panel-zQ_w0sPl.js +1 -0
- package/dist/gateway/static/root/assets/{activity-store-Btmg10yU.js → activity-store-CddlQHam.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-pdlJJov8.js → agent-avatar-dicebear-DOfTopIk.js} +1 -1
- package/dist/gateway/static/root/assets/agents-RZNd9xMI.js +2 -0
- package/dist/gateway/static/root/assets/{api-GGYxPxVF.js → api-NUlcaaV9.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BU9oSmtJ.js → app-management-settings-panel-J0-z_uc1.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B2chSkbj.js → appearance-settings-CMaQOx2C.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BOeTZgdL.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BC83GwY1.js → archive-plugin-BVwE70GV.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DWSH5325.js → attachment-load-aj5U56K9.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Bc25f4wz.js → automation-suggestion-card-CKz8rxAb.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-wYN1N-Il.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Kgu5yX35.js → binary-plugins-Ie6owbEw.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B9gJmzdE.js → block-editor-BaDrd5GJ.js} +31 -31
- package/dist/gateway/static/root/assets/browser-settings-page-DD3djQtX.js +8 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-6z36IfIC.js → capability-presets-api-BjO4YD-O.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Bqzl2UZ9.js → capability-presets-settings-panel-bwezWQpF.js} +2 -2
- package/dist/gateway/static/root/assets/{channel-recipient-api-DEkm4HRd.js → channel-recipient-api-BisDU_DH.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Bohv9YRy.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-h3VHD5Uq.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-DPriINR1.js → connector-logo-DGjjzBIH.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-LIAkMlN-.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CG91Su8E.js → desktop-pet-CoQ4Edck.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DUzETFxq.js → desktop-pet-settings--sjUYeNX.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-XNbI2wM7.js → directory-picker-path-field-CpmfFDx3.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BsLa5Nr8.js → dreaming-settings-D7rRROE7.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-C-5Nyrdu.js → extension-debug-page-BzqW3ssG.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BEocT43y.js → extension-page-CKDbBzVR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page--XOHrL-O.js → extension-settings-page-DjNMSdRz.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DZrNmiR3.js → gateway-config-api-CUEAZEld.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DfBvlqb2.js → gateway-settings-h1wWBrxD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cc5dxiD_.js → gateway-startup-retry-CbMPgpHX.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-xfO0R5Bx.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-CVVKF2hY.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-Cdghd3f3.js → goals-config-api-C-Vq8VR9.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-W666NFIU.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-CvOdikU6.js → goals-settings-DVrTDWYS.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CvaxjdV_.js → heartbeat-settings-Dv8qA4E7.js} +1 -1
- package/dist/gateway/static/root/assets/{index-C4HpPu1y.js → index-DHRxn7Sy.js} +61 -64
- package/dist/gateway/static/root/assets/index-gpwk8Nro.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BVt0deH6.js → keyboard-shortcuts-settings-DEKtMZbg.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-y5WmNSyZ.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C0HGfwao.js → local-apps-page-DQT2lZk7.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Dt0pSudQ.js → locale-store-d9Cylz62.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DMQaC4Jn.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CjVg43Kl.js → markdown-split-Cp6NxQJr.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D-LkrsY6.js → media-plugins-Dv1cQK2J.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CqXpNawC.js → messages-Bwu1tG3T.js} +4 -4
- package/dist/gateway/static/root/assets/models-hub-panel-CoYDJvX_.js +2 -0
- package/dist/gateway/static/root/assets/{notes-page-BsoNcBQ3.js → notes-page-CePZ2we1.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-C9B-7EsK.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-C9OfBAT6.js → page-tabs-C1jBfKTZ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BCrigyTS.js → preview-open-alternatives-Cl9anbg0.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DG_P8S7e.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-C1pro-bG.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DDj6t0SQ.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-CnyZMYdJ.js → save-bar-controls-CWu_o1ta.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Bez97_Ou.js → schedule-field-DuZbqL7X.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DbKY5jSv.js → schema-form-Bixut-2d.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C1aZFTTX.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CwRP1Nsl.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-4f60Dgw-.js → settings-collapsible-section-C_7lCtCp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-CCQ7MjdZ.js → settings-form-section-D0DPTbO0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CQhjhb0F.js → settings-loading-skeleton-tN-9u8dj.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-C2L9g3kd.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-C7sfPFaM.js → settings-page-layout-CBUOPmx_.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DFjG5i48.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DeErzPeg.js → share-preview-page-BiSh0nLu.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bh2T05Hp.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ppRtNzpM.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Dnw1xKKm.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Dk1ZhfpM.js → system-settings-panel-h7uqbQ-n.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Cd_gY2Cb.js → theme-store-DjYRaF0J.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-fe1xAgdw.js → typed-models-lib-BkqBD32C.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-Cbo3s1uh.js → use-channel-catalog-DiWtF12K.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-09T5O8lO.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-C4770AsA.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-D__GQy1R.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CAIgG4im.js +1 -0
- package/dist/gateway/static/root/assets/work-page-CkZvIUpT.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-qqixrSRL.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-THxdPWzb.js +11 -0
- package/dist/gateway/static/root/connector-icons/local-files.svg +6 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +63 -61
- package/dist/src/agent/embedded/xopc-auth-storage.js +1 -1
- package/dist/src/agent/tools/factory.js +2 -2
- package/dist/src/agent/tools/session-search-tool.d.ts +2 -2
- package/dist/src/agent/tools/session-search-tool.js +8 -19
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/config-surface.d.ts +0 -26
- package/dist/src/connectors/builtin-catalog.js +90 -248
- package/dist/src/connectors/composio-catalog.js +28 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.d.ts +1 -0
- package/dist/src/connectors/composio.js +8 -1
- package/dist/src/connectors/connector-memory-sync.d.ts +10 -0
- package/dist/src/connectors/connector-memory-sync.js +184 -38
- package/dist/src/connectors/integration-strategy.js +65 -8
- package/dist/src/connectors/memory-sync-coordinator.d.ts +28 -0
- package/dist/src/connectors/memory-sync-coordinator.js +162 -0
- package/dist/src/connectors/memory-sync-profile.d.ts +13 -0
- package/dist/src/connectors/memory-sync-profile.js +73 -0
- package/dist/src/connectors/runtime-adapter-registry.js +17 -4
- package/dist/src/connectors/runtime-status.d.ts +9 -0
- package/dist/src/connectors/runtime-status.js +68 -0
- package/dist/src/connectors/types.d.ts +2 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +138 -12
- package/dist/src/gateway/hono/routes/public-gateway.js +1 -0
- package/dist/src/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +14 -0
- package/dist/src/knowledge/index.d.ts +2 -0
- package/dist/src/knowledge/index.js +3 -1
- package/dist/src/knowledge/ingestion-service.js +40 -3
- package/dist/src/knowledge/local-folder-adapter.d.ts +7 -0
- package/dist/src/knowledge/local-folder-adapter.js +86 -0
- package/dist/src/knowledge/people-graph.d.ts +28 -0
- package/dist/src/knowledge/people-graph.js +126 -0
- package/dist/src/knowledge/types.d.ts +2 -0
- package/dist/src/user-context/projection.d.ts +2 -0
- package/dist/src/user-context/projection.js +12 -2
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-NDjTqOIb.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-DHvwQknj.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-32U6mfy-.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CTWycuu_.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-DdelF9BQ.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CBgr61Zt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CO3ASIfE.js +0 -2
- package/dist/gateway/static/root/assets/goal-create-dialog-BRVB5I7f.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-Drdz_llY.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-CEh2UTzg.js +0 -2
- package/dist/gateway/static/root/assets/index-DjvInkv6.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dcmb1Ruc.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BWdV-HsP.js +0 -7
- package/dist/gateway/static/root/assets/models-hub-panel-Du41WFC6.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-VeU2xG2r.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-B9QsnXWV.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BbplZbzF.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CfbuqKDd.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CSQLpHd4.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C25HTTPK.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-BZb-E5vI.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B1FSxWQ3.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DDg5dL3k.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B-ocgAT-.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CtO4i9ds.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-CqtVqiYz.js +0 -1
- package/dist/gateway/static/root/assets/user-profile-fields-editor-DcnCOHwp.js +0 -1
- package/dist/gateway/static/root/assets/user-profile-settings-panel-CTWZR6nV.js +0 -1
- package/dist/gateway/static/root/assets/utils-BDzZMJls.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-C9Psto-d.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CNVeagdJ.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DKSNc1SH.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Bwbg1Ht-.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-ZKbrdYmp.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DBHqpZ76.js +0 -11
- package/dist/gateway/static/root/connector-icons/brave-search.svg +0 -1
- package/dist/gateway/static/root/connector-icons/fetch.svg +0 -6
- package/dist/gateway/static/root/connector-icons/memory.svg +0 -5
- package/dist/gateway/static/root/connector-icons/playwright.svg +0 -9
- package/dist/gateway/static/root/connector-icons/sequential-thinking.svg +0 -8
- package/dist/gateway/static/root/connector-icons/time.svg +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Local Files">
|
|
2
|
+
<rect width="64" height="64" rx="16" fill="#FFF7E6"/>
|
|
3
|
+
<path d="M10 21a5 5 0 0 1 5-5h13l6 6h15a5 5 0 0 1 5 5v19a5 5 0 0 1-5 5H15a5 5 0 0 1-5-5V21Z" fill="#F59E0B"/>
|
|
4
|
+
<path d="M10 27h44v19a5 5 0 0 1-5 5H15a5 5 0 0 1-5-5V27Z" fill="#FBBF24"/>
|
|
5
|
+
<path d="M19 37h26" stroke="#92400E" stroke-width="3" stroke-linecap="round" opacity=".65"/>
|
|
6
|
+
</svg>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>xopc</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DHRxn7Sy.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-BODqo66o.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/circle-alert-RzVebuX2.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-Bwu1tG3T.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-d9Cylz62.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
35
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-CbMPgpHX.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-CddlQHam.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DjYRaF0J.js">
|
|
35
|
+
<link rel="stylesheet" crossorigin href="/assets/index-gpwk8Nro.css">
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
38
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -824,6 +824,7 @@ var AgentManager = class {
|
|
|
824
824
|
createAgentForProfile(sessionKey, profile, resolvedWorkspacePath, rt, activeProjectContext, activeSelfVerifyContext) {
|
|
825
825
|
const modelRef = profile.primaryModelRef?.trim() || this.defaultModel;
|
|
826
826
|
const model = this.resolveModelStringToModel(modelRef);
|
|
827
|
+
let agent;
|
|
827
828
|
const contextFiles = this.resolveContextFilesForSession(sessionKey, profile);
|
|
828
829
|
const dreamingRoot = resolveDreamingRoot();
|
|
829
830
|
const tools = this.toolsFactory.createAllTools({
|
|
@@ -832,76 +833,77 @@ var AgentManager = class {
|
|
|
832
833
|
agentId: profile.agentId,
|
|
833
834
|
dreamingRoot,
|
|
834
835
|
disabledTools: profile.tools.denied,
|
|
835
|
-
getPrimaryModel: () =>
|
|
836
|
+
getPrimaryModel: () => agent?.state.model ?? model,
|
|
836
837
|
getMemoryManager: () => rt.memoryManager,
|
|
837
838
|
getSkillManager: () => rt.skillManager
|
|
838
839
|
});
|
|
839
840
|
if (this.config.config?.codeIntelligence?.enabled && this.config.config.codeIntelligence.agentIds.includes(profile.agentId)) rt.codeIntelligence.prime().catch(() => {});
|
|
840
841
|
const registeredToolNames = tools.map((t) => t.name);
|
|
841
842
|
const thinkingLevel = profile.thinkingDefault ?? this.config.thinkingLevel ?? "medium";
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
agentId: profile.agentId,
|
|
855
|
-
thinkingLevel,
|
|
856
|
-
activeProjectContext: this.composeDynamicProjectContext(activeProjectContext, activeSelfVerifyContext)
|
|
857
|
-
}),
|
|
858
|
-
model,
|
|
843
|
+
agent = new Agent({
|
|
844
|
+
initialState: {
|
|
845
|
+
systemPrompt: rt.systemPromptBuilder.build(contextFiles, {
|
|
846
|
+
externalMemoryInstructions: rt.memoryManager.buildExternalSystemPrompt(),
|
|
847
|
+
workspaceOverride: resolvedWorkspacePath,
|
|
848
|
+
profileMarkdownPathRoot: resolveAgentProfileDir(this.config.config, profile.agentId),
|
|
849
|
+
systemPromptOverride: profile.systemPromptOverride,
|
|
850
|
+
skillAllowlist: profile.skillsAllowlist,
|
|
851
|
+
registeredToolNames,
|
|
852
|
+
sessionKey,
|
|
853
|
+
modelRef,
|
|
854
|
+
agentId: profile.agentId,
|
|
859
855
|
thinkingLevel,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
856
|
+
activeProjectContext: this.composeDynamicProjectContext(activeProjectContext, activeSelfVerifyContext)
|
|
857
|
+
}),
|
|
858
|
+
model,
|
|
859
|
+
thinkingLevel,
|
|
860
|
+
tools,
|
|
861
|
+
messages: []
|
|
862
|
+
},
|
|
863
|
+
toolExecution: "parallel",
|
|
864
|
+
streamFn: createExtensionAwareStreamFn(),
|
|
865
|
+
getApiKey: (provider) => this.resolveApiKeyWithCache(provider),
|
|
866
|
+
beforeToolCall: async ({ toolCall, args }) => {
|
|
867
|
+
const toolName = toolCall.name;
|
|
868
|
+
if (toolName === "exec_command") {
|
|
869
|
+
const ctx = this.config.getCurrentContext();
|
|
870
|
+
const cfg = this.mergedConfig();
|
|
871
|
+
if (ctx && cfg) {
|
|
872
|
+
const command = typeof args?.cmd === "string" ? args.cmd : JSON.stringify(args ?? {});
|
|
873
|
+
const accountId = typeof ctx.metadata?.accountId === "string" ? ctx.metadata.accountId : void 0;
|
|
874
|
+
const approval = await maybeRequestChannelExecApproval({
|
|
875
|
+
cfg,
|
|
876
|
+
payload: {
|
|
877
|
+
sessionKey: ctx.sessionKey,
|
|
878
|
+
channel: ctx.channel,
|
|
879
|
+
chatId: ctx.chatId,
|
|
880
|
+
accountId,
|
|
881
|
+
toolName,
|
|
882
|
+
summary: command.slice(0, 500),
|
|
883
|
+
details: { command: command.slice(0, 2e3) }
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
if (approval.required && !approval.approved) return {
|
|
887
|
+
block: true,
|
|
888
|
+
reason: approval.reason ?? "Exec approval denied or timed out."
|
|
889
|
+
};
|
|
891
890
|
}
|
|
892
|
-
if (!this.config.hookRunner) return;
|
|
893
|
-
const parsed = parseMcpToolName(toolName);
|
|
894
|
-
const hookResult = await this.config.hookRunner.runBeforeToolCall(toolName, args ?? {}, {
|
|
895
|
-
sessionKey,
|
|
896
|
-
isMcpTool: parsed !== null,
|
|
897
|
-
mcpServerId: parsed?.serverId
|
|
898
|
-
});
|
|
899
|
-
if (!hookResult.allowed) return {
|
|
900
|
-
block: true,
|
|
901
|
-
reason: hookResult.reason ?? "Tool call blocked by policy hook."
|
|
902
|
-
};
|
|
903
891
|
}
|
|
904
|
-
|
|
892
|
+
if (!this.config.hookRunner) return;
|
|
893
|
+
const parsed = parseMcpToolName(toolName);
|
|
894
|
+
const hookResult = await this.config.hookRunner.runBeforeToolCall(toolName, args ?? {}, {
|
|
895
|
+
sessionKey,
|
|
896
|
+
isMcpTool: parsed !== null,
|
|
897
|
+
mcpServerId: parsed?.serverId
|
|
898
|
+
});
|
|
899
|
+
if (!hookResult.allowed) return {
|
|
900
|
+
block: true,
|
|
901
|
+
reason: hookResult.reason ?? "Tool call blocked by policy hook."
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
return {
|
|
906
|
+
agent,
|
|
905
907
|
registeredToolNames
|
|
906
908
|
};
|
|
907
909
|
}
|
|
@@ -34,7 +34,7 @@ function createEmbeddedModelRuntime() {
|
|
|
34
34
|
*/
|
|
35
35
|
async function applyXopcProviderApiKey(modelRuntime, providerId) {
|
|
36
36
|
const key = resolveXopcProviderApiKey(providerId);
|
|
37
|
-
if (key && key !== "extension-managed") await modelRuntime.setRuntimeApiKey(providerId, key);
|
|
37
|
+
if (key && key !== "extension-managed") await modelRuntime.setRuntimeApiKey(providerId, key, { allowNetwork: false });
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
export { applyXopcProviderApiKey, createEmbeddedCredentialStore, createEmbeddedModelRuntime, resolveXopcProviderApiKey };
|
|
@@ -278,9 +278,9 @@ var AgentToolsFactory = class {
|
|
|
278
278
|
})] : [],
|
|
279
279
|
...getMemMgr && shouldRegisterCuratedMemoryTool(this.deps.getConfig?.()) ? [createCuratedMemoryTool(() => getMemMgr())] : [],
|
|
280
280
|
...getMemMgr?.().getAdditionalTools() ?? [],
|
|
281
|
-
...this.deps.getSessionStore ? [createSessionSearchTool({
|
|
281
|
+
...this.deps.getSessionStore && getPrimary ? [createSessionSearchTool({
|
|
282
282
|
getSessionStore: this.deps.getSessionStore,
|
|
283
|
-
|
|
283
|
+
getPrimaryModel: getPrimary,
|
|
284
284
|
getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey
|
|
285
285
|
})] : [],
|
|
286
286
|
...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
-
import type
|
|
2
|
+
import { type Api, type Model } from '@earendil-works/pi-ai/compat';
|
|
3
3
|
import type { SessionStore } from '../../session/store.js';
|
|
4
4
|
export interface SessionSearchToolDeps {
|
|
5
5
|
getSessionStore: () => SessionStore;
|
|
6
|
-
|
|
6
|
+
getPrimaryModel: () => Model<Api>;
|
|
7
7
|
getCurrentSessionKey?: () => string | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare function createSessionSearchTool(deps: SessionSearchToolDeps): AgentTool;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import {
|
|
3
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
4
4
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
5
5
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
6
6
|
import { Type } from "@sinclair/typebox";
|
|
@@ -9,21 +9,10 @@ init_providers();
|
|
|
9
9
|
init_logger();
|
|
10
10
|
const log = createLogger("Agent:SessionSearch");
|
|
11
11
|
const MAX_SUMMARY_CHARS = 2e4;
|
|
12
|
-
function resolveSummaryModel(
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
} catch (err) {
|
|
17
|
-
log.warn({
|
|
18
|
-
err,
|
|
19
|
-
ref
|
|
20
|
-
}, "session_search: summary model resolve failed, using fallback");
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
return resolveModel("openai/gpt-4o-mini");
|
|
24
|
-
} catch {
|
|
25
|
-
return resolveModel(getDefaultModelSync(getConfig?.()));
|
|
26
|
-
}
|
|
12
|
+
function resolveSummaryModel(deps) {
|
|
13
|
+
const envRef = process.env.XOPC_SESSION_SEARCH_MODEL?.trim();
|
|
14
|
+
if (envRef) return resolveModel(envRef);
|
|
15
|
+
return deps.getPrimaryModel();
|
|
27
16
|
}
|
|
28
17
|
function extractTextFromContent(content) {
|
|
29
18
|
if (typeof content === "string") return content;
|
|
@@ -50,7 +39,7 @@ function formatMessagesForSummary(messages) {
|
|
|
50
39
|
}
|
|
51
40
|
return lines.join("\n\n");
|
|
52
41
|
}
|
|
53
|
-
async function summarizeSession(messages, query,
|
|
42
|
+
async function summarizeSession(messages, query, deps, signal, logMeta) {
|
|
54
43
|
if (messages.length === 0) return "No messages in session.";
|
|
55
44
|
const userMsg = {
|
|
56
45
|
role: "user",
|
|
@@ -60,7 +49,7 @@ Conversation:
|
|
|
60
49
|
${formatMessagesForSummary(messages)}`,
|
|
61
50
|
timestamp: Date.now()
|
|
62
51
|
};
|
|
63
|
-
const model = resolveSummaryModel(
|
|
52
|
+
const model = resolveSummaryModel(deps);
|
|
64
53
|
try {
|
|
65
54
|
const result = await completeWithResolvedCredentials(model, { messages: [userMsg] }, {
|
|
66
55
|
maxTokens: 400,
|
|
@@ -157,7 +146,7 @@ function createSessionSearchTool(deps) {
|
|
|
157
146
|
return {
|
|
158
147
|
sessionKey: key,
|
|
159
148
|
score,
|
|
160
|
-
summary: await summarizeSession(messages, query, deps
|
|
149
|
+
summary: await summarizeSession(messages, query, deps, signal, { summarizingSessionKey: key })
|
|
161
150
|
};
|
|
162
151
|
}));
|
|
163
152
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
2
|
import "../agent-manifest/index.js";
|
|
3
|
+
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
4
4
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
//#region src/config/agent-profile.ts
|
|
@@ -3,32 +3,6 @@
|
|
|
3
3
|
* (Runtime validation lives in schema / zod elsewhere.)
|
|
4
4
|
*/
|
|
5
5
|
export interface Config {
|
|
6
|
-
agents?: {
|
|
7
|
-
defaults?: {
|
|
8
|
-
workspace?: string;
|
|
9
|
-
model?: string | {
|
|
10
|
-
primary?: string;
|
|
11
|
-
fallbacks?: string[];
|
|
12
|
-
};
|
|
13
|
-
maxTokens?: number;
|
|
14
|
-
temperature?: number;
|
|
15
|
-
max_tool_iterations?: number;
|
|
16
|
-
memory?: {
|
|
17
|
-
enabled?: boolean;
|
|
18
|
-
useEnhancedSystem?: boolean;
|
|
19
|
-
userProfileEnabled?: boolean;
|
|
20
|
-
memoryCharLimit?: number;
|
|
21
|
-
userCharLimit?: number;
|
|
22
|
-
provider?: 'none' | 'stub';
|
|
23
|
-
injectionFrequency?: 'every-turn' | 'first-turn';
|
|
24
|
-
contextCadence?: number;
|
|
25
|
-
dialecticCadence?: number;
|
|
26
|
-
};
|
|
27
|
-
sessionSearch?: {
|
|
28
|
-
summaryModel?: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
6
|
channels?: Record<string, unknown>;
|
|
33
7
|
gateway?: {
|
|
34
8
|
host?: string;
|