dsh-tavern-bundle 0.1.0
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/LICENSE +21 -0
- package/README.md +216 -0
- package/cordis.patch.yml +14 -0
- package/lib/adapters/model-gateway.d.ts +4 -0
- package/lib/adapters/model-gateway.d.ts.map +1 -0
- package/lib/adapters/model-gateway.js +3 -0
- package/lib/adapters/model-gateway.js.map +1 -0
- package/lib/adapters/prestep-spike.d.ts +16 -0
- package/lib/adapters/prestep-spike.d.ts.map +1 -0
- package/lib/adapters/prestep-spike.js +114 -0
- package/lib/adapters/prestep-spike.js.map +1 -0
- package/lib/adapters/runtime-probe.d.ts +67 -0
- package/lib/adapters/runtime-probe.d.ts.map +1 -0
- package/lib/adapters/runtime-probe.js +106 -0
- package/lib/adapters/runtime-probe.js.map +1 -0
- package/lib/adapters/session-agent-provider.d.ts +3 -0
- package/lib/adapters/session-agent-provider.d.ts.map +1 -0
- package/lib/adapters/session-agent-provider.js +3 -0
- package/lib/adapters/session-agent-provider.js.map +1 -0
- package/lib/adapters/subagent-gateway.d.ts +3 -0
- package/lib/adapters/subagent-gateway.d.ts.map +1 -0
- package/lib/adapters/subagent-gateway.js +3 -0
- package/lib/adapters/subagent-gateway.js.map +1 -0
- package/lib/application/chat/chat-application-service.d.ts +94 -0
- package/lib/application/chat/chat-application-service.d.ts.map +1 -0
- package/lib/application/chat/chat-application-service.js +291 -0
- package/lib/application/chat/chat-application-service.js.map +1 -0
- package/lib/application/companion/agent-orchestrator.d.ts +91 -0
- package/lib/application/companion/agent-orchestrator.d.ts.map +1 -0
- package/lib/application/companion/agent-orchestrator.js +298 -0
- package/lib/application/companion/agent-orchestrator.js.map +1 -0
- package/lib/application/companion/companion-child-service.d.ts +47 -0
- package/lib/application/companion/companion-child-service.d.ts.map +1 -0
- package/lib/application/companion/companion-child-service.js +30 -0
- package/lib/application/companion/companion-child-service.js.map +1 -0
- package/lib/application/companion/companion-invocation-service.d.ts +42 -0
- package/lib/application/companion/companion-invocation-service.d.ts.map +1 -0
- package/lib/application/companion/companion-invocation-service.js +50 -0
- package/lib/application/companion/companion-invocation-service.js.map +1 -0
- package/lib/application/companion/companion-profile-service.d.ts +32 -0
- package/lib/application/companion/companion-profile-service.d.ts.map +1 -0
- package/lib/application/companion/companion-profile-service.js +112 -0
- package/lib/application/companion/companion-profile-service.js.map +1 -0
- package/lib/application/companion/companion-promotion-service.d.ts +69 -0
- package/lib/application/companion/companion-promotion-service.d.ts.map +1 -0
- package/lib/application/companion/companion-promotion-service.js +129 -0
- package/lib/application/companion/companion-promotion-service.js.map +1 -0
- package/lib/application/group-chat/group-chat-execution-service.d.ts +22 -0
- package/lib/application/group-chat/group-chat-execution-service.d.ts.map +1 -0
- package/lib/application/group-chat/group-chat-execution-service.js +110 -0
- package/lib/application/group-chat/group-chat-execution-service.js.map +1 -0
- package/lib/application/group-chat/group-chat-orchestrator.d.ts +51 -0
- package/lib/application/group-chat/group-chat-orchestrator.d.ts.map +1 -0
- package/lib/application/group-chat/group-chat-orchestrator.js +57 -0
- package/lib/application/group-chat/group-chat-orchestrator.js.map +1 -0
- package/lib/application/memory/memory-retriever.d.ts +37 -0
- package/lib/application/memory/memory-retriever.d.ts.map +1 -0
- package/lib/application/memory/memory-retriever.js +91 -0
- package/lib/application/memory/memory-retriever.js.map +1 -0
- package/lib/application/memory/memory-service.d.ts +128 -0
- package/lib/application/memory/memory-service.d.ts.map +1 -0
- package/lib/application/memory/memory-service.js +346 -0
- package/lib/application/memory/memory-service.js.map +1 -0
- package/lib/application/ports/companion-runtime-port.d.ts +72 -0
- package/lib/application/ports/companion-runtime-port.d.ts.map +1 -0
- package/lib/application/ports/companion-runtime-port.js +2 -0
- package/lib/application/ports/companion-runtime-port.js.map +1 -0
- package/lib/application/ports/llm-port.d.ts +7 -0
- package/lib/application/ports/llm-port.d.ts.map +1 -0
- package/lib/application/ports/llm-port.js +2 -0
- package/lib/application/ports/llm-port.js.map +1 -0
- package/lib/application/ports/message-source.d.ts +4 -0
- package/lib/application/ports/message-source.d.ts.map +1 -0
- package/lib/application/ports/message-source.js +5 -0
- package/lib/application/ports/message-source.js.map +1 -0
- package/lib/application/ports/session-context-port.d.ts +13 -0
- package/lib/application/ports/session-context-port.d.ts.map +1 -0
- package/lib/application/ports/session-context-port.js +2 -0
- package/lib/application/ports/session-context-port.js.map +1 -0
- package/lib/application/ports/subagent-port.d.ts +31 -0
- package/lib/application/ports/subagent-port.d.ts.map +1 -0
- package/lib/application/ports/subagent-port.js +2 -0
- package/lib/application/ports/subagent-port.js.map +1 -0
- package/lib/application/ports/user-resolver-port.d.ts +5 -0
- package/lib/application/ports/user-resolver-port.d.ts.map +1 -0
- package/lib/application/ports/user-resolver-port.js +2 -0
- package/lib/application/ports/user-resolver-port.js.map +1 -0
- package/lib/application/relationship/relationship-event-service.d.ts +31 -0
- package/lib/application/relationship/relationship-event-service.d.ts.map +1 -0
- package/lib/application/relationship/relationship-event-service.js +43 -0
- package/lib/application/relationship/relationship-event-service.js.map +1 -0
- package/lib/application/relationship/relationship-policy.d.ts +20 -0
- package/lib/application/relationship/relationship-policy.d.ts.map +1 -0
- package/lib/application/relationship/relationship-policy.js +24 -0
- package/lib/application/relationship/relationship-policy.js.map +1 -0
- package/lib/application/relationship/relationship-projection.d.ts +14 -0
- package/lib/application/relationship/relationship-projection.d.ts.map +1 -0
- package/lib/application/relationship/relationship-projection.js +25 -0
- package/lib/application/relationship/relationship-projection.js.map +1 -0
- package/lib/application/relationship/relationship-service.d.ts +95 -0
- package/lib/application/relationship/relationship-service.d.ts.map +1 -0
- package/lib/application/relationship/relationship-service.js +254 -0
- package/lib/application/relationship/relationship-service.js.map +1 -0
- package/lib/application/workspace/workspace-service.d.ts +106 -0
- package/lib/application/workspace/workspace-service.d.ts.map +1 -0
- package/lib/application/workspace/workspace-service.js +44 -0
- package/lib/application/workspace/workspace-service.js.map +1 -0
- package/lib/bootstrap/create-domain.d.ts +5 -0
- package/lib/bootstrap/create-domain.d.ts.map +1 -0
- package/lib/bootstrap/create-domain.js +14 -0
- package/lib/bootstrap/create-domain.js.map +1 -0
- package/lib/bootstrap/create-repositories.d.ts +403 -0
- package/lib/bootstrap/create-repositories.d.ts.map +1 -0
- package/lib/bootstrap/create-repositories.js +39 -0
- package/lib/bootstrap/create-repositories.js.map +1 -0
- package/lib/bootstrap/create-runtime.d.ts +8 -0
- package/lib/bootstrap/create-runtime.d.ts.map +1 -0
- package/lib/bootstrap/create-runtime.js +10 -0
- package/lib/bootstrap/create-runtime.js.map +1 -0
- package/lib/bootstrap/create-services.d.ts +52 -0
- package/lib/bootstrap/create-services.d.ts.map +1 -0
- package/lib/bootstrap/create-services.js +79 -0
- package/lib/bootstrap/create-services.js.map +1 -0
- package/lib/bootstrap/install-commands.d.ts +4 -0
- package/lib/bootstrap/install-commands.d.ts.map +1 -0
- package/lib/bootstrap/install-commands.js +322 -0
- package/lib/bootstrap/install-commands.js.map +1 -0
- package/lib/bootstrap/install-http.d.ts +7 -0
- package/lib/bootstrap/install-http.d.ts.map +1 -0
- package/lib/bootstrap/install-http.js +265 -0
- package/lib/bootstrap/install-http.js.map +1 -0
- package/lib/bootstrap/lifecycle.d.ts +14 -0
- package/lib/bootstrap/lifecycle.d.ts.map +1 -0
- package/lib/bootstrap/lifecycle.js +56 -0
- package/lib/bootstrap/lifecycle.js.map +1 -0
- package/lib/bootstrap/types.d.ts +9 -0
- package/lib/bootstrap/types.d.ts.map +1 -0
- package/lib/bootstrap/types.js +2 -0
- package/lib/bootstrap/types.js.map +1 -0
- package/lib/client.js +6 -0
- package/lib/client.js.map +1 -0
- package/lib/core/audit-service.d.ts +43 -0
- package/lib/core/audit-service.d.ts.map +1 -0
- package/lib/core/audit-service.js +75 -0
- package/lib/core/audit-service.js.map +1 -0
- package/lib/core/candidate-extractor.d.ts +31 -0
- package/lib/core/candidate-extractor.d.ts.map +1 -0
- package/lib/core/candidate-extractor.js +83 -0
- package/lib/core/candidate-extractor.js.map +1 -0
- package/lib/core/candidate-service.d.ts +72 -0
- package/lib/core/candidate-service.d.ts.map +1 -0
- package/lib/core/candidate-service.js +283 -0
- package/lib/core/candidate-service.js.map +1 -0
- package/lib/core/character-service.d.ts +26 -0
- package/lib/core/character-service.d.ts.map +1 -0
- package/lib/core/character-service.js +68 -0
- package/lib/core/character-service.js.map +1 -0
- package/lib/core/chat-file-io.d.ts +28 -0
- package/lib/core/chat-file-io.d.ts.map +1 -0
- package/lib/core/chat-file-io.js +114 -0
- package/lib/core/chat-file-io.js.map +1 -0
- package/lib/core/chat-service.d.ts +4 -0
- package/lib/core/chat-service.d.ts.map +1 -0
- package/lib/core/chat-service.js +3 -0
- package/lib/core/chat-service.js.map +1 -0
- package/lib/core/command-arguments.d.ts +2 -0
- package/lib/core/command-arguments.d.ts.map +1 -0
- package/lib/core/command-arguments.js +42 -0
- package/lib/core/command-arguments.js.map +1 -0
- package/lib/core/companion-child-agent-service.d.ts +3 -0
- package/lib/core/companion-child-agent-service.d.ts.map +1 -0
- package/lib/core/companion-child-agent-service.js +3 -0
- package/lib/core/companion-child-agent-service.js.map +1 -0
- package/lib/core/companion-invocation-service.d.ts +3 -0
- package/lib/core/companion-invocation-service.d.ts.map +1 -0
- package/lib/core/companion-invocation-service.js +3 -0
- package/lib/core/companion-invocation-service.js.map +1 -0
- package/lib/core/companion-profile-service.d.ts +3 -0
- package/lib/core/companion-profile-service.d.ts.map +1 -0
- package/lib/core/companion-profile-service.js +3 -0
- package/lib/core/companion-profile-service.js.map +1 -0
- package/lib/core/companion-promotion-service.d.ts +3 -0
- package/lib/core/companion-promotion-service.d.ts.map +1 -0
- package/lib/core/companion-promotion-service.js +3 -0
- package/lib/core/companion-promotion-service.js.map +1 -0
- package/lib/core/context-assembler.d.ts +92 -0
- package/lib/core/context-assembler.d.ts.map +1 -0
- package/lib/core/context-assembler.js +185 -0
- package/lib/core/context-assembler.js.map +1 -0
- package/lib/core/conversation-repository.d.ts +42 -0
- package/lib/core/conversation-repository.d.ts.map +1 -0
- package/lib/core/conversation-repository.js +94 -0
- package/lib/core/conversation-repository.js.map +1 -0
- package/lib/core/group-chat-execution-service.d.ts +3 -0
- package/lib/core/group-chat-execution-service.d.ts.map +1 -0
- package/lib/core/group-chat-execution-service.js +3 -0
- package/lib/core/group-chat-execution-service.js.map +1 -0
- package/lib/core/group-chat-orchestrator.d.ts +3 -0
- package/lib/core/group-chat-orchestrator.d.ts.map +1 -0
- package/lib/core/group-chat-orchestrator.js +3 -0
- package/lib/core/group-chat-orchestrator.js.map +1 -0
- package/lib/core/memory-retriever.d.ts +3 -0
- package/lib/core/memory-retriever.d.ts.map +1 -0
- package/lib/core/memory-retriever.js +3 -0
- package/lib/core/memory-retriever.js.map +1 -0
- package/lib/core/memory-service.d.ts +3 -0
- package/lib/core/memory-service.d.ts.map +1 -0
- package/lib/core/memory-service.js +3 -0
- package/lib/core/memory-service.js.map +1 -0
- package/lib/core/personality-candidate-service.d.ts +46 -0
- package/lib/core/personality-candidate-service.d.ts.map +1 -0
- package/lib/core/personality-candidate-service.js +65 -0
- package/lib/core/personality-candidate-service.js.map +1 -0
- package/lib/core/prompt-assembler.d.ts +43 -0
- package/lib/core/prompt-assembler.d.ts.map +1 -0
- package/lib/core/prompt-assembler.js +67 -0
- package/lib/core/prompt-assembler.js.map +1 -0
- package/lib/core/relationship-event-service.d.ts +3 -0
- package/lib/core/relationship-event-service.d.ts.map +1 -0
- package/lib/core/relationship-event-service.js +3 -0
- package/lib/core/relationship-event-service.js.map +1 -0
- package/lib/core/relationship-policy.d.ts +3 -0
- package/lib/core/relationship-policy.d.ts.map +1 -0
- package/lib/core/relationship-policy.js +3 -0
- package/lib/core/relationship-policy.js.map +1 -0
- package/lib/core/relationship-projection.d.ts +3 -0
- package/lib/core/relationship-projection.d.ts.map +1 -0
- package/lib/core/relationship-projection.js +3 -0
- package/lib/core/relationship-projection.js.map +1 -0
- package/lib/core/relationship-service.d.ts +3 -0
- package/lib/core/relationship-service.d.ts.map +1 -0
- package/lib/core/relationship-service.js +3 -0
- package/lib/core/relationship-service.js.map +1 -0
- package/lib/core/roleplay-contract.d.ts +11 -0
- package/lib/core/roleplay-contract.d.ts.map +1 -0
- package/lib/core/roleplay-contract.js +27 -0
- package/lib/core/roleplay-contract.js.map +1 -0
- package/lib/core/runtime-binding-service.d.ts +19 -0
- package/lib/core/runtime-binding-service.d.ts.map +1 -0
- package/lib/core/runtime-binding-service.js +66 -0
- package/lib/core/runtime-binding-service.js.map +1 -0
- package/lib/core/scene-service.d.ts +60 -0
- package/lib/core/scene-service.d.ts.map +1 -0
- package/lib/core/scene-service.js +212 -0
- package/lib/core/scene-service.js.map +1 -0
- package/lib/core/session-binding-service.d.ts +51 -0
- package/lib/core/session-binding-service.d.ts.map +1 -0
- package/lib/core/session-binding-service.js +106 -0
- package/lib/core/session-binding-service.js.map +1 -0
- package/lib/core/skill-service.d.ts +82 -0
- package/lib/core/skill-service.d.ts.map +1 -0
- package/lib/core/skill-service.js +45 -0
- package/lib/core/skill-service.js.map +1 -0
- package/lib/core/tavern-session-bridge.d.ts +3 -0
- package/lib/core/tavern-session-bridge.d.ts.map +1 -0
- package/lib/core/tavern-session-bridge.js +3 -0
- package/lib/core/tavern-session-bridge.js.map +1 -0
- package/lib/core/user-resolver.d.ts +15 -0
- package/lib/core/user-resolver.d.ts.map +1 -0
- package/lib/core/user-resolver.js +17 -0
- package/lib/core/user-resolver.js.map +1 -0
- package/lib/core/workspace-service.d.ts +3 -0
- package/lib/core/workspace-service.d.ts.map +1 -0
- package/lib/core/workspace-service.js +3 -0
- package/lib/core/workspace-service.js.map +1 -0
- package/lib/core/workspace-session-service.d.ts +11 -0
- package/lib/core/workspace-session-service.d.ts.map +1 -0
- package/lib/core/workspace-session-service.js +14 -0
- package/lib/core/workspace-session-service.js.map +1 -0
- package/lib/domain/schemas.d.ts +1173 -0
- package/lib/domain/schemas.d.ts.map +1 -0
- package/lib/domain/schemas.js +590 -0
- package/lib/domain/schemas.js.map +1 -0
- package/lib/domain/spec.d.ts +494 -0
- package/lib/domain/spec.d.ts.map +1 -0
- package/lib/domain/spec.js +63 -0
- package/lib/domain/spec.js.map +1 -0
- package/lib/import/artifact-service.d.ts +33 -0
- package/lib/import/artifact-service.d.ts.map +1 -0
- package/lib/import/artifact-service.js +67 -0
- package/lib/import/artifact-service.js.map +1 -0
- package/lib/import/import-service.d.ts +30 -0
- package/lib/import/import-service.d.ts.map +1 -0
- package/lib/import/import-service.js +154 -0
- package/lib/import/import-service.js.map +1 -0
- package/lib/import/parser.d.ts +81 -0
- package/lib/import/parser.d.ts.map +1 -0
- package/lib/import/parser.js +423 -0
- package/lib/import/parser.js.map +1 -0
- package/lib/index.d.ts +60 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +111 -0
- package/lib/index.js.map +1 -0
- package/lib/infrastructure/dsh/llm/llm-port.d.ts +3 -0
- package/lib/infrastructure/dsh/llm/llm-port.d.ts.map +1 -0
- package/lib/infrastructure/dsh/llm/llm-port.js +2 -0
- package/lib/infrastructure/dsh/llm/llm-port.js.map +1 -0
- package/lib/infrastructure/dsh/llm/model-gateway.d.ts +10 -0
- package/lib/infrastructure/dsh/llm/model-gateway.d.ts.map +1 -0
- package/lib/infrastructure/dsh/llm/model-gateway.js +21 -0
- package/lib/infrastructure/dsh/llm/model-gateway.js.map +1 -0
- package/lib/infrastructure/dsh/session/session-agent-provider.d.ts +28 -0
- package/lib/infrastructure/dsh/session/session-agent-provider.d.ts.map +1 -0
- package/lib/infrastructure/dsh/session/session-agent-provider.js +40 -0
- package/lib/infrastructure/dsh/session/session-agent-provider.js.map +1 -0
- package/lib/infrastructure/dsh/session/tavern-session-bridge.d.ts +142 -0
- package/lib/infrastructure/dsh/session/tavern-session-bridge.d.ts.map +1 -0
- package/lib/infrastructure/dsh/session/tavern-session-bridge.js +544 -0
- package/lib/infrastructure/dsh/session/tavern-session-bridge.js.map +1 -0
- package/lib/infrastructure/dsh/subagent/subagent-gateway.d.ts +63 -0
- package/lib/infrastructure/dsh/subagent/subagent-gateway.d.ts.map +1 -0
- package/lib/infrastructure/dsh/subagent/subagent-gateway.js +70 -0
- package/lib/infrastructure/dsh/subagent/subagent-gateway.js.map +1 -0
- package/lib/infrastructure/runtime/companion-runtime.d.ts +128 -0
- package/lib/infrastructure/runtime/companion-runtime.d.ts.map +1 -0
- package/lib/infrastructure/runtime/companion-runtime.js +127 -0
- package/lib/infrastructure/runtime/companion-runtime.js.map +1 -0
- package/lib/infrastructure/runtime/runtime-factory.d.ts +10 -0
- package/lib/infrastructure/runtime/runtime-factory.d.ts.map +1 -0
- package/lib/infrastructure/runtime/runtime-factory.js +14 -0
- package/lib/infrastructure/runtime/runtime-factory.js.map +1 -0
- package/lib/interfaces/http/chat/chat-http.d.ts +23 -0
- package/lib/interfaces/http/chat/chat-http.d.ts.map +1 -0
- package/lib/interfaces/http/chat/chat-http.js +310 -0
- package/lib/interfaces/http/chat/chat-http.js.map +1 -0
- package/lib/interfaces/http/companion/companion-http.d.ts +8 -0
- package/lib/interfaces/http/companion/companion-http.d.ts.map +1 -0
- package/lib/interfaces/http/companion/companion-http.js +76 -0
- package/lib/interfaces/http/companion/companion-http.js.map +1 -0
- package/lib/interfaces/http/companion/promotion-http.d.ts +6 -0
- package/lib/interfaces/http/companion/promotion-http.d.ts.map +1 -0
- package/lib/interfaces/http/companion/promotion-http.js +25 -0
- package/lib/interfaces/http/companion/promotion-http.js.map +1 -0
- package/lib/interfaces/http/companion/runtime-http.d.ts +13 -0
- package/lib/interfaces/http/companion/runtime-http.d.ts.map +1 -0
- package/lib/interfaces/http/companion/runtime-http.js +51 -0
- package/lib/interfaces/http/companion/runtime-http.js.map +1 -0
- package/lib/interfaces/http/companion/stage4-companion-http.d.ts +30 -0
- package/lib/interfaces/http/companion/stage4-companion-http.d.ts.map +1 -0
- package/lib/interfaces/http/companion/stage4-companion-http.js +149 -0
- package/lib/interfaces/http/companion/stage4-companion-http.js.map +1 -0
- package/lib/interfaces/http/group/group-http.d.ts +11 -0
- package/lib/interfaces/http/group/group-http.d.ts.map +1 -0
- package/lib/interfaces/http/group/group-http.js +77 -0
- package/lib/interfaces/http/group/group-http.js.map +1 -0
- package/lib/interfaces/http/memory/candidate-http.d.ts +8 -0
- package/lib/interfaces/http/memory/candidate-http.d.ts.map +1 -0
- package/lib/interfaces/http/memory/candidate-http.js +86 -0
- package/lib/interfaces/http/memory/candidate-http.js.map +1 -0
- package/lib/interfaces/http/relationship/companion-relationship-http.d.ts +7 -0
- package/lib/interfaces/http/relationship/companion-relationship-http.d.ts.map +1 -0
- package/lib/interfaces/http/relationship/companion-relationship-http.js +30 -0
- package/lib/interfaces/http/relationship/companion-relationship-http.js.map +1 -0
- package/lib/interfaces/http/workspace/workspace-http.d.ts +19 -0
- package/lib/interfaces/http/workspace/workspace-http.d.ts.map +1 -0
- package/lib/interfaces/http/workspace/workspace-http.js +78 -0
- package/lib/interfaces/http/workspace/workspace-http.js.map +1 -0
- package/lib/interfaces/read-model/tavern-read-api.d.ts +44 -0
- package/lib/interfaces/read-model/tavern-read-api.d.ts.map +1 -0
- package/lib/interfaces/read-model/tavern-read-api.js +189 -0
- package/lib/interfaces/read-model/tavern-read-api.js.map +1 -0
- package/lib/remote/candidate-api.d.ts +3 -0
- package/lib/remote/candidate-api.d.ts.map +1 -0
- package/lib/remote/candidate-api.js +3 -0
- package/lib/remote/candidate-api.js.map +1 -0
- package/lib/remote/chat-api.d.ts +3 -0
- package/lib/remote/chat-api.d.ts.map +1 -0
- package/lib/remote/chat-api.js +3 -0
- package/lib/remote/chat-api.js.map +1 -0
- package/lib/remote/companion-api.d.ts +3 -0
- package/lib/remote/companion-api.d.ts.map +1 -0
- package/lib/remote/companion-api.js +3 -0
- package/lib/remote/companion-api.js.map +1 -0
- package/lib/remote/companion-promotion-api.d.ts +3 -0
- package/lib/remote/companion-promotion-api.d.ts.map +1 -0
- package/lib/remote/companion-promotion-api.js +3 -0
- package/lib/remote/companion-promotion-api.js.map +1 -0
- package/lib/remote/import-http.d.ts +29 -0
- package/lib/remote/import-http.d.ts.map +1 -0
- package/lib/remote/import-http.js +106 -0
- package/lib/remote/import-http.js.map +1 -0
- package/lib/remote/stage4-api.d.ts +6 -0
- package/lib/remote/stage4-api.d.ts.map +1 -0
- package/lib/remote/stage4-api.js +4 -0
- package/lib/remote/stage4-api.js.map +1 -0
- package/lib/remote/stage5-runtime-api.d.ts +4 -0
- package/lib/remote/stage5-runtime-api.d.ts.map +1 -0
- package/lib/remote/stage5-runtime-api.js +2 -0
- package/lib/remote/stage5-runtime-api.js.map +1 -0
- package/lib/remote/stage6-group-api.d.ts +4 -0
- package/lib/remote/stage6-group-api.d.ts.map +1 -0
- package/lib/remote/stage6-group-api.js +2 -0
- package/lib/remote/stage6-group-api.js.map +1 -0
- package/lib/remote/tavern-api.d.ts +3 -0
- package/lib/remote/tavern-api.d.ts.map +1 -0
- package/lib/remote/tavern-api.js +3 -0
- package/lib/remote/tavern-api.js.map +1 -0
- package/lib/runtime/agent-orchestrator.d.ts +3 -0
- package/lib/runtime/agent-orchestrator.d.ts.map +1 -0
- package/lib/runtime/agent-orchestrator.js +3 -0
- package/lib/runtime/agent-orchestrator.js.map +1 -0
- package/lib/runtime/companion-runtime.d.ts +3 -0
- package/lib/runtime/companion-runtime.d.ts.map +1 -0
- package/lib/runtime/companion-runtime.js +3 -0
- package/lib/runtime/companion-runtime.js.map +1 -0
- package/lib/runtime/langgraph-graph.d.ts +32 -0
- package/lib/runtime/langgraph-graph.d.ts.map +1 -0
- package/lib/runtime/langgraph-graph.js +32 -0
- package/lib/runtime/langgraph-graph.js.map +1 -0
- package/lib/runtime/state.d.ts +38 -0
- package/lib/runtime/state.d.ts.map +1 -0
- package/lib/runtime/state.js +16 -0
- package/lib/runtime/state.js.map +1 -0
- package/lib/seed/elaine.d.ts +9 -0
- package/lib/seed/elaine.d.ts.map +1 -0
- package/lib/seed/elaine.js +27 -0
- package/lib/seed/elaine.js.map +1 -0
- package/lib/tools/import-character.d.ts +16 -0
- package/lib/tools/import-character.d.ts.map +1 -0
- package/lib/tools/import-character.js +98 -0
- package/lib/tools/import-character.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionBindingService —— 一个 Tavern 聊天文件对应一个 DSH 原生会话。
|
|
3
|
+
*
|
|
4
|
+
* Conversation 是持久化事实源;binding 仅表示该聊天当前已被载入 Tavern
|
|
5
|
+
* workspace 的原生呈现租约。旧版“角色会话容器 + activeConversationId”数据
|
|
6
|
+
* 在启动时迁移为每个聊天文件一行,绝不删除 Tavern Conversation。
|
|
7
|
+
*/
|
|
8
|
+
import type { KvTable } from '@deepseek-ai/dsh-storage-domain';
|
|
9
|
+
import type { SessionBinding } from '../domain/schemas.js';
|
|
10
|
+
export interface SessionBindingInput {
|
|
11
|
+
readonly sessionId: string;
|
|
12
|
+
readonly conversationId: string;
|
|
13
|
+
readonly characterId: string;
|
|
14
|
+
readonly ownerUserId: string;
|
|
15
|
+
/** 伙伴 Agent 会话绑定;普通角色卡聊天不设置。 */
|
|
16
|
+
readonly companionProfileId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SessionBindingService {
|
|
19
|
+
upsert(input: SessionBindingInput): Promise<SessionBinding>;
|
|
20
|
+
get(sessionId: string): Promise<SessionBinding | null>;
|
|
21
|
+
getByConversation(userId: string, conversationId: string): Promise<SessionBinding | null>;
|
|
22
|
+
getByCompanion(userId: string, companionProfileId: string): Promise<SessionBinding | null>;
|
|
23
|
+
listByUser(userId: string): Promise<SessionBinding[]>;
|
|
24
|
+
listByCharacter(userId: string, characterId: string): Promise<SessionBinding[]>;
|
|
25
|
+
listAll(): Promise<SessionBinding[]>;
|
|
26
|
+
remove(sessionId: string): Promise<void>;
|
|
27
|
+
removeByConversation(conversationId: string): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare class KvTableSessionBindingService implements SessionBindingService {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(table: KvTable<string, SessionBinding>);
|
|
32
|
+
upsert(input: SessionBindingInput): Promise<SessionBinding>;
|
|
33
|
+
get(sessionId: string): Promise<SessionBinding | null>;
|
|
34
|
+
getByConversation(userId: string, conversationId: string): Promise<SessionBinding | null>;
|
|
35
|
+
getByCompanion(userId: string, companionProfileId: string): Promise<SessionBinding | null>;
|
|
36
|
+
listByUser(userId: string): Promise<SessionBinding[]>;
|
|
37
|
+
listByCharacter(userId: string, characterId: string): Promise<SessionBinding[]>;
|
|
38
|
+
listAll(): Promise<SessionBinding[]>;
|
|
39
|
+
remove(sessionId: string): Promise<void>;
|
|
40
|
+
removeByConversation(conversationId: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 兼容旧数据:把 activeConversationId 写成正式 conversationId。旧 M1 已把
|
|
43
|
+
* 多个角色会话归并为一行,因此仅能恢复其当时 active 的聊天;其它聊天文件
|
|
44
|
+
* 本来没有运行时 session,用户可在设置页重新打开。
|
|
45
|
+
*/
|
|
46
|
+
migrateLegacyToConversation(): Promise<{
|
|
47
|
+
migrated: number;
|
|
48
|
+
}>;
|
|
49
|
+
private sort;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=session-binding-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-binding-service.d.ts","sourceRoot":"","sources":["../../src/core/session-binding-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,gCAAgC;IAChC,QAAQ,CAAC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AAkB,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAO1F,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAQrD,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/E,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAQpC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjE;;;;OAIG;IACG,2BAA2B,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAiBlE,OAAO,CAAC,IAAI;CAKb"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionBindingService —— 一个 Tavern 聊天文件对应一个 DSH 原生会话。
|
|
3
|
+
*
|
|
4
|
+
* Conversation 是持久化事实源;binding 仅表示该聊天当前已被载入 Tavern
|
|
5
|
+
* workspace 的原生呈现租约。旧版“角色会话容器 + activeConversationId”数据
|
|
6
|
+
* 在启动时迁移为每个聊天文件一行,绝不删除 Tavern Conversation。
|
|
7
|
+
*/
|
|
8
|
+
function conversationOf(binding) {
|
|
9
|
+
return binding.conversationId ?? binding.activeConversationId;
|
|
10
|
+
}
|
|
11
|
+
export class KvTableSessionBindingService {
|
|
12
|
+
#table;
|
|
13
|
+
#index = new Map();
|
|
14
|
+
constructor(table) {
|
|
15
|
+
this.#table = table;
|
|
16
|
+
}
|
|
17
|
+
async upsert(input) {
|
|
18
|
+
const now = new Date().toISOString();
|
|
19
|
+
const existing = this.#table.get(input.sessionId);
|
|
20
|
+
const binding = {
|
|
21
|
+
id: input.sessionId,
|
|
22
|
+
...input,
|
|
23
|
+
createdAt: existing?.createdAt ?? now,
|
|
24
|
+
updatedAt: now,
|
|
25
|
+
};
|
|
26
|
+
await this.#table.put(input.sessionId, binding);
|
|
27
|
+
this.#index.set(input.sessionId, binding);
|
|
28
|
+
return binding;
|
|
29
|
+
}
|
|
30
|
+
get(sessionId) {
|
|
31
|
+
const cached = this.#index.get(sessionId);
|
|
32
|
+
return Promise.resolve(cached ?? this.#table.get(sessionId) ?? null);
|
|
33
|
+
}
|
|
34
|
+
async getByConversation(userId, conversationId) {
|
|
35
|
+
for (const binding of await this.listByUser(userId)) {
|
|
36
|
+
if (conversationOf(binding) === conversationId)
|
|
37
|
+
return binding;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
async getByCompanion(userId, companionProfileId) {
|
|
42
|
+
for (const binding of await this.listByUser(userId)) {
|
|
43
|
+
if (binding.companionProfileId === companionProfileId)
|
|
44
|
+
return binding;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
async listByUser(userId) {
|
|
49
|
+
const result = [];
|
|
50
|
+
for (const [, binding] of this.#table.entries()) {
|
|
51
|
+
if (binding.ownerUserId === userId && conversationOf(binding) !== undefined)
|
|
52
|
+
result.push(binding);
|
|
53
|
+
}
|
|
54
|
+
return this.sort(result);
|
|
55
|
+
}
|
|
56
|
+
async listByCharacter(userId, characterId) {
|
|
57
|
+
return (await this.listByUser(userId)).filter(binding => binding.characterId === characterId);
|
|
58
|
+
}
|
|
59
|
+
async listAll() {
|
|
60
|
+
const result = [];
|
|
61
|
+
for (const [, binding] of this.#table.entries()) {
|
|
62
|
+
if (conversationOf(binding) !== undefined)
|
|
63
|
+
result.push(binding);
|
|
64
|
+
}
|
|
65
|
+
return this.sort(result);
|
|
66
|
+
}
|
|
67
|
+
async remove(sessionId) {
|
|
68
|
+
await this.#table.delete(sessionId);
|
|
69
|
+
this.#index.delete(sessionId);
|
|
70
|
+
}
|
|
71
|
+
async removeByConversation(conversationId) {
|
|
72
|
+
for (const binding of await this.listAll()) {
|
|
73
|
+
if (conversationOf(binding) === conversationId)
|
|
74
|
+
await this.remove(binding.sessionId);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 兼容旧数据:把 activeConversationId 写成正式 conversationId。旧 M1 已把
|
|
79
|
+
* 多个角色会话归并为一行,因此仅能恢复其当时 active 的聊天;其它聊天文件
|
|
80
|
+
* 本来没有运行时 session,用户可在设置页重新打开。
|
|
81
|
+
*/
|
|
82
|
+
async migrateLegacyToConversation() {
|
|
83
|
+
let migrated = 0;
|
|
84
|
+
for (const binding of await this.listAll()) {
|
|
85
|
+
if (binding.conversationId !== undefined)
|
|
86
|
+
continue;
|
|
87
|
+
const conversationId = binding.activeConversationId;
|
|
88
|
+
if (conversationId === undefined)
|
|
89
|
+
continue;
|
|
90
|
+
await this.upsert({
|
|
91
|
+
sessionId: binding.sessionId,
|
|
92
|
+
conversationId,
|
|
93
|
+
characterId: binding.characterId,
|
|
94
|
+
ownerUserId: binding.ownerUserId,
|
|
95
|
+
});
|
|
96
|
+
migrated += 1;
|
|
97
|
+
}
|
|
98
|
+
return { migrated };
|
|
99
|
+
}
|
|
100
|
+
sort(bindings) {
|
|
101
|
+
bindings.sort((a, b) => (a.updatedAt > b.updatedAt ? -1 : a.updatedAt < b.updatedAt ? 1
|
|
102
|
+
: (a.id > b.id ? -1 : a.id < b.id ? 1 : 0)));
|
|
103
|
+
return bindings;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=session-binding-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-binding-service.js","sourceRoot":"","sources":["../../src/core/session-binding-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,SAAS,cAAc,CAAC,OAAuB;IAC7C,OAAO,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,oBAAoB,CAAA;AAC/D,CAAC;AAED,MAAM,OAAO,4BAA4B;IAC9B,MAAM,CAAiC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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9C,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { KvTable } from '@deepseek-ai/dsh-storage-domain';
|
|
2
|
+
import type { AuditService } from './audit-service.js';
|
|
3
|
+
import type { CompanionProfile, CompanionSkill, CompanionSkillStatus, CompanionWorkflowId } from '../domain/schemas.js';
|
|
4
|
+
export interface SkillInput {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
instructions: string;
|
|
8
|
+
workflowId?: CompanionWorkflowId;
|
|
9
|
+
outputFormat?: string;
|
|
10
|
+
boundaries?: string[];
|
|
11
|
+
status?: CompanionSkillStatus;
|
|
12
|
+
}
|
|
13
|
+
/** Companion Skill CRUD. Skills shape how a companion works; they never grant tools. */
|
|
14
|
+
export declare class SkillService {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(skills: KvTable<string, CompanionSkill>, profiles: KvTable<string, CompanionProfile>, audit: AuditService);
|
|
17
|
+
list(owner: string, profileId?: string): {
|
|
18
|
+
id: string;
|
|
19
|
+
ownerUserId: string;
|
|
20
|
+
companionProfileId: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
instructions: string;
|
|
24
|
+
status: "active" | "disabled";
|
|
25
|
+
version: number;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
workflowId?: "conversation" | "analysis" | "planning" | "research" | undefined;
|
|
29
|
+
outputFormat?: string | undefined;
|
|
30
|
+
boundaries?: string[] | undefined;
|
|
31
|
+
requiredToolIds?: string[] | undefined;
|
|
32
|
+
}[];
|
|
33
|
+
create(owner: string, profileId: string, input: SkillInput): Promise<{
|
|
34
|
+
id: string;
|
|
35
|
+
ownerUserId: string;
|
|
36
|
+
companionProfileId: string;
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
instructions: string;
|
|
40
|
+
status: "active" | "disabled";
|
|
41
|
+
version: number;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
workflowId?: "conversation" | "analysis" | "planning" | "research" | undefined;
|
|
45
|
+
outputFormat?: string | undefined;
|
|
46
|
+
boundaries?: string[] | undefined;
|
|
47
|
+
requiredToolIds?: string[] | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
update(owner: string, id: string, input: Partial<SkillInput>): Promise<{
|
|
50
|
+
id: string;
|
|
51
|
+
ownerUserId: string;
|
|
52
|
+
companionProfileId: string;
|
|
53
|
+
name: string;
|
|
54
|
+
description: string;
|
|
55
|
+
instructions: string;
|
|
56
|
+
status: "active" | "disabled";
|
|
57
|
+
version: number;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
workflowId?: "conversation" | "analysis" | "planning" | "research" | undefined;
|
|
61
|
+
outputFormat?: string | undefined;
|
|
62
|
+
boundaries?: string[] | undefined;
|
|
63
|
+
requiredToolIds?: string[] | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
setStatus(owner: string, id: string, status: CompanionSkillStatus): Promise<{
|
|
66
|
+
id: string;
|
|
67
|
+
ownerUserId: string;
|
|
68
|
+
companionProfileId: string;
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
instructions: string;
|
|
72
|
+
status: "active" | "disabled";
|
|
73
|
+
version: number;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
workflowId?: "conversation" | "analysis" | "planning" | "research" | undefined;
|
|
77
|
+
outputFormat?: string | undefined;
|
|
78
|
+
boundaries?: string[] | undefined;
|
|
79
|
+
requiredToolIds?: string[] | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=skill-service.d.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
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
/** Companion Skill CRUD. Skills shape how a companion works; they never grant tools. */
|
|
3
|
+
export class SkillService {
|
|
4
|
+
#skills;
|
|
5
|
+
#profiles;
|
|
6
|
+
#audit;
|
|
7
|
+
constructor(skills, profiles, audit) {
|
|
8
|
+
this.#skills = skills;
|
|
9
|
+
this.#profiles = profiles;
|
|
10
|
+
this.#audit = audit;
|
|
11
|
+
}
|
|
12
|
+
list(owner, profileId) {
|
|
13
|
+
return [...this.#skills.entries()].map(([, x]) => x).filter(x => x.ownerUserId === owner && (profileId === undefined || x.companionProfileId === profileId));
|
|
14
|
+
}
|
|
15
|
+
#owned(owner, id) {
|
|
16
|
+
const x = this.#skills.get(id);
|
|
17
|
+
if (!x || x.ownerUserId !== owner)
|
|
18
|
+
throw Error('[Tavern] Skill 不存在或无权访问');
|
|
19
|
+
return x;
|
|
20
|
+
}
|
|
21
|
+
async create(owner, profileId, input) {
|
|
22
|
+
const p = this.#profiles.get(profileId);
|
|
23
|
+
if (!p || p.ownerUserId !== owner)
|
|
24
|
+
throw Error('[Tavern] Companion 不存在或无权访问');
|
|
25
|
+
const now = new Date().toISOString();
|
|
26
|
+
const x = { id: randomUUID(), ownerUserId: owner, companionProfileId: profileId, ...input, status: 'active', version: 1, createdAt: now, updatedAt: now };
|
|
27
|
+
await this.#skills.put(x.id, x);
|
|
28
|
+
await this.#audit.log({ entityType: 'companion_profile', entityId: profileId, action: 'update', after: { skillId: x.id, version: 1 }, source: 'user', actorId: owner });
|
|
29
|
+
return x;
|
|
30
|
+
}
|
|
31
|
+
async update(owner, id, input) {
|
|
32
|
+
const old = this.#owned(owner, id);
|
|
33
|
+
const x = { ...old, ...input, version: old.version + 1, updatedAt: new Date().toISOString() };
|
|
34
|
+
await this.#skills.put(id, x);
|
|
35
|
+
await this.#audit.log({ entityType: 'companion_profile', entityId: old.companionProfileId, action: 'update', before: { skillId: id, version: old.version }, after: { skillId: id, version: x.version }, source: 'user', actorId: owner });
|
|
36
|
+
return x;
|
|
37
|
+
}
|
|
38
|
+
async setStatus(owner, id, status) {
|
|
39
|
+
const old = this.#owned(owner, id);
|
|
40
|
+
if (old.status === status)
|
|
41
|
+
return old;
|
|
42
|
+
return this.update(owner, id, { status });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=skill-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-service.js","sourceRoot":"","sources":["../../src/core/skill-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAexC,wFAAwF;AACxF,MAAM,OAAO,YAAY;IACd,OAAO,CAAiC;IACxC,SAAS,CAAmC;IAC5C,MAAM,CAAc;IAC7B,YAAY,MAAuC,EAAE,QAA2C,EAAE,KAAmB;QACnH,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,IAAI,CAAC,KAAa,EAAE,SAAkB;QACpC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,KAAK,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAA;IAC9J,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,EAAU;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC9B,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,KAAK;YAAE,MAAM,KAAK,CAAC,yBAAyB,CAA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,CAAC,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAA;QAC7G,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,CAAC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;QACzO,OAAO,CAAC,CAAA;IACV,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAAa,EAAE,EAAU,EAAE,MAA4B;QACrE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAClC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,GAAG,CAAA;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tavern-session-bridge.d.ts","sourceRoot":"","sources":["../../src/core/tavern-session-bridge.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,wDAAwD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tavern-session-bridge.js","sourceRoot":"","sources":["../../src/core/tavern-session-bridge.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,wDAAwD,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UserResolver —— 稳定用户身份解析(阶段 1,ADR-004)。
|
|
3
|
+
*
|
|
4
|
+
* 本地单用户版:User.id = getOrCreateAnonymousUserId()($DSH_HOME 持久化 UUID,
|
|
5
|
+
* 探针已确认可用)。领域模型按 ownerUserId 归属所有长期资源;
|
|
6
|
+
* DSH session 只作连接上下文,不充当资源所有者。
|
|
7
|
+
* 多用户支持预留:未来替换 UserResolver 实现即可,领域模型不变。
|
|
8
|
+
*/
|
|
9
|
+
import type { UserResolverPort } from '../application/ports/user-resolver-port.js';
|
|
10
|
+
export type UserResolver = UserResolverPort;
|
|
11
|
+
/** 本地单用户解析器:返回 harness-home 的匿名用户 UUID。 */
|
|
12
|
+
export declare class LocalUserResolver implements UserResolver {
|
|
13
|
+
getCurrentUserId(): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=user-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-resolver.d.ts","sourceRoot":"","sources":["../../src/core/user-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAA;AAI3C,2CAA2C;AAC3C,qBAAa,iBAAkB,YAAW,YAAY;IAC9C,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;CAG1C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UserResolver —— 稳定用户身份解析(阶段 1,ADR-004)。
|
|
3
|
+
*
|
|
4
|
+
* 本地单用户版:User.id = getOrCreateAnonymousUserId()($DSH_HOME 持久化 UUID,
|
|
5
|
+
* 探针已确认可用)。领域模型按 ownerUserId 归属所有长期资源;
|
|
6
|
+
* DSH session 只作连接上下文,不充当资源所有者。
|
|
7
|
+
* 多用户支持预留:未来替换 UserResolver 实现即可,领域模型不变。
|
|
8
|
+
*/
|
|
9
|
+
import { getOrCreateAnonymousUserId } from '@deepseek-ai/dsh-anonymous-user-id';
|
|
10
|
+
/* legacy name retained for callers */
|
|
11
|
+
/** 本地单用户解析器:返回 harness-home 的匿名用户 UUID。 */
|
|
12
|
+
export class LocalUserResolver {
|
|
13
|
+
async getCurrentUserId() {
|
|
14
|
+
return String(getOrCreateAnonymousUserId());
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=user-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-resolver.js","sourceRoot":"","sources":["../../src/core/user-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAM/E,sCAAsC;AAEtC,2CAA2C;AAC3C,MAAM,OAAO,iBAAiB;IAC5B,KAAK,CAAC,gBAAgB;QACpB,OAAO,MAAM,CAAC,0BAA0B,EAAE,CAAC,CAAA;IAC7C,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../../src/core/workspace-service.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,+CAA+C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-service.js","sourceRoot":"","sources":["../../src/core/workspace-service.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,+CAA+C,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KvTable } from '@deepseek-ai/dsh-storage-domain';
|
|
2
|
+
import type { WorkspaceSessionBinding } from '../domain/schemas.js';
|
|
3
|
+
export declare class WorkspaceSessionService {
|
|
4
|
+
private readonly table;
|
|
5
|
+
constructor(table: KvTable<string, WorkspaceSessionBinding>);
|
|
6
|
+
get(ownerUserId: string, workspaceId: string, threadId: string): WorkspaceSessionBinding | null;
|
|
7
|
+
getBySession(sessionId: string): WorkspaceSessionBinding | null;
|
|
8
|
+
list(ownerUserId: string, workspaceId: string): WorkspaceSessionBinding[];
|
|
9
|
+
create(input: Omit<WorkspaceSessionBinding, 'id' | 'createdAt' | 'updatedAt' | 'status'>): Promise<WorkspaceSessionBinding>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=workspace-session-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-session-service.d.ts","sourceRoot":"","sources":["../../src/core/workspace-session-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAC5E,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI;IAG/F,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI;IAC/D,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,uBAAuB,EAAE;IACnE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,uBAAuB,EAAE,IAAI,GAAC,WAAW,GAAC,WAAW,GAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAC5H"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
export class WorkspaceSessionService {
|
|
3
|
+
table;
|
|
4
|
+
constructor(table) {
|
|
5
|
+
this.table = table;
|
|
6
|
+
}
|
|
7
|
+
get(ownerUserId, workspaceId, threadId) {
|
|
8
|
+
return [...this.table.entries()].map(([, value]) => value).find(value => value.ownerUserId === ownerUserId && value.workspaceId === workspaceId && value.threadId === threadId && value.status === 'active') ?? null;
|
|
9
|
+
}
|
|
10
|
+
getBySession(sessionId) { return [...this.table.entries()].map(([, value]) => value).find(value => value.sessionId === sessionId && value.status === 'active') ?? null; }
|
|
11
|
+
list(ownerUserId, workspaceId) { return [...this.table.entries()].map(([, value]) => value).filter(value => value.ownerUserId === ownerUserId && value.workspaceId === workspaceId && value.status === 'active').sort((a, b) => b.updatedAt.localeCompare(a.updatedAt)); }
|
|
12
|
+
async create(input) { const now = new Date().toISOString(); const value = { ...input, id: randomUUID(), status: 'active', createdAt: now, updatedAt: now }; await this.table.put(value.id, value); return value; }
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=workspace-session-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-session-service.js","sourceRoot":"","sources":["../../src/core/workspace-session-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,MAAM,OAAO,uBAAuB;IACL;IAA7B,YAA6B,KAA+C;QAA/C,UAAK,GAAL,KAAK,CAA0C;IAAG,CAAC;IAChF,GAAG,CAAC,WAAmB,EAAE,WAAmB,EAAE,QAAgB;QAC5D,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,IAAI,KAAK,CAAC,WAAW,KAAK,WAAW,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,IAAI,IAAI,CAAA;IACtN,CAAC;IACD,YAAY,CAAC,SAAiB,IAAoC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OA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