@xopcai/xopc 0.0.244 → 0.0.246
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/{activity-store-CAah-_8h.js → activity-store-BlxqErph.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BhXGsupm.js → agent-avatar-dicebear-CJJzpYYS.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Blzn2H6t.js → agent-defaults-settings-panel-0dRjnL2s.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Cmp-z8Y_.js → agents-je3sRGmk.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B2tKxbcz.js → api-BbXzyQMj.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CezjAP1K.js → app-management-settings-panel-Cnn3i00c.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C-CfS05x.js → appearance-settings-BToQaw_v.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-7Y13_bqZ.js → apps-page-EpUZsl4h.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BmSx7wzY.js → archive-plugin-DD2SweEH.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DI4CoIga.js → attachment-load-BFtcib5t.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D04Xceck.js → automations-page-XS8wIl5o.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-wEO1OWk0.js → automations-workspace-BGQdHrip.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BJQe8TRu.js → binary-plugins-Xs7pLHxR.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BSzGjJC6.js → block-editor-BPdSzceB.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DjAZ_LF2.js → browser-settings-page-DJGcm7rH.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CRnkgZHI.js → browser-workflow-inputs-BAAc151l.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CwbxA3B7.js → browser-workflows-page-DUPPvE30.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-jt9bqUMK.js → capabilities-settings-panel-cl9kYilL.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-Cz_TWY3a.js → channels-settings-BcIr-_GM.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-DuY4MGxe.js → channels-status-swr-CCBCtLDg.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D3gj2D3U.js → chat-terminal-dock-DKW1M6aJ.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Shs5vbzx.js → connectors-page-DNHqaZfX.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-DgWHw0jX.js → cron-expression-Bijb0ZQu.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CKg-RPbs.js → date-picker-BZuHw-SY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CVYkw-NN.js → dependency-picker-BsBD2JFY.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bf46oXTY.js → desktop-pet-Ceuw3QKb.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BJO_klc7.js → desktop-pet-settings-DctOXexM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-T2PmFFOW.js → extension-debug-page-BNlMPATK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-2wAE2RCe.js → extension-page-CK4Uvzge.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Y9ZiCJ21.js → extension-settings-page-CpnXXemw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DaYY1Gkn.js → gateway-config-api-C_mlpe-r.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BC3pgb_P.js → gateway-config-swr-826dipyU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-eO3IzW_J.js → gateway-settings-DSSW17ed.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-uMcSfLru.js → gateway-startup-retry-DyvcAIMm.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BAgrkyHc.js → heartbeat-settings-hbmIZTpg.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-GTjKH7LK.js → home-page-CaVvW77l.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-D1qlQA-A.js → image-generation-api-D7cyfks6.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DUz0O54y.js → index-eZjksPvq.js} +10 -10
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CWGqL6o5.js → keyboard-shortcuts-settings-BQrDwwgi.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DKJ-rks0.js → local-app-workbench-page-D3K1XmOM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Bfidv29d.js → local-apps-page-D-YWD6LS.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CMZljTJx.js → locale-store-CBoCuIMx.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DwAHrPbF.js → logs-page-DvLc9l59.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BG7j1I9f.js → management-settings-DsULLUUv.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-AnmmpLs6.js → markdown-split-CjqlP6IB.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-PPCLt7fu.js → markdown-view-BXsHghJd.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CGS-05cE.js → media-plugins-DQL029DU.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BbdwoxVo.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DoKK5GfV.js → mobile-pairing-wizard-gauprAae.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-88f4fzYS.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-Lr8rsFAR.js → notes-page-AsEfLZt9.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-ISWnKLxO.js → notes-workbench-CI30cDh3.js} +2 -2
- package/dist/gateway/static/root/assets/{oauth-api-4VeMbkTJ.js → oauth-api-BjSUDIgq.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BU0HiZtv.js → product-open-page-CAJeUXeU.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BZqr4yam.js → project-detail-page-jO_4I5zN.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Dau8733A.js → projects-page-BrTGFME0.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CWOtPFrE.js → registry-api-BhGKnvLP.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DdChlvGP.js → remote-access-hub-CH70D5SH.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CmZTNv1W.js → runtime-tools-settings-panel-DH6EilMV.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-XlVPyiVQ.js → schema-form-DYHmEZeZ.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-C3kADsd4.js → sessions-page-hbfUNtNs.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Vg3_jua6.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DblUeM3V.js → settings-page-BHwPd_M3.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-bDfRfSnq.js → setup-status-panel-DkcpWSss.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DBMWFMN-.js → share-preview-page-BjwrS03F.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bu6lIStj.js → shares-settings-BL4DEt6p.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CafhNktn.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CSOseeQe.js → skills-page-OHyK25op.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-CniRGhkJ.js → skills-page.utils-DQx9ulmg.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-D0GqNpKy.js → system-settings-panel-wO7DWv4C.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BRCq-nR7.js → task-detail-page-anyomXsu.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-uxUwr10D.js → theme-store-hybK3oC9.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BtjS2nrM.js → tunnel-api-CVC8BHZu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-TwuAycG8.js → use-autosave-DMvRu2XZ.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-CbqPu8xZ.js → user-context-page-BBk9YdBn.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CzwG5plu.js → voice-api-key-field-DuBK2NDG.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-MqyI6cgq.js → voice-config-api-CBbiF1T3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DS15FzQA.js → work-discovery-overlay-B7VXWpDr.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C_boCemi.js → workflow-run-setup-panel-BokVAsWN.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CaI2ruyy.js → workflows-page-RUTv0yvR.js} +1 -1
- package/dist/gateway/static/root/index.html +11 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/turn-outcome.js +3 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +3 -1
- package/dist/src/agent/agent-manager.d.ts +2 -4
- package/dist/src/agent/agent-manager.js +24 -28
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/child-agent-factory.d.ts +10 -7
- package/dist/src/agent/child-agent-factory.js +112 -158
- package/dist/src/agent/coding/index.d.ts +1 -1
- package/dist/src/agent/coding/index.js +2 -2
- package/dist/src/agent/coding/repository-instructions.d.ts +12 -0
- package/dist/src/agent/coding/repository-instructions.js +76 -0
- package/dist/src/agent/coding/run-verification.d.ts +34 -0
- package/dist/src/agent/coding/run-verification.js +134 -0
- package/dist/src/agent/coding/verification-command.d.ts +3 -0
- package/dist/src/agent/coding/verification-command.js +50 -0
- package/dist/src/agent/coding/workspace-revision.d.ts +2 -0
- package/dist/src/agent/coding/workspace-revision.js +77 -0
- package/dist/src/agent/commands/command-isolation.d.ts +21 -0
- package/dist/src/agent/commands/command-isolation.js +71 -0
- package/dist/src/agent/commands/command-registry.d.ts +56 -0
- package/dist/src/agent/commands/command-registry.js +259 -0
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -1
- package/dist/src/agent/embedded/run-turn.js +88 -25
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
- package/dist/src/agent/embedded/subscribe-session.d.ts +2 -1
- package/dist/src/agent/embedded/subscribe-session.js +2 -1
- package/dist/src/agent/embedded/types.d.ts +3 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +4 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/memory/user-context-coordinator.js +1 -1
- package/dist/src/agent/middleware/index.d.ts +0 -5
- package/dist/src/agent/middleware/index.js +1 -2
- package/dist/src/agent/orchestration/agent-event-handler.d.ts +0 -5
- package/dist/src/agent/orchestration/agent-event-handler.js +1 -96
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/agent-turn-policy.js +5 -5
- package/dist/src/agent/orchestration/index.d.ts +1 -1
- package/dist/src/agent/orchestration/index.js +2 -2
- package/dist/src/agent/orchestration/loop-guard.d.ts +4 -31
- package/dist/src/agent/orchestration/loop-guard.js +14 -99
- package/dist/src/agent/prompt/sections/tooling.js +2 -4
- package/dist/src/agent/sandbox/types.d.ts +2 -2
- package/dist/src/agent/sandbox/types.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.d.ts +0 -2
- package/dist/src/agent/service.js +6 -23
- package/dist/src/agent/tasks/task-judge-service.d.ts +7 -0
- package/dist/src/agent/tasks/task-judge-service.js +24 -2
- package/dist/src/agent/tools/delegate-tool.d.ts +2 -1
- package/dist/src/agent/tools/delegate-tool.js +102 -124
- package/dist/src/agent/tools/exec-command.d.ts +8 -1
- package/dist/src/agent/tools/exec-command.js +77 -169
- package/dist/src/agent/tools/executor.js +9 -2
- package/dist/src/agent/tools/factory.js +50 -5
- package/dist/src/agent/tools/find.d.ts +10 -13
- package/dist/src/agent/tools/find.js +33 -80
- package/dist/src/agent/tools/grep.d.ts +14 -18
- package/dist/src/agent/tools/grep.js +56 -144
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +2 -3
- package/dist/src/agent/tools/language-diagnostics.d.ts +11 -0
- package/dist/src/agent/tools/language-diagnostics.js +62 -0
- package/dist/src/agent/tools/managed-job-tool.d.ts +2 -1
- package/dist/src/agent/tools/managed-job-tool.js +58 -118
- package/dist/src/agent/tools/read.js +24 -7
- package/dist/src/agent/tools/repository-search.d.ts +5 -0
- package/dist/src/agent/tools/repository-search.js +56 -0
- package/dist/src/agent/tools/review-workspace.d.ts +2 -0
- package/dist/src/agent/tools/review-workspace.js +103 -0
- package/dist/src/agent/tools/write.js +4 -4
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent/workflow/subagent-runner.d.ts +0 -2
- package/dist/src/agent/workflow/subagent-runner.js +12 -31
- package/dist/src/agent-config/schema.d.ts +42 -0
- package/dist/src/agent-config/schema.js +5 -0
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +1 -1
- package/dist/src/config/schema.d.ts +28 -0
- package/dist/src/execution-environments/local-worktree-manager.d.ts +3 -1
- package/dist/src/execution-environments/local-worktree-manager.js +8 -3
- package/dist/src/execution-environments/session-environment-service.js +5 -3
- package/dist/src/gateway/hono/lib/config-payload.d.ts +7 -0
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +4 -1
- package/dist/src/gateway/service.js +3 -3
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-ripgrep.d.ts +0 -6
- package/dist/src/gateway/workspace-ripgrep.js +2 -40
- package/dist/src/infra/ripgrep.d.ts +13 -0
- package/dist/src/infra/ripgrep.js +46 -0
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/session/turn-outcome-projector.js +26 -6
- package/dist/src/tasks/task-run-coordinator.d.ts +2 -2
- package/dist/src/tasks/task-run-coordinator.js +14 -12
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/agentEngine.d.ts +1 -1
- package/dist/src/voice/realtime/runtime.d.ts +3 -68
- package/dist/src/voice/realtime/runtime.types.d.ts +69 -0
- package/dist/src/voice/realtime/runtime.types.js +1 -0
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/messages-CTSgFlE4.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-ZrbGRiGY.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CSYy6SUa.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BNMc4l04.js +0 -1
- package/dist/src/agent/coding/turn-diff-tracker.d.ts +0 -67
- package/dist/src/agent/coding/turn-diff-tracker.js +0 -231
- package/dist/src/agent/middleware/self-verify.d.ts +0 -136
- package/dist/src/agent/middleware/self-verify.js +0 -380
- package/dist/src/agent/tools/execute-code-tool.d.ts +0 -11
- package/dist/src/agent/tools/execute-code-tool.js +0 -208
|
@@ -106,6 +106,13 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
106
106
|
allowed?: string[];
|
|
107
107
|
};
|
|
108
108
|
runtime: {
|
|
109
|
+
commandIsolation?: {
|
|
110
|
+
mode: "host";
|
|
111
|
+
} | {
|
|
112
|
+
mode: "docker";
|
|
113
|
+
image: string;
|
|
114
|
+
network: boolean;
|
|
115
|
+
};
|
|
109
116
|
maxTurns?: number;
|
|
110
117
|
timeoutMs?: number;
|
|
111
118
|
maxToolFailuresPerTurn?: number;
|
|
@@ -2,8 +2,8 @@ import { buildSessionKey, init_session_key } from "../../../routing/session-key.
|
|
|
2
2
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
3
3
|
import "../../../projects/index.js";
|
|
4
4
|
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
5
|
-
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
6
5
|
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
6
|
+
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
7
7
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
8
8
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
9
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
2
2
|
import { FileServiceError } from "../files/file-service.js";
|
|
3
3
|
import { resolveMediaReference } from "../media/media-reference.js";
|
|
4
|
-
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
5
4
|
import { pendingTranscriptReferencesMediaUri } from "../agent/inbound/attachment-pipeline.js";
|
|
5
|
+
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
6
6
|
import { messagesReferenceMediaUri } from "../media/session-references.js";
|
|
7
7
|
//#region src/gateway/media-access.ts
|
|
8
8
|
/** Resolve media only when the supplied session or task references it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { loadConfig } from "../config/loader.js";
|
|
2
|
-
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
3
2
|
import "../config/index.js";
|
|
3
|
+
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
4
4
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
5
5
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
6
6
|
import { acquireGatewayLock } from "./lock.js";
|
|
@@ -90,11 +90,14 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
90
90
|
})));
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
+
if (event.type === "turn_outcome") {
|
|
94
|
+
taskRun?.captureOutcome(event.payload);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
93
97
|
if (event.type === "patch_applied") {
|
|
94
98
|
taskRun?.capturePatch(event.payload.added, event.payload.removed);
|
|
95
99
|
return;
|
|
96
100
|
}
|
|
97
|
-
if (event.type === "command_completed" && event.payload.exitCode === 0 && /(^|\s)(test|vitest|jest|pytest|lint|typecheck|build)(\s|$|:)/i.test(event.payload.command)) taskRun?.captureCommand(event.payload.command, event.payload.durationMs);
|
|
98
101
|
};
|
|
99
102
|
const emitAndYield = function* (events) {
|
|
100
103
|
for (const event of events) {
|
|
@@ -28,6 +28,7 @@ import { ProjectService } from "../projects/project-service.js";
|
|
|
28
28
|
import { resolveProjectAgentId } from "../projects/project-agent.js";
|
|
29
29
|
import "../projects/index.js";
|
|
30
30
|
import { resolveEffectiveGatewayPort } from "./host.js";
|
|
31
|
+
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
31
32
|
import { AutomationService } from "../automations/service/automation-service.js";
|
|
32
33
|
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
33
34
|
import "../automations/index.js";
|
|
@@ -38,7 +39,6 @@ import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
|
|
|
38
39
|
import { TaskSignalService } from "../tasks/task-signal-service.js";
|
|
39
40
|
import "../tasks/index.js";
|
|
40
41
|
import "../agent/mcp/bundle-mcp-tools.js";
|
|
41
|
-
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
42
42
|
import { SessionIndex } from "../session/manager.js";
|
|
43
43
|
import "../session/index.js";
|
|
44
44
|
import { ExtensionLoader } from "../extensions/loader.js";
|
|
@@ -59,14 +59,14 @@ import "../knowledge/index.js";
|
|
|
59
59
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
60
60
|
import { ConnectedSourceChangePublisher } from "../connectors/source-change-publisher.js";
|
|
61
61
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
62
|
-
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
63
|
-
import "../endpoint-tools/index.js";
|
|
64
62
|
import { DiscussionService } from "../discussions/service.js";
|
|
65
63
|
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
66
64
|
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
67
65
|
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
68
66
|
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
69
67
|
import "../discussions/index.js";
|
|
68
|
+
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
69
|
+
import "../endpoint-tools/index.js";
|
|
70
70
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
71
71
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
72
72
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { retireSessionMcpRuntimeForSessionKey } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
4
|
-
import "../agent/mcp/bundle-mcp-tools.js";
|
|
5
4
|
import { abortEmbeddedRun } from "../agent/embedded/runs.js";
|
|
5
|
+
import "../agent/mcp/bundle-mcp-tools.js";
|
|
6
6
|
//#region src/gateway/session-reset-service.ts
|
|
7
7
|
init_logger();
|
|
8
8
|
const log = createLogger("SessionReset");
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/** Ripgrep binaries inside `app.asar` are not executable (spawn throws ENOTDIR). */
|
|
2
|
-
export declare function isAsarBundledPath(filePath: string): boolean;
|
|
3
|
-
/** True when `filePath` is a real on-disk executable candidate (not inside asar). */
|
|
4
|
-
export declare function isRunnableRipgrepPath(filePath: string): boolean;
|
|
5
|
-
/** @internal Test-only — clears memoized ripgrep path between cases. */
|
|
6
|
-
export declare function resetRipgrepBinaryCacheForTests(): void;
|
|
7
1
|
export interface WorkspaceSearchHit {
|
|
8
2
|
filePath: string;
|
|
9
3
|
lineNumber: number;
|
|
@@ -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 { resolveRipgrepBinary } from "../infra/ripgrep.js";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
//#region src/gateway/workspace-ripgrep.ts
|
|
6
6
|
init_logger();
|
|
@@ -8,44 +8,6 @@ const log = createLogger("WorkspaceRipgrep");
|
|
|
8
8
|
function isEnoent(err) {
|
|
9
9
|
return err !== null && typeof err === "object" && err.code === "ENOENT";
|
|
10
10
|
}
|
|
11
|
-
/** Ripgrep binaries inside `app.asar` are not executable (spawn throws ENOTDIR). */
|
|
12
|
-
function isAsarBundledPath(filePath) {
|
|
13
|
-
return filePath.includes(".asar");
|
|
14
|
-
}
|
|
15
|
-
/** True when `filePath` is a real on-disk executable candidate (not inside asar). */
|
|
16
|
-
function isRunnableRipgrepPath(filePath) {
|
|
17
|
-
const trimmed = filePath.trim();
|
|
18
|
-
if (!trimmed || isAsarBundledPath(trimmed)) return false;
|
|
19
|
-
return existsSync(trimmed);
|
|
20
|
-
}
|
|
21
|
-
let cachedRipgrepBin;
|
|
22
|
-
/** @internal Test-only — clears memoized ripgrep path between cases. */
|
|
23
|
-
function resetRipgrepBinaryCacheForTests() {
|
|
24
|
-
cachedRipgrepBin = void 0;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Resolve ripgrep binary:
|
|
28
|
-
* 1. `XOPC_RIPGREP_BIN` (Electron extraResources `bin/rg`)
|
|
29
|
-
* 2. `@vscode/ripgrep` postinstall path (dev / CLI)
|
|
30
|
-
* 3. `rg` on PATH
|
|
31
|
-
*/
|
|
32
|
-
async function resolveRipgrepBinary() {
|
|
33
|
-
if (cachedRipgrepBin) return cachedRipgrepBin;
|
|
34
|
-
const envBin = process.env.XOPC_RIPGREP_BIN?.trim();
|
|
35
|
-
if (envBin && isRunnableRipgrepPath(envBin)) {
|
|
36
|
-
cachedRipgrepBin = envBin;
|
|
37
|
-
return envBin;
|
|
38
|
-
}
|
|
39
|
-
let bin = "rg";
|
|
40
|
-
try {
|
|
41
|
-
const { rgPath } = await import("@vscode/ripgrep");
|
|
42
|
-
if (typeof rgPath === "string" && rgPath.length > 0) if (isRunnableRipgrepPath(rgPath)) bin = rgPath;
|
|
43
|
-
else if (isAsarBundledPath(rgPath)) log.debug({ rgPath }, "@vscode/ripgrep path is inside app.asar; will try rg on PATH or XOPC_RIPGREP_BIN");
|
|
44
|
-
else log.debug({ rgPath }, "@vscode/ripgrep binary not on disk; will try rg on PATH");
|
|
45
|
-
} catch {}
|
|
46
|
-
cachedRipgrepBin = bin;
|
|
47
|
-
return bin;
|
|
48
|
-
}
|
|
49
11
|
function spawnRipgrep(executable, args, options, context) {
|
|
50
12
|
try {
|
|
51
13
|
return spawn(executable, args, {
|
|
@@ -192,4 +154,4 @@ function runRipgrepListFiles(dirAbsPath) {
|
|
|
192
154
|
})();
|
|
193
155
|
}
|
|
194
156
|
//#endregion
|
|
195
|
-
export {
|
|
157
|
+
export { runRipgrepInDirectory, runRipgrepListFiles };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ripgrep binaries inside `app.asar` are not executable (spawn throws ENOTDIR). */
|
|
2
|
+
export declare function isAsarBundledPath(filePath: string): boolean;
|
|
3
|
+
/** True when `filePath` is a real on-disk executable candidate (not inside asar). */
|
|
4
|
+
export declare function isRunnableRipgrepPath(filePath: string): boolean;
|
|
5
|
+
/** @internal Test-only — clears memoized ripgrep path between cases. */
|
|
6
|
+
export declare function resetRipgrepBinaryCacheForTests(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve ripgrep binary:
|
|
9
|
+
* 1. `XOPC_RIPGREP_BIN` (Electron extraResources `bin/rg`)
|
|
10
|
+
* 2. `@vscode/ripgrep` postinstall path (dev / CLI)
|
|
11
|
+
* 3. `rg` on PATH
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveRipgrepBinary(): Promise<string>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
//#region src/infra/ripgrep.ts
|
|
5
|
+
init_logger();
|
|
6
|
+
const log = createLogger("WorkspaceRipgrep");
|
|
7
|
+
/** Ripgrep binaries inside `app.asar` are not executable (spawn throws ENOTDIR). */
|
|
8
|
+
function isAsarBundledPath(filePath) {
|
|
9
|
+
return filePath.includes(".asar");
|
|
10
|
+
}
|
|
11
|
+
/** True when `filePath` is a real on-disk executable candidate (not inside asar). */
|
|
12
|
+
function isRunnableRipgrepPath(filePath) {
|
|
13
|
+
const trimmed = filePath.trim();
|
|
14
|
+
if (!trimmed || isAsarBundledPath(trimmed)) return false;
|
|
15
|
+
return existsSync(trimmed);
|
|
16
|
+
}
|
|
17
|
+
let cachedRipgrepBin;
|
|
18
|
+
/** @internal Test-only — clears memoized ripgrep path between cases. */
|
|
19
|
+
function resetRipgrepBinaryCacheForTests() {
|
|
20
|
+
cachedRipgrepBin = void 0;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolve ripgrep binary:
|
|
24
|
+
* 1. `XOPC_RIPGREP_BIN` (Electron extraResources `bin/rg`)
|
|
25
|
+
* 2. `@vscode/ripgrep` postinstall path (dev / CLI)
|
|
26
|
+
* 3. `rg` on PATH
|
|
27
|
+
*/
|
|
28
|
+
async function resolveRipgrepBinary() {
|
|
29
|
+
if (cachedRipgrepBin) return cachedRipgrepBin;
|
|
30
|
+
const envBin = process.env.XOPC_RIPGREP_BIN?.trim();
|
|
31
|
+
if (envBin && isRunnableRipgrepPath(envBin)) {
|
|
32
|
+
cachedRipgrepBin = envBin;
|
|
33
|
+
return envBin;
|
|
34
|
+
}
|
|
35
|
+
let bin = "rg";
|
|
36
|
+
try {
|
|
37
|
+
const { rgPath } = await import("@vscode/ripgrep");
|
|
38
|
+
if (typeof rgPath === "string" && rgPath.length > 0) if (isRunnableRipgrepPath(rgPath)) bin = rgPath;
|
|
39
|
+
else if (isAsarBundledPath(rgPath)) log.debug({ rgPath }, "@vscode/ripgrep path is inside app.asar; will try rg on PATH or XOPC_RIPGREP_BIN");
|
|
40
|
+
else log.debug({ rgPath }, "@vscode/ripgrep binary not on disk; will try rg on PATH");
|
|
41
|
+
} catch {}
|
|
42
|
+
cachedRipgrepBin = bin;
|
|
43
|
+
return bin;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { isAsarBundledPath, isRunnableRipgrepPath, resetRipgrepBinaryCacheForTests, resolveRipgrepBinary };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
2
2
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../../providers/index.js";
|
|
3
3
|
import { createExtensionAwareStreamFn } from "../../providers/extension-stream-bridge.js";
|
|
4
|
-
import { runAgentTurnWithTimeout } from "../../agent/orchestration/run-agent-turn-with-timeout.js";
|
|
5
4
|
import { isAssistantTurnAborted, isAssistantTurnFailed } from "../../agent/orchestration/llm-turn-retry.js";
|
|
5
|
+
import { runAgentTurnWithTimeout } from "../../agent/orchestration/run-agent-turn-with-timeout.js";
|
|
6
6
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
8
8
|
//#region src/proactive/execution/agent-executor.ts
|
|
@@ -12,8 +12,8 @@ import { appendCompactionBoundaryIfUnchanged, appendTranscriptEntry, listCompact
|
|
|
12
12
|
import { getSessionConfig, setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
13
13
|
import "../storage/sqlite/index.js";
|
|
14
14
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
15
|
-
import { readPostCompactionContext } from "../agent/reply/post-compaction-context.js";
|
|
16
15
|
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
16
|
+
import { readPostCompactionContext } from "../agent/reply/post-compaction-context.js";
|
|
17
17
|
import { resolveCompactionPolicy } from "../agent/memory/compaction-policy.js";
|
|
18
18
|
import { promoteCompactionLedger } from "../agent/memory/compaction-promotion.js";
|
|
19
19
|
import { SlidingWindow } from "../agent/memory/window.js";
|
|
@@ -2,7 +2,6 @@ import { TurnOutcomeDeliverableSchema, fileResourceArtifactUri, mergeTurnOutcome
|
|
|
2
2
|
import { parseProductDeliveryEnvelope } from "../../packages/gateway-contract/src/product-delivery.js";
|
|
3
3
|
import { parseFileResourceId } from "../files/file-service.js";
|
|
4
4
|
//#region src/session/turn-outcome-projector.ts
|
|
5
|
-
const VERIFICATION_COMMAND = /(^|[\s:/_-])(test|vitest|jest|pytest|lint|typecheck|type-check|build)([\s:/_-]|$)/i;
|
|
6
5
|
const MAX_OUTCOME_DIFF_CHARS = 2e5;
|
|
7
6
|
function record(value) {
|
|
8
7
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -75,14 +74,16 @@ function projectTurnOutcome(params) {
|
|
|
75
74
|
let removed = 0;
|
|
76
75
|
let failedToolCount = 0;
|
|
77
76
|
let createdAtMs = 0;
|
|
77
|
+
let verificationSummary = null;
|
|
78
78
|
for (const source of params.rows) {
|
|
79
79
|
const row = source;
|
|
80
80
|
if (row.turnId !== params.turnId) continue;
|
|
81
|
+
if (row.type === "custom" && row.customType === "coding_verification") verificationSummary = record(row.data);
|
|
81
82
|
const timestamp = typeof row.timestamp === "number" ? row.timestamp : Date.parse(typeof row.timestamp === "string" ? row.timestamp : "");
|
|
82
83
|
if (Number.isFinite(timestamp)) createdAtMs = Math.max(createdAtMs, timestamp);
|
|
83
84
|
if (row.role !== "toolResult" && row.role !== "tool") continue;
|
|
84
|
-
if (row.isError === true) failedToolCount += 1;
|
|
85
85
|
const details = record(row.details) ?? {};
|
|
86
|
+
if (row.isError === true && record(details.verification)?.kind !== "check") failedToolCount += 1;
|
|
86
87
|
const explicit = Array.isArray(details.artifacts) ? details.artifacts.flatMap((value) => {
|
|
87
88
|
const parsed = TurnOutcomeDeliverableSchema.safeParse(value);
|
|
88
89
|
return parsed.success ? [parsed.data] : [];
|
|
@@ -111,23 +112,42 @@ function projectTurnOutcome(params) {
|
|
|
111
112
|
if (typeof details.added === "number") added += Math.max(0, details.added);
|
|
112
113
|
if (typeof details.removed === "number") removed += Math.max(0, details.removed);
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
const verification = record(details.verification);
|
|
116
|
+
if (verification?.kind === "check" && text(verification.command)) {
|
|
115
117
|
const toolCallId = text(row.toolCallId) ?? `check-${evidence.size + 1}`;
|
|
116
|
-
const command = text(
|
|
118
|
+
const command = text(verification.command);
|
|
117
119
|
evidence.set(toolCallId, {
|
|
118
120
|
evidenceId: `${params.turnId}:${toolCallId}:check`,
|
|
119
121
|
kind: "check",
|
|
120
122
|
label: command,
|
|
121
|
-
status:
|
|
123
|
+
status: verification.status === "failed" ? "failed" : "warning",
|
|
122
124
|
command,
|
|
123
125
|
...typeof details.durationMs === "number" ? { durationMs: Math.max(0, details.durationMs) } : {}
|
|
124
126
|
});
|
|
125
127
|
}
|
|
126
128
|
}
|
|
129
|
+
if (verificationSummary) {
|
|
130
|
+
evidence.clear();
|
|
131
|
+
for (const raw of Array.isArray(verificationSummary.evidence) ? verificationSummary.evidence : []) {
|
|
132
|
+
const item = record(raw);
|
|
133
|
+
if (item?.kind !== "check" || !text(item.command) || !text(item.toolCallId)) continue;
|
|
134
|
+
const id = `${params.turnId}:${item.toolCallId}:check`;
|
|
135
|
+
evidence.set(id, {
|
|
136
|
+
evidenceId: id,
|
|
137
|
+
kind: "check",
|
|
138
|
+
label: String(item.command),
|
|
139
|
+
command: String(item.command),
|
|
140
|
+
status: item.status === "passed" ? "passed" : item.status === "failed" ? "failed" : "warning",
|
|
141
|
+
...text(item.revision) ? { revision: text(item.revision) } : {},
|
|
142
|
+
...text(item.logPath) ? { logPath: text(item.logPath) } : {},
|
|
143
|
+
...typeof item.durationMs === "number" ? { durationMs: Math.max(0, item.durationMs) } : {}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
127
147
|
const evidenceItems = [...evidence.values()];
|
|
128
148
|
const collectedArtifacts = [...deliverables.values()];
|
|
129
149
|
const artifactItems = mergeTurnOutcomeDeliverables(collectedArtifacts);
|
|
130
|
-
const partial = failedToolCount > 0 || evidenceItems.some((item) => item.status === "
|
|
150
|
+
const partial = !verificationSummary && failedToolCount > 0 || evidenceItems.some((item) => item.status !== "passed") || verificationSummary?.required === true && verificationSummary.changed === true && !evidenceItems.some((item) => item.status === "passed") || collectedArtifacts.some((item) => item.availability !== "available");
|
|
131
151
|
const diff = diffs.join("\n");
|
|
132
152
|
const diffTruncated = diff.length > MAX_OUTCOME_DIFF_CHARS;
|
|
133
153
|
const createdAt = new Date(createdAtMs || Date.now()).toISOString();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TaskEvidence, TaskRunReceipt } from '@xopcai/gateway-contract';
|
|
1
|
+
import type { TaskEvidence, TaskRunReceipt, TurnOutcome } from '@xopcai/gateway-contract';
|
|
2
2
|
import type { ExecutionContext } from './execution-context.js';
|
|
3
3
|
export declare class TaskRunCoordinator {
|
|
4
4
|
#private;
|
|
@@ -14,8 +14,8 @@ export declare class TaskRunCoordinator {
|
|
|
14
14
|
title: string;
|
|
15
15
|
status: string;
|
|
16
16
|
}>): void;
|
|
17
|
+
captureOutcome(outcome: TurnOutcome): void;
|
|
17
18
|
capturePatch(added: number, removed: number): void;
|
|
18
|
-
captureCommand(command: string, durationMs?: number): void;
|
|
19
19
|
finalize(input: {
|
|
20
20
|
status: TaskRunReceipt['status'];
|
|
21
21
|
summary: string;
|
|
@@ -75,6 +75,19 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
captureOutcome(outcome) {
|
|
79
|
+
for (const item of outcome.evidence) {
|
|
80
|
+
if (item.kind !== "check") continue;
|
|
81
|
+
this.addEvidence({
|
|
82
|
+
kind: "test",
|
|
83
|
+
title: item.label,
|
|
84
|
+
summary: `Final workspace check: ${item.status}`,
|
|
85
|
+
provenance: "tool",
|
|
86
|
+
strength: item.status === "passed" ? "verified" : "observed",
|
|
87
|
+
observedAt: Date.now()
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
78
91
|
capturePatch(added, removed) {
|
|
79
92
|
this.addEvidence({
|
|
80
93
|
kind: "state",
|
|
@@ -85,17 +98,6 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
85
98
|
observedAt: Date.now()
|
|
86
99
|
});
|
|
87
100
|
}
|
|
88
|
-
captureCommand(command, durationMs) {
|
|
89
|
-
if (!/(^|\s)(test|vitest|jest|pytest|lint|typecheck|build)(\s|$|:)/i.test(command)) return;
|
|
90
|
-
this.addEvidence({
|
|
91
|
-
kind: "test",
|
|
92
|
-
title: command.slice(0, 120),
|
|
93
|
-
summary: durationMs === void 0 ? "Command completed successfully" : `Command completed successfully in ${durationMs} ms`,
|
|
94
|
-
provenance: "tool",
|
|
95
|
-
strength: "verified",
|
|
96
|
-
observedAt: Date.now()
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
101
|
finalize(input) {
|
|
100
102
|
const run = this.#runs.get(this.runId);
|
|
101
103
|
if (!run || ![
|
|
@@ -118,7 +120,7 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
118
120
|
},
|
|
119
121
|
remainingWork: [],
|
|
120
122
|
needsUser: false,
|
|
121
|
-
completionVerdict: input.status === "succeeded" ? "
|
|
123
|
+
completionVerdict: input.status === "succeeded" ? "partial" : "not_achieved",
|
|
122
124
|
...input.status === "failed" ? { failure: {
|
|
123
125
|
code: "agent_run_failed",
|
|
124
126
|
phase: "execution",
|
|
@@ -13,8 +13,8 @@ import { ProjectService } from "../../projects/project-service.js";
|
|
|
13
13
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
14
14
|
import "../../projects/index.js";
|
|
15
15
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
16
|
-
import { setTuiDefaultAgentConfig } from "../../commands/agents.config.js";
|
|
17
16
|
import { evictEmbeddedSessionRunner } from "../../agent/embedded/session-runner.js";
|
|
17
|
+
import { setTuiDefaultAgentConfig } from "../../commands/agents.config.js";
|
|
18
18
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
19
19
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
20
20
|
import { SessionIndex } from "../../session/manager.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VoiceTicketClaim, VoiceRealtimeRuntimeOptions } from './runtime.js';
|
|
1
|
+
import type { VoiceTicketClaim, VoiceRealtimeRuntimeOptions } from './runtime.types.js';
|
|
2
2
|
import type { VoiceEngine, VoiceEventSink } from './engine.js';
|
|
3
3
|
export declare function createAgentVoiceEngine(options: {
|
|
4
4
|
claim: VoiceTicketClaim;
|
|
@@ -1,79 +1,15 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'node:http';
|
|
2
2
|
import type { Socket } from 'node:net';
|
|
3
|
-
import { type CreateVoiceSessionRequest, type CreateVoiceSessionResponse
|
|
3
|
+
import { type CreateVoiceSessionRequest, type CreateVoiceSessionResponse } from '@xopcai/realtime-protocol/voice';
|
|
4
4
|
import type { Config } from '../../config/schema.js';
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
import type { TTSConfig } from '../tts/types.js';
|
|
8
|
-
import { type VoiceConversationContext } from './conversation-context.js';
|
|
9
|
-
import { type OmniRoute } from './omniRoute.js';
|
|
10
|
-
import { type OmniTranscript } from './omniEngine.js';
|
|
11
|
-
interface ResolvedStreamingStt {
|
|
12
|
-
plugin: MediaUnderstandingProvider & Required<Pick<MediaUnderstandingProvider, 'openAudioStream' | 'streamingAudio'>>;
|
|
13
|
-
model: string;
|
|
14
|
-
apiKey?: string;
|
|
15
|
-
baseUrl?: string;
|
|
16
|
-
headers?: Record<string, string>;
|
|
17
|
-
language?: string;
|
|
18
|
-
prompt?: string;
|
|
19
|
-
route: VoiceProviderRoute;
|
|
20
|
-
}
|
|
21
|
-
export interface VoiceTicketClaim {
|
|
22
|
-
sessionId: string;
|
|
23
|
-
principalId: string;
|
|
24
|
-
request: CreateVoiceSessionRequest;
|
|
25
|
-
inputMode: 'server_vad';
|
|
26
|
-
idleTimeoutMs: number;
|
|
27
|
-
maxSessionMs: number;
|
|
28
|
-
silenceDurationMs: number;
|
|
29
|
-
stt?: ResolvedStreamingStt;
|
|
30
|
-
omni?: OmniRoute;
|
|
31
|
-
conversationSessionId?: string;
|
|
32
|
-
tts?: ResolvedStreamingTts;
|
|
33
|
-
config: Config;
|
|
34
|
-
createdAt: number;
|
|
35
|
-
expiresAt: number;
|
|
36
|
-
}
|
|
37
|
-
interface ResolvedStreamingTts {
|
|
38
|
-
provider: ResolvedSpeechProvider;
|
|
39
|
-
config: TTSConfig;
|
|
40
|
-
route: VoiceProviderRoute;
|
|
41
|
-
}
|
|
5
|
+
import type { ResolvedStreamingStt, ResolvedStreamingTts, VoiceRealtimeRuntimeOptions } from './runtime.types.js';
|
|
6
|
+
export type { VoiceTicketClaim, VoiceRealtimeRuntimeOptions } from './runtime.types.js';
|
|
42
7
|
export type VoiceSessionCreationErrorCode = 'VOICE_DISABLED' | 'SESSION_NOT_FOUND' | 'SESSION_CONFLICT' | 'SESSION_LIMIT' | 'PROVIDER_UNAVAILABLE';
|
|
43
8
|
export declare class VoiceSessionCreationError extends Error {
|
|
44
9
|
readonly code: VoiceSessionCreationErrorCode;
|
|
45
10
|
readonly status: 404 | 409 | 429 | 503;
|
|
46
11
|
constructor(code: VoiceSessionCreationErrorCode, message: string, status: 404 | 409 | 429 | 503);
|
|
47
12
|
}
|
|
48
|
-
interface VoiceAgentEvent {
|
|
49
|
-
type: string;
|
|
50
|
-
payload?: {
|
|
51
|
-
delta?: unknown;
|
|
52
|
-
message?: unknown;
|
|
53
|
-
status?: unknown;
|
|
54
|
-
toolCallId?: unknown;
|
|
55
|
-
toolName?: unknown;
|
|
56
|
-
requestId?: unknown;
|
|
57
|
-
question?: unknown;
|
|
58
|
-
choices?: unknown;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export interface VoiceRealtimeRuntimeOptions {
|
|
62
|
-
recordOmniTranscript?: (sessionKey: string, callId: string, entry: OmniTranscript, expectedSessionId: string) => Promise<void>;
|
|
63
|
-
getConversationContext?: (sessionKey: string, expectedSessionId: string) => Promise<VoiceConversationContext>;
|
|
64
|
-
getSessionIdentity?: (sessionKey: string) => Promise<string | undefined>;
|
|
65
|
-
getConfig: () => Config;
|
|
66
|
-
sessionExists: (sessionKey: string) => Promise<boolean>;
|
|
67
|
-
sessionBusy: (sessionKey: string) => boolean;
|
|
68
|
-
runAgent: (text: string, sessionKey: string, signal: AbortSignal) => AsyncIterable<VoiceAgentEvent>;
|
|
69
|
-
recordInterruption: (entry: {
|
|
70
|
-
sessionKey: string;
|
|
71
|
-
responseId: string;
|
|
72
|
-
reason: 'barge_in' | 'client_cancelled';
|
|
73
|
-
generatedCharacters: number;
|
|
74
|
-
interruptedDuring: 'thinking' | 'speaking';
|
|
75
|
-
}) => Promise<void>;
|
|
76
|
-
}
|
|
77
13
|
export declare function resolveStreamingStt(config: Config, language?: string): ResolvedStreamingStt | undefined;
|
|
78
14
|
export declare function resolveStreamingTts(config: Config): ResolvedStreamingTts | undefined;
|
|
79
15
|
export declare class VoiceRealtimeRuntime {
|
|
@@ -96,4 +32,3 @@ export declare class VoiceRealtimeRuntime {
|
|
|
96
32
|
private pruneTickets;
|
|
97
33
|
private handleConnection;
|
|
98
34
|
}
|
|
99
|
-
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CreateVoiceSessionRequest, VoiceProviderRoute } from '@xopcai/realtime-protocol/voice';
|
|
2
|
+
import type { Config } from '../../config/schema.js';
|
|
3
|
+
import type { MediaUnderstandingProvider } from '../../media-understanding/types.js';
|
|
4
|
+
import type { ResolvedSpeechProvider } from '../tts/factory.js';
|
|
5
|
+
import type { TTSConfig } from '../tts/types.js';
|
|
6
|
+
import type { VoiceConversationContext } from './conversation-context.js';
|
|
7
|
+
import type { OmniTranscript } from './omniEngine.js';
|
|
8
|
+
import type { OmniRoute } from './omniRoute.js';
|
|
9
|
+
export interface ResolvedStreamingStt {
|
|
10
|
+
plugin: MediaUnderstandingProvider & Required<Pick<MediaUnderstandingProvider, 'openAudioStream' | 'streamingAudio'>>;
|
|
11
|
+
model: string;
|
|
12
|
+
apiKey?: string;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
language?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
route: VoiceProviderRoute;
|
|
18
|
+
}
|
|
19
|
+
export interface VoiceTicketClaim {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
principalId: string;
|
|
22
|
+
request: CreateVoiceSessionRequest;
|
|
23
|
+
inputMode: 'server_vad';
|
|
24
|
+
idleTimeoutMs: number;
|
|
25
|
+
maxSessionMs: number;
|
|
26
|
+
silenceDurationMs: number;
|
|
27
|
+
stt?: ResolvedStreamingStt;
|
|
28
|
+
omni?: OmniRoute;
|
|
29
|
+
conversationSessionId?: string;
|
|
30
|
+
tts?: ResolvedStreamingTts;
|
|
31
|
+
config: Config;
|
|
32
|
+
createdAt: number;
|
|
33
|
+
expiresAt: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ResolvedStreamingTts {
|
|
36
|
+
provider: ResolvedSpeechProvider;
|
|
37
|
+
config: TTSConfig;
|
|
38
|
+
route: VoiceProviderRoute;
|
|
39
|
+
}
|
|
40
|
+
interface VoiceAgentEvent {
|
|
41
|
+
type: string;
|
|
42
|
+
payload?: {
|
|
43
|
+
delta?: unknown;
|
|
44
|
+
message?: unknown;
|
|
45
|
+
status?: unknown;
|
|
46
|
+
toolCallId?: unknown;
|
|
47
|
+
toolName?: unknown;
|
|
48
|
+
requestId?: unknown;
|
|
49
|
+
question?: unknown;
|
|
50
|
+
choices?: unknown;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface VoiceRealtimeRuntimeOptions {
|
|
54
|
+
recordOmniTranscript?: (sessionKey: string, callId: string, entry: OmniTranscript, expectedSessionId: string) => Promise<void>;
|
|
55
|
+
getConversationContext?: (sessionKey: string, expectedSessionId: string) => Promise<VoiceConversationContext>;
|
|
56
|
+
getSessionIdentity?: (sessionKey: string) => Promise<string | undefined>;
|
|
57
|
+
getConfig: () => Config;
|
|
58
|
+
sessionExists: (sessionKey: string) => Promise<boolean>;
|
|
59
|
+
sessionBusy: (sessionKey: string) => boolean;
|
|
60
|
+
runAgent: (text: string, sessionKey: string, signal: AbortSignal) => AsyncIterable<VoiceAgentEvent>;
|
|
61
|
+
recordInterruption: (entry: {
|
|
62
|
+
sessionKey: string;
|
|
63
|
+
responseId: string;
|
|
64
|
+
reason: 'barge_in' | 'client_cancelled';
|
|
65
|
+
generatedCharacters: number;
|
|
66
|
+
interruptedDuring: 'thinking' | 'speaking';
|
|
67
|
+
}) => Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.246",
|
|
4
4
|
"description": "Local-first personal AI assistant with reviewable user understanding, durable tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
"vitest": "4.1.5",
|
|
165
165
|
"vue": "^3.5.35",
|
|
166
166
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
167
|
-
"@xopcai/
|
|
167
|
+
"@xopcai/realtime-protocol": "0.0.0",
|
|
168
168
|
"@xopcai/realtime-client": "0.0.0",
|
|
169
|
-
"@xopcai/
|
|
169
|
+
"@xopcai/gateway-contract": "0.0.0"
|
|
170
170
|
},
|
|
171
171
|
"scripts": {
|
|
172
172
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|