@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
package/lib/zhin-agent/index.js
CHANGED
|
@@ -1,64 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ZhinAgent —
|
|
3
|
-
*
|
|
4
|
-
* 核心能力:
|
|
5
|
-
* 1. 全局单例,应用生命周期内常驻
|
|
6
|
-
* 2. Skill 感知:两级过滤 Skill → Tool
|
|
7
|
-
* 3. 双层记忆:per-scene(对话上下文)+ per-user(长期偏好)
|
|
8
|
-
* 4. 任务规划:复杂请求自动分解为子步骤
|
|
9
|
-
* 5. 多模态输出:结构化 OutputElement[]
|
|
10
|
-
* 6. 智能路径选择:纯闲聊走轻量路径,工具请求走完整路径
|
|
11
|
-
* 7. 用户画像:跨会话个性化记忆
|
|
12
|
-
* 8. 速率限制:防止单用户过度消耗资源
|
|
13
|
-
* 9. 流式输出:onChunk 回调实时推送部分文本
|
|
14
|
-
* 10. 情绪感知:根据用户语气调整回复风格
|
|
15
|
-
* 11. 定时任务:cron_add 持久化定时任务
|
|
16
|
-
* 12. 多模态输入:图片/音频直接传给视觉模型
|
|
2
|
+
* ZhinAgent — IM Agent 门面类(组合 ideal 模块;实现见 init/ + internal/)。
|
|
17
3
|
*/
|
|
18
4
|
import { randomUUID } from 'node:crypto';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { ConversationMemory, createMemoryContextRepository,
|
|
22
|
-
import {
|
|
23
|
-
import { ZhinAgentEventEmitter } from '
|
|
5
|
+
import { resolveIMSessionIdFromMessage } from '@zhin.js/core';
|
|
6
|
+
import { Logger } from '@zhin.js/logger';
|
|
7
|
+
import { MemoryIMSessionStore, ConversationMemory, createMemoryContextRepository, MemoryImTranscriptStore, RateLimiter, } from '@zhin.js/ai';
|
|
8
|
+
import { createMemorySystemForHost } from '../memory/memory-system.js';
|
|
9
|
+
import { ZhinAgentEventEmitter } from '../event/event-emitter.js';
|
|
24
10
|
import { UserProfileStore } from '../user-profile.js';
|
|
25
|
-
import { RateLimiter } from '@zhin.js/ai';
|
|
26
|
-
import { SubagentManager } from '../subagent.js';
|
|
27
11
|
import { buildParentContextPreamble } from '../subagent-parent-context.js';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export
|
|
12
|
+
import { DEFAULT_CONFIG, isPhaseTraceEnabled, isPromptTraceEnabled, isPromptTraceVerbose, } from '../config/index.js';
|
|
13
|
+
import { processTextTurn, processMultimodalTurn } from '../turn/turn-pipeline.js';
|
|
14
|
+
import { resolveContextTailMessageLimit } from '../context/context-tail-limit.js';
|
|
15
|
+
import { archiveSessionByKey } from '../session/session-io.js';
|
|
16
|
+
import { asPrivate } from '../internal/as-private.js';
|
|
17
|
+
import { PromptController } from '../turn/prompt-controller.js';
|
|
18
|
+
import { getActiveTurnTracker } from '../internal/turn-context.js';
|
|
19
|
+
import { computeDeferredDelta } from '../turn/turn-deferred-delta.js';
|
|
20
|
+
import { resolveDeferredToolsConfig } from '../tool-catalog/resolve-config.js';
|
|
21
|
+
import { buildDisciplinedPrompt as assembleDisciplinedPrompt } from '../prompt/assembly.js';
|
|
22
|
+
import { createInboundTurnQueue, runWithInboundQueue } from '../turn/inbound-queue-runtime.js';
|
|
23
|
+
import { continueAfterDeferredWorker, continueAfterSubagent } from '../turn/auto-continue.js';
|
|
24
|
+
import { createSubagentSystem } from '../subagent/subagent-system-init.js';
|
|
25
|
+
import { processTextTurnStream } from '../turn/process-stream.js';
|
|
26
|
+
import { followUpMessage, runPromptTurn, steerMessage } from '../turn/prompt-api.js';
|
|
27
|
+
import { appendActiveSkills, getTurnActiveSkills, initInboundTurnContext as bridgeInitInboundTurnContext, initScheduleTurnContext as bridgeInitScheduleTurnContext, runInTurnContext as bridgeRunInTurnContext, } from '../turn/turn-context-bridge.js';
|
|
28
|
+
import { emitSessionCompactEvent, emitSessionNewEvent } from '../event/session-events.js';
|
|
29
|
+
import { applyZhinAgentConfigure, wireZhinAgentLlmApiLayer } from '../init/configure-zhin-agent.js';
|
|
30
|
+
import { disposeZhinAgentResources } from '../init/dispose-zhin-agent.js';
|
|
31
|
+
import { clearZhinAgentRuntimeModules, createZhinAgentRuntimeModules, } from './runtime-modules.js';
|
|
32
|
+
export { PromptAccessDeniedError } from '../turn/prompt-access.js';
|
|
33
|
+
export { formatAiHandlerCompleteLog, formatZhinAgentTurnUsage } from '../turn/turn-metrics.js';
|
|
34
|
+
export * from '../prompt/prompt-builder.js';
|
|
35
|
+
export * from '../prompt/templates.js';
|
|
36
|
+
export * from '../turn/task-continuation.js';
|
|
49
37
|
const logger = new Logger(null, 'ZhinAgent');
|
|
50
|
-
// ============================================================================
|
|
51
|
-
// ZhinAgent
|
|
52
|
-
// ============================================================================
|
|
53
|
-
import { PromptAccessDeniedError } from './prompt-access.js';
|
|
54
38
|
export class ZhinAgent {
|
|
55
39
|
provider;
|
|
56
40
|
providerResolver = null;
|
|
57
41
|
activeBinding = null;
|
|
58
42
|
config;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
sessions;
|
|
43
|
+
/** ideal 模块槽位;经 getter/setter 供 configure 与 asPrivate(host) 读写 */
|
|
44
|
+
runtimeModules;
|
|
62
45
|
imSessionStore = new MemoryIMSessionStore();
|
|
63
46
|
agentSessionStore;
|
|
64
47
|
contextRepository;
|
|
@@ -67,9 +50,9 @@ export class ZhinAgent {
|
|
|
67
50
|
externalTools = new Map();
|
|
68
51
|
userProfiles;
|
|
69
52
|
rateLimiter;
|
|
70
|
-
|
|
53
|
+
subagentSystem = null;
|
|
71
54
|
bootstrapContext = '';
|
|
72
|
-
|
|
55
|
+
alwaysSkillsBaseline = '';
|
|
73
56
|
skillsSummaryXML = '';
|
|
74
57
|
modelRegistry = null;
|
|
75
58
|
phaseTraceEnabled;
|
|
@@ -77,7 +60,6 @@ export class ZhinAgent {
|
|
|
77
60
|
promptTraceVerbose;
|
|
78
61
|
emitter = new ZhinAgentEventEmitter();
|
|
79
62
|
deferredCatalog = [];
|
|
80
|
-
deferredWorkerRunner = new DeferredWorkerRunner();
|
|
81
63
|
lastToolSearchDeferredStats;
|
|
82
64
|
promptController;
|
|
83
65
|
deferredResultSender = null;
|
|
@@ -86,6 +68,29 @@ export class ZhinAgent {
|
|
|
86
68
|
memoryPersistenceReady;
|
|
87
69
|
resolveMemoryPersistenceReady;
|
|
88
70
|
memoryPersistenceDone = false;
|
|
71
|
+
inboundQueueConfig;
|
|
72
|
+
inboundTurnQueue;
|
|
73
|
+
turnContextState = {
|
|
74
|
+
alwaysSkillsBaseline: '',
|
|
75
|
+
};
|
|
76
|
+
get skillRegistry() { return this.runtimeModules.skillRegistry; }
|
|
77
|
+
set skillRegistry(value) { this.runtimeModules.skillRegistry = value; }
|
|
78
|
+
get skillSystem() { return this.runtimeModules.skillSystem; }
|
|
79
|
+
set skillSystem(value) { this.runtimeModules.skillSystem = value; }
|
|
80
|
+
get orchestrator() { return this.runtimeModules.orchestrator; }
|
|
81
|
+
set orchestrator(value) { this.runtimeModules.orchestrator = value; }
|
|
82
|
+
get agentCore() { return this.runtimeModules.agentCore; }
|
|
83
|
+
set agentCore(value) { this.runtimeModules.agentCore = value; }
|
|
84
|
+
get toolSystem() { return this.runtimeModules.toolSystem; }
|
|
85
|
+
set toolSystem(value) { this.runtimeModules.toolSystem = value; }
|
|
86
|
+
get contextSystem() { return this.runtimeModules.contextSystem; }
|
|
87
|
+
set contextSystem(value) { this.runtimeModules.contextSystem = value; }
|
|
88
|
+
get memorySystem() { return this.runtimeModules.memorySystem; }
|
|
89
|
+
set memorySystem(value) { this.runtimeModules.memorySystem = value; }
|
|
90
|
+
get sessionSystem() { return this.runtimeModules.sessionSystem; }
|
|
91
|
+
set sessionSystem(value) { this.runtimeModules.sessionSystem = value; }
|
|
92
|
+
get eventSystem() { return this.runtimeModules.eventSystem; }
|
|
93
|
+
set eventSystem(value) { this.runtimeModules.eventSystem = value; }
|
|
89
94
|
get phaseConfig() {
|
|
90
95
|
return { phaseTraceEnabled: this.phaseTraceEnabled, onPhaseTrace: this.config.onPhaseTrace };
|
|
91
96
|
}
|
|
@@ -95,16 +100,27 @@ export class ZhinAgent {
|
|
|
95
100
|
promptTraceVerbose: this.promptTraceVerbose,
|
|
96
101
|
};
|
|
97
102
|
}
|
|
103
|
+
get autoContinueHost() {
|
|
104
|
+
return {
|
|
105
|
+
config: this.config,
|
|
106
|
+
promptController: this.promptController,
|
|
107
|
+
getDeferredAutoContinueDepth: (k) => this.getDeferredAutoContinueDepth(k),
|
|
108
|
+
setDeferredAutoContinueDepth: (k, d) => this.deferredAutoContinueDepthBySession.set(k, d),
|
|
109
|
+
resetDeferredAutoContinueDepth: (k) => this.resetDeferredAutoContinueDepth(k),
|
|
110
|
+
getDeferredResultSender: () => this.getDeferredResultSender(),
|
|
111
|
+
runInTurnContext: (turnId, fn) => this.runInTurnContext(turnId, fn),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
98
114
|
constructor(provider, config) {
|
|
99
115
|
this.provider = provider;
|
|
100
|
-
|
|
116
|
+
const merged = { ...DEFAULT_CONFIG, ...config };
|
|
117
|
+
this.config = merged;
|
|
101
118
|
this.phaseTraceEnabled = isPhaseTraceEnabled(this.config);
|
|
102
119
|
this.promptTraceEnabled = isPromptTraceEnabled(this.config);
|
|
103
120
|
this.promptTraceVerbose = isPromptTraceVerbose(this.config);
|
|
104
121
|
this.memoryPersistenceReady = new Promise((resolve) => {
|
|
105
122
|
this.resolveMemoryPersistenceReady = resolve;
|
|
106
123
|
});
|
|
107
|
-
this.sessions = createMemorySessionManager();
|
|
108
124
|
this.memory = new ConversationMemory({
|
|
109
125
|
minTopicRounds: this.config.minTopicRounds,
|
|
110
126
|
slidingWindowSize: this.config.slidingWindowSize,
|
|
@@ -115,96 +131,46 @@ export class ZhinAgent {
|
|
|
115
131
|
this.userProfiles = new UserProfileStore();
|
|
116
132
|
this.rateLimiter = new RateLimiter(this.config.rateLimit);
|
|
117
133
|
this.promptController = new PromptController(this.config.steeringMode, this.config.followUpMode);
|
|
134
|
+
const inbound = createInboundTurnQueue(this.config, this.emitter);
|
|
135
|
+
this.inboundQueueConfig = inbound.config;
|
|
136
|
+
this.inboundTurnQueue = inbound.queue;
|
|
118
137
|
const memoryStack = createMemoryContextRepository({
|
|
119
|
-
tailMessageLimit: this.config
|
|
138
|
+
tailMessageLimit: resolveContextTailMessageLimit(this.config),
|
|
120
139
|
});
|
|
121
140
|
this.agentSessionStore = memoryStack.sessionStore;
|
|
122
141
|
this.contextRepository = memoryStack.repository;
|
|
123
142
|
this.imTranscriptStore = new MemoryImTranscriptStore();
|
|
143
|
+
this.turnContextState.alwaysSkillsBaseline = this.alwaysSkillsBaseline;
|
|
144
|
+
this.runtimeModules = createZhinAgentRuntimeModules(asPrivate(this));
|
|
124
145
|
this.wireLlmApiLayer();
|
|
125
|
-
// DB 注入完成前由 waitForMemoryPersistence 等待;useDatabase:false 时由 bootstrap 立即 mark
|
|
126
146
|
}
|
|
127
|
-
// ── DI setters ──────────────────────────────────────────────────────
|
|
128
|
-
/**
|
|
129
|
-
* 统一依赖注入入口。替代逐字段 setter。
|
|
130
|
-
* 所有 setter 现委托到此方法;新代码优先使用 configure()。
|
|
131
|
-
*/
|
|
132
147
|
configure(deps) {
|
|
133
|
-
|
|
134
|
-
this.skillRegistry = deps.skillRegistry;
|
|
135
|
-
logger.debug(`SkillRegistry connected (${deps.skillRegistry.size} skills)`);
|
|
136
|
-
}
|
|
137
|
-
if (deps.orchestrator !== undefined) {
|
|
138
|
-
this.orchestrator = deps.orchestrator;
|
|
139
|
-
logger.debug('AgentOrchestrator connected for MCP and resources');
|
|
140
|
-
}
|
|
141
|
-
if (deps.sessionManager !== undefined) {
|
|
142
|
-
this.sessions.dispose();
|
|
143
|
-
this.sessions = deps.sessionManager;
|
|
144
|
-
}
|
|
145
|
-
if (deps.imSessionStore !== undefined)
|
|
146
|
-
this.imSessionStore = deps.imSessionStore;
|
|
147
|
-
if (deps.agentSessionStore !== undefined)
|
|
148
|
-
this.agentSessionStore = deps.agentSessionStore;
|
|
149
|
-
if (deps.contextRepository !== undefined)
|
|
150
|
-
this.contextRepository = deps.contextRepository;
|
|
151
|
-
if (deps.imTranscriptStore !== undefined)
|
|
152
|
-
this.imTranscriptStore = deps.imTranscriptStore;
|
|
153
|
-
if (deps.modelRegistry !== undefined) {
|
|
154
|
-
this.modelRegistry = deps.modelRegistry;
|
|
155
|
-
this.subagentManager?.setModelRegistry(deps.modelRegistry);
|
|
156
|
-
}
|
|
157
|
-
if (deps.hostPlugin !== undefined)
|
|
158
|
-
this.emitter.setHostPlugin(deps.hostPlugin);
|
|
159
|
-
if (deps.providerResolver !== undefined) {
|
|
160
|
-
this.providerResolver = deps.providerResolver;
|
|
161
|
-
this.wireLlmApiLayer();
|
|
162
|
-
}
|
|
163
|
-
if (deps.activeBinding !== undefined) {
|
|
164
|
-
this.activeBinding = deps.activeBinding;
|
|
165
|
-
if (deps.activeBinding) {
|
|
166
|
-
const patch = bindingToModelConfig(deps.activeBinding);
|
|
167
|
-
this.config = { ...this.config, ...patch };
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (deps.subagentSender !== undefined) {
|
|
171
|
-
this.subagentManager?.setSender(deps.subagentSender);
|
|
172
|
-
}
|
|
173
|
-
if (deps.deferredResultSender !== undefined)
|
|
174
|
-
this.deferredResultSender = deps.deferredResultSender;
|
|
175
|
-
if (deps.bootstrapContext !== undefined) {
|
|
176
|
-
this.bootstrapContext = deps.bootstrapContext;
|
|
177
|
-
logger.debug(`Bootstrap context set (${deps.bootstrapContext.length} chars)`);
|
|
178
|
-
}
|
|
179
|
-
if (deps.activeSkillsContext !== undefined)
|
|
180
|
-
this.activeSkillsContext = deps.activeSkillsContext || '';
|
|
181
|
-
if (deps.skillsSummaryXML !== undefined)
|
|
182
|
-
this.skillsSummaryXML = deps.skillsSummaryXML || '';
|
|
183
|
-
}
|
|
184
|
-
/** @deprecated 使用 configure({ skillRegistry }) */
|
|
185
|
-
setSkillRegistry(registry) { this.configure({ skillRegistry: registry }); }
|
|
186
|
-
/** @deprecated 使用 configure({ orchestrator }) */
|
|
187
|
-
setOrchestrator(orchestrator) { this.configure({ orchestrator }); }
|
|
188
|
-
/** @deprecated 使用 configure({ modelRegistry }) */
|
|
189
|
-
setModelRegistry(registry) { this.configure({ modelRegistry: registry }); }
|
|
190
|
-
/** @deprecated 使用 configure({ hostPlugin }) */
|
|
191
|
-
setHostPlugin(plugin) { this.configure({ hostPlugin: plugin }); }
|
|
192
|
-
/** @deprecated 使用 configure({ providerResolver }) */
|
|
193
|
-
setProviderResolver(resolver) { this.configure({ providerResolver: resolver }); }
|
|
194
|
-
wireLlmApiLayer() {
|
|
195
|
-
registerLlmApiFromProviders([sdkEntryFromProvider(this.provider)], (alias) => {
|
|
196
|
-
const p = alias === this.provider.name ? this.provider : this.providerResolver?.(alias);
|
|
197
|
-
return p?.models ?? [];
|
|
198
|
-
});
|
|
148
|
+
applyZhinAgentConfigure(this, deps);
|
|
199
149
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
150
|
+
getTurnActiveSkills() {
|
|
151
|
+
return getTurnActiveSkills(this.turnContextState);
|
|
152
|
+
}
|
|
153
|
+
/** @deprecated 使用 getTurnActiveSkills() */
|
|
154
|
+
get activeSkillsContext() {
|
|
155
|
+
return this.getTurnActiveSkills();
|
|
156
|
+
}
|
|
157
|
+
getAlwaysSkillsBaseline() {
|
|
158
|
+
return this.alwaysSkillsBaseline;
|
|
159
|
+
}
|
|
160
|
+
initScheduleTurnContext(ctx) {
|
|
161
|
+
bridgeInitScheduleTurnContext(this.turnContextState, ctx);
|
|
162
|
+
}
|
|
163
|
+
initInboundTurnContext() {
|
|
164
|
+
bridgeInitInboundTurnContext(this.turnContextState);
|
|
165
|
+
}
|
|
166
|
+
appendActiveSkillsContext(fragment) {
|
|
167
|
+
appendActiveSkills(fragment);
|
|
168
|
+
}
|
|
169
|
+
buildDisciplinedPrompt(basePrompt) {
|
|
170
|
+
return assembleDisciplinedPrompt(asPrivate(this), basePrompt);
|
|
171
|
+
}
|
|
172
|
+
wireLlmApiLayer() {
|
|
173
|
+
wireZhinAgentLlmApiLayer(this.provider, this.providerResolver);
|
|
208
174
|
}
|
|
209
175
|
getActiveBinding() {
|
|
210
176
|
return this.activeBinding;
|
|
@@ -221,11 +187,6 @@ export class ZhinAgent {
|
|
|
221
187
|
}
|
|
222
188
|
return this.provider;
|
|
223
189
|
}
|
|
224
|
-
/** @deprecated 消息事实源已迁至 im_transcripts / agent_messages,保留空实现以兼容旧 bootstrap */
|
|
225
|
-
async upgradeMemoryToDatabase(_msgModel, _sumModel) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
/** 等待 DB store 注入(bootstrap 会 mark;已 mark 时立即返回) */
|
|
229
190
|
async waitForMemoryPersistence() {
|
|
230
191
|
if (this.memoryPersistenceDone)
|
|
231
192
|
return;
|
|
@@ -249,55 +210,30 @@ export class ZhinAgent {
|
|
|
249
210
|
this.memoryPersistenceDone = true;
|
|
250
211
|
this.resolveMemoryPersistenceReady?.();
|
|
251
212
|
}
|
|
213
|
+
sharePersistenceWith(target) {
|
|
214
|
+
target.configure({
|
|
215
|
+
imSessionStore: this.imSessionStore,
|
|
216
|
+
agentSessionStore: this.agentSessionStore,
|
|
217
|
+
contextRepository: this.contextRepository,
|
|
218
|
+
imTranscriptStore: this.imTranscriptStore,
|
|
219
|
+
});
|
|
220
|
+
if (this.memoryPersistenceDone) {
|
|
221
|
+
target.markMemoryPersistenceReady();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
252
224
|
upgradeProfilesToDatabase(model) {
|
|
253
225
|
this.userProfiles.upgradeToDatabase(model);
|
|
254
226
|
}
|
|
255
|
-
|
|
256
|
-
this.
|
|
227
|
+
initSubagentSystem(createTools) {
|
|
228
|
+
this.subagentSystem = createSubagentSystem({
|
|
257
229
|
provider: this.provider,
|
|
258
|
-
|
|
259
|
-
createTools,
|
|
260
|
-
subagentTools: this.config.subagentTools,
|
|
261
|
-
maxIterations: this.config.maxSubagentIterations,
|
|
262
|
-
execPolicyConfig: this.config,
|
|
230
|
+
config: this.config,
|
|
263
231
|
modelRegistry: this.modelRegistry,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
eventEmitter: this.emitter,
|
|
268
|
-
onEvent: (event) => {
|
|
269
|
-
const sessionId = resolveIMSessionIdFromMessage(event.origin.message);
|
|
270
|
-
const payload = this.emitter.createPayload(sessionId, event.origin.message, 'text', {
|
|
271
|
-
source: 'subagent',
|
|
272
|
-
path: 'agent',
|
|
273
|
-
taskId: event.taskId,
|
|
274
|
-
label: event.label,
|
|
275
|
-
content: event.task,
|
|
276
|
-
status: event.status,
|
|
277
|
-
error: event.error,
|
|
278
|
-
reply: event.result,
|
|
279
|
-
agentId: event.agent,
|
|
280
|
-
hookContext: {
|
|
281
|
-
subagentAgent: event.agent,
|
|
282
|
-
},
|
|
283
|
-
});
|
|
284
|
-
if (event.phase === 'spawn') {
|
|
285
|
-
this.emitter.emit('ai.subagent.spawn', payload);
|
|
286
|
-
}
|
|
287
|
-
else if (event.phase === 'start') {
|
|
288
|
-
this.emitter.emit('ai.subagent.start', payload);
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
this.emitter.emit('ai.subagent.finish', payload);
|
|
292
|
-
}
|
|
293
|
-
},
|
|
232
|
+
emitter: this.emitter,
|
|
233
|
+
createTools,
|
|
234
|
+
onSubagentComplete: (payload) => this.continueAfterSubagent(payload),
|
|
294
235
|
});
|
|
295
|
-
logger.debug('SubagentManager initialized');
|
|
296
236
|
}
|
|
297
|
-
/** @deprecated 使用 configure({ subagentSender }) */
|
|
298
|
-
setSubagentSender(sender) { this.configure({ subagentSender: sender }); }
|
|
299
|
-
/** @deprecated 使用 configure({ deferredResultSender }) */
|
|
300
|
-
setDeferredResultSender(sender) { this.configure({ deferredResultSender: sender }); }
|
|
301
237
|
getDeferredResultSender() {
|
|
302
238
|
return this.deferredResultSender;
|
|
303
239
|
}
|
|
@@ -308,42 +244,20 @@ export class ZhinAgent {
|
|
|
308
244
|
this.deferredAutoContinueDepthBySession.delete(sessionKey);
|
|
309
245
|
}
|
|
310
246
|
async continueAfterDeferredWorker(commMessage, taskId, goal, result) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
logger.info(formatCompact({
|
|
316
|
-
deferred: 'auto_continue',
|
|
317
|
-
task_id: taskId,
|
|
318
|
-
depth: depth + 1,
|
|
319
|
-
}));
|
|
320
|
-
const message = buildDeferredAutoContinueUserMessage(taskId, goal, result.status);
|
|
321
|
-
const elements = await this.runInTurnContext(randomUUID(), () => processTextTurn(asPrivate(this), '', commMessage, [], undefined, {
|
|
322
|
-
prebuiltMessages: [message],
|
|
323
|
-
deferredAutoContinue: true,
|
|
324
|
-
}));
|
|
325
|
-
const sender = this.getDeferredResultSender();
|
|
326
|
-
if (sender && elements.length > 0) {
|
|
327
|
-
await deliverDeferredAutoContinueReply(sender, commMessage, elements);
|
|
328
|
-
}
|
|
329
|
-
logger.info(formatCompact({
|
|
330
|
-
deferred: 'auto_continue_done',
|
|
331
|
-
task_id: taskId,
|
|
332
|
-
depth: depth + 1,
|
|
333
|
-
outbound: elements.length,
|
|
334
|
-
}));
|
|
247
|
+
return continueAfterDeferredWorker(this.autoContinueHost, asPrivate(this), commMessage, taskId, goal, result);
|
|
248
|
+
}
|
|
249
|
+
async continueAfterSubagent(payload) {
|
|
250
|
+
return continueAfterSubagent(this.autoContinueHost, asPrivate(this), payload);
|
|
335
251
|
}
|
|
336
252
|
getActiveTurnTracker() {
|
|
337
253
|
return getActiveTurnTracker();
|
|
338
254
|
}
|
|
339
255
|
runInTurnContext(turnId, fn) {
|
|
340
|
-
|
|
341
|
-
return runInTurnContextAls(turnId, tracker, fn);
|
|
256
|
+
return bridgeRunInTurnContext(this.turnContextState, this.config, turnId, fn);
|
|
342
257
|
}
|
|
343
|
-
|
|
344
|
-
return this.
|
|
258
|
+
getSubagentSystem() {
|
|
259
|
+
return this.subagentSystem;
|
|
345
260
|
}
|
|
346
|
-
/** fork 模式:主会话 active_leaf 链快照(不含 spawn_task / tool_search 编排噪声) */
|
|
347
261
|
async buildParentContextSnapshotForSubagent(origin) {
|
|
348
262
|
const sessionKey = resolveIMSessionIdFromMessage(origin.message);
|
|
349
263
|
const active = await this.agentSessionStore.findActive(sessionKey);
|
|
@@ -366,11 +280,14 @@ export class ZhinAgent {
|
|
|
366
280
|
getLastTurnMetrics() {
|
|
367
281
|
return this.lastTurnMetrics;
|
|
368
282
|
}
|
|
283
|
+
getLastTurnToolSnapshot() {
|
|
284
|
+
const priv = asPrivate(this);
|
|
285
|
+
const snap = priv.lastDeferredSessionSnapshot ?? { loadedTools: {}, loadedSkills: [] };
|
|
286
|
+
const deferredCfg = resolveDeferredToolsConfig(this.config);
|
|
287
|
+
return computeDeferredDelta(snap, deferredCfg.alwaysLoadedTools, priv.lastDeferredSnapshotBefore);
|
|
288
|
+
}
|
|
369
289
|
beginActiveTurn() {
|
|
370
|
-
|
|
371
|
-
if (!tracker)
|
|
372
|
-
return;
|
|
373
|
-
tracker.begin();
|
|
290
|
+
getActiveTurnTracker()?.begin();
|
|
374
291
|
}
|
|
375
292
|
async finalizeActiveTurn(partial) {
|
|
376
293
|
const tracker = getActiveTurnTracker();
|
|
@@ -380,39 +297,10 @@ export class ZhinAgent {
|
|
|
380
297
|
this.lastTurnMetrics = tracker.lastMetrics;
|
|
381
298
|
}
|
|
382
299
|
emitSessionNewEvent(sessionId, commMessage, mode, content, reply) {
|
|
383
|
-
this.emitter
|
|
384
|
-
reason: 'first_message',
|
|
385
|
-
content,
|
|
386
|
-
reply,
|
|
387
|
-
}));
|
|
300
|
+
emitSessionNewEvent(this.emitter, sessionId, commMessage, mode, content, reply);
|
|
388
301
|
}
|
|
389
302
|
emitSessionCompactEvent(sessionId, commMessage, mode, info) {
|
|
390
|
-
this.emitter
|
|
391
|
-
path: 'agent',
|
|
392
|
-
compactedCount: 1,
|
|
393
|
-
savedTokens: info.microSavedTokens + info.autoSavedTokens,
|
|
394
|
-
totalTokensBefore: info.totalTokensBefore,
|
|
395
|
-
totalTokensAfter: info.totalTokensAfter,
|
|
396
|
-
result: info,
|
|
397
|
-
}));
|
|
398
|
-
}
|
|
399
|
-
// ── prompt() / steer / followUp (ADR 0009 D6) ─────────────────────
|
|
400
|
-
assertMasterForPromptControl(commMessage) {
|
|
401
|
-
const plugin = this.emitter.getHostPlugin();
|
|
402
|
-
if (!plugin) {
|
|
403
|
-
throw new PromptAccessDeniedError('steer/followUp 需要有效的 master 上下文');
|
|
404
|
-
}
|
|
405
|
-
try {
|
|
406
|
-
const role = resolveToolRequesterRole(plugin, commMessage);
|
|
407
|
-
if (role !== 'master') {
|
|
408
|
-
throw new PromptAccessDeniedError('steer/followUp 仅 master 可用');
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
catch (error) {
|
|
412
|
-
if (error instanceof PromptAccessDeniedError)
|
|
413
|
-
throw error;
|
|
414
|
-
throw new PromptAccessDeniedError('steer/followUp 需要有效的 master 上下文');
|
|
415
|
-
}
|
|
303
|
+
emitSessionCompactEvent(this.emitter, sessionId, commMessage, mode, info);
|
|
416
304
|
}
|
|
417
305
|
subscribe(listener) {
|
|
418
306
|
return this.promptController.subscribe(listener);
|
|
@@ -433,42 +321,17 @@ export class ZhinAgent {
|
|
|
433
321
|
this.promptController.clearFollowUpQueue(sessionKey);
|
|
434
322
|
}
|
|
435
323
|
steer(message, commMessage) {
|
|
436
|
-
this.
|
|
437
|
-
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
438
|
-
this.promptController.steer(sessionKey, message);
|
|
324
|
+
steerMessage(this.promptController, this.emitter, message, commMessage);
|
|
439
325
|
}
|
|
440
326
|
followUp(message, commMessage) {
|
|
441
|
-
this.
|
|
442
|
-
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
443
|
-
this.promptController.followUp(sessionKey, message);
|
|
327
|
+
followUpMessage(this.promptController, this.emitter, message, commMessage);
|
|
444
328
|
}
|
|
445
|
-
/**
|
|
446
|
-
* 对齐 Agent.prompt:入队并执行 LLM turn(需 IM Message 通讯上下文)。
|
|
447
|
-
* process() / processMultimodal() 在 agentLoop 路径下内部委托此方法。
|
|
448
|
-
*/
|
|
449
329
|
async prompt(input, commMessage, options) {
|
|
450
|
-
|
|
451
|
-
const text = messages
|
|
452
|
-
.flatMap((message) => {
|
|
453
|
-
if (message.role !== 'user')
|
|
454
|
-
return [];
|
|
455
|
-
const user = message;
|
|
456
|
-
return user.content
|
|
457
|
-
.filter((block) => block.type === 'text')
|
|
458
|
-
.map((block) => block.text);
|
|
459
|
-
})
|
|
460
|
-
.join('\n')
|
|
461
|
-
.trim();
|
|
462
|
-
await this.runInTurnContext(randomUUID(), () => processTextTurn(asPrivate(this), text, commMessage, [], options?.onChunk, {
|
|
463
|
-
prebuiltMessages: messages,
|
|
464
|
-
}));
|
|
330
|
+
return runPromptTurn(asPrivate(this), input, commMessage, (id, fn) => this.runInTurnContext(id, fn), options);
|
|
465
331
|
}
|
|
466
|
-
// ── Core processing ─────────────────────────────────────────────────
|
|
467
|
-
/** 旁听由 zhin `message.receive` 写入 im_transcripts,此处保留空实现 */
|
|
468
332
|
async appendPassiveGroupChatter(_commMessage, _rawContent) {
|
|
469
333
|
return;
|
|
470
334
|
}
|
|
471
|
-
/** 归档当前场景 active 会话(/reset);下次 @ 将创建新 session 纪元 */
|
|
472
335
|
async archiveSessionForCommMessage(commMessage) {
|
|
473
336
|
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
474
337
|
return archiveSessionByKey({
|
|
@@ -477,80 +340,53 @@ export class ZhinAgent {
|
|
|
477
340
|
contextRepository: this.contextRepository,
|
|
478
341
|
}, sessionKey);
|
|
479
342
|
}
|
|
480
|
-
/** 手动压缩当前 session epoch(/compact) */
|
|
481
343
|
async compactSessionForCommMessage(commMessage) {
|
|
482
|
-
const
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const contextWindow = llmModel.contextWindow ?? this.config.contextTokens;
|
|
493
|
-
return manualCompactSession(this.contextRepository, {
|
|
494
|
-
host: asPrivate(this),
|
|
495
|
-
sessionId,
|
|
496
|
-
commMessage,
|
|
497
|
-
model: llmModel,
|
|
498
|
-
compactionConfig: this.config.compaction,
|
|
499
|
-
contextWindow,
|
|
500
|
-
mode: 'text',
|
|
501
|
-
});
|
|
344
|
+
const priv = asPrivate(this);
|
|
345
|
+
const memorySystem = this.memorySystem ?? createMemorySystemForHost(priv);
|
|
346
|
+
return memorySystem.compactSessionForCommMessage(priv, commMessage, this.requireSessionSystem().sessionDeps(priv));
|
|
347
|
+
}
|
|
348
|
+
requireSessionSystem() {
|
|
349
|
+
const system = this.sessionSystem;
|
|
350
|
+
if (!system) {
|
|
351
|
+
throw new Error('ZhinAgent.sessionSystem is required');
|
|
352
|
+
}
|
|
353
|
+
return system;
|
|
502
354
|
}
|
|
503
355
|
async process(content, commMessage, externalTools = [], onChunk) {
|
|
504
|
-
return this.runInTurnContext(randomUUID(), () =>
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
async runDeferredWorker(goal, toolQuery, commMessage, allTools) {
|
|
510
|
-
return runDeferredWorkerTurn(asPrivate(this), goal, toolQuery, commMessage, allTools);
|
|
356
|
+
return this.runInTurnContext(randomUUID(), () => runWithInboundQueue(commMessage, this.inboundQueueConfig, this.inboundTurnQueue, {
|
|
357
|
+
content,
|
|
358
|
+
run: (mergedContent) => processTextTurn(asPrivate(this), mergedContent, commMessage, externalTools, onChunk),
|
|
359
|
+
}));
|
|
511
360
|
}
|
|
512
|
-
|
|
513
|
-
|
|
361
|
+
async *processStream(content, commMessage, externalTools = []) {
|
|
362
|
+
yield* processTextTurnStream(asPrivate(this), {
|
|
363
|
+
content,
|
|
364
|
+
commMessage,
|
|
365
|
+
externalTools,
|
|
366
|
+
inboundQueueConfig: this.inboundQueueConfig,
|
|
367
|
+
inboundTurnQueue: this.inboundTurnQueue,
|
|
368
|
+
runInTurnContext: (id, fn) => this.runInTurnContext(id, fn),
|
|
369
|
+
});
|
|
514
370
|
}
|
|
515
371
|
async processMultimodal(parts, commMessage, onChunk) {
|
|
516
|
-
return this.runInTurnContext(randomUUID(), () =>
|
|
372
|
+
return this.runInTurnContext(randomUUID(), () => runWithInboundQueue(commMessage, this.inboundQueueConfig, this.inboundTurnQueue, {
|
|
373
|
+
coalesce: false,
|
|
374
|
+
run: () => processMultimodalTurn(asPrivate(this), parts, commMessage, onChunk),
|
|
375
|
+
}));
|
|
517
376
|
}
|
|
518
|
-
// ── Internal helpers ────────────────────────────────────────────────
|
|
519
|
-
// ── Lifecycle ───────────────────────────────────────────────────────
|
|
520
377
|
isReady() {
|
|
521
378
|
return true;
|
|
522
379
|
}
|
|
523
380
|
dispose() {
|
|
524
|
-
this
|
|
525
|
-
this.
|
|
526
|
-
this.externalTools.clear();
|
|
527
|
-
this.userProfiles.dispose();
|
|
528
|
-
this.rateLimiter.dispose();
|
|
529
|
-
if (this.subagentManager) {
|
|
530
|
-
this.subagentManager.dispose();
|
|
531
|
-
this.subagentManager = null;
|
|
532
|
-
}
|
|
533
|
-
if (this.promptController) {
|
|
534
|
-
this.promptController.abort();
|
|
535
|
-
}
|
|
536
|
-
// 使用 Disposable 接口统一清理资源(运行时 has-dispose 检查)
|
|
537
|
-
const tryDispose = (obj) => {
|
|
538
|
-
if (obj && typeof obj.dispose === 'function') {
|
|
539
|
-
obj.dispose?.();
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
tryDispose(this.imSessionStore);
|
|
543
|
-
tryDispose(this.agentSessionStore);
|
|
544
|
-
tryDispose(this.contextRepository);
|
|
545
|
-
tryDispose(this.imTranscriptStore);
|
|
381
|
+
disposeZhinAgentResources(this);
|
|
382
|
+
this.subagentSystem = null;
|
|
546
383
|
this.deferredAutoContinueDepthBySession.clear();
|
|
547
384
|
this.deferredCatalog = [];
|
|
548
385
|
this.lastTurnMetrics = null;
|
|
549
386
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- disposed, fields intentionally nulled
|
|
550
387
|
this.provider = null;
|
|
551
388
|
this.providerResolver = null;
|
|
552
|
-
this.
|
|
553
|
-
this.orchestrator = null;
|
|
389
|
+
clearZhinAgentRuntimeModules(this.runtimeModules);
|
|
554
390
|
}
|
|
555
391
|
}
|
|
556
392
|
//# sourceMappingURL=index.js.map
|