@zhin.js/agent 0.3.1 → 1.0.2
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/README.md +123 -50
- package/lib/a2a/delegation-message.d.ts +14 -0
- package/lib/a2a/delegation-message.d.ts.map +1 -0
- package/lib/a2a/delegation-message.js +53 -0
- package/lib/a2a/delegation-message.js.map +1 -0
- package/lib/a2a/task-state.d.ts +9 -0
- package/lib/a2a/task-state.d.ts.map +1 -0
- package/lib/a2a/task-state.js +53 -0
- package/lib/a2a/task-state.js.map +1 -0
- package/lib/activity-feedback/adapter-integration.d.ts +51 -0
- package/lib/activity-feedback/adapter-integration.d.ts.map +1 -0
- package/lib/activity-feedback/adapter-integration.js +130 -0
- package/lib/activity-feedback/adapter-integration.js.map +1 -0
- package/lib/activity-feedback/config-resolver.d.ts +3 -0
- package/lib/activity-feedback/config-resolver.d.ts.map +1 -0
- package/lib/activity-feedback/config-resolver.js +89 -0
- package/lib/activity-feedback/config-resolver.js.map +1 -0
- package/lib/activity-feedback/event-context.d.ts +22 -0
- package/lib/activity-feedback/event-context.d.ts.map +1 -0
- package/lib/activity-feedback/event-context.js +65 -0
- package/lib/activity-feedback/event-context.js.map +1 -0
- package/lib/activity-feedback/index.d.ts +10 -0
- package/lib/activity-feedback/index.d.ts.map +1 -0
- package/lib/activity-feedback/index.js +7 -0
- package/lib/activity-feedback/index.js.map +1 -0
- package/lib/activity-feedback/manager.d.ts +15 -0
- package/lib/activity-feedback/manager.d.ts.map +1 -0
- package/lib/activity-feedback/manager.js +47 -0
- package/lib/activity-feedback/manager.js.map +1 -0
- package/lib/activity-feedback/schedule-guard.d.ts +8 -0
- package/lib/activity-feedback/schedule-guard.d.ts.map +1 -0
- package/lib/activity-feedback/schedule-guard.js +26 -0
- package/lib/activity-feedback/schedule-guard.js.map +1 -0
- package/lib/activity-feedback/types.d.ts +24 -0
- package/lib/activity-feedback/types.d.ts.map +1 -0
- package/lib/activity-feedback/types.js +11 -0
- package/lib/activity-feedback/types.js.map +1 -0
- package/lib/agent-prompt/registry.d.ts +1 -1
- package/lib/agent-prompt/registry.d.ts.map +1 -1
- package/lib/agent-prompt/registry.js.map +1 -1
- package/lib/agent-prompt/resolver.d.ts +2 -2
- package/lib/agent-prompt/resolver.d.ts.map +1 -1
- package/lib/agent-prompt/resolver.js +4 -2
- package/lib/agent-prompt/resolver.js.map +1 -1
- package/lib/ai-event-bus.d.ts +1 -1
- package/lib/ai-event-bus.d.ts.map +1 -1
- package/lib/ai-event-bus.js +2 -3
- package/lib/ai-event-bus.js.map +1 -1
- package/lib/ai-event-subscriber.d.ts +7 -2
- package/lib/ai-event-subscriber.d.ts.map +1 -1
- package/lib/ai-event-subscriber.js +5 -0
- package/lib/ai-event-subscriber.js.map +1 -1
- package/lib/aop/coordination/index.d.ts +7 -0
- package/lib/aop/coordination/index.d.ts.map +1 -0
- package/lib/aop/coordination/index.js +7 -0
- package/lib/aop/coordination/index.js.map +1 -0
- package/lib/aop/inbound/index.d.ts +7 -0
- package/lib/aop/inbound/index.d.ts.map +1 -0
- package/lib/aop/inbound/index.js +6 -0
- package/lib/aop/inbound/index.js.map +1 -0
- package/lib/aop/index.d.ts +11 -0
- package/lib/aop/index.d.ts.map +1 -0
- package/lib/aop/index.js +11 -0
- package/lib/aop/index.js.map +1 -0
- package/lib/aop/pipeline/index.d.ts +12 -0
- package/lib/aop/pipeline/index.d.ts.map +1 -0
- package/lib/aop/pipeline/index.js +12 -0
- package/lib/aop/pipeline/index.js.map +1 -0
- package/lib/aop/pipeline/pipeline-flow.d.ts +25 -0
- package/lib/aop/pipeline/pipeline-flow.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-flow.js +115 -0
- package/lib/aop/pipeline/pipeline-flow.js.map +1 -0
- package/lib/aop/pipeline/pipeline-mode.d.ts +10 -0
- package/lib/aop/pipeline/pipeline-mode.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-mode.js +16 -0
- package/lib/aop/pipeline/pipeline-mode.js.map +1 -0
- package/lib/aop/pipeline/pipeline-service.d.ts +121 -0
- package/lib/aop/pipeline/pipeline-service.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-service.js +226 -0
- package/lib/aop/pipeline/pipeline-service.js.map +1 -0
- package/lib/aop/pipeline/pipeline-transitions.d.ts +14 -0
- package/lib/aop/pipeline/pipeline-transitions.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-transitions.js +31 -0
- package/lib/aop/pipeline/pipeline-transitions.js.map +1 -0
- package/lib/aop/pipeline/ports.d.ts +16 -0
- package/lib/aop/pipeline/ports.d.ts.map +1 -0
- package/lib/aop/pipeline/ports.js +2 -0
- package/lib/aop/pipeline/ports.js.map +1 -0
- package/lib/aop/pipeline/role-capability-policy.d.ts +16 -0
- package/lib/aop/pipeline/role-capability-policy.d.ts.map +1 -0
- package/lib/aop/pipeline/role-capability-policy.js +29 -0
- package/lib/aop/pipeline/role-capability-policy.js.map +1 -0
- package/lib/aop/runtime/index.d.ts +9 -0
- package/lib/aop/runtime/index.d.ts.map +1 -0
- package/lib/aop/runtime/index.js +9 -0
- package/lib/aop/runtime/index.js.map +1 -0
- package/lib/assistant/domains/home-assistant.d.ts +1 -1
- package/lib/assistant/domains/home-assistant.d.ts.map +1 -1
- package/lib/assistant/domains/home-assistant.js.map +1 -1
- package/lib/assistant/event-ingress.d.ts +5 -5
- package/lib/assistant/event-ingress.d.ts.map +1 -1
- package/lib/assistant/event-ingress.js.map +1 -1
- package/lib/assistant/home-mcp-bridge.d.ts +1 -1
- package/lib/assistant/home-mcp-bridge.d.ts.map +1 -1
- package/lib/assistant/home-mcp-bridge.js.map +1 -1
- package/lib/assistant/home-policy.d.ts +4 -1
- package/lib/assistant/home-policy.d.ts.map +1 -1
- package/lib/assistant/home-policy.js +1 -1
- package/lib/assistant/home-policy.js.map +1 -1
- package/lib/assistant/home-tools.d.ts.map +1 -1
- package/lib/assistant/home-tools.js +1 -2
- package/lib/assistant/home-tools.js.map +1 -1
- package/lib/assistant/index.d.ts +18 -9
- package/lib/assistant/index.d.ts.map +1 -1
- package/lib/assistant/index.js +13 -6
- package/lib/assistant/index.js.map +1 -1
- package/lib/assistant/job-creator.d.ts +14 -0
- package/lib/assistant/job-creator.d.ts.map +1 -0
- package/lib/assistant/job-creator.js +44 -0
- package/lib/assistant/job-creator.js.map +1 -0
- package/lib/assistant/job-engine.d.ts +17 -17
- package/lib/assistant/job-engine.d.ts.map +1 -1
- package/lib/assistant/job-engine.js +29 -35
- package/lib/assistant/job-engine.js.map +1 -1
- package/lib/assistant/job-scheduler.d.ts +8 -4
- package/lib/assistant/job-scheduler.d.ts.map +1 -1
- package/lib/assistant/job-scheduler.js +59 -33
- package/lib/assistant/job-scheduler.js.map +1 -1
- package/lib/assistant/job-store.d.ts +24 -33
- package/lib/assistant/job-store.d.ts.map +1 -1
- package/lib/assistant/job-store.js +69 -184
- package/lib/assistant/job-store.js.map +1 -1
- package/lib/assistant/job-utils.d.ts +2 -0
- package/lib/assistant/job-utils.d.ts.map +1 -0
- package/lib/assistant/job-utils.js +7 -0
- package/lib/assistant/job-utils.js.map +1 -0
- package/lib/assistant/job-worker.d.ts +6 -2
- package/lib/assistant/job-worker.d.ts.map +1 -1
- package/lib/assistant/job-worker.js +8 -0
- package/lib/assistant/job-worker.js.map +1 -1
- package/lib/assistant/notification-router.d.ts +6 -3
- package/lib/assistant/notification-router.d.ts.map +1 -1
- package/lib/assistant/notification-router.js +75 -32
- package/lib/assistant/notification-router.js.map +1 -1
- package/lib/assistant/profile-loader.d.ts +15 -10
- package/lib/assistant/profile-loader.d.ts.map +1 -1
- package/lib/assistant/profile-loader.js +88 -25
- package/lib/assistant/profile-loader.js.map +1 -1
- package/lib/assistant/profile-types.d.ts +6 -1
- package/lib/assistant/profile-types.d.ts.map +1 -1
- package/lib/assistant/profile-types.js.map +1 -1
- package/lib/assistant/runtime-registry.d.ts +3 -3
- package/lib/assistant/runtime-registry.d.ts.map +1 -1
- package/lib/assistant/runtime-registry.js +3 -0
- package/lib/assistant/runtime-registry.js.map +1 -1
- package/lib/assistant/schedule-execution.d.ts +22 -0
- package/lib/assistant/schedule-execution.d.ts.map +1 -0
- package/lib/assistant/schedule-execution.js +99 -0
- package/lib/assistant/schedule-execution.js.map +1 -0
- package/lib/assistant/schedule-job-service.d.ts +25 -0
- package/lib/assistant/schedule-job-service.d.ts.map +1 -0
- package/lib/assistant/schedule-job-service.js +129 -0
- package/lib/assistant/schedule-job-service.js.map +1 -0
- package/lib/assistant/schedule-message.d.ts +9 -0
- package/lib/assistant/schedule-message.d.ts.map +1 -0
- package/lib/assistant/schedule-message.js +23 -0
- package/lib/assistant/schedule-message.js.map +1 -0
- package/lib/assistant/schedule-skills.d.ts +3 -0
- package/lib/assistant/schedule-skills.d.ts.map +1 -0
- package/lib/assistant/schedule-skills.js +24 -0
- package/lib/assistant/schedule-skills.js.map +1 -0
- package/lib/assistant/schedule-tool-runtime.d.ts +7 -0
- package/lib/assistant/schedule-tool-runtime.d.ts.map +1 -0
- package/lib/assistant/schedule-tool-runtime.js +50 -0
- package/lib/assistant/schedule-tool-runtime.js.map +1 -0
- package/lib/assistant/types.d.ts +70 -18
- package/lib/assistant/types.d.ts.map +1 -1
- package/lib/assistant/types.js +6 -5
- package/lib/assistant/types.js.map +1 -1
- package/lib/builtin/analyze-media-tool.d.ts +1 -1
- package/lib/builtin/analyze-media-tool.d.ts.map +1 -1
- package/lib/builtin/analyze-media-tool.js +2 -2
- package/lib/builtin/analyze-media-tool.js.map +1 -1
- package/lib/builtin/ask-user-session-service.d.ts +40 -0
- package/lib/builtin/ask-user-session-service.d.ts.map +1 -0
- package/lib/builtin/ask-user-session-service.js +258 -0
- package/lib/builtin/ask-user-session-service.js.map +1 -0
- package/lib/builtin/ask-user-session.d.ts +18 -0
- package/lib/builtin/ask-user-session.d.ts.map +1 -0
- package/lib/builtin/ask-user-session.js +21 -0
- package/lib/builtin/ask-user-session.js.map +1 -0
- package/lib/builtin/ask-user-tool.d.ts +7 -15
- package/lib/builtin/ask-user-tool.d.ts.map +1 -1
- package/lib/builtin/ask-user-tool.js +73 -113
- package/lib/builtin/ask-user-tool.js.map +1 -1
- package/lib/builtin/bash-tool.d.ts +1 -1
- package/lib/builtin/bash-tool.d.ts.map +1 -1
- package/lib/builtin/bash-tool.js +4 -4
- package/lib/builtin/bash-tool.js.map +1 -1
- package/lib/builtin/deferred-tool-meta.d.ts +46 -0
- package/lib/builtin/deferred-tool-meta.d.ts.map +1 -0
- package/lib/builtin/deferred-tool-meta.js +130 -0
- package/lib/builtin/deferred-tool-meta.js.map +1 -0
- package/lib/builtin/edit-file-tool.d.ts +1 -1
- package/lib/builtin/edit-file-tool.d.ts.map +1 -1
- package/lib/builtin/edit-file-tool.js +4 -4
- package/lib/builtin/edit-file-tool.js.map +1 -1
- package/lib/builtin/five-agent/index.d.ts +20 -0
- package/lib/builtin/five-agent/index.d.ts.map +1 -0
- package/lib/builtin/five-agent/index.js +23 -0
- package/lib/builtin/five-agent/index.js.map +1 -0
- package/lib/builtin/five-agent/prompts.d.ts +11 -0
- package/lib/builtin/five-agent/prompts.d.ts.map +1 -0
- package/lib/builtin/five-agent/prompts.js +35 -0
- package/lib/builtin/five-agent/prompts.js.map +1 -0
- package/lib/builtin/five-agent/strategy.d.ts +4 -0
- package/lib/builtin/five-agent/strategy.d.ts.map +1 -0
- package/lib/builtin/five-agent/strategy.js +42 -0
- package/lib/builtin/five-agent/strategy.js.map +1 -0
- package/lib/builtin/generate-image-tool.d.ts +1 -1
- package/lib/builtin/generate-image-tool.d.ts.map +1 -1
- package/lib/builtin/generate-image-tool.js +9 -9
- package/lib/builtin/generate-image-tool.js.map +1 -1
- package/lib/builtin/glob-tool.d.ts +1 -1
- package/lib/builtin/glob-tool.d.ts.map +1 -1
- package/lib/builtin/glob-tool.js +3 -3
- package/lib/builtin/glob-tool.js.map +1 -1
- package/lib/builtin/grep-tool.d.ts +1 -1
- package/lib/builtin/grep-tool.d.ts.map +1 -1
- package/lib/builtin/grep-tool.js +10 -10
- package/lib/builtin/grep-tool.js.map +1 -1
- package/lib/builtin/install-skill-tool.d.ts +1 -1
- package/lib/builtin/install-skill-tool.d.ts.map +1 -1
- package/lib/builtin/install-skill-tool.js +3 -3
- package/lib/builtin/install-skill-tool.js.map +1 -1
- package/lib/builtin/knowledge-search-tool.js +3 -3
- package/lib/builtin/knowledge-search-tool.js.map +1 -1
- package/lib/builtin/list-dir-tool.d.ts +1 -1
- package/lib/builtin/list-dir-tool.d.ts.map +1 -1
- package/lib/builtin/list-dir-tool.js +2 -2
- package/lib/builtin/list-dir-tool.js.map +1 -1
- package/lib/builtin/load-skill-tool.d.ts +20 -0
- package/lib/builtin/load-skill-tool.d.ts.map +1 -0
- package/lib/builtin/load-skill-tool.js +60 -0
- package/lib/builtin/load-skill-tool.js.map +1 -0
- package/lib/builtin/memory-search-tool.d.ts.map +1 -1
- package/lib/builtin/memory-search-tool.js +8 -5
- package/lib/builtin/memory-search-tool.js.map +1 -1
- package/lib/builtin/memory-upsert-tool.d.ts.map +1 -1
- package/lib/builtin/memory-upsert-tool.js +11 -8
- package/lib/builtin/memory-upsert-tool.js.map +1 -1
- package/lib/builtin/orchestration-tools.d.ts +3 -4
- package/lib/builtin/orchestration-tools.d.ts.map +1 -1
- package/lib/builtin/orchestration-tools.js +101 -93
- package/lib/builtin/orchestration-tools.js.map +1 -1
- package/lib/builtin/read-file-tool.d.ts +1 -1
- package/lib/builtin/read-file-tool.d.ts.map +1 -1
- package/lib/builtin/read-file-tool.js +4 -4
- package/lib/builtin/read-file-tool.js.map +1 -1
- package/lib/builtin/run-deferred-task-tool.d.ts +1 -1
- package/lib/builtin/run-deferred-task-tool.d.ts.map +1 -1
- package/lib/builtin/run-deferred-task-tool.js +3 -3
- package/lib/builtin/run-deferred-task-tool.js.map +1 -1
- package/lib/builtin/spawn-task-tool.d.ts +13 -6
- package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
- package/lib/builtin/spawn-task-tool.js +135 -30
- package/lib/builtin/spawn-task-tool.js.map +1 -1
- package/lib/builtin/todo-read-tool.d.ts +1 -1
- package/lib/builtin/todo-read-tool.d.ts.map +1 -1
- package/lib/builtin/todo-read-tool.js +2 -2
- package/lib/builtin/todo-read-tool.js.map +1 -1
- package/lib/builtin/todo-write-tool.d.ts +1 -1
- package/lib/builtin/todo-write-tool.d.ts.map +1 -1
- package/lib/builtin/todo-write-tool.js +3 -3
- package/lib/builtin/todo-write-tool.js.map +1 -1
- package/lib/builtin/web-fetch-tool.d.ts +2 -2
- package/lib/builtin/web-fetch-tool.d.ts.map +1 -1
- package/lib/builtin/web-fetch-tool.js +6 -3
- package/lib/builtin/web-fetch-tool.js.map +1 -1
- package/lib/builtin/web-search-tool.d.ts +1 -1
- package/lib/builtin/web-search-tool.d.ts.map +1 -1
- package/lib/builtin/web-search-tool.js +5 -5
- package/lib/builtin/web-search-tool.js.map +1 -1
- package/lib/builtin/write-file-tool.d.ts +1 -1
- package/lib/builtin/write-file-tool.d.ts.map +1 -1
- package/lib/builtin/write-file-tool.js +3 -3
- package/lib/builtin/write-file-tool.js.map +1 -1
- package/lib/builtin-tools.d.ts +1 -1
- package/lib/builtin-tools.js +3 -3
- package/lib/builtin-tools.js.map +1 -1
- package/lib/collaboration/ask-user-bridge.d.ts +9 -0
- package/lib/collaboration/ask-user-bridge.d.ts.map +1 -0
- package/lib/collaboration/ask-user-bridge.js +59 -0
- package/lib/collaboration/ask-user-bridge.js.map +1 -0
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts +22 -0
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts.map +1 -0
- package/lib/collaboration/bootstrap-agent-runtimes.js +106 -0
- package/lib/collaboration/bootstrap-agent-runtimes.js.map +1 -0
- package/lib/collaboration/collab-admin-gate.d.ts +21 -0
- package/lib/collaboration/collab-admin-gate.d.ts.map +1 -0
- package/lib/collaboration/collab-admin-gate.js +74 -0
- package/lib/collaboration/collab-admin-gate.js.map +1 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts +46 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts.map +1 -0
- package/lib/collaboration/collaboration-artifact-repository.js +102 -0
- package/lib/collaboration/collaboration-artifact-repository.js.map +1 -0
- package/lib/collaboration/collaboration-commands.d.ts +38 -0
- package/lib/collaboration/collaboration-commands.d.ts.map +1 -0
- package/lib/collaboration/collaboration-commands.js +504 -0
- package/lib/collaboration/collaboration-commands.js.map +1 -0
- package/lib/collaboration/collaboration-config.d.ts +30 -0
- package/lib/collaboration/collaboration-config.d.ts.map +1 -0
- package/lib/collaboration/collaboration-config.js +170 -0
- package/lib/collaboration/collaboration-config.js.map +1 -0
- package/lib/collaboration/collaboration-context.d.ts +12 -0
- package/lib/collaboration/collaboration-context.d.ts.map +1 -0
- package/lib/collaboration/collaboration-context.js +89 -0
- package/lib/collaboration/collaboration-context.js.map +1 -0
- package/lib/collaboration/collaboration-db-model.d.ts +350 -0
- package/lib/collaboration/collaboration-db-model.d.ts.map +1 -0
- package/lib/collaboration/collaboration-db-model.js +112 -0
- package/lib/collaboration/collaboration-db-model.js.map +1 -0
- package/lib/collaboration/collaboration-delegation.d.ts +21 -0
- package/lib/collaboration/collaboration-delegation.d.ts.map +1 -0
- package/lib/collaboration/collaboration-delegation.js +194 -0
- package/lib/collaboration/collaboration-delegation.js.map +1 -0
- package/lib/collaboration/collaboration-dispatch.d.ts +32 -0
- package/lib/collaboration/collaboration-dispatch.d.ts.map +1 -0
- package/lib/collaboration/collaboration-dispatch.js +93 -0
- package/lib/collaboration/collaboration-dispatch.js.map +1 -0
- package/lib/collaboration/collaboration-kernel-bridge.d.ts +23 -0
- package/lib/collaboration/collaboration-kernel-bridge.d.ts.map +1 -0
- package/lib/collaboration/collaboration-kernel-bridge.js +106 -0
- package/lib/collaboration/collaboration-kernel-bridge.js.map +1 -0
- package/lib/collaboration/collaboration-outbound.d.ts +64 -0
- package/lib/collaboration/collaboration-outbound.d.ts.map +1 -0
- package/lib/collaboration/collaboration-outbound.js +315 -0
- package/lib/collaboration/collaboration-outbound.js.map +1 -0
- package/lib/collaboration/collaboration-scene-repository.d.ts +152 -0
- package/lib/collaboration/collaboration-scene-repository.d.ts.map +1 -0
- package/lib/collaboration/collaboration-scene-repository.js +440 -0
- package/lib/collaboration/collaboration-scene-repository.js.map +1 -0
- package/lib/collaboration/collaboration-turn-snapshot.d.ts +18 -0
- package/lib/collaboration/collaboration-turn-snapshot.d.ts.map +1 -0
- package/lib/collaboration/collaboration-turn-snapshot.js +35 -0
- package/lib/collaboration/collaboration-turn-snapshot.js.map +1 -0
- package/lib/collaboration/delegation-state.d.ts +30 -0
- package/lib/collaboration/delegation-state.d.ts.map +1 -0
- package/lib/collaboration/delegation-state.js +86 -0
- package/lib/collaboration/delegation-state.js.map +1 -0
- package/lib/collaboration/endpoint-identity.d.ts +28 -0
- package/lib/collaboration/endpoint-identity.d.ts.map +1 -0
- package/lib/collaboration/endpoint-identity.js +88 -0
- package/lib/collaboration/endpoint-identity.js.map +1 -0
- package/lib/collaboration/group-feed.d.ts +30 -0
- package/lib/collaboration/group-feed.d.ts.map +1 -0
- package/lib/collaboration/group-feed.js +150 -0
- package/lib/collaboration/group-feed.js.map +1 -0
- package/lib/collaboration/group-message.d.ts +53 -0
- package/lib/collaboration/group-message.d.ts.map +1 -0
- package/lib/collaboration/group-message.js +162 -0
- package/lib/collaboration/group-message.js.map +1 -0
- package/lib/collaboration/im-mention-delegate.d.ts +22 -0
- package/lib/collaboration/im-mention-delegate.d.ts.map +1 -0
- package/lib/collaboration/im-mention-delegate.js +15 -0
- package/lib/collaboration/im-mention-delegate.js.map +1 -0
- package/lib/collaboration/inbound-peer-handback.d.ts +18 -0
- package/lib/collaboration/inbound-peer-handback.d.ts.map +1 -0
- package/lib/collaboration/inbound-peer-handback.js +69 -0
- package/lib/collaboration/inbound-peer-handback.js.map +1 -0
- package/lib/collaboration/inbound-spawn-task.d.ts +29 -0
- package/lib/collaboration/inbound-spawn-task.d.ts.map +1 -0
- package/lib/collaboration/inbound-spawn-task.js +97 -0
- package/lib/collaboration/inbound-spawn-task.js.map +1 -0
- package/lib/collaboration/inbound-turn-endpoint.d.ts +16 -0
- package/lib/collaboration/inbound-turn-endpoint.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-endpoint.js +26 -0
- package/lib/collaboration/inbound-turn-endpoint.js.map +1 -0
- package/lib/collaboration/inbound-turn-enrich.d.ts +25 -0
- package/lib/collaboration/inbound-turn-enrich.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-enrich.js +51 -0
- package/lib/collaboration/inbound-turn-enrich.js.map +1 -0
- package/lib/collaboration/inbound-turn-execute.d.ts +33 -0
- package/lib/collaboration/inbound-turn-execute.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-execute.js +73 -0
- package/lib/collaboration/inbound-turn-execute.js.map +1 -0
- package/lib/collaboration/inbound-turn-outbound-stage.d.ts +25 -0
- package/lib/collaboration/inbound-turn-outbound-stage.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-outbound-stage.js +73 -0
- package/lib/collaboration/inbound-turn-outbound-stage.js.map +1 -0
- package/lib/collaboration/inbound-turn-pipeline.d.ts +28 -0
- package/lib/collaboration/inbound-turn-pipeline.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-pipeline.js +193 -0
- package/lib/collaboration/inbound-turn-pipeline.js.map +1 -0
- package/lib/collaboration/inbound-turn-route.d.ts +42 -0
- package/lib/collaboration/inbound-turn-route.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-route.js +90 -0
- package/lib/collaboration/inbound-turn-route.js.map +1 -0
- package/lib/collaboration/inbound-turn-tools.d.ts +13 -0
- package/lib/collaboration/inbound-turn-tools.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-tools.js +19 -0
- package/lib/collaboration/inbound-turn-tools.js.map +1 -0
- package/lib/collaboration/index.d.ts +26 -0
- package/lib/collaboration/index.d.ts.map +1 -0
- package/lib/collaboration/index.js +24 -0
- package/lib/collaboration/index.js.map +1 -0
- package/lib/collaboration/init-observe-hook.d.ts +59 -0
- package/lib/collaboration/init-observe-hook.d.ts.map +1 -0
- package/lib/collaboration/init-observe-hook.js +190 -0
- package/lib/collaboration/init-observe-hook.js.map +1 -0
- package/lib/collaboration/init-wizard-service.d.ts +57 -0
- package/lib/collaboration/init-wizard-service.d.ts.map +1 -0
- package/lib/collaboration/init-wizard-service.js +188 -0
- package/lib/collaboration/init-wizard-service.js.map +1 -0
- package/lib/collaboration/outbound-resolver.d.ts +35 -0
- package/lib/collaboration/outbound-resolver.d.ts.map +1 -0
- package/lib/collaboration/outbound-resolver.js +188 -0
- package/lib/collaboration/outbound-resolver.js.map +1 -0
- package/lib/collaboration/peer-policy.d.ts +29 -0
- package/lib/collaboration/peer-policy.d.ts.map +1 -0
- package/lib/collaboration/peer-policy.js +118 -0
- package/lib/collaboration/peer-policy.js.map +1 -0
- package/lib/collaboration/resolve-agent-session-key.d.ts +21 -0
- package/lib/collaboration/resolve-agent-session-key.d.ts.map +1 -0
- package/lib/collaboration/resolve-agent-session-key.js +61 -0
- package/lib/collaboration/resolve-agent-session-key.js.map +1 -0
- package/lib/collaboration/runtime-registry.d.ts +18 -0
- package/lib/collaboration/runtime-registry.d.ts.map +1 -0
- package/lib/collaboration/runtime-registry.js +40 -0
- package/lib/collaboration/runtime-registry.js.map +1 -0
- package/lib/collaboration/scene-context.d.ts +17 -0
- package/lib/collaboration/scene-context.d.ts.map +1 -0
- package/lib/collaboration/scene-context.js +22 -0
- package/lib/collaboration/scene-context.js.map +1 -0
- package/lib/collaboration/scene-identity-service.d.ts +167 -0
- package/lib/collaboration/scene-identity-service.d.ts.map +1 -0
- package/lib/collaboration/scene-identity-service.js +468 -0
- package/lib/collaboration/scene-identity-service.js.map +1 -0
- package/lib/collaboration/scene-service.d.ts +65 -0
- package/lib/collaboration/scene-service.d.ts.map +1 -0
- package/lib/collaboration/scene-service.js +152 -0
- package/lib/collaboration/scene-service.js.map +1 -0
- package/lib/collaboration/structured-ai-outbound.d.ts +23 -0
- package/lib/collaboration/structured-ai-outbound.d.ts.map +1 -0
- package/lib/collaboration/structured-ai-outbound.js +179 -0
- package/lib/collaboration/structured-ai-outbound.js.map +1 -0
- package/lib/collaboration/turn-plan-resolver.d.ts +17 -0
- package/lib/collaboration/turn-plan-resolver.d.ts.map +1 -0
- package/lib/collaboration/turn-plan-resolver.js +63 -0
- package/lib/collaboration/turn-plan-resolver.js.map +1 -0
- package/lib/collaboration/types.d.ts +147 -0
- package/lib/collaboration/types.d.ts.map +1 -0
- package/lib/collaboration/types.js +16 -0
- package/lib/collaboration/types.js.map +1 -0
- package/lib/collaboration/wire-collaboration-storage.d.ts +4 -0
- package/lib/collaboration/wire-collaboration-storage.d.ts.map +1 -0
- package/lib/collaboration/wire-collaboration-storage.js +28 -0
- package/lib/collaboration/wire-collaboration-storage.js.map +1 -0
- package/lib/common-adapter-tools.d.ts +6 -7
- package/lib/common-adapter-tools.d.ts.map +1 -1
- package/lib/common-adapter-tools.js +9 -9
- package/lib/common-adapter-tools.js.map +1 -1
- package/lib/config/agent-binding-registry.d.ts +1 -1
- package/lib/config/agent-binding-registry.d.ts.map +1 -1
- package/lib/config/agent-binding-registry.js.map +1 -1
- package/lib/config/agent-bindings.d.ts +1 -1
- package/lib/config/agent-bindings.d.ts.map +1 -1
- package/lib/config/agent-bindings.js +2 -0
- package/lib/config/agent-bindings.js.map +1 -1
- package/lib/config/agent-interfaces.d.ts +58 -0
- package/lib/config/agent-interfaces.d.ts.map +1 -0
- package/lib/config/agent-interfaces.js +8 -0
- package/lib/config/agent-interfaces.js.map +1 -0
- package/lib/config/fix-ai-config.d.ts +1 -0
- package/lib/config/fix-ai-config.d.ts.map +1 -1
- package/lib/config/fix-ai-config.js +152 -15
- package/lib/config/fix-ai-config.js.map +1 -1
- package/lib/config/index.d.ts +13 -0
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +8 -0
- package/lib/config/index.js.map +1 -1
- package/lib/config/keyword-triggers.d.ts +6 -0
- package/lib/config/keyword-triggers.d.ts.map +1 -0
- package/lib/config/keyword-triggers.js +6 -0
- package/lib/config/keyword-triggers.js.map +1 -0
- package/lib/config/model-harness-runtime.d.ts +5 -0
- package/lib/config/model-harness-runtime.d.ts.map +1 -0
- package/lib/config/model-harness-runtime.js +65 -0
- package/lib/config/model-harness-runtime.js.map +1 -0
- package/lib/config/model-harness.d.ts +16 -0
- package/lib/config/model-harness.d.ts.map +1 -0
- package/lib/config/model-harness.js +2 -0
- package/lib/config/model-harness.js.map +1 -0
- package/lib/config/normalize-ai-config.d.ts +2 -2
- package/lib/config/normalize-ai-config.d.ts.map +1 -1
- package/lib/config/normalize-ai-config.js +49 -29
- package/lib/config/normalize-ai-config.js.map +1 -1
- package/lib/config/provider-instance.d.ts +1 -1
- package/lib/config/provider-instance.d.ts.map +1 -1
- package/lib/config/provider-instance.js.map +1 -1
- package/lib/config/resolve-pipeline-binding.d.ts +16 -0
- package/lib/config/resolve-pipeline-binding.d.ts.map +1 -0
- package/lib/config/resolve-pipeline-binding.js +35 -0
- package/lib/config/resolve-pipeline-binding.js.map +1 -0
- package/lib/config/types.d.ts +17 -9
- package/lib/config/types.d.ts.map +1 -1
- package/lib/config/types.js.map +1 -1
- package/lib/config/validate-ai-config.d.ts.map +1 -1
- package/lib/config/validate-ai-config.js +6 -1
- package/lib/config/validate-ai-config.js.map +1 -1
- package/lib/config/zhin-agent-config.d.ts +83 -0
- package/lib/config/zhin-agent-config.d.ts.map +1 -0
- package/lib/config/zhin-agent-config.js +2 -0
- package/lib/config/zhin-agent-config.js.map +1 -0
- package/lib/config/zhin-agent-constants.d.ts +11 -0
- package/lib/config/zhin-agent-constants.d.ts.map +1 -0
- package/lib/config/zhin-agent-constants.js +26 -0
- package/lib/config/zhin-agent-constants.js.map +1 -0
- package/lib/config/zhin-agent-defaults.d.ts +3 -0
- package/lib/config/zhin-agent-defaults.d.ts.map +1 -0
- package/lib/config/zhin-agent-defaults.js +63 -0
- package/lib/config/zhin-agent-defaults.js.map +1 -0
- package/lib/config/zhin-agent-dependencies.d.ts +37 -0
- package/lib/config/zhin-agent-dependencies.d.ts.map +1 -0
- package/lib/config/zhin-agent-dependencies.js +2 -0
- package/lib/config/zhin-agent-dependencies.js.map +1 -0
- package/lib/config/zhin-agent-runtime.d.ts +21 -0
- package/lib/config/zhin-agent-runtime.d.ts.map +1 -0
- package/lib/config/zhin-agent-runtime.js +91 -0
- package/lib/config/zhin-agent-runtime.js.map +1 -0
- package/lib/context/agents-instruction.d.ts +11 -0
- package/lib/context/agents-instruction.d.ts.map +1 -0
- package/lib/context/agents-instruction.js +94 -0
- package/lib/context/agents-instruction.js.map +1 -0
- package/lib/context/context-system.d.ts +47 -0
- package/lib/context/context-system.d.ts.map +1 -0
- package/lib/context/context-system.js +115 -0
- package/lib/context/context-system.js.map +1 -0
- package/lib/context/context-tail-limit.d.ts +7 -0
- package/lib/context/context-tail-limit.d.ts.map +1 -0
- package/lib/context/context-tail-limit.js +12 -0
- package/lib/context/context-tail-limit.js.map +1 -0
- package/lib/context/contracts.d.ts +34 -0
- package/lib/context/contracts.d.ts.map +1 -0
- package/lib/context/contracts.js +8 -0
- package/lib/context/contracts.js.map +1 -0
- package/lib/context/default-builders.d.ts +24 -0
- package/lib/context/default-builders.d.ts.map +1 -0
- package/lib/context/default-builders.js +56 -0
- package/lib/context/default-builders.js.map +1 -0
- package/lib/context/envelope-parts.d.ts +13 -0
- package/lib/context/envelope-parts.d.ts.map +1 -0
- package/lib/context/envelope-parts.js +2 -0
- package/lib/context/envelope-parts.js.map +1 -0
- package/lib/context/index.d.ts +16 -0
- package/lib/context/index.d.ts.map +1 -0
- package/lib/context/index.js +10 -0
- package/lib/context/index.js.map +1 -0
- package/lib/context/model-resolver.d.ts.map +1 -0
- package/lib/context/model-resolver.js +28 -0
- package/lib/context/model-resolver.js.map +1 -0
- package/lib/context/turn-envelope.d.ts +20 -0
- package/lib/context/turn-envelope.d.ts.map +1 -0
- package/lib/context/turn-envelope.js +80 -0
- package/lib/context/turn-envelope.js.map +1 -0
- package/lib/context/turn-user-message.d.ts +10 -0
- package/lib/context/turn-user-message.d.ts.map +1 -0
- package/lib/context/turn-user-message.js +48 -0
- package/lib/context/turn-user-message.js.map +1 -0
- package/lib/core/agent-core-run.d.ts +61 -0
- package/lib/core/agent-core-run.d.ts.map +1 -0
- package/lib/core/agent-core-run.js +588 -0
- package/lib/core/agent-core-run.js.map +1 -0
- package/lib/core/agent-core.d.ts +18 -0
- package/lib/core/agent-core.d.ts.map +1 -0
- package/lib/core/agent-core.js +73 -0
- package/lib/core/agent-core.js.map +1 -0
- package/lib/core/agent-loop-standalone.d.ts +42 -0
- package/lib/core/agent-loop-standalone.d.ts.map +1 -0
- package/lib/core/agent-loop-standalone.js +163 -0
- package/lib/core/agent-loop-standalone.js.map +1 -0
- package/lib/core/agent-loop-turn.d.ts +8 -0
- package/lib/core/agent-loop-turn.d.ts.map +1 -0
- package/lib/core/agent-loop-turn.js +17 -0
- package/lib/core/agent-loop-turn.js.map +1 -0
- package/lib/core/compose-deps.d.ts +13 -0
- package/lib/core/compose-deps.d.ts.map +1 -0
- package/lib/core/compose-deps.js +35 -0
- package/lib/core/compose-deps.js.map +1 -0
- package/lib/core/contracts.d.ts +50 -0
- package/lib/core/contracts.d.ts.map +1 -0
- package/lib/core/contracts.js +11 -0
- package/lib/core/contracts.js.map +1 -0
- package/lib/core/index.d.ts +13 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +9 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/text-sanitize.d.ts.map +1 -0
- package/lib/core/text-sanitize.js.map +1 -0
- package/lib/core/tool-calls-user-format.d.ts.map +1 -0
- package/lib/core/tool-calls-user-format.js +138 -0
- package/lib/core/tool-calls-user-format.js.map +1 -0
- package/lib/core/turn-event-mapper.d.ts +12 -0
- package/lib/core/turn-event-mapper.d.ts.map +1 -0
- package/lib/core/turn-event-mapper.js +54 -0
- package/lib/core/turn-event-mapper.js.map +1 -0
- package/lib/deferred-worker-runner.d.ts +7 -5
- package/lib/deferred-worker-runner.d.ts.map +1 -1
- package/lib/deferred-worker-runner.js +9 -11
- package/lib/deferred-worker-runner.js.map +1 -1
- package/lib/deferred-worker-tool-load.d.ts +1 -1
- package/lib/deferred-worker-tool-load.d.ts.map +1 -1
- package/lib/deferred-worker-tool-load.js +3 -0
- package/lib/deferred-worker-tool-load.js.map +1 -1
- package/lib/discovery/agents.d.ts +10 -1
- package/lib/discovery/agents.d.ts.map +1 -1
- package/lib/discovery/agents.js +11 -1
- package/lib/discovery/agents.js.map +1 -1
- package/lib/event/contracts.d.ts +26 -0
- package/lib/event/contracts.d.ts.map +1 -0
- package/lib/event/contracts.js +9 -0
- package/lib/event/contracts.js.map +1 -0
- package/lib/event/event-emitter.d.ts +17 -0
- package/lib/event/event-emitter.d.ts.map +1 -0
- package/lib/event/event-emitter.js +73 -0
- package/lib/event/event-emitter.js.map +1 -0
- package/lib/event/event-system.d.ts +13 -0
- package/lib/event/event-system.d.ts.map +1 -0
- package/lib/event/event-system.js +56 -0
- package/lib/event/event-system.js.map +1 -0
- package/lib/event/filtering-middleware.d.ts +13 -0
- package/lib/event/filtering-middleware.d.ts.map +1 -0
- package/lib/event/filtering-middleware.js +19 -0
- package/lib/event/filtering-middleware.js.map +1 -0
- package/lib/event/index.d.ts +11 -0
- package/lib/event/index.d.ts.map +1 -0
- package/lib/event/index.js +8 -0
- package/lib/event/index.js.map +1 -0
- package/lib/event/logging-middleware.d.ts +6 -0
- package/lib/event/logging-middleware.d.ts.map +1 -0
- package/lib/event/logging-middleware.js +16 -0
- package/lib/event/logging-middleware.js.map +1 -0
- package/lib/event/session-events.d.ts +10 -0
- package/lib/event/session-events.d.ts.map +1 -0
- package/lib/event/session-events.js +18 -0
- package/lib/event/session-events.js.map +1 -0
- package/lib/event/turn-event.d.ts +77 -0
- package/lib/event/turn-event.d.ts.map +1 -0
- package/lib/event/turn-event.js +2 -0
- package/lib/event/turn-event.js.map +1 -0
- package/lib/index.d.ts +46 -26
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +30 -16
- package/lib/index.js.map +1 -1
- package/lib/init/activate-ai-database-storage.d.ts +2 -2
- package/lib/init/activate-ai-database-storage.d.ts.map +1 -1
- package/lib/init/activate-ai-database-storage.js +17 -8
- package/lib/init/activate-ai-database-storage.js.map +1 -1
- package/lib/init/compose-zhin-agent-runtime.d.ts +29 -0
- package/lib/init/compose-zhin-agent-runtime.d.ts.map +1 -0
- package/lib/init/compose-zhin-agent-runtime.js +40 -0
- package/lib/init/compose-zhin-agent-runtime.js.map +1 -0
- package/lib/init/configure-zhin-agent.d.ts +46 -0
- package/lib/init/configure-zhin-agent.d.ts.map +1 -0
- package/lib/init/configure-zhin-agent.js +75 -0
- package/lib/init/configure-zhin-agent.js.map +1 -0
- package/lib/init/create-zhin-agent.d.ts.map +1 -1
- package/lib/init/create-zhin-agent.js +161 -134
- package/lib/init/create-zhin-agent.js.map +1 -1
- package/lib/init/dispose-zhin-agent.d.ts +28 -0
- package/lib/init/dispose-zhin-agent.d.ts.map +1 -0
- package/lib/init/dispose-zhin-agent.js +25 -0
- package/lib/init/dispose-zhin-agent.js.map +1 -0
- package/lib/init/introspection-args.d.ts +4 -1
- package/lib/init/introspection-args.d.ts.map +1 -1
- package/lib/init/introspection-args.js.map +1 -1
- package/lib/init/management-command-guard.d.ts +2 -5
- package/lib/init/management-command-guard.d.ts.map +1 -1
- package/lib/init/management-command-guard.js +2 -16
- package/lib/init/management-command-guard.js.map +1 -1
- package/lib/init/message-media.d.ts +1 -1
- package/lib/init/message-media.d.ts.map +1 -1
- package/lib/init/message-media.js.map +1 -1
- package/lib/init/register-ai-trigger.d.ts.map +1 -1
- package/lib/init/register-ai-trigger.js +28 -295
- package/lib/init/register-ai-trigger.js.map +1 -1
- package/lib/init/register-builtin-tools.d.ts.map +1 -1
- package/lib/init/register-builtin-tools.js +9 -8
- package/lib/init/register-builtin-tools.js.map +1 -1
- package/lib/init/register-collaboration-commands.d.ts +2 -0
- package/lib/init/register-collaboration-commands.d.ts.map +1 -0
- package/lib/init/register-collaboration-commands.js +110 -0
- package/lib/init/register-collaboration-commands.js.map +1 -0
- package/lib/init/register-db-models.d.ts.map +1 -1
- package/lib/init/register-db-models.js +11 -2
- package/lib/init/register-db-models.js.map +1 -1
- package/lib/init/register-db-upgrade.d.ts.map +1 -1
- package/lib/init/register-db-upgrade.js +14 -9
- package/lib/init/register-db-upgrade.js.map +1 -1
- package/lib/init/register-group-session-passive.d.ts.map +1 -1
- package/lib/init/register-group-session-passive.js +19 -13
- package/lib/init/register-group-session-passive.js.map +1 -1
- package/lib/init/register-im-segment-filter.d.ts +2 -0
- package/lib/init/register-im-segment-filter.d.ts.map +1 -0
- package/lib/init/register-im-segment-filter.js +23 -0
- package/lib/init/register-im-segment-filter.js.map +1 -0
- package/lib/init/register-init-wizard-guardrail.d.ts +2 -0
- package/lib/init/register-init-wizard-guardrail.d.ts.map +1 -0
- package/lib/init/register-init-wizard-guardrail.js +46 -0
- package/lib/init/register-init-wizard-guardrail.js.map +1 -0
- package/lib/init/register-introspection-commands.d.ts.map +1 -1
- package/lib/init/register-introspection-commands.js +18 -33
- package/lib/init/register-introspection-commands.js.map +1 -1
- package/lib/init/register-management-tools.d.ts.map +1 -1
- package/lib/init/register-management-tools.js +38 -32
- package/lib/init/register-management-tools.js.map +1 -1
- package/lib/init/register-owner-approve-commands.d.ts.map +1 -1
- package/lib/init/register-owner-approve-commands.js +7 -1
- package/lib/init/register-owner-approve-commands.js.map +1 -1
- package/lib/init.js +6 -6
- package/lib/init.js.map +1 -1
- package/lib/internal/agent-host.d.ts +86 -0
- package/lib/internal/agent-host.d.ts.map +1 -0
- package/lib/internal/agent-host.js +2 -0
- package/lib/internal/agent-host.js.map +1 -0
- package/lib/internal/as-private.d.ts +11 -0
- package/lib/internal/as-private.d.ts.map +1 -0
- package/lib/internal/as-private.js +4 -0
- package/lib/internal/as-private.js.map +1 -0
- package/lib/internal/host-types.d.ts +81 -0
- package/lib/internal/host-types.d.ts.map +1 -0
- package/lib/internal/host-types.js +2 -0
- package/lib/internal/host-types.js.map +1 -0
- package/lib/internal/phase-trace.d.ts +17 -0
- package/lib/internal/phase-trace.d.ts.map +1 -0
- package/lib/internal/phase-trace.js.map +1 -0
- package/lib/internal/prompt-trace.d.ts +17 -0
- package/lib/internal/prompt-trace.d.ts.map +1 -0
- package/lib/internal/prompt-trace.js.map +1 -0
- package/lib/internal/turn-context.d.ts +26 -0
- package/lib/internal/turn-context.d.ts.map +1 -0
- package/lib/internal/turn-context.js +64 -0
- package/lib/internal/turn-context.js.map +1 -0
- package/lib/media/deliver-subagent-result.d.ts +2 -2
- package/lib/media/deliver-subagent-result.d.ts.map +1 -1
- package/lib/media/media-publisher.d.ts +1 -1
- package/lib/media/media-publisher.d.ts.map +1 -1
- package/lib/media/media-publisher.js.map +1 -1
- package/lib/media/media-router.d.ts +11 -2
- package/lib/media/media-router.d.ts.map +1 -1
- package/lib/media/media-router.js +62 -4
- package/lib/media/media-router.js.map +1 -1
- package/lib/media/media-tool-bridge.d.ts +1 -1
- package/lib/media/media-tool-bridge.d.ts.map +1 -1
- package/lib/media/media-types.d.ts +1 -1
- package/lib/media/media-types.d.ts.map +1 -1
- package/lib/media/media-types.js +1 -1
- package/lib/media/media-types.js.map +1 -1
- package/lib/media/resolve-config.d.ts +1 -0
- package/lib/media/resolve-config.d.ts.map +1 -1
- package/lib/media/resolve-config.js +5 -0
- package/lib/media/resolve-config.js.map +1 -1
- package/lib/media/subagent-inbound.d.ts.map +1 -1
- package/lib/media/subagent-inbound.js +33 -4
- package/lib/media/subagent-inbound.js.map +1 -1
- package/lib/media/subagent-user-delivery.d.ts +1 -1
- package/lib/media/subagent-user-delivery.d.ts.map +1 -1
- package/lib/memory/ai-compaction-strategy.d.ts +14 -0
- package/lib/memory/ai-compaction-strategy.d.ts.map +1 -0
- package/lib/memory/ai-compaction-strategy.js +31 -0
- package/lib/memory/ai-compaction-strategy.js.map +1 -0
- package/lib/memory/compaction-runtime.d.ts +28 -0
- package/lib/memory/compaction-runtime.d.ts.map +1 -0
- package/lib/memory/compaction-runtime.js +108 -0
- package/lib/memory/compaction-runtime.js.map +1 -0
- package/lib/memory/context-repository-store.d.ts +14 -0
- package/lib/memory/context-repository-store.d.ts.map +1 -0
- package/lib/memory/context-repository-store.js +22 -0
- package/lib/memory/context-repository-store.js.map +1 -0
- package/lib/memory/contracts.d.ts +24 -0
- package/lib/memory/contracts.d.ts.map +1 -0
- package/lib/memory/contracts.js +8 -0
- package/lib/memory/contracts.js.map +1 -0
- package/lib/memory/index.d.ts +11 -0
- package/lib/memory/index.d.ts.map +1 -0
- package/lib/memory/index.js +8 -0
- package/lib/memory/index.js.map +1 -0
- package/lib/memory/memory-system.d.ts +22 -0
- package/lib/memory/memory-system.d.ts.map +1 -0
- package/lib/memory/memory-system.js +71 -0
- package/lib/memory/memory-system.js.map +1 -0
- package/lib/memory-layers.d.ts +1 -1
- package/lib/memory-layers.d.ts.map +1 -1
- package/lib/memory-layers.js +1 -2
- package/lib/memory-layers.js.map +1 -1
- package/lib/orchestrator/agent-dispatcher.d.ts +7 -18
- package/lib/orchestrator/agent-dispatcher.d.ts.map +1 -1
- package/lib/orchestrator/agent-dispatcher.js +54 -116
- package/lib/orchestrator/agent-dispatcher.js.map +1 -1
- package/lib/orchestrator/bootstrap-executors.d.ts +7 -0
- package/lib/orchestrator/bootstrap-executors.d.ts.map +1 -0
- package/lib/orchestrator/bootstrap-executors.js +170 -0
- package/lib/orchestrator/bootstrap-executors.js.map +1 -0
- package/lib/orchestrator/hook-registry.d.ts +18 -3
- package/lib/orchestrator/hook-registry.d.ts.map +1 -1
- package/lib/orchestrator/hook-registry.js +66 -2
- package/lib/orchestrator/hook-registry.js.map +1 -1
- package/lib/orchestrator/index.d.ts +7 -1
- package/lib/orchestrator/index.d.ts.map +1 -1
- package/lib/orchestrator/index.js +4 -1
- package/lib/orchestrator/index.js.map +1 -1
- package/lib/orchestrator/orchestration-mappers.d.ts +9 -0
- package/lib/orchestrator/orchestration-mappers.d.ts.map +1 -0
- package/lib/orchestrator/orchestration-mappers.js +162 -0
- package/lib/orchestrator/orchestration-mappers.js.map +1 -0
- package/lib/orchestrator/orchestration-repository.d.ts +14 -14
- package/lib/orchestrator/orchestration-repository.d.ts.map +1 -1
- package/lib/orchestrator/orchestration-repository.js +87 -53
- package/lib/orchestrator/orchestration-repository.js.map +1 -1
- package/lib/orchestrator/orchestration-service.d.ts +82 -18
- package/lib/orchestrator/orchestration-service.d.ts.map +1 -1
- package/lib/orchestrator/orchestration-service.js +445 -103
- package/lib/orchestrator/orchestration-service.js.map +1 -1
- package/lib/orchestrator/orchestration-types.d.ts +88 -0
- package/lib/orchestrator/orchestration-types.d.ts.map +1 -0
- package/lib/orchestrator/orchestration-types.js +2 -0
- package/lib/orchestrator/orchestration-types.js.map +1 -0
- package/lib/orchestrator/owner-confirm-orchestration.d.ts +7 -1
- package/lib/orchestrator/owner-confirm-orchestration.d.ts.map +1 -1
- package/lib/orchestrator/owner-confirm-orchestration.js +1 -1
- package/lib/orchestrator/owner-confirm-orchestration.js.map +1 -1
- package/lib/orchestrator/remote-agent-registry.d.ts +10 -7
- package/lib/orchestrator/remote-agent-registry.d.ts.map +1 -1
- package/lib/orchestrator/remote-agent-registry.js +83 -51
- package/lib/orchestrator/remote-agent-registry.js.map +1 -1
- package/lib/orchestrator/remote-task-executor.d.ts.map +1 -1
- package/lib/orchestrator/remote-task-executor.js +179 -98
- package/lib/orchestrator/remote-task-executor.js.map +1 -1
- package/lib/orchestrator/remote-task-poller.js +1 -1
- package/lib/orchestrator/resolve-subagent-tools.d.ts +7 -3
- package/lib/orchestrator/resolve-subagent-tools.d.ts.map +1 -1
- package/lib/orchestrator/resolve-subagent-tools.js +36 -31
- package/lib/orchestrator/resolve-subagent-tools.js.map +1 -1
- package/lib/orchestrator/skill-registry.d.ts +10 -1
- package/lib/orchestrator/skill-registry.d.ts.map +1 -1
- package/lib/orchestrator/skill-registry.js +26 -37
- package/lib/orchestrator/skill-registry.js.map +1 -1
- package/lib/orchestrator/tool-registry.d.ts +1 -1
- package/lib/orchestrator/tool-registry.d.ts.map +1 -1
- package/lib/orchestrator/tool-registry.js.map +1 -1
- package/lib/orchestrator/tool-selection.d.ts +3 -3
- package/lib/orchestrator/tool-selection.d.ts.map +1 -1
- package/lib/orchestrator/tool-selection.js +1 -2
- package/lib/orchestrator/tool-selection.js.map +1 -1
- package/lib/orchestrator/types.d.ts +52 -0
- package/lib/orchestrator/types.d.ts.map +1 -1
- package/lib/outbound/send-proactive.d.ts +24 -0
- package/lib/outbound/send-proactive.d.ts.map +1 -0
- package/lib/outbound/send-proactive.js +54 -0
- package/lib/outbound/send-proactive.js.map +1 -0
- package/lib/prompt/assembly.d.ts +31 -0
- package/lib/prompt/assembly.d.ts.map +1 -0
- package/lib/prompt/assembly.js +90 -0
- package/lib/prompt/assembly.js.map +1 -0
- package/lib/prompt/index.d.ts +11 -0
- package/lib/prompt/index.d.ts.map +1 -0
- package/lib/prompt/index.js +9 -0
- package/lib/prompt/index.js.map +1 -0
- package/lib/prompt/prompt-builder.d.ts.map +1 -0
- package/lib/prompt/prompt-builder.js +574 -0
- package/lib/prompt/prompt-builder.js.map +1 -0
- package/lib/prompt/system-prompt.d.ts +63 -0
- package/lib/prompt/system-prompt.d.ts.map +1 -0
- package/lib/prompt/system-prompt.js +496 -0
- package/lib/prompt/system-prompt.js.map +1 -0
- package/lib/prompt/templates.d.ts +162 -0
- package/lib/prompt/templates.d.ts.map +1 -0
- package/lib/prompt/templates.js +447 -0
- package/lib/prompt/templates.js.map +1 -0
- package/lib/prompt/workspace-prompt.d.ts.map +1 -0
- package/lib/prompt/workspace-prompt.js.map +1 -0
- package/lib/reserved-tools.d.ts.map +1 -1
- package/lib/reserved-tools.js +9 -6
- package/lib/reserved-tools.js.map +1 -1
- package/lib/routing/route-matcher.d.ts +6 -1
- package/lib/routing/route-matcher.d.ts.map +1 -1
- package/lib/routing/route-matcher.js +53 -8
- package/lib/routing/route-matcher.js.map +1 -1
- package/lib/routing/runtime-binding.d.ts +1 -1
- package/lib/routing/runtime-binding.d.ts.map +1 -1
- package/lib/schedule-cron.d.ts +18 -0
- package/lib/schedule-cron.d.ts.map +1 -0
- package/lib/schedule-cron.js +62 -0
- package/lib/schedule-cron.js.map +1 -0
- package/lib/schedule-manager.d.ts +28 -0
- package/lib/schedule-manager.d.ts.map +1 -0
- package/lib/schedule-manager.js +150 -0
- package/lib/schedule-manager.js.map +1 -0
- package/lib/security/dangerous-tool-policy-hook.d.ts +6 -0
- package/lib/security/dangerous-tool-policy-hook.d.ts.map +1 -0
- package/lib/security/dangerous-tool-policy-hook.js +41 -0
- package/lib/security/dangerous-tool-policy-hook.js.map +1 -0
- package/lib/security/dangerous-tool-policy.d.ts +2 -2
- package/lib/security/dangerous-tool-policy.d.ts.map +1 -1
- package/lib/security/dangerous-tool-policy.js.map +1 -1
- package/lib/security/exec-policy-hook.d.ts +7 -0
- package/lib/security/exec-policy-hook.d.ts.map +1 -0
- package/lib/security/exec-policy-hook.js +29 -0
- package/lib/security/exec-policy-hook.js.map +1 -0
- package/lib/security/exec-policy.d.ts +1 -1
- package/lib/security/exec-policy.d.ts.map +1 -1
- package/lib/security/file-policy-hook.d.ts +6 -0
- package/lib/security/file-policy-hook.d.ts.map +1 -0
- package/lib/security/file-policy-hook.js +30 -0
- package/lib/security/file-policy-hook.js.map +1 -0
- package/lib/security/owner-approve-always-store.d.ts +1 -1
- package/lib/security/owner-approve-always-store.d.ts.map +1 -1
- package/lib/security/owner-approve-always-store.js.map +1 -1
- package/lib/security/sandbox-enhanced.d.ts.map +1 -1
- package/lib/security/sandbox-enhanced.js +10 -8
- package/lib/security/sandbox-enhanced.js.map +1 -1
- package/lib/security/sandbox.d.ts.map +1 -1
- package/lib/security/sandbox.js +5 -4
- package/lib/security/sandbox.js.map +1 -1
- package/lib/segment/filter-im-delivery.d.ts +7 -0
- package/lib/segment/filter-im-delivery.d.ts.map +1 -0
- package/lib/segment/filter-im-delivery.js +32 -0
- package/lib/segment/filter-im-delivery.js.map +1 -0
- package/lib/service.d.ts +5 -14
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +7 -12
- package/lib/service.js.map +1 -1
- package/lib/session/branch-summarization-runtime.d.ts +16 -0
- package/lib/session/branch-summarization-runtime.d.ts.map +1 -0
- package/lib/session/branch-summarization-runtime.js +58 -0
- package/lib/session/branch-summarization-runtime.js.map +1 -0
- package/lib/session/contracts.d.ts +27 -0
- package/lib/session/contracts.d.ts.map +1 -0
- package/lib/session/contracts.js +9 -0
- package/lib/session/contracts.js.map +1 -0
- package/lib/session/index.d.ts +17 -0
- package/lib/session/index.d.ts.map +1 -0
- package/lib/session/index.js +12 -0
- package/lib/session/index.js.map +1 -0
- package/lib/session/passive-group-buffer.d.ts +15 -0
- package/lib/session/passive-group-buffer.d.ts.map +1 -0
- package/lib/session/passive-group-buffer.js +45 -0
- package/lib/session/passive-group-buffer.js.map +1 -0
- package/lib/session/passive-group-session.d.ts +12 -0
- package/lib/session/passive-group-session.d.ts.map +1 -0
- package/lib/session/passive-group-session.js +36 -0
- package/lib/session/passive-group-session.js.map +1 -0
- package/lib/session/session-io.d.ts +43 -0
- package/lib/session/session-io.d.ts.map +1 -0
- package/lib/session/session-io.js +135 -0
- package/lib/session/session-io.js.map +1 -0
- package/lib/session/session-system.d.ts +31 -0
- package/lib/session/session-system.d.ts.map +1 -0
- package/lib/session/session-system.js +70 -0
- package/lib/session/session-system.js.map +1 -0
- package/lib/session/session-tree-commands.d.ts +5 -0
- package/lib/session/session-tree-commands.d.ts.map +1 -0
- package/lib/session/session-tree-commands.js +32 -0
- package/lib/session/session-tree-commands.js.map +1 -0
- package/lib/session/strategies.d.ts +11 -0
- package/lib/session/strategies.d.ts.map +1 -0
- package/lib/session/strategies.js +19 -0
- package/lib/session/strategies.js.map +1 -0
- package/lib/session-tree-runtime-registry.d.ts +1 -1
- package/lib/session-tree-runtime-registry.d.ts.map +1 -1
- package/lib/session-tree-runtime-registry.js +1 -1
- package/lib/session-tree-runtime-registry.js.map +1 -1
- package/lib/skill/contracts.d.ts +29 -0
- package/lib/skill/contracts.d.ts.map +1 -0
- package/lib/skill/contracts.js +7 -0
- package/lib/skill/contracts.js.map +1 -0
- package/lib/skill/index.d.ts +8 -0
- package/lib/skill/index.d.ts.map +1 -0
- package/lib/skill/index.js +6 -0
- package/lib/skill/index.js.map +1 -0
- package/lib/skill/skill-load-opts.d.ts +5 -0
- package/lib/skill/skill-load-opts.d.ts.map +1 -0
- package/lib/skill/skill-load-opts.js +14 -0
- package/lib/skill/skill-load-opts.js.map +1 -0
- package/lib/skill/skill-system.d.ts +17 -0
- package/lib/skill/skill-system.d.ts.map +1 -0
- package/lib/skill/skill-system.js +51 -0
- package/lib/skill/skill-system.js.map +1 -0
- package/lib/spawn/permission-task.d.ts +9 -0
- package/lib/spawn/permission-task.d.ts.map +1 -0
- package/lib/spawn/permission-task.js +37 -0
- package/lib/spawn/permission-task.js.map +1 -0
- package/lib/stability/memory-pressure.js +1 -1
- package/lib/stability/memory-pressure.js.map +1 -1
- package/lib/subagent/contracts.d.ts +37 -0
- package/lib/subagent/contracts.d.ts.map +1 -0
- package/lib/subagent/contracts.js +8 -0
- package/lib/subagent/contracts.js.map +1 -0
- package/lib/subagent/im-result-sink.d.ts +15 -0
- package/lib/subagent/im-result-sink.d.ts.map +1 -0
- package/lib/subagent/im-result-sink.js +47 -0
- package/lib/subagent/im-result-sink.js.map +1 -0
- package/lib/subagent/index.d.ts +12 -0
- package/lib/subagent/index.d.ts.map +1 -0
- package/lib/subagent/index.js +8 -0
- package/lib/subagent/index.js.map +1 -0
- package/lib/subagent/subagent-runtime.d.ts +173 -0
- package/lib/subagent/subagent-runtime.d.ts.map +1 -0
- package/lib/subagent/subagent-runtime.js +553 -0
- package/lib/subagent/subagent-runtime.js.map +1 -0
- package/lib/subagent/subagent-system-init.d.ts +15 -0
- package/lib/subagent/subagent-system-init.d.ts.map +1 -0
- package/lib/subagent/subagent-system-init.js +53 -0
- package/lib/subagent/subagent-system-init.js.map +1 -0
- package/lib/subagent/subagent-system.d.ts +31 -0
- package/lib/subagent/subagent-system.d.ts.map +1 -0
- package/lib/subagent/subagent-system.js +98 -0
- package/lib/subagent/subagent-system.js.map +1 -0
- package/lib/subagent-ai-events.d.ts +4 -4
- package/lib/subagent-ai-events.d.ts.map +1 -1
- package/lib/subagent-ai-events.js.map +1 -1
- package/lib/subagent-goal-notify.d.ts +11 -9
- package/lib/subagent-goal-notify.d.ts.map +1 -1
- package/lib/subagent-goal-notify.js +14 -8
- package/lib/subagent-goal-notify.js.map +1 -1
- package/lib/subagent-preset.js +3 -3
- package/lib/subagent-preset.js.map +1 -1
- package/lib/task-executor.d.ts +14 -10
- package/lib/task-executor.d.ts.map +1 -1
- package/lib/task-executor.js +94 -39
- package/lib/task-executor.js.map +1 -1
- package/lib/tool/context-tools.d.ts +10 -0
- package/lib/tool/context-tools.d.ts.map +1 -0
- package/lib/tool/context-tools.js +107 -0
- package/lib/tool/context-tools.js.map +1 -0
- package/lib/tool/contracts.d.ts +26 -0
- package/lib/tool/contracts.d.ts.map +1 -0
- package/lib/tool/contracts.js +8 -0
- package/lib/tool/contracts.js.map +1 -0
- package/lib/tool/deferred-resolution.d.ts +14 -0
- package/lib/tool/deferred-resolution.d.ts.map +1 -0
- package/lib/tool/deferred-resolution.js +72 -0
- package/lib/tool/deferred-resolution.js.map +1 -0
- package/lib/tool/index.d.ts +14 -0
- package/lib/tool/index.d.ts.map +1 -0
- package/lib/tool/index.js +9 -0
- package/lib/tool/index.js.map +1 -0
- package/lib/tool/pre-exec.d.ts.map +1 -0
- package/lib/tool/pre-exec.js.map +1 -0
- package/lib/tool/prepare-turn-tools.d.ts +22 -0
- package/lib/tool/prepare-turn-tools.d.ts.map +1 -0
- package/lib/tool/prepare-turn-tools.js +73 -0
- package/lib/tool/prepare-turn-tools.js.map +1 -0
- package/lib/tool/runtime.d.ts +24 -0
- package/lib/tool/runtime.d.ts.map +1 -0
- package/lib/tool/runtime.js +20 -0
- package/lib/tool/runtime.js.map +1 -0
- package/lib/tool/sources.d.ts +59 -0
- package/lib/tool/sources.d.ts.map +1 -0
- package/lib/tool/sources.js +110 -0
- package/lib/tool/sources.js.map +1 -0
- package/lib/tool/tool-system.d.ts +36 -0
- package/lib/tool/tool-system.d.ts.map +1 -0
- package/lib/tool/tool-system.js +84 -0
- package/lib/tool/tool-system.js.map +1 -0
- package/lib/tool/web-search-locale-attach.d.ts.map +1 -0
- package/lib/tool/web-search-locale-attach.js.map +1 -0
- package/lib/tool-bridge.d.ts +11 -0
- package/lib/tool-bridge.d.ts.map +1 -0
- package/lib/tool-bridge.js +10 -0
- package/lib/tool-bridge.js.map +1 -0
- package/lib/tool-catalog/index.d.ts +4 -0
- package/lib/tool-catalog/index.d.ts.map +1 -0
- package/lib/tool-catalog/index.js +4 -0
- package/lib/tool-catalog/index.js.map +1 -0
- package/lib/tool-catalog/resolve-config.d.ts +8 -0
- package/lib/tool-catalog/resolve-config.d.ts.map +1 -0
- package/lib/tool-catalog/resolve-config.js +22 -0
- package/lib/tool-catalog/resolve-config.js.map +1 -0
- package/lib/tool-catalog/session-deferred-store.d.ts +22 -0
- package/lib/tool-catalog/session-deferred-store.d.ts.map +1 -0
- package/lib/tool-catalog/session-deferred-store.js +50 -0
- package/lib/tool-catalog/session-deferred-store.js.map +1 -0
- package/lib/tool-catalog/tool-catalog.d.ts +24 -0
- package/lib/tool-catalog/tool-catalog.d.ts.map +1 -0
- package/lib/tool-catalog/tool-catalog.js +119 -0
- package/lib/tool-catalog/tool-catalog.js.map +1 -0
- package/lib/tool-catalog/types.d.ts +29 -0
- package/lib/tool-catalog/types.d.ts.map +1 -0
- package/lib/tool-catalog/types.js +18 -0
- package/lib/tool-catalog/types.js.map +1 -0
- package/lib/turn/auto-continue.d.ts +18 -0
- package/lib/turn/auto-continue.d.ts.map +1 -0
- package/lib/turn/auto-continue.js +76 -0
- package/lib/turn/auto-continue.js.map +1 -0
- package/lib/turn/deferred-auto-continue.d.ts +11 -0
- package/lib/turn/deferred-auto-continue.d.ts.map +1 -0
- package/lib/turn/deferred-auto-continue.js.map +1 -0
- package/lib/turn/deferred-delivery.d.ts +9 -0
- package/lib/turn/deferred-delivery.d.ts.map +1 -0
- package/lib/turn/deferred-delivery.js.map +1 -0
- package/lib/turn/inbound-queue-config.d.ts +14 -0
- package/lib/turn/inbound-queue-config.d.ts.map +1 -0
- package/lib/turn/inbound-queue-config.js +39 -0
- package/lib/turn/inbound-queue-config.js.map +1 -0
- package/lib/turn/inbound-queue-runtime.d.ts +15 -0
- package/lib/turn/inbound-queue-runtime.d.ts.map +1 -0
- package/lib/turn/inbound-queue-runtime.js +29 -0
- package/lib/turn/inbound-queue-runtime.js.map +1 -0
- package/lib/turn/inbound-turn-queue.d.ts +29 -0
- package/lib/turn/inbound-turn-queue.d.ts.map +1 -0
- package/lib/turn/inbound-turn-queue.js +132 -0
- package/lib/turn/inbound-turn-queue.js.map +1 -0
- package/lib/turn/index.d.ts +34 -0
- package/lib/turn/index.d.ts.map +1 -0
- package/lib/turn/index.js +26 -0
- package/lib/turn/index.js.map +1 -0
- package/lib/turn/multimodal-message.d.ts +9 -0
- package/lib/turn/multimodal-message.d.ts.map +1 -0
- package/lib/turn/multimodal-message.js +72 -0
- package/lib/turn/multimodal-message.js.map +1 -0
- package/lib/turn/persist-deferred-context.d.ts +5 -0
- package/lib/turn/persist-deferred-context.d.ts.map +1 -0
- package/lib/turn/persist-deferred-context.js +35 -0
- package/lib/turn/persist-deferred-context.js.map +1 -0
- package/lib/turn/persist-subagent-context.d.ts +5 -0
- package/lib/turn/persist-subagent-context.d.ts.map +1 -0
- package/lib/turn/persist-subagent-context.js +36 -0
- package/lib/turn/persist-subagent-context.js.map +1 -0
- package/lib/turn/process-stream.d.ts +14 -0
- package/lib/turn/process-stream.d.ts.map +1 -0
- package/lib/turn/process-stream.js +56 -0
- package/lib/turn/process-stream.js.map +1 -0
- package/lib/turn/prompt-access.d.ts.map +1 -0
- package/lib/turn/prompt-access.js.map +1 -0
- package/lib/turn/prompt-api.d.ts +14 -0
- package/lib/turn/prompt-api.d.ts.map +1 -0
- package/lib/turn/prompt-api.js +51 -0
- package/lib/turn/prompt-api.js.map +1 -0
- package/lib/turn/prompt-controller.d.ts +59 -0
- package/lib/turn/prompt-controller.d.ts.map +1 -0
- package/lib/turn/prompt-controller.js +190 -0
- package/lib/turn/prompt-controller.js.map +1 -0
- package/lib/turn/prompt-input.d.ts +3 -0
- package/lib/turn/prompt-input.d.ts.map +1 -0
- package/lib/turn/prompt-input.js.map +1 -0
- package/lib/turn/session-message-queue.d.ts +19 -0
- package/lib/turn/session-message-queue.d.ts.map +1 -0
- package/lib/turn/session-message-queue.js.map +1 -0
- package/lib/turn/subagent-auto-continue.d.ts +7 -0
- package/lib/turn/subagent-auto-continue.d.ts.map +1 -0
- package/lib/turn/subagent-auto-continue.js +16 -0
- package/lib/turn/subagent-auto-continue.js.map +1 -0
- package/lib/turn/task-continuation.d.ts.map +1 -0
- package/lib/turn/task-continuation.js.map +1 -0
- package/lib/turn/turn-complete.d.ts +25 -0
- package/lib/turn/turn-complete.d.ts.map +1 -0
- package/lib/turn/turn-complete.js +63 -0
- package/lib/turn/turn-complete.js.map +1 -0
- package/lib/turn/turn-context-bridge.d.ts +13 -0
- package/lib/turn/turn-context-bridge.d.ts.map +1 -0
- package/lib/turn/turn-context-bridge.js +33 -0
- package/lib/turn/turn-context-bridge.js.map +1 -0
- package/lib/turn/turn-deferred-delta.d.ts +6 -0
- package/lib/turn/turn-deferred-delta.d.ts.map +1 -0
- package/lib/turn/turn-deferred-delta.js +24 -0
- package/lib/turn/turn-deferred-delta.js.map +1 -0
- package/lib/turn/turn-metrics.d.ts +10 -0
- package/lib/turn/turn-metrics.d.ts.map +1 -0
- package/lib/turn/turn-metrics.js.map +1 -0
- package/lib/turn/turn-pipeline.d.ts +14 -0
- package/lib/turn/turn-pipeline.d.ts.map +1 -0
- package/lib/turn/turn-pipeline.js +242 -0
- package/lib/turn/turn-pipeline.js.map +1 -0
- package/lib/turn/turn-tracker.d.ts.map +1 -0
- package/lib/turn/turn-tracker.js.map +1 -0
- package/lib/typing-indicator/adapter-integration.d.ts +3 -142
- package/lib/typing-indicator/adapter-integration.d.ts.map +1 -1
- package/lib/typing-indicator/adapter-integration.js +1 -329
- package/lib/typing-indicator/adapter-integration.js.map +1 -1
- package/lib/zhin-agent/index.d.ts +73 -83
- package/lib/zhin-agent/index.d.ts.map +1 -1
- package/lib/zhin-agent/index.js +168 -332
- package/lib/zhin-agent/index.js.map +1 -1
- package/lib/zhin-agent/runtime-modules.d.ts +27 -0
- package/lib/zhin-agent/runtime-modules.d.ts.map +1 -0
- package/lib/zhin-agent/runtime-modules.js +28 -0
- package/lib/zhin-agent/runtime-modules.js.map +1 -0
- package/package.json +59 -6
- package/lib/assistant/legacy-convert.d.ts +0 -43
- package/lib/assistant/legacy-convert.d.ts.map +0 -1
- package/lib/assistant/legacy-convert.js +0 -108
- package/lib/assistant/legacy-convert.js.map +0 -1
- package/lib/builtin/activate-skill-tool.d.ts +0 -21
- package/lib/builtin/activate-skill-tool.d.ts.map +0 -1
- package/lib/builtin/activate-skill-tool.js +0 -57
- package/lib/builtin/activate-skill-tool.js.map +0 -1
- package/lib/builtin/run-spec-dry-run-tool.d.ts +0 -3
- package/lib/builtin/run-spec-dry-run-tool.d.ts.map +0 -1
- package/lib/builtin/run-spec-dry-run-tool.js +0 -51
- package/lib/builtin/run-spec-dry-run-tool.js.map +0 -1
- package/lib/builtin/run-validation-spec-tool.d.ts +0 -5
- package/lib/builtin/run-validation-spec-tool.d.ts.map +0 -1
- package/lib/builtin/run-validation-spec-tool.js +0 -44
- package/lib/builtin/run-validation-spec-tool.js.map +0 -1
- package/lib/builtin/tool-search-tool.d.ts +0 -19
- package/lib/builtin/tool-search-tool.d.ts.map +0 -1
- package/lib/builtin/tool-search-tool.js +0 -54
- package/lib/builtin/tool-search-tool.js.map +0 -1
- package/lib/cron-engine.d.ts +0 -121
- package/lib/cron-engine.d.ts.map +0 -1
- package/lib/cron-engine.js +0 -360
- package/lib/cron-engine.js.map +0 -1
- package/lib/init/register-agent-mesh-mcp.d.ts +0 -2
- package/lib/init/register-agent-mesh-mcp.d.ts.map +0 -1
- package/lib/init/register-agent-mesh-mcp.js +0 -29
- package/lib/init/register-agent-mesh-mcp.js.map +0 -1
- package/lib/init/register-mcp-memory-default.d.ts +0 -2
- package/lib/init/register-mcp-memory-default.d.ts.map +0 -1
- package/lib/init/register-mcp-memory-default.js +0 -35
- package/lib/init/register-mcp-memory-default.js.map +0 -1
- package/lib/init/register-typing-indicator.d.ts +0 -10
- package/lib/init/register-typing-indicator.d.ts.map +0 -1
- package/lib/init/register-typing-indicator.js +0 -286
- package/lib/init/register-typing-indicator.js.map +0 -1
- package/lib/mcp-server/agent-mesh-tools.d.ts +0 -8
- package/lib/mcp-server/agent-mesh-tools.d.ts.map +0 -1
- package/lib/mcp-server/agent-mesh-tools.js +0 -138
- package/lib/mcp-server/agent-mesh-tools.js.map +0 -1
- package/lib/orchestrator/delegation-processor.d.ts +0 -34
- package/lib/orchestrator/delegation-processor.d.ts.map +0 -1
- package/lib/orchestrator/delegation-processor.js +0 -146
- package/lib/orchestrator/delegation-processor.js.map +0 -1
- package/lib/orchestrator/mission-milestone-notify.d.ts +0 -17
- package/lib/orchestrator/mission-milestone-notify.d.ts.map +0 -1
- package/lib/orchestrator/mission-milestone-notify.js +0 -54
- package/lib/orchestrator/mission-milestone-notify.js.map +0 -1
- package/lib/orchestrator/mission-negotiation.d.ts +0 -17
- package/lib/orchestrator/mission-negotiation.d.ts.map +0 -1
- package/lib/orchestrator/mission-negotiation.js +0 -89
- package/lib/orchestrator/mission-negotiation.js.map +0 -1
- package/lib/orchestrator/mission-patch-acl.d.ts +0 -9
- package/lib/orchestrator/mission-patch-acl.d.ts.map +0 -1
- package/lib/orchestrator/mission-patch-acl.js +0 -29
- package/lib/orchestrator/mission-patch-acl.js.map +0 -1
- package/lib/orchestrator/mission-runner.d.ts +0 -23
- package/lib/orchestrator/mission-runner.d.ts.map +0 -1
- package/lib/orchestrator/mission-runner.js +0 -181
- package/lib/orchestrator/mission-runner.js.map +0 -1
- package/lib/orchestrator/mission-spec.d.ts +0 -44
- package/lib/orchestrator/mission-spec.d.ts.map +0 -1
- package/lib/orchestrator/mission-spec.js +0 -121
- package/lib/orchestrator/mission-spec.js.map +0 -1
- package/lib/orchestrator/mission-state.d.ts +0 -48
- package/lib/orchestrator/mission-state.d.ts.map +0 -1
- package/lib/orchestrator/mission-state.js +0 -66
- package/lib/orchestrator/mission-state.js.map +0 -1
- package/lib/subagent.d.ts +0 -141
- package/lib/subagent.d.ts.map +0 -1
- package/lib/subagent.js +0 -483
- package/lib/subagent.js.map +0 -1
- package/lib/zhin-agent/agent-loop-standalone.d.ts +0 -43
- package/lib/zhin-agent/agent-loop-standalone.d.ts.map +0 -1
- package/lib/zhin-agent/agent-loop-standalone.js +0 -163
- package/lib/zhin-agent/agent-loop-standalone.js.map +0 -1
- package/lib/zhin-agent/agent-loop-turn.d.ts +0 -52
- package/lib/zhin-agent/agent-loop-turn.d.ts.map +0 -1
- package/lib/zhin-agent/agent-loop-turn.js +0 -395
- package/lib/zhin-agent/agent-loop-turn.js.map +0 -1
- package/lib/zhin-agent/agents-instruction.d.ts +0 -15
- package/lib/zhin-agent/agents-instruction.d.ts.map +0 -1
- package/lib/zhin-agent/agents-instruction.js +0 -98
- package/lib/zhin-agent/agents-instruction.js.map +0 -1
- package/lib/zhin-agent/branch-summarization-runtime.d.ts +0 -16
- package/lib/zhin-agent/branch-summarization-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/branch-summarization-runtime.js +0 -58
- package/lib/zhin-agent/branch-summarization-runtime.js.map +0 -1
- package/lib/zhin-agent/builtin-tools.d.ts +0 -14
- package/lib/zhin-agent/builtin-tools.d.ts.map +0 -1
- package/lib/zhin-agent/builtin-tools.js +0 -114
- package/lib/zhin-agent/builtin-tools.js.map +0 -1
- package/lib/zhin-agent/compaction-runtime.d.ts +0 -29
- package/lib/zhin-agent/compaction-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/compaction-runtime.js +0 -108
- package/lib/zhin-agent/compaction-runtime.js.map +0 -1
- package/lib/zhin-agent/config.d.ts +0 -190
- package/lib/zhin-agent/config.d.ts.map +0 -1
- package/lib/zhin-agent/config.js +0 -207
- package/lib/zhin-agent/config.js.map +0 -1
- package/lib/zhin-agent/context-budget.d.ts +0 -27
- package/lib/zhin-agent/context-budget.d.ts.map +0 -1
- package/lib/zhin-agent/context-budget.js +0 -50
- package/lib/zhin-agent/context-budget.js.map +0 -1
- package/lib/zhin-agent/deferred-auto-continue.d.ts +0 -11
- package/lib/zhin-agent/deferred-auto-continue.d.ts.map +0 -1
- package/lib/zhin-agent/deferred-auto-continue.js.map +0 -1
- package/lib/zhin-agent/deferred-delivery.d.ts +0 -9
- package/lib/zhin-agent/deferred-delivery.d.ts.map +0 -1
- package/lib/zhin-agent/deferred-delivery.js.map +0 -1
- package/lib/zhin-agent/event-emitter.d.ts +0 -11
- package/lib/zhin-agent/event-emitter.d.ts.map +0 -1
- package/lib/zhin-agent/event-emitter.js +0 -44
- package/lib/zhin-agent/event-emitter.js.map +0 -1
- package/lib/zhin-agent/interfaces.d.ts +0 -63
- package/lib/zhin-agent/interfaces.d.ts.map +0 -1
- package/lib/zhin-agent/interfaces.js +0 -8
- package/lib/zhin-agent/interfaces.js.map +0 -1
- package/lib/zhin-agent/model-harness.d.ts +0 -29
- package/lib/zhin-agent/model-harness.d.ts.map +0 -1
- package/lib/zhin-agent/model-harness.js +0 -67
- package/lib/zhin-agent/model-harness.js.map +0 -1
- package/lib/zhin-agent/model-resolver.d.ts.map +0 -1
- package/lib/zhin-agent/model-resolver.js +0 -27
- package/lib/zhin-agent/model-resolver.js.map +0 -1
- package/lib/zhin-agent/multimodal-message.d.ts +0 -9
- package/lib/zhin-agent/multimodal-message.d.ts.map +0 -1
- package/lib/zhin-agent/multimodal-message.js +0 -69
- package/lib/zhin-agent/multimodal-message.js.map +0 -1
- package/lib/zhin-agent/persist-deferred-context.d.ts +0 -5
- package/lib/zhin-agent/persist-deferred-context.d.ts.map +0 -1
- package/lib/zhin-agent/persist-deferred-context.js +0 -34
- package/lib/zhin-agent/persist-deferred-context.js.map +0 -1
- package/lib/zhin-agent/phase-trace.d.ts +0 -23
- package/lib/zhin-agent/phase-trace.d.ts.map +0 -1
- package/lib/zhin-agent/phase-trace.js.map +0 -1
- package/lib/zhin-agent/pre-exec.d.ts.map +0 -1
- package/lib/zhin-agent/pre-exec.js.map +0 -1
- package/lib/zhin-agent/prompt-access.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-access.js.map +0 -1
- package/lib/zhin-agent/prompt-assembly.d.ts +0 -31
- package/lib/zhin-agent/prompt-assembly.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-assembly.js +0 -87
- package/lib/zhin-agent/prompt-assembly.js.map +0 -1
- package/lib/zhin-agent/prompt-builder.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-builder.js +0 -579
- package/lib/zhin-agent/prompt-builder.js.map +0 -1
- package/lib/zhin-agent/prompt-controller.d.ts +0 -54
- package/lib/zhin-agent/prompt-controller.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-controller.js +0 -177
- package/lib/zhin-agent/prompt-controller.js.map +0 -1
- package/lib/zhin-agent/prompt-input.d.ts +0 -3
- package/lib/zhin-agent/prompt-input.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-input.js.map +0 -1
- package/lib/zhin-agent/prompt-templates.d.ts +0 -162
- package/lib/zhin-agent/prompt-templates.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-templates.js +0 -447
- package/lib/zhin-agent/prompt-templates.js.map +0 -1
- package/lib/zhin-agent/prompt-trace.d.ts +0 -20
- package/lib/zhin-agent/prompt-trace.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-trace.js.map +0 -1
- package/lib/zhin-agent/prompt.d.ts +0 -83
- package/lib/zhin-agent/prompt.d.ts.map +0 -1
- package/lib/zhin-agent/prompt.js +0 -548
- package/lib/zhin-agent/prompt.js.map +0 -1
- package/lib/zhin-agent/session-io.d.ts +0 -37
- package/lib/zhin-agent/session-io.d.ts.map +0 -1
- package/lib/zhin-agent/session-io.js +0 -115
- package/lib/zhin-agent/session-io.js.map +0 -1
- package/lib/zhin-agent/session-message-queue.d.ts +0 -20
- package/lib/zhin-agent/session-message-queue.d.ts.map +0 -1
- package/lib/zhin-agent/session-message-queue.js.map +0 -1
- package/lib/zhin-agent/session-tree-commands.d.ts +0 -5
- package/lib/zhin-agent/session-tree-commands.d.ts.map +0 -1
- package/lib/zhin-agent/session-tree-commands.js +0 -32
- package/lib/zhin-agent/session-tree-commands.js.map +0 -1
- package/lib/zhin-agent/task-continuation.d.ts.map +0 -1
- package/lib/zhin-agent/task-continuation.js.map +0 -1
- package/lib/zhin-agent/text-sanitize.d.ts.map +0 -1
- package/lib/zhin-agent/text-sanitize.js.map +0 -1
- package/lib/zhin-agent/tool-calls-user-format.d.ts.map +0 -1
- package/lib/zhin-agent/tool-calls-user-format.js +0 -138
- package/lib/zhin-agent/tool-calls-user-format.js.map +0 -1
- package/lib/zhin-agent/tool-catalog.d.ts +0 -15
- package/lib/zhin-agent/tool-catalog.d.ts.map +0 -1
- package/lib/zhin-agent/tool-catalog.js +0 -60
- package/lib/zhin-agent/tool-catalog.js.map +0 -1
- package/lib/zhin-agent/tool-orchestration.d.ts +0 -9
- package/lib/zhin-agent/tool-orchestration.d.ts.map +0 -1
- package/lib/zhin-agent/tool-orchestration.js +0 -90
- package/lib/zhin-agent/tool-orchestration.js.map +0 -1
- package/lib/zhin-agent/tool-runtime.d.ts +0 -31
- package/lib/zhin-agent/tool-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/tool-runtime.js +0 -61
- package/lib/zhin-agent/tool-runtime.js.map +0 -1
- package/lib/zhin-agent/tool-search-orchestrator.d.ts +0 -26
- package/lib/zhin-agent/tool-search-orchestrator.d.ts.map +0 -1
- package/lib/zhin-agent/tool-search-orchestrator.js +0 -107
- package/lib/zhin-agent/tool-search-orchestrator.js.map +0 -1
- package/lib/zhin-agent/turn-context.d.ts +0 -9
- package/lib/zhin-agent/turn-context.d.ts.map +0 -1
- package/lib/zhin-agent/turn-context.js +0 -12
- package/lib/zhin-agent/turn-context.js.map +0 -1
- package/lib/zhin-agent/turn-metrics.d.ts +0 -20
- package/lib/zhin-agent/turn-metrics.d.ts.map +0 -1
- package/lib/zhin-agent/turn-metrics.js.map +0 -1
- package/lib/zhin-agent/turn-pipeline.d.ts +0 -12
- package/lib/zhin-agent/turn-pipeline.d.ts.map +0 -1
- package/lib/zhin-agent/turn-pipeline.js +0 -326
- package/lib/zhin-agent/turn-pipeline.js.map +0 -1
- package/lib/zhin-agent/turn-tracker.d.ts.map +0 -1
- package/lib/zhin-agent/turn-tracker.js.map +0 -1
- package/lib/zhin-agent/turn-user-message.d.ts +0 -11
- package/lib/zhin-agent/turn-user-message.d.ts.map +0 -1
- package/lib/zhin-agent/turn-user-message.js +0 -49
- package/lib/zhin-agent/turn-user-message.js.map +0 -1
- package/lib/zhin-agent/web-search-locale-attach.d.ts.map +0 -1
- package/lib/zhin-agent/web-search-locale-attach.js.map +0 -1
- package/lib/zhin-agent/workspace-prompt.d.ts.map +0 -1
- package/lib/zhin-agent/workspace-prompt.js.map +0 -1
- package/lib/zhin-agent/zhin-agent-private.d.ts +0 -90
- package/lib/zhin-agent/zhin-agent-private.d.ts.map +0 -1
- package/lib/zhin-agent/zhin-agent-private.js +0 -4
- package/lib/zhin-agent/zhin-agent-private.js.map +0 -1
- /package/lib/{zhin-agent → context}/model-resolver.d.ts +0 -0
- /package/lib/{zhin-agent → core}/text-sanitize.d.ts +0 -0
- /package/lib/{zhin-agent → core}/text-sanitize.js +0 -0
- /package/lib/{zhin-agent → core}/tool-calls-user-format.d.ts +0 -0
- /package/lib/{zhin-agent → internal}/phase-trace.js +0 -0
- /package/lib/{zhin-agent → internal}/prompt-trace.js +0 -0
- /package/lib/{zhin-agent → prompt}/prompt-builder.d.ts +0 -0
- /package/lib/{zhin-agent → prompt}/workspace-prompt.d.ts +0 -0
- /package/lib/{zhin-agent → prompt}/workspace-prompt.js +0 -0
- /package/lib/{zhin-agent → tool}/pre-exec.d.ts +0 -0
- /package/lib/{zhin-agent → tool}/pre-exec.js +0 -0
- /package/lib/{zhin-agent → tool}/web-search-locale-attach.d.ts +0 -0
- /package/lib/{zhin-agent → tool}/web-search-locale-attach.js +0 -0
- /package/lib/{zhin-agent → turn}/deferred-auto-continue.js +0 -0
- /package/lib/{zhin-agent → turn}/deferred-delivery.js +0 -0
- /package/lib/{zhin-agent → turn}/prompt-access.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/prompt-access.js +0 -0
- /package/lib/{zhin-agent → turn}/prompt-input.js +0 -0
- /package/lib/{zhin-agent → turn}/session-message-queue.js +0 -0
- /package/lib/{zhin-agent → turn}/task-continuation.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/task-continuation.js +0 -0
- /package/lib/{zhin-agent → turn}/turn-metrics.js +0 -0
- /package/lib/{zhin-agent → turn}/turn-tracker.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/turn-tracker.js +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContentPart[] → agentLoop UserMessage(ADR 0009 D2:image blocks)
|
|
3
|
+
*/
|
|
4
|
+
import { createUserMessage } from '@zhin.js/ai';
|
|
5
|
+
import { normalizeContentPartsToPayloads } from '../media/media-normalize.js';
|
|
6
|
+
function parseDataUri(dataUri) {
|
|
7
|
+
const m = /^data:([^;]+);base64,(.+)$/i.exec(dataUri.trim());
|
|
8
|
+
if (!m)
|
|
9
|
+
return null;
|
|
10
|
+
return { mime: m[1], base64: m[2] };
|
|
11
|
+
}
|
|
12
|
+
function imageUrlToContent(url) {
|
|
13
|
+
const parsed = parseDataUri(url);
|
|
14
|
+
if (parsed) {
|
|
15
|
+
return { type: 'image', data: parsed.base64, mimeType: parsed.mime };
|
|
16
|
+
}
|
|
17
|
+
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
18
|
+
return { type: 'image', data: url, mimeType: 'image/jpeg' };
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
/** 从 ContentPart 拼会话可见文本(含 [图片] 等占位) */
|
|
23
|
+
export function summarizeMultimodalParts(parts, supportsVision) {
|
|
24
|
+
const fragments = [];
|
|
25
|
+
for (const p of parts) {
|
|
26
|
+
switch (p.type) {
|
|
27
|
+
case 'text':
|
|
28
|
+
fragments.push(p.text);
|
|
29
|
+
break;
|
|
30
|
+
case 'image_url':
|
|
31
|
+
fragments.push('[图片]');
|
|
32
|
+
break;
|
|
33
|
+
case 'video_url':
|
|
34
|
+
fragments.push('[视频]');
|
|
35
|
+
break;
|
|
36
|
+
case 'audio':
|
|
37
|
+
fragments.push('[音频]');
|
|
38
|
+
break;
|
|
39
|
+
case 'face':
|
|
40
|
+
fragments.push(p.face.text || `[表情:${p.face.id}]`);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return fragments.join(' ') || '[多模态消息]';
|
|
45
|
+
}
|
|
46
|
+
/** 构建带 image blocks 的 UserMessage(vision 模型走 agentLoop) */
|
|
47
|
+
export async function buildVisionUserMessage(sessionUserContent, parts, supportsVision, maxFileBytes) {
|
|
48
|
+
const images = [];
|
|
49
|
+
if (supportsVision) {
|
|
50
|
+
const payloads = await normalizeContentPartsToPayloads(parts, maxFileBytes);
|
|
51
|
+
for (const payload of payloads) {
|
|
52
|
+
if (payload.kind === 'image') {
|
|
53
|
+
images.push({
|
|
54
|
+
type: 'image',
|
|
55
|
+
data: payload.base64,
|
|
56
|
+
mimeType: payload.mimeType,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (images.length === 0) {
|
|
61
|
+
for (const p of parts) {
|
|
62
|
+
if (p.type !== 'image_url')
|
|
63
|
+
continue;
|
|
64
|
+
const block = imageUrlToContent(p.image_url.url);
|
|
65
|
+
if (block)
|
|
66
|
+
images.push(block);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return createUserMessage(sessionUserContent, images.length > 0 ? images : undefined);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=multimodal-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multimodal-message.js","sourceRoot":"","sources":["../../src/turn/multimodal-message.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAyD,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAM9E,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,CAAC,GAAG,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE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,IAAI,CAAC;oBACV,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,OAAO,CAAC,MAAM;oBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;iBAC3B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;gBACtB,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW;oBAAE,SAAS;gBACrC,MAAM,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACjD,IAAI,KAAK;oBAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeferredWorkerResult } from '../deferred-worker-runner.js';
|
|
2
|
+
import type { Message } from '../orchestrator/types.js';
|
|
3
|
+
import type { ZhinAgentPrivate } from '../internal/agent-host.js';
|
|
4
|
+
export declare function persistDeferredWorkerResultToContext(agent: ZhinAgentPrivate, commMessage: Message, taskId: string, goal: string, result: DeferredWorkerResult): Promise<boolean>;
|
|
5
|
+
//# sourceMappingURL=persist-deferred-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-deferred-context.d.ts","sourceRoot":"","sources":["../../src/turn/persist-deferred-context.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,wBAAsB,oCAAoC,CACxD,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,OAAO,CAAC,CA0BlB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deferred worker 完成后将结果写入主会话 ContextRepository,
|
|
3
|
+
* 避免下一轮主 Agent 仍只看到 run_deferred_task 的 delegated 占位。
|
|
4
|
+
*/
|
|
5
|
+
import { EMPTY_TOKEN_USAGE, } from '@zhin.js/ai';
|
|
6
|
+
import { resolveAgentTurnSessionKey } from '../collaboration/resolve-agent-session-key.js';
|
|
7
|
+
import { resolveSubagentDisplayLabel } from '../subagent-goal-notify.js';
|
|
8
|
+
import { packageSubagentResult } from '../subagent-artifact.js';
|
|
9
|
+
import { extractDeferredBody } from './deferred-delivery.js';
|
|
10
|
+
export async function persistDeferredWorkerResultToContext(agent, commMessage, taskId, goal, result) {
|
|
11
|
+
const body = extractDeferredBody(result);
|
|
12
|
+
if (!body.trim())
|
|
13
|
+
return false;
|
|
14
|
+
const sessionKey = resolveAgentTurnSessionKey(commMessage);
|
|
15
|
+
const active = await agent.agentSessionStore.findActive(sessionKey);
|
|
16
|
+
const sessionId = active?.session_id;
|
|
17
|
+
if (!sessionId)
|
|
18
|
+
return false;
|
|
19
|
+
const label = resolveSubagentDisplayLabel(undefined, goal);
|
|
20
|
+
const packaged = packageSubagentResult(body, taskId);
|
|
21
|
+
const text = `[Deferred worker 完成 · task:${taskId} · ${label}]\n\n${packaged.text}`;
|
|
22
|
+
const assistantMessage = {
|
|
23
|
+
role: 'assistant',
|
|
24
|
+
content: [{ type: 'text', text }],
|
|
25
|
+
api: 'openai-completions',
|
|
26
|
+
provider: 'deferred-worker',
|
|
27
|
+
model: 'worker',
|
|
28
|
+
usage: EMPTY_TOKEN_USAGE,
|
|
29
|
+
stopReason: 'stop',
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
};
|
|
32
|
+
await agent.contextRepository.appendMessages(sessionId, [assistantMessage]);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=persist-deferred-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-deferred-context.js","sourceRoot":"","sources":["../../src/turn/persist-deferred-context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,iBAAiB,GAElB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,KAAuB,EACvB,WAAoB,EACpB,MAAc,EACd,IAAY,EACZ,MAA4B;IAE5B,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IAE/B,MAAM,UAAU,GAAG,0BAA0B,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,MAAM,EAAE,UAAU,CAAC;IACrC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAE7B,MAAM,KAAK,GAAG,2BAA2B,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,8BAA8B,MAAM,MAAM,KAAK,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEpF,MAAM,gBAAgB,GAAqB;QACzC,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACjC,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,iBAAiB;QAC3B,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,iBAAiB;QACxB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC;IAEF,MAAM,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SubagentCompletePayload } from '../subagent/index.js';
|
|
2
|
+
import type { Message } from '../orchestrator/types.js';
|
|
3
|
+
import type { ZhinAgentPrivate } from '../internal/agent-host.js';
|
|
4
|
+
export declare function persistSubagentResultToContext(agent: ZhinAgentPrivate, commMessage: Message, payload: SubagentCompletePayload): Promise<boolean>;
|
|
5
|
+
//# sourceMappingURL=persist-subagent-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-subagent-context.d.ts","sourceRoot":"","sources":["../../src/turn/persist-subagent-context.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,OAAO,CAAC,CA8BlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persist async subagent result into main session context before auto-continue.
|
|
3
|
+
*/
|
|
4
|
+
import { EMPTY_TOKEN_USAGE, } from '@zhin.js/ai';
|
|
5
|
+
import { resolveAgentTurnSessionKey } from '../collaboration/resolve-agent-session-key.js';
|
|
6
|
+
import { packageSubagentResult } from '../subagent-artifact.js';
|
|
7
|
+
export async function persistSubagentResultToContext(agent, commMessage, payload) {
|
|
8
|
+
const body = payload.result.trim();
|
|
9
|
+
if (!body)
|
|
10
|
+
return false;
|
|
11
|
+
const sessionKey = resolveAgentTurnSessionKey(commMessage);
|
|
12
|
+
const active = await agent.agentSessionStore.findActive(sessionKey);
|
|
13
|
+
const sessionId = active?.session_id;
|
|
14
|
+
if (!sessionId)
|
|
15
|
+
return false;
|
|
16
|
+
const packaged = packageSubagentResult(body, payload.taskId);
|
|
17
|
+
const text = [
|
|
18
|
+
`[Subagent completed · task:${payload.taskId} · ${payload.label}]`,
|
|
19
|
+
`status: ${payload.status}`,
|
|
20
|
+
'',
|
|
21
|
+
packaged.text,
|
|
22
|
+
].join('\n');
|
|
23
|
+
const assistantMessage = {
|
|
24
|
+
role: 'assistant',
|
|
25
|
+
content: [{ type: 'text', text }],
|
|
26
|
+
api: 'openai-completions',
|
|
27
|
+
provider: 'subagent',
|
|
28
|
+
model: payload.agent ?? 'subagent',
|
|
29
|
+
usage: EMPTY_TOKEN_USAGE,
|
|
30
|
+
stopReason: 'stop',
|
|
31
|
+
timestamp: Date.now(),
|
|
32
|
+
};
|
|
33
|
+
await agent.contextRepository.appendMessages(sessionId, [assistantMessage]);
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=persist-subagent-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-subagent-context.js","sourceRoot":"","sources":["../../src/turn/persist-subagent-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,iBAAiB,GAElB,MAAM,aAAa,CAAC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,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Message, Tool } from '../orchestrator/types.js';
|
|
2
|
+
import type { TurnEvent } from '../event/turn-event.js';
|
|
3
|
+
import type { InboundTurnQueue } from '../turn/inbound-turn-queue.js';
|
|
4
|
+
import type { ResolvedInboundQueueConfig } from '../turn/inbound-queue-config.js';
|
|
5
|
+
import type { ZhinAgentPrivate } from '../internal/agent-host.js';
|
|
6
|
+
export declare function processTextTurnStream(agent: ZhinAgentPrivate, opts: {
|
|
7
|
+
content: string;
|
|
8
|
+
commMessage: Message;
|
|
9
|
+
externalTools: Tool[];
|
|
10
|
+
inboundQueueConfig: ResolvedInboundQueueConfig;
|
|
11
|
+
inboundTurnQueue: InboundTurnQueue;
|
|
12
|
+
runInTurnContext: <T>(turnId: string, fn: () => Promise<T>) => Promise<T>;
|
|
13
|
+
}): AsyncGenerator<TurnEvent, void, undefined>;
|
|
14
|
+
//# sourceMappingURL=process-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-stream.d.ts","sourceRoot":"","sources":["../../src/turn/process-stream.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAuB,qBAAqB,CAC1C,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,IAAI,EAAE,CAAC;IACtB,kBAAkB,EAAE,0BAA0B,CAAC;IAC/C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3E,GACA,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CA0D5C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { resolveIMSessionIdFromMessage } from '@zhin.js/core';
|
|
3
|
+
import { runWithInboundQueue } from '../turn/inbound-queue-runtime.js';
|
|
4
|
+
import { processTextTurn } from './turn-pipeline.js';
|
|
5
|
+
export async function* processTextTurnStream(agent, opts) {
|
|
6
|
+
const { content, commMessage, externalTools, inboundQueueConfig, inboundTurnQueue, runInTurnContext } = opts;
|
|
7
|
+
const turnId = randomUUID();
|
|
8
|
+
const sessionId = resolveIMSessionIdFromMessage(commMessage);
|
|
9
|
+
yield { type: 'turn_start', sessionId, turnId };
|
|
10
|
+
const eventQueue = [];
|
|
11
|
+
let resolveWaiting;
|
|
12
|
+
let done = false;
|
|
13
|
+
let sawTurnEnd = false;
|
|
14
|
+
let finalOutput = [];
|
|
15
|
+
let finalError;
|
|
16
|
+
const onTurnEvent = (event) => {
|
|
17
|
+
if (event.type === 'turn_end')
|
|
18
|
+
sawTurnEnd = true;
|
|
19
|
+
eventQueue.push(event);
|
|
20
|
+
resolveWaiting?.();
|
|
21
|
+
};
|
|
22
|
+
const runPromise = runInTurnContext(turnId, () => runWithInboundQueue(commMessage, inboundQueueConfig, inboundTurnQueue, {
|
|
23
|
+
content,
|
|
24
|
+
run: (mergedContent) => processTextTurn(agent, mergedContent, commMessage, externalTools, undefined, { onTurnEvent }),
|
|
25
|
+
})).then((output) => {
|
|
26
|
+
finalOutput = output;
|
|
27
|
+
done = true;
|
|
28
|
+
resolveWaiting?.();
|
|
29
|
+
}).catch((err) => {
|
|
30
|
+
finalError = err instanceof Error ? err : new Error(String(err));
|
|
31
|
+
done = true;
|
|
32
|
+
resolveWaiting?.();
|
|
33
|
+
});
|
|
34
|
+
while (!done || eventQueue.length > 0) {
|
|
35
|
+
if (eventQueue.length > 0) {
|
|
36
|
+
yield eventQueue.shift();
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (!done) {
|
|
40
|
+
await new Promise((resolve) => { resolveWaiting = resolve; });
|
|
41
|
+
resolveWaiting = undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (finalError) {
|
|
45
|
+
yield { type: 'error', error: finalError, recoverable: false };
|
|
46
|
+
}
|
|
47
|
+
else if (!sawTurnEnd) {
|
|
48
|
+
yield {
|
|
49
|
+
type: 'turn_end',
|
|
50
|
+
output: finalOutput,
|
|
51
|
+
usage: { promptTokens: 0, completionTokens: 0, totalTokens: 0 },
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
await runPromise.catch(() => { });
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=process-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-stream.js","sourceRoot":"","sources":["../../src/turn/process-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAM9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,qBAAqB,CAC1C,KAAuB,EACvB,IAOC;IAED,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAC7G,MAAM,MAAM,GA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,EAAE,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,UAAU,CAAC,KAAK,EAAG,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,GAAG,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,cAAc,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IACjE,CAAC;SAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM;YACJ,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE;SAChE,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-access.d.ts","sourceRoot":"","sources":["../../src/turn/prompt-access.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-access.js","sourceRoot":"","sources":["../../src/turn/prompt-access.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentMessage, ImageContent, OutputElement } from '@zhin.js/ai';
|
|
2
|
+
import type { Message } from '../orchestrator/types.js';
|
|
3
|
+
import type { OnChunkCallback } from '../config/index.js';
|
|
4
|
+
import type { PromptController } from '../turn/prompt-controller.js';
|
|
5
|
+
import type { ZhinAgentEventEmitter } from '../event/event-emitter.js';
|
|
6
|
+
import type { ZhinAgentPrivate } from '../internal/agent-host.js';
|
|
7
|
+
export declare function assertMasterForPromptControl(emitter: ZhinAgentEventEmitter, commMessage: Message): void;
|
|
8
|
+
export declare function runPromptTurn(agent: ZhinAgentPrivate, input: string | AgentMessage | AgentMessage[], commMessage: Message, runInTurnContext: <T>(turnId: string, fn: () => Promise<T>) => Promise<T>, options?: {
|
|
9
|
+
images?: ImageContent[];
|
|
10
|
+
onChunk?: OnChunkCallback;
|
|
11
|
+
}): Promise<OutputElement[]>;
|
|
12
|
+
export declare function steerMessage(promptController: PromptController, emitter: ZhinAgentEventEmitter, message: AgentMessage, commMessage: Message): void;
|
|
13
|
+
export declare function followUpMessage(promptController: PromptController, emitter: ZhinAgentEventEmitter, message: AgentMessage, commMessage: Message): void;
|
|
14
|
+
//# sourceMappingURL=prompt-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-api.d.ts","sourceRoot":"","sources":["../../src/turn/prompt-api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAe,MAAM,aAAa,CAAC;AAC1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,OAAO,GACnB,IAAI,CAcN;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,EAAE,EAC7C,WAAW,EAAE,OAAO,EACpB,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACzE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,eAAe,CAAA;CAAE,GAC/D,OAAO,CAAC,aAAa,EAAE,CAAC,CAiB1B;AAED,wBAAgB,YAAY,CAC1B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,OAAO,GACnB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,OAAO,GACnB,IAAI,CAIN"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { resolveIMSessionIdFromMessage } from '@zhin.js/core';
|
|
3
|
+
import { PromptAccessDeniedError } from './prompt-access.js';
|
|
4
|
+
import { resolveToolRequesterRole } from '../security/owner-approve-always-store.js';
|
|
5
|
+
import { normalizePromptMessages } from './prompt-input.js';
|
|
6
|
+
import { processTextTurn } from '../turn/turn-pipeline.js';
|
|
7
|
+
export function assertMasterForPromptControl(emitter, commMessage) {
|
|
8
|
+
const plugin = emitter.getHostPlugin();
|
|
9
|
+
if (!plugin) {
|
|
10
|
+
throw new PromptAccessDeniedError('steer/followUp 需要有效的 master 上下文');
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const role = resolveToolRequesterRole(plugin, commMessage);
|
|
14
|
+
if (role !== 'master') {
|
|
15
|
+
throw new PromptAccessDeniedError('steer/followUp 仅 master 可用');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof PromptAccessDeniedError)
|
|
20
|
+
throw error;
|
|
21
|
+
throw new PromptAccessDeniedError('steer/followUp 需要有效的 master 上下文');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export async function runPromptTurn(agent, input, commMessage, runInTurnContext, options) {
|
|
25
|
+
const messages = normalizePromptMessages(input, options?.images);
|
|
26
|
+
const text = messages
|
|
27
|
+
.flatMap((message) => {
|
|
28
|
+
if (message.role !== 'user')
|
|
29
|
+
return [];
|
|
30
|
+
const user = message;
|
|
31
|
+
return user.content
|
|
32
|
+
.filter((block) => block.type === 'text')
|
|
33
|
+
.map((block) => block.text);
|
|
34
|
+
})
|
|
35
|
+
.join('\n')
|
|
36
|
+
.trim();
|
|
37
|
+
return runInTurnContext(randomUUID(), () => processTextTurn(agent, text, commMessage, [], options?.onChunk, {
|
|
38
|
+
prebuiltMessages: messages,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
export function steerMessage(promptController, emitter, message, commMessage) {
|
|
42
|
+
assertMasterForPromptControl(emitter, commMessage);
|
|
43
|
+
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
44
|
+
promptController.steer(sessionKey, message);
|
|
45
|
+
}
|
|
46
|
+
export function followUpMessage(promptController, emitter, message, commMessage) {
|
|
47
|
+
assertMasterForPromptControl(emitter, commMessage);
|
|
48
|
+
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
49
|
+
promptController.followUp(sessionKey, message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gentEvent, AgentMessage, QueueMode } from '@zhin.js/ai';
|
|
2
|
+
import type { Message } from '../orchestrator/types.js';
|
|
3
|
+
import type { OnChunkCallback } from '../config/index.js';
|
|
4
|
+
import type { AgentLoopTurnResult } from '../core/agent-loop-turn.js';
|
|
5
|
+
export interface PromptTurnHooks {
|
|
6
|
+
getSteeringMessages: () => Promise<AgentMessage[]>;
|
|
7
|
+
getFollowUpMessages: () => Promise<AgentMessage[]>;
|
|
8
|
+
}
|
|
9
|
+
export interface PromptTurnRequest {
|
|
10
|
+
sessionKey: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
userMessages: AgentMessage[];
|
|
13
|
+
commMessage: Message;
|
|
14
|
+
onChunk?: OnChunkCallback;
|
|
15
|
+
execute: (initialMessages: AgentMessage[], hooks: PromptTurnHooks, signal: AbortSignal, turnId: string) => Promise<AgentLoopTurnResult>;
|
|
16
|
+
}
|
|
17
|
+
/** 同 session 新入站消息取代仍在执行的旧 turn 时抛出;调用方应跳过出站回复。 */
|
|
18
|
+
export declare class TurnSupersededError extends Error {
|
|
19
|
+
readonly sessionKey: string;
|
|
20
|
+
constructor(sessionKey: string);
|
|
21
|
+
}
|
|
22
|
+
type PromptSubscriber = (event: AgentEvent, signal: AbortSignal) => void | Promise<void>;
|
|
23
|
+
export declare class PromptController {
|
|
24
|
+
private readonly steeringMode;
|
|
25
|
+
private readonly followUpMode;
|
|
26
|
+
private readonly subscribers;
|
|
27
|
+
private readonly activeTurns;
|
|
28
|
+
private readonly latestTurnBySession;
|
|
29
|
+
private idleWaiters;
|
|
30
|
+
private lastResult;
|
|
31
|
+
constructor(steeringMode: QueueMode, followUpMode: QueueMode);
|
|
32
|
+
isIdle(): boolean;
|
|
33
|
+
isBusy(): boolean;
|
|
34
|
+
getActiveTurnCount(): number;
|
|
35
|
+
getActiveSessionKey(): string | null;
|
|
36
|
+
getActiveContext(): Message | null;
|
|
37
|
+
getLastResult(): AgentLoopTurnResult | null;
|
|
38
|
+
subscribe(listener: PromptSubscriber): () => void;
|
|
39
|
+
waitForIdle(): Promise<void>;
|
|
40
|
+
/** Abort all active turns (optionally scoped to one session). */
|
|
41
|
+
abort(sessionKey?: string): void;
|
|
42
|
+
clearSteeringQueue(sessionKey?: string): void;
|
|
43
|
+
clearFollowUpQueue(sessionKey?: string): void;
|
|
44
|
+
/** Master-only: inject into the latest active turn on this session. */
|
|
45
|
+
steer(sessionKey: string, message: AgentMessage | AgentMessage[]): void;
|
|
46
|
+
/** Master-only: queue continuation on the latest active turn. */
|
|
47
|
+
followUp(sessionKey: string, message: AgentMessage | AgentMessage[]): void;
|
|
48
|
+
/** 同 session 串行:新 turn 开始前 abort 仍在执行的旧 turn,避免过期回复污染群上下文。 */
|
|
49
|
+
schedule(request: PromptTurnRequest): Promise<AgentLoopTurnResult>;
|
|
50
|
+
private resolveLatestTurn;
|
|
51
|
+
private notifyIdle;
|
|
52
|
+
private emitEvent;
|
|
53
|
+
private promoteLatestTurn;
|
|
54
|
+
private demoteLatestTurn;
|
|
55
|
+
private runTurn;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=prompt-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-controller.d.ts","sourceRoot":"","sources":["../../src/turn/prompt-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,MAAM,WAAW,eAAe;IAC9B,mBAAmB,EAAE,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACnD,mBAAmB,EAAE,MAAM,OAAO,CAAC,YA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,IAAI;IAO3C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAOlC,iEAAiE;IACjE,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAOhC,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAO7C,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAO7C,uEAAuE;IACvE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,IAAI;IAQvE,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,IAAI;IAQ1E,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKlE,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,UAAU;YAQJ,SAAS;IAMvB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;YAWV,OAAO;IAoDrB,OAAO,IAAI,IAAI;CAWhB"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { SessionMessageQueue } from './session-message-queue.js';
|
|
3
|
+
/** 同 session 新入站消息取代仍在执行的旧 turn 时抛出;调用方应跳过出站回复。 */
|
|
4
|
+
export class TurnSupersededError extends Error {
|
|
5
|
+
sessionKey;
|
|
6
|
+
constructor(sessionKey) {
|
|
7
|
+
super(`Turn superseded on session ${sessionKey}`);
|
|
8
|
+
this.name = 'TurnSupersededError';
|
|
9
|
+
this.sessionKey = sessionKey;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export class PromptController {
|
|
13
|
+
steeringMode;
|
|
14
|
+
followUpMode;
|
|
15
|
+
subscribers = new Set();
|
|
16
|
+
activeTurns = new Map();
|
|
17
|
+
latestTurnBySession = new Map();
|
|
18
|
+
idleWaiters = [];
|
|
19
|
+
lastResult = null;
|
|
20
|
+
constructor(steeringMode, followUpMode) {
|
|
21
|
+
this.steeringMode = steeringMode;
|
|
22
|
+
this.followUpMode = followUpMode;
|
|
23
|
+
}
|
|
24
|
+
isIdle() {
|
|
25
|
+
return this.activeTurns.size === 0;
|
|
26
|
+
}
|
|
27
|
+
isBusy() {
|
|
28
|
+
return this.activeTurns.size > 0;
|
|
29
|
+
}
|
|
30
|
+
getActiveTurnCount() {
|
|
31
|
+
return this.activeTurns.size;
|
|
32
|
+
}
|
|
33
|
+
getActiveSessionKey() {
|
|
34
|
+
const latest = [...this.latestTurnBySession.entries()].at(-1);
|
|
35
|
+
return latest?.[0] ?? null;
|
|
36
|
+
}
|
|
37
|
+
getActiveContext() {
|
|
38
|
+
const turnId = [...this.latestTurnBySession.values()].at(-1);
|
|
39
|
+
if (!turnId)
|
|
40
|
+
return null;
|
|
41
|
+
return this.activeTurns.get(turnId)?.commMessage ?? null;
|
|
42
|
+
}
|
|
43
|
+
getLastResult() {
|
|
44
|
+
return this.lastResult;
|
|
45
|
+
}
|
|
46
|
+
subscribe(listener) {
|
|
47
|
+
this.subscribers.add(listener);
|
|
48
|
+
return () => {
|
|
49
|
+
this.subscribers.delete(listener);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async waitForIdle() {
|
|
53
|
+
if (this.isIdle())
|
|
54
|
+
return;
|
|
55
|
+
await new Promise((resolve) => {
|
|
56
|
+
this.idleWaiters.push(resolve);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Abort all active turns (optionally scoped to one session). */
|
|
60
|
+
abort(sessionKey) {
|
|
61
|
+
for (const turn of this.activeTurns.values()) {
|
|
62
|
+
if (sessionKey && turn.sessionKey !== sessionKey)
|
|
63
|
+
continue;
|
|
64
|
+
turn.abortController.abort();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
clearSteeringQueue(sessionKey) {
|
|
68
|
+
for (const turn of this.activeTurns.values()) {
|
|
69
|
+
if (sessionKey && turn.sessionKey !== sessionKey)
|
|
70
|
+
continue;
|
|
71
|
+
turn.queue.clearSteering();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
clearFollowUpQueue(sessionKey) {
|
|
75
|
+
for (const turn of this.activeTurns.values()) {
|
|
76
|
+
if (sessionKey && turn.sessionKey !== sessionKey)
|
|
77
|
+
continue;
|
|
78
|
+
turn.queue.clearFollowUp();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Master-only: inject into the latest active turn on this session. */
|
|
82
|
+
steer(sessionKey, message) {
|
|
83
|
+
const turn = this.resolveLatestTurn(sessionKey);
|
|
84
|
+
if (!turn) {
|
|
85
|
+
throw new Error('steer requires an active turn on the same session');
|
|
86
|
+
}
|
|
87
|
+
turn.queue.pushSteering(message);
|
|
88
|
+
}
|
|
89
|
+
/** Master-only: queue continuation on the latest active turn. */
|
|
90
|
+
followUp(sessionKey, message) {
|
|
91
|
+
const turn = this.resolveLatestTurn(sessionKey);
|
|
92
|
+
if (!turn) {
|
|
93
|
+
throw new Error('followUp requires an active turn on the same session');
|
|
94
|
+
}
|
|
95
|
+
turn.queue.pushFollowUp(message);
|
|
96
|
+
}
|
|
97
|
+
/** 同 session 串行:新 turn 开始前 abort 仍在执行的旧 turn,避免过期回复污染群上下文。 */
|
|
98
|
+
schedule(request) {
|
|
99
|
+
this.abort(request.sessionKey);
|
|
100
|
+
return this.runTurn(request);
|
|
101
|
+
}
|
|
102
|
+
resolveLatestTurn(sessionKey) {
|
|
103
|
+
const turnId = this.latestTurnBySession.get(sessionKey);
|
|
104
|
+
if (!turnId)
|
|
105
|
+
return undefined;
|
|
106
|
+
return this.activeTurns.get(turnId);
|
|
107
|
+
}
|
|
108
|
+
notifyIdle() {
|
|
109
|
+
if (!this.isIdle())
|
|
110
|
+
return;
|
|
111
|
+
const waiters = this.idleWaiters.splice(0);
|
|
112
|
+
for (const resolve of waiters) {
|
|
113
|
+
resolve();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async emitEvent(event, signal) {
|
|
117
|
+
for (const listener of this.subscribers) {
|
|
118
|
+
await listener(event, signal);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
promoteLatestTurn(sessionKey, turnId) {
|
|
122
|
+
this.latestTurnBySession.set(sessionKey, turnId);
|
|
123
|
+
}
|
|
124
|
+
demoteLatestTurn(sessionKey, turnId) {
|
|
125
|
+
if (this.latestTurnBySession.get(sessionKey) !== turnId)
|
|
126
|
+
return;
|
|
127
|
+
this.latestTurnBySession.delete(sessionKey);
|
|
128
|
+
for (const [id, turn] of this.activeTurns) {
|
|
129
|
+
if (turn.sessionKey === sessionKey) {
|
|
130
|
+
this.latestTurnBySession.set(sessionKey, id);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async runTurn(request) {
|
|
136
|
+
const turnId = randomUUID();
|
|
137
|
+
const abortController = new AbortController();
|
|
138
|
+
const signal = abortController.signal;
|
|
139
|
+
const queue = new SessionMessageQueue(this.steeringMode, this.followUpMode);
|
|
140
|
+
const activeTurn = {
|
|
141
|
+
turnId,
|
|
142
|
+
sessionKey: request.sessionKey,
|
|
143
|
+
commMessage: request.commMessage,
|
|
144
|
+
queue,
|
|
145
|
+
abortController,
|
|
146
|
+
};
|
|
147
|
+
this.activeTurns.set(turnId, activeTurn);
|
|
148
|
+
this.promoteLatestTurn(request.sessionKey, turnId);
|
|
149
|
+
let lastResult = null;
|
|
150
|
+
try {
|
|
151
|
+
await this.emitEvent({ type: 'agent_start' }, signal);
|
|
152
|
+
const hooks = {
|
|
153
|
+
getSteeringMessages: async () => queue.drainSteering(),
|
|
154
|
+
getFollowUpMessages: async () => queue.drainFollowUp(),
|
|
155
|
+
};
|
|
156
|
+
lastResult = await request.execute(request.userMessages, hooks, signal, turnId);
|
|
157
|
+
while (queue.hasFollowUp() && !signal.aborted) {
|
|
158
|
+
const batch = queue.drainFollowUp();
|
|
159
|
+
lastResult = await request.execute(batch, hooks, signal, turnId);
|
|
160
|
+
}
|
|
161
|
+
if (signal.aborted) {
|
|
162
|
+
throw new TurnSupersededError(request.sessionKey);
|
|
163
|
+
}
|
|
164
|
+
await this.emitEvent({ type: 'agent_end', messages: request.userMessages }, signal);
|
|
165
|
+
if (!lastResult) {
|
|
166
|
+
throw new Error('Prompt turn produced no result');
|
|
167
|
+
}
|
|
168
|
+
this.lastResult = lastResult;
|
|
169
|
+
return lastResult;
|
|
170
|
+
}
|
|
171
|
+
finally {
|
|
172
|
+
this.activeTurns.delete(turnId);
|
|
173
|
+
this.demoteLatestTurn(request.sessionKey, turnId);
|
|
174
|
+
this.notifyIdle();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
dispose() {
|
|
178
|
+
for (const turn of this.activeTurns.values()) {
|
|
179
|
+
turn.abortController.abort();
|
|
180
|
+
}
|
|
181
|
+
this.activeTurns.clear();
|
|
182
|
+
this.latestTurnBySession.clear();
|
|
183
|
+
this.subscribers.clear();
|
|
184
|
+
const waiters = this.idleWaiters.splice(0);
|
|
185
|
+
for (const resolve of waiters)
|
|
186
|
+
resolve();
|
|
187
|
+
this.lastResult = null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=prompt-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-controller.js","sourceRoot":"","sources":["../../src/turn/prompt-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAqBjE,mDAAmD;AACnD,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,UAAU,CAAS;IAE5B,YAAY,UAAkB;QAC5B,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,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AAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3C,KAAK,MAAM,OAAO,IAAI,OAAO;YAAE,OAAO,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../src/turn/prompt-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAqB,MAAM,aAAa,CAAC;AACtF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,EAAE,EAC7C,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,YAAY,EAAE,CAKhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-input.js","sourceRoot":"","sources":["../../src/turn/prompt-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtF,MAAM,UAAU,uBAAuB,CACrC,KAA6C,EAC7C,MAAuB;IAEvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC"}
|