@xopcai/xopc 0.0.430 → 0.0.431
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/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{index-C5BhE5cA.js → index-BmUSsdwn.js} +6 -6
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +18 -18
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +12 -12
- package/dist/src/agent/child-agent-factory.js +2 -2
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +6 -6
- package/dist/src/agent/embedded/run-turn.js +19 -19
- package/dist/src/agent/embedded/session-runner.js +4 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +1 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +4 -4
- package/dist/src/agent/external-tools/composio-provider.js +4 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +6 -6
- package/dist/src/agent/external-tools/extension-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +3 -3
- package/dist/src/agent/external-tools/memory-provider.js +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +2 -2
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/independent-execution.js +2 -2
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/mcp/connection-drafts.js +1 -1
- package/dist/src/agent/mcp/connection-setup.js +1 -1
- package/dist/src/agent/mcp/conversation-setup.js +1 -1
- package/dist/src/agent/mcp/discovery.js +2 -2
- package/dist/src/agent/mcp/transport.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-streaming.js +6 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +22 -22
- package/dist/src/agent/session/session-config-service.js +2 -2
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +8 -8
- package/dist/src/agent/tools/create-share-tool.js +2 -2
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/exec-command.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +19 -19
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +2 -2
- package/dist/src/agent/tools/index.js +4 -4
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +2 -2
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +4 -4
- package/dist/src/agent/tools/personal-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +5 -5
- package/dist/src/agent/tools/phone-use-tool.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +2 -2
- package/dist/src/agent/tools/web.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +12 -12
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +3 -3
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/flows.js +1 -1
- package/dist/src/computer/model-adapter.js +1 -1
- package/dist/src/computer/runtime.js +4 -4
- package/dist/src/config/agent-profile.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/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -2
- package/dist/src/connectors/connected-source-understanding.js +5 -5
- package/dist/src/connectors/connection-recovery-service.js +4 -4
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/instances.js +1 -1
- package/dist/src/connectors/runtime-adapter-registry.js +2 -2
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/device-routes.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +2 -2
- package/dist/src/gateway/hono/app.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
- package/dist/src/gateway/hono/routes/models.js +4 -4
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +2 -2
- package/dist/src/gateway/hono/routes/phone.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +5 -5
- package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
- package/dist/src/gateway/hono/routes/sessions.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +7 -7
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +5 -5
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +45 -45
- package/dist/src/gateway/session-context-summary.js +4 -4
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +4 -4
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/runtime.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +9 -9
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/service.js +3 -3
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/source-learning.js +5 -5
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +3 -3
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +7 -7
- package/dist/src/personal-agent/prompt-context.js +7 -7
- package/dist/src/personal-agent/prompts.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +9 -9
- package/dist/src/personal-agent/request-delivery.js +2 -2
- package/dist/src/personal-agent/request-service.js +7 -7
- package/dist/src/personal-agent/result-reader.js +1 -1
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/phone/model-adapter.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/runtime.js +4 -4
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-service.js +2 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +2 -2
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/session-share-service.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +2 -2
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +5 -5
- package/dist/src/tasks/task-allocation-service.js +5 -5
- package/dist/src/tasks/task-application-service.js +5 -5
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-contract-planner.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +4 -4
- package/dist/src/tasks/task-main-update-decision-service.js +3 -3
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-research-result.js +4 -4
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -12
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +4 -4
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +5 -5
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/bailian-plan-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/bailian-plan-speech.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/service.js +7 -7
- package/package.json +1 -1
|
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { isLoopbackHost } from "../host.js";
|
|
4
4
|
import { getOAuthProviderInterfaces, init_registry } from "../../auth/oauth/registry.js";
|
|
5
5
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
6
|
-
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
7
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
8
7
|
import "../../capabilities/readiness/index.js";
|
|
8
|
+
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
9
9
|
import { applyXopcCloudCapabilitySetup } from "../xopc-cloud-capability-setup.js";
|
|
10
10
|
import { Hono } from "hono";
|
|
11
11
|
//#region src/gateway/hono/oauth-async.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PluginSelectionRequired } from "../../../extensions/agent-plugins/source-catalog.js";
|
|
2
2
|
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
3
|
-
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
4
3
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
4
|
+
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
5
5
|
import { evictAllEmbeddedSessionRunners } from "../../../agent/embedded/session-runner.js";
|
|
6
6
|
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
7
7
|
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
1
2
|
import { AgentEntrySchema, AgentModelsOverrideSchema, AgentProfileSchema, RuntimePolicySchema, SkillOverrideSchema, ToolPoliciesSchema } from "../../../agent-config/schema.js";
|
|
2
3
|
import { init_agent_config } from "../../../agent-config/index.js";
|
|
3
|
-
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
4
4
|
import { init_agent_scope } from "../../../agent/agent-scope.js";
|
|
5
5
|
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
6
6
|
import { createGatewayAgent, deleteAgentAvatarFile, deleteGatewayAgent, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, readAgentAvatarFile, readAgentProfileFile, resolveAgentAvatarImage, updateGatewayAgent, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
|
-
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
3
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
|
+
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
4
|
import { validateExtensionConfig } from "../../../extensions/config-validation.js";
|
|
5
5
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
6
6
|
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
2
2
|
import { init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
3
3
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { ProjectService } from "../../../projects/project-service.js";
|
|
5
|
-
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
6
|
-
import "../../../agent/skills/skills-marketplace.js";
|
|
7
4
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
8
5
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../../session/session-workspace.js";
|
|
9
6
|
import { getProjectForSession } from "../../../projects/workspace.js";
|
|
7
|
+
import { ProjectService } from "../../../projects/project-service.js";
|
|
8
|
+
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
9
|
+
import "../../../agent/skills/skills-marketplace.js";
|
|
10
10
|
import "../../../projects/index.js";
|
|
11
|
+
import { isSkillInstallTarget } from "../../../agent/skills/install-target.js";
|
|
11
12
|
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
12
13
|
import { buildReviewContext, resolveGitRoot } from "../../../review/review-git.js";
|
|
13
14
|
import "../../../chat-commands/index.js";
|
|
14
|
-
import { isSkillInstallTarget } from "../../../agent/skills/install-target.js";
|
|
15
15
|
//#region src/gateway/hono/routes/commands-skills.ts
|
|
16
16
|
init_agent_scope();
|
|
17
17
|
init_session_repository();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OutboundProxySchema, init_outbound_proxy } from "../../../../config/outbound-proxy.js";
|
|
2
2
|
import { init_public_url, validatePublicUrl } from "../../../../config/public-url.js";
|
|
3
3
|
import { isValidIPv4 } from "../../../../config/gateway-bind.js";
|
|
4
|
-
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
5
4
|
import { mergeShareConfigPatch } from "../../../../share/share-config.js";
|
|
6
5
|
import { mergeSiteShareConfigPatch } from "../../../../share/site-share-config.js";
|
|
6
|
+
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
7
7
|
import { PATCH_OK, patchError } from "./result.js";
|
|
8
8
|
//#region src/gateway/hono/routes/config-patch/gateway.ts
|
|
9
9
|
init_outbound_proxy();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
2
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
4
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
7
6
|
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";
|
|
@@ -8,7 +8,6 @@ import { getConnectorSyncPolicy, upsertConnectorSyncPolicy } from "../../../stor
|
|
|
8
8
|
import "../../../storage/sqlite/index.js";
|
|
9
9
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
10
10
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
11
|
-
import { createConnectorSetupSecretRequest, submitConnectorSetupSecret } from "../../../connectors/setup-secrets.js";
|
|
12
11
|
import { activateComposioBackend, addComposioBackend, ensureComposioBackend, getComposioBackend, listComposioBackends, removeComposioBackend } from "../../../connectors/composio-backends.js";
|
|
13
12
|
import { getAuthorizationAttempt } from "../../../connectors/authorization-attempts.js";
|
|
14
13
|
import { ComposioSessionsAdapter, resolveComposioApiKey } from "../../../connectors/composio-sessions.js";
|
|
@@ -17,6 +16,7 @@ import { listComposioConnectorCatalog } from "../../../connectors/composio-catal
|
|
|
17
16
|
import { configureComposioApiKey, executeComposioTool, getComposioInstallationPolicy, getComposioToolkitAuthState, getComposioToolkitScope, inspectComposioConnectorHealth, listComposioConnections, listComposioTools, refreshComposioConnection, revokeComposioConnection, setComposioToolkitScope, updateComposioConnection, updateComposioInstallationPolicy } from "../../../connectors/composio.js";
|
|
18
17
|
import { listConnectorProviders } from "../../../connectors/providers.js";
|
|
19
18
|
import { getConnectorDefinition, listConnectorCatalog } from "../../../connectors/catalog.js";
|
|
19
|
+
import { createConnectorSetupSecretRequest, submitConnectorSetupSecret } from "../../../connectors/setup-secrets.js";
|
|
20
20
|
import { recordConnectorHealthUsage } from "../../../connectors/usage.js";
|
|
21
21
|
import { getConnectorInstance, getInstalledConnectorDefinition, listConnectorInstances } from "../../../connectors/instances.js";
|
|
22
22
|
import { installConnector, installConnectorDefinition, uninstallConnector, updateConnectorConfig } from "../../../connectors/install.js";
|
|
@@ -3,8 +3,8 @@ import { getConnectorAccount } from "../../../storage/sqlite/connector-account-r
|
|
|
3
3
|
import { countKnowledgeSourceItems, deleteKnowledgeSourceItems } from "../../../storage/sqlite/knowledge-repository.js";
|
|
4
4
|
import "../../../storage/sqlite/index.js";
|
|
5
5
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
6
|
-
import { listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
7
6
|
import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
|
|
7
|
+
import { listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
8
8
|
import "../../../user-model/index.js";
|
|
9
9
|
import { getUnderstandingSourceGrant, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantPolicies } from "../../../user-context/sources/repository.js";
|
|
10
10
|
import { listConnectedContentCandidates, readConnectedContent } from "../../../connectors/content-enrichment.js";
|
|
@@ -5,9 +5,9 @@ import { endpointPrincipalRegistrationSchema, endpointSessionBindingRequestSchem
|
|
|
5
5
|
import { createEndpointPrincipal, getEndpointPrincipal, listEndpointPrincipals, revokeEndpointPrincipal } from "../../../storage/sqlite/endpoint-principal-repository.js";
|
|
6
6
|
import { listEndpointToolInvocationAuditPage } from "../../../storage/sqlite/endpoint-tool-invocation-repository.js";
|
|
7
7
|
import "../../../storage/sqlite/index.js";
|
|
8
|
+
import { getEndpointDeviceSettings, renameEndpointDevice } from "../../../storage/sqlite/endpoint-device-settings-repository.js";
|
|
8
9
|
import { parseEndpointPublicKey } from "../../../endpoint-tools/auth.js";
|
|
9
10
|
import { ENDPOINT_UPLOAD_MAX_BYTES, EndpointUploadError } from "../../../endpoint-tools/upload-service.js";
|
|
10
|
-
import { getEndpointDeviceSettings, renameEndpointDevice } from "../../../storage/sqlite/endpoint-device-settings-repository.js";
|
|
11
11
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
//#region src/gateway/hono/routes/endpoint-tools.ts
|
|
@@ -3,8 +3,8 @@ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
|
3
3
|
import { decideConnectorApproval } from "../../../storage/sqlite/connector-repository.js";
|
|
4
4
|
import { acknowledgeHomeAttention } from "../../../storage/sqlite/home-attention-repository.js";
|
|
5
5
|
import "../../../storage/sqlite/index.js";
|
|
6
|
-
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
7
6
|
import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "../../../tasks/home-query-service.js";
|
|
7
|
+
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
8
8
|
import { HomeOpportunityActionError, HomeOpportunityNotFoundError } from "../../../home-intelligence/application-service.js";
|
|
9
9
|
//#region src/gateway/hono/routes/home.ts
|
|
10
10
|
init_src();
|
|
@@ -2,9 +2,9 @@ import { hasGatewayScope } from "../../security/gateway-scopes.js";
|
|
|
2
2
|
import { locationShareRequestSchema } from "../../../../packages/endpoint-tools-protocol/src/location-sharing.js";
|
|
3
3
|
import { endpointTurnClaimSchema, init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
4
4
|
import { PhoneError, init_contracts } from "../../../phone/contracts.js";
|
|
5
|
+
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
5
6
|
import { LocationSharingError } from "../../../endpoint-tools/location-sharing.js";
|
|
6
7
|
import { endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
7
|
-
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
8
8
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { Hono } from "hono";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
1
2
|
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
2
3
|
import { resolveMcpSetupConfig } from "../../../agent/mcp/effective-server.js";
|
|
3
4
|
import { loadMergedMcpConfig } from "../../../agent/mcp/config.js";
|
|
4
5
|
import { discoverMcpTools } from "../../../agent/mcp/tool-catalog.js";
|
|
5
|
-
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
6
6
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../../agent/mcp/connection-setup.js";
|
|
7
7
|
import { McpConnectionDrafts, McpDraftError, mcpConfigRevision } from "../../../agent/mcp/connection-drafts.js";
|
|
8
8
|
import { withGatewayConfigWriteLock } from "../lib/config-write-lock.js";
|
|
@@ -2,13 +2,13 @@ import { getSqliteDatabase, init_transaction } from "../../../storage/sqlite/tra
|
|
|
2
2
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import { init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
4
4
|
import { getSessionConfig } from "../../../storage/sqlite/config-repository.js";
|
|
5
|
-
import { bindOwnerIdentity } from "../../../user-context/identity-bindings.js";
|
|
6
5
|
import { init_config, resolveKnowledgeReadPolicy } from "../../../user-context/config.js";
|
|
7
|
-
import {
|
|
6
|
+
import { bindOwnerIdentity } from "../../../user-context/identity-bindings.js";
|
|
7
|
+
import { enqueueConversationLearning, learningStatus } from "../../../memory-learning/repository.js";
|
|
8
8
|
import { canUseKnowledge, knowledgeExclusion } from "../../../knowledge-memory/usage-policy.js";
|
|
9
9
|
import { getKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
10
|
import "../../../knowledge-memory/index.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveEffectiveAgentProfileForSession } from "../../../config/agent-profile.js";
|
|
12
12
|
//#region src/gateway/hono/routes/memory-learning.ts
|
|
13
13
|
init_transaction();
|
|
14
14
|
init_session_repository();
|
|
@@ -13,13 +13,13 @@ import { CredentialResolver, init_credentials } from "../../../auth/credentials.
|
|
|
13
13
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
14
14
|
import { PROVIDER_META, getAllModels, getAllProviders, getAvailableModels, getProviderAuthState, init_providers, isProviderConfigured, isProviderConfiguredSync } from "../../../providers/index.js";
|
|
15
15
|
import { XopcCloudAccountError, XopcCloudAccountService } from "../../../providers/xopc-cloud-account-service.js";
|
|
16
|
-
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
17
|
-
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
18
|
-
import { applyImageGenerationCatalogUpdate, getAgentImageGenerationConfig, getDefaultImageGenerationConfig, getImageGenerationCatalog, prepareDefaultImageGenerationSetup, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
19
16
|
import { buildCapabilityPlansForConfig } from "../../../capabilities/readiness/from-config.js";
|
|
20
17
|
import "../../../capabilities/readiness/index.js";
|
|
21
|
-
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
22
18
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
19
|
+
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
20
|
+
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
21
|
+
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
22
|
+
import { applyImageGenerationCatalogUpdate, getAgentImageGenerationConfig, getDefaultImageGenerationConfig, getImageGenerationCatalog, prepareDefaultImageGenerationSetup, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
23
23
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
24
24
|
import { getXopcCloudCatalogCoordinator } from "../../../providers/xopc-cloud-catalog-coordinator.js";
|
|
25
25
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
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 { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
4
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
7
7
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
8
|
-
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
9
8
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
9
|
+
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
10
10
|
import { getShareStore } from "../../../share/share-store.js";
|
|
11
11
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
12
12
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../../config/paths-state.js";
|
|
2
|
-
import { RuntimeError } from "../../../runtime-tools/errors.js";
|
|
3
2
|
import { resolveAdbPath } from "../../../phone/adb-driver.js";
|
|
4
3
|
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
4
|
+
import { RuntimeError } from "../../../runtime-tools/errors.js";
|
|
5
5
|
import { PhoneDependencyManager, probePhoneAdb } from "../../../runtime-tools/phone-dependencies.js";
|
|
6
6
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../../config/paths-state.js";
|
|
2
2
|
import { getSessionMetadata, init_session_read_repository } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
4
|
-
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
5
4
|
import { init_paths } from "../../../config/paths.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
7
6
|
import { phoneModelProfile } from "../../../phone/model-policy.js";
|
|
8
7
|
import { getAllModels, init_providers, isProviderConfiguredSync, resolveModel } from "../../../providers/index.js";
|
|
9
8
|
import { phoneAllowsApp } from "../../../phone/app-access.js";
|
|
10
|
-
import "../../../phone/model-adapter.js";
|
|
11
9
|
import { managedPhoneAdbPath } from "../../../runtime-tools/phone-dependency-catalog.js";
|
|
10
|
+
import "../../../phone/model-adapter.js";
|
|
12
11
|
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
12
|
+
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
13
13
|
import { PhoneSetupService } from "../../../phone/setup/service.js";
|
|
14
14
|
import { PhoneDependencyManager, probePhoneAdb } from "../../../runtime-tools/phone-dependencies.js";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
@@ -3,15 +3,15 @@ import { init_logger } from "../../../utils/logger.js";
|
|
|
3
3
|
import { setDevicePhoneAccess } from "../../../storage/sqlite/device-access-repository.js";
|
|
4
4
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
5
5
|
import { init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
6
|
-
import { createConversation, init_conversation_repository } from "../../../storage/sqlite/conversation-repository.js";
|
|
7
6
|
import { MOCK_PHONE_MODEL, PhoneActionSchema, PhoneConfigSchema, PhoneDeviceSchema, PhoneError, PhoneExecutionModeSchema, PhoneInputSchema, init_contracts } from "../../../phone/contracts.js";
|
|
7
|
+
import { createConversation, init_conversation_repository } from "../../../storage/sqlite/conversation-repository.js";
|
|
8
8
|
import { getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
9
9
|
import { phoneModelProfile } from "../../../phone/model-policy.js";
|
|
10
10
|
import { getAllModels, init_providers, isProviderConfiguredSync } from "../../../providers/index.js";
|
|
11
11
|
import { normalizePhoneAppAccess, phoneAppAccess } from "../../../phone/app-access.js";
|
|
12
|
-
import { createPhoneModel } from "../../../phone/model-adapter.js";
|
|
13
12
|
import { cancelPhoneAssistance, pendingPhoneAssistance, phoneAssistance, phoneAssistanceReport } from "../../../phone/assistance.js";
|
|
14
13
|
import { resolveAdbPath } from "../../../phone/adb-driver.js";
|
|
14
|
+
import { createPhoneModel } from "../../../phone/model-adapter.js";
|
|
15
15
|
import { getPhoneRuntime, phoneExecutionContext } from "../../../phone/runtime.js";
|
|
16
16
|
import { registerPhoneSetupRoutes } from "./phone-setup.js";
|
|
17
17
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
@@ -6,22 +6,22 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
6
6
|
import "../../../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../../../activity/service.js";
|
|
8
8
|
import "../../../activity/index.js";
|
|
9
|
+
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
|
+
import "../../../knowledge-memory/index.js";
|
|
11
|
+
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
12
|
+
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
9
13
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
14
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
-
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
12
15
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
13
16
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
14
17
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
15
18
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
16
19
|
import { inferSuggestedProjectDefaultAgentId } from "../../../projects/project-agent-suggestion.js";
|
|
17
20
|
import { buildProjectLoopOverview } from "../../../projects/project-loop.js";
|
|
18
|
-
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
19
21
|
import "../../../projects/index.js";
|
|
20
22
|
import { TaskApplicationService } from "../../../tasks/task-application-service.js";
|
|
21
|
-
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
22
|
-
import "../../../knowledge-memory/index.js";
|
|
23
|
-
import { defineTaskContract } from "../../../tasks/task-contract-definition.js";
|
|
24
23
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
24
|
+
import { defineTaskContract } from "../../../tasks/task-contract-definition.js";
|
|
25
25
|
import { ProjectOperatingViewService, summarizeProjectOperatingView } from "../../../tasks/project-operating-view-service.js";
|
|
26
26
|
import "../../../tasks/index.js";
|
|
27
27
|
import { parseActivityIncludeRelated, parseActivityQuery } from "./activity.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../../config/paths-state.js";
|
|
2
|
+
import { RuntimeToolsConfigSchema, init_schema } from "../../../config/schema.js";
|
|
2
3
|
import { normalizeRuntimeVersionRequest } from "../../../runtime-tools/probe.js";
|
|
3
4
|
import { ManagedRuntimeManager } from "../../../runtime-tools/manager.js";
|
|
4
|
-
import { RuntimeToolsConfigSchema, init_schema } from "../../../config/schema.js";
|
|
5
5
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
6
6
|
import { pruneRuntimeTools } from "../../../runtime-tools/prune.js";
|
|
7
7
|
import { registerPhoneDependencyRoutes } from "./phone-dependencies.js";
|
|
@@ -5,12 +5,12 @@ import { sessionInputCommandSchema, sessionMaterializeCommandSchema } from "../.
|
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
|
+
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
8
9
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
9
10
|
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
10
11
|
import "../../../chat-commands/index.js";
|
|
11
|
-
import { deviceTurnSourceContext, endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
12
|
-
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
13
12
|
import { isVoiceLikeAttachment } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
13
|
+
import { deviceTurnSourceContext, endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
14
14
|
import { SessionCommandError, getSessionInputReceipt, isConversationDeleted, retrySessionPreparation } from "../../../storage/sqlite/session-creation-repository.js";
|
|
15
15
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
16
16
|
import { browserPageContextToAgentContext } from "../../../agent/source-context/browser-page.js";
|
|
@@ -5,18 +5,18 @@ import { endpointContextSchema } from "../../../../packages/gateway-contract/src
|
|
|
5
5
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
8
9
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
9
10
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
10
11
|
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
11
|
-
import {
|
|
12
|
+
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
13
|
+
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
14
|
+
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
12
15
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
13
16
|
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
14
17
|
import "../../../chat-commands/index.js";
|
|
15
|
-
import { deviceTurnSourceContext, endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
16
|
-
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
17
|
-
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
18
|
-
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
19
18
|
import { isVoiceLikeAttachment } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
19
|
+
import { deviceTurnSourceContext, endpointClaimBelongsToPrincipal } from "../../../endpoint-tools/turn-context.js";
|
|
20
20
|
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
21
21
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
22
22
|
import { browserPageContextToAgentContext } from "../../../agent/source-context/browser-page.js";
|
|
@@ -3,11 +3,11 @@ import { SessionDiscoveryQuerySchema } from "../../../../packages/gateway-contra
|
|
|
3
3
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
4
4
|
import "../../../session/types.js";
|
|
5
5
|
import { SidebarLayoutConflictError, getSidebarLayout, replaceSidebarLayout, sortBySidebarLayout } from "../../../storage/sqlite/sidebar-layout-repository.js";
|
|
6
|
-
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
7
6
|
import { summarizeAiUsageByConversations } from "../../../storage/sqlite/ai-usage-repository.js";
|
|
8
|
-
import {
|
|
9
|
-
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
7
|
+
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
10
8
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
9
|
+
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
10
|
+
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
11
11
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
12
12
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
13
13
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
@@ -4,7 +4,6 @@ import "../../../storage/sqlite/index.js";
|
|
|
4
4
|
import { FileServiceError } from "../../../files/file-service.js";
|
|
5
5
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
6
6
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
7
|
-
import { getGatewayFileSpaceService } from "../../file-space-service.js";
|
|
8
7
|
import { SHARE_CONFIG_DEFAULTS } from "../../../share/share-types.js";
|
|
9
8
|
import { resolveSiteShareConfig } from "../../../share/site-share-config.js";
|
|
10
9
|
import { logShareAudit } from "../../../share/share-audit.js";
|
|
@@ -17,6 +16,7 @@ import { HostedStaticSitePublicationBuilder } from "../../../share/hosted-static
|
|
|
17
16
|
import { publishHostedStaticSite } from "../../../share/hosted-static-site-publish.js";
|
|
18
17
|
import { audienceDefaults, cleanupStagedSite, decideShareKind, forgetStagedSite, makeDescription, makeTitle, probeShareTarget, rememberStagedSite, stageSingleHtmlAsSite } from "../../../share/share-auto.js";
|
|
19
18
|
import { deleteThumbnail, placeholderSvg, readThumbnail, scheduleThumbnail, thumbnailContentType, thumbnailExists } from "../../../share/share-thumbnail.js";
|
|
19
|
+
import { getGatewayFileSpaceService } from "../../file-space-service.js";
|
|
20
20
|
import { SHARED_HTML_CSP } from "../../security/csp.js";
|
|
21
21
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
22
22
|
import { renderFolderLandingPage, renderShareExpiredPage, renderShareLandingPage, renderSnapshotShareLandingPage } from "../../../share/share-landing.js";
|
|
@@ -2,8 +2,8 @@ import { chooseModelThinking } from "../../../../packages/gateway-contract/src/m
|
|
|
2
2
|
import { clarificationSubmissionSchema } from "../../../../packages/gateway-contract/src/clarifications.js";
|
|
3
3
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
4
4
|
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
5
|
-
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
6
5
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
6
|
+
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
7
7
|
import { validateSideChatSelections } from "../../side-chat/context-snapshot.js";
|
|
8
8
|
import { SideChatError, parseThinkingLevel } from "../../side-chat/manager.js";
|
|
9
9
|
import "../../side-chat/index.js";
|
|
@@ -6,13 +6,13 @@ import { hasGatewayScope } from "../../security/gateway-scopes.js";
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
9
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
11
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
-
import { TaskCollaborationRepository } from "../../../tasks/task-collaboration-repository.js";
|
|
12
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
13
12
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
14
13
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
15
14
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
15
|
+
import { TaskCollaborationRepository } from "../../../tasks/task-collaboration-repository.js";
|
|
16
16
|
import { TaskMutationOutputSchema } from "../../../tasks/capabilities/write.js";
|
|
17
17
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
18
18
|
import { ProjectOperatingViewService } from "../../../tasks/project-operating-view-service.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
|
|
2
2
|
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
3
|
+
import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
|
|
4
|
+
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
|
|
5
|
+
import "../../../knowledge-memory/index.js";
|
|
6
|
+
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
3
7
|
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../../user-model/repository.js";
|
|
4
|
-
import { applyUserProfilePatch, getUserProfileSnapshot } from "../../../user-model/profile.js";
|
|
5
8
|
import { listActionRuleSuggestions } from "../../../user-model/action-rule-suggestions.js";
|
|
6
|
-
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
7
9
|
import { listUserAssertionEdges, listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
10
|
+
import { applyUserProfilePatch, getUserProfileSnapshot } from "../../../user-model/profile.js";
|
|
8
11
|
import { bootstrapUserModel } from "../../../user-model/bootstrap.js";
|
|
9
|
-
import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
|
|
10
12
|
import { canUseAssertion } from "../../../user-model/usage-policy.js";
|
|
11
13
|
import "../../../user-model/index.js";
|
|
12
|
-
import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
|
|
13
|
-
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
|
|
14
|
-
import "../../../knowledge-memory/index.js";
|
|
15
|
-
import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
|
|
16
14
|
import { listMemoryMaintenanceRuns } from "../../../memory-maintenance/service.js";
|
|
17
15
|
import "../../../memory-maintenance/index.js";
|
|
16
|
+
import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
|
|
17
|
+
import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
|
|
18
18
|
import { registerMemoryLearningRoutes } from "./memory-learning.js";
|
|
19
19
|
import { userInfo } from "node:os";
|
|
20
20
|
//#region src/gateway/hono/routes/user-model.ts
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
2
1
|
import { init_model_usage, withModelUsageOrigin } from "../../../providers/model-usage.js";
|
|
3
2
|
import { voiceSelectionSchema } from "../../../../packages/realtime-protocol/src/voice-catalog.js";
|
|
4
3
|
import { VOICE_TIMING_METRICS, createVoiceSessionRequestSchema, init_voice } from "../../../../packages/realtime-protocol/src/voice.js";
|
|
5
4
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
6
5
|
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
6
|
+
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
7
7
|
import { PlatformVoiceError } from "../../../voice/platform-streams.js";
|
|
8
|
-
import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
|
|
9
|
-
import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
|
|
10
|
-
import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
|
|
11
|
-
import { speak, speakStream } from "../../../voice/tts/speak-core.js";
|
|
12
8
|
import { resolveSttProviderConfigSlice } from "../../../voice/stt/config-slice.js";
|
|
13
9
|
import { resolveSTTProviderChain } from "../../../voice/stt/factory.js";
|
|
14
|
-
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
15
|
-
import "../../../voice/tts/index.js";
|
|
16
10
|
import { STTTranscriptionError, transcribe } from "../../../voice/stt/transcribe-core.js";
|
|
11
|
+
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
17
12
|
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
18
13
|
import "../../../voice/stt/index.js";
|
|
14
|
+
import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
|
|
15
|
+
import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
|
|
16
|
+
import { speak, speakStream } from "../../../voice/tts/speak-core.js";
|
|
17
|
+
import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
|
|
19
18
|
import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
|
|
19
|
+
import "../../../voice/tts/index.js";
|
|
20
20
|
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
21
21
|
import { getSessionPreparation } from "../../../storage/sqlite/session-creation-repository.js";
|
|
22
22
|
import { resolveOmniRoute } from "../../../voice/realtime/omniRoute.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
4
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
7
6
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
8
7
|
import "../media-shared/http/index.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import fs from "node:fs/promises";
|
|
4
|
+
import fs$1 from "node:fs/promises";
|
|
5
5
|
import net from "node:net";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
@@ -29,7 +29,7 @@ function resolveGatewayLockPath(configPath) {
|
|
|
29
29
|
function isGatewayConfigLockedByAnotherProcessSync(configPath, currentPid = process.pid) {
|
|
30
30
|
const lockPath = resolveGatewayLockPath(configPath);
|
|
31
31
|
try {
|
|
32
|
-
const parsed = JSON.parse(
|
|
32
|
+
const parsed = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
33
33
|
if (typeof parsed.pid !== "number" || parsed.pid === currentPid || parsed.configPath !== configPath) return false;
|
|
34
34
|
if (!isPidAlive(parsed.pid)) return false;
|
|
35
35
|
if (process.platform !== "linux" || !Number.isFinite(parsed.startTime)) return true;
|
|
@@ -69,7 +69,7 @@ function isPidAlive(pid) {
|
|
|
69
69
|
function readLinuxStartTime(pid) {
|
|
70
70
|
if (process.platform !== "linux") return null;
|
|
71
71
|
try {
|
|
72
|
-
const raw =
|
|
72
|
+
const raw = fs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
|
|
73
73
|
const closeParen = raw.lastIndexOf(")");
|
|
74
74
|
if (closeParen < 0) return null;
|
|
75
75
|
const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
|
|
@@ -81,7 +81,7 @@ function readLinuxStartTime(pid) {
|
|
|
81
81
|
}
|
|
82
82
|
async function readLockPayload(lockPath) {
|
|
83
83
|
try {
|
|
84
|
-
const raw = await fs.readFile(lockPath, "utf8");
|
|
84
|
+
const raw = await fs$1.readFile(lockPath, "utf8");
|
|
85
85
|
const parsed = JSON.parse(raw);
|
|
86
86
|
if (typeof parsed.pid !== "number") return null;
|
|
87
87
|
if (typeof parsed.createdAt !== "string") return null;
|
|
@@ -117,11 +117,11 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
117
117
|
const staleMs = opts.staleMs ?? DEFAULT_STALE_MS;
|
|
118
118
|
const port = opts.port;
|
|
119
119
|
const lockPath = resolveGatewayLockPath(configPath);
|
|
120
|
-
await fs.mkdir(path.dirname(lockPath), { recursive: true });
|
|
120
|
+
await fs$1.mkdir(path.dirname(lockPath), { recursive: true });
|
|
121
121
|
const startedAt = Date.now();
|
|
122
122
|
let lastPayload = null;
|
|
123
123
|
while (Date.now() - startedAt < timeoutMs) try {
|
|
124
|
-
const handle = await fs.open(lockPath, "wx");
|
|
124
|
+
const handle = await fs$1.open(lockPath, "wx");
|
|
125
125
|
const startTime = process.platform === "linux" ? readLinuxStartTime(process.pid) : null;
|
|
126
126
|
const payload = {
|
|
127
127
|
pid: process.pid,
|
|
@@ -136,7 +136,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
136
136
|
configPath,
|
|
137
137
|
release: async () => {
|
|
138
138
|
await handle.close().catch(() => void 0);
|
|
139
|
-
await fs.rm(lockPath, { force: true });
|
|
139
|
+
await fs$1.rm(lockPath, { force: true });
|
|
140
140
|
console.log(`[GatewayLock] Lock released: lockPath=${lockPath}`);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -147,7 +147,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
147
147
|
const ownerStatus = ownerPid ? await resolveOwnerStatus(ownerPid, lastPayload, port) : "unknown";
|
|
148
148
|
if (ownerStatus === "dead" && ownerPid) {
|
|
149
149
|
console.warn(`[GatewayLock] Cleaning up stale gateway lock: pid=${ownerPid}`);
|
|
150
|
-
await fs.rm(lockPath, { force: true });
|
|
150
|
+
await fs$1.rm(lockPath, { force: true });
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
153
|
if (ownerStatus !== "alive") {
|
|
@@ -157,14 +157,14 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
157
157
|
stale = Number.isFinite(createdAt) ? Date.now() - createdAt > staleMs : false;
|
|
158
158
|
}
|
|
159
159
|
if (!stale) try {
|
|
160
|
-
const st = await fs.stat(lockPath);
|
|
160
|
+
const st = await fs$1.stat(lockPath);
|
|
161
161
|
stale = Date.now() - st.mtimeMs > staleMs;
|
|
162
162
|
} catch {
|
|
163
163
|
stale = false;
|
|
164
164
|
}
|
|
165
165
|
if (stale) {
|
|
166
166
|
console.warn(`[GatewayLock] Removing stale lock file: lockPath=${lockPath}`);
|
|
167
|
-
await fs.rm(lockPath, { force: true });
|
|
167
|
+
await fs$1.rm(lockPath, { force: true });
|
|
168
168
|
continue;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
|
|
2
|
-
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
3
2
|
import { resolveMediaReference } from "../media/media-reference.js";
|
|
3
|
+
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
4
4
|
import { FileServiceError } from "../files/file-service.js";
|
|
5
5
|
import { pendingTranscriptReferencesMediaUri } from "../agent/inbound/attachment-pipeline.js";
|
|
6
6
|
import { messagesReferenceMediaUri, taskResultReferencesMediaUri } from "../media/session-references.js";
|