@zhin.js/agent 1.1.2 → 1.1.5
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 +52 -52
- package/lib/activity-feedback/adapter-integration.d.ts +8 -9
- package/lib/activity-feedback/adapter-integration.d.ts.map +1 -1
- package/lib/activity-feedback/adapter-integration.js +22 -18
- package/lib/activity-feedback/adapter-integration.js.map +1 -1
- package/lib/activity-feedback/ai-bus.d.ts.map +1 -1
- package/lib/activity-feedback/ai-bus.js +7 -1
- package/lib/activity-feedback/ai-bus.js.map +1 -1
- package/lib/activity-feedback/event-context.d.ts +1 -1
- package/lib/activity-feedback/event-context.d.ts.map +1 -1
- package/lib/activity-feedback/event-context.js +9 -6
- package/lib/activity-feedback/event-context.js.map +1 -1
- package/lib/activity-feedback/index.d.ts +3 -2
- package/lib/activity-feedback/index.d.ts.map +1 -1
- package/lib/activity-feedback/index.js +3 -2
- package/lib/activity-feedback/index.js.map +1 -1
- package/lib/activity-feedback/manager.d.ts +4 -1
- package/lib/activity-feedback/manager.d.ts.map +1 -1
- package/lib/activity-feedback/manager.js +10 -8
- package/lib/activity-feedback/manager.js.map +1 -1
- package/lib/activity-feedback/subagent-prefix.d.ts +17 -0
- package/lib/activity-feedback/subagent-prefix.d.ts.map +1 -0
- package/lib/activity-feedback/subagent-prefix.js +54 -0
- package/lib/activity-feedback/subagent-prefix.js.map +1 -0
- package/lib/agent-prompt/registry.js +1 -1
- package/lib/agent-prompt/registry.js.map +1 -1
- package/lib/agent-prompt/resolver.d.ts.map +1 -1
- package/lib/agent-prompt/resolver.js +5 -7
- package/lib/agent-prompt/resolver.js.map +1 -1
- package/lib/ai-event-bus.js +2 -2
- package/lib/ai-event-bus.js.map +1 -1
- package/lib/ai-event-subscriber.d.ts +1 -1
- package/lib/ai-event-subscriber.d.ts.map +1 -1
- package/lib/ai-event-subscriber.js +1 -1
- package/lib/ai-event-subscriber.js.map +1 -1
- package/lib/aop/index.d.ts +1 -1
- package/lib/aop/index.d.ts.map +1 -1
- package/lib/aop/index.js +1 -1
- package/lib/aop/index.js.map +1 -1
- package/lib/aop/pipeline/pipeline-service.d.ts +2 -0
- package/lib/aop/pipeline/pipeline-service.d.ts.map +1 -1
- package/lib/aop/pipeline/pipeline-service.js +26 -14
- package/lib/aop/pipeline/pipeline-service.js.map +1 -1
- package/lib/assistant/bootstrap-assistant-home.d.ts +31 -0
- package/lib/assistant/bootstrap-assistant-home.d.ts.map +1 -0
- package/lib/assistant/bootstrap-assistant-home.js +97 -0
- package/lib/assistant/bootstrap-assistant-home.js.map +1 -0
- package/lib/assistant/deliver-schedule-to-adapter.d.ts +3 -3
- package/lib/assistant/deliver-schedule-to-adapter.d.ts.map +1 -1
- package/lib/assistant/deliver-schedule-to-adapter.js +2 -6
- package/lib/assistant/deliver-schedule-to-adapter.js.map +1 -1
- package/lib/assistant/domains/{home-assistant.d.ts → ha-home-backend.d.ts} +16 -13
- package/lib/assistant/domains/ha-home-backend.d.ts.map +1 -0
- package/lib/assistant/domains/{home-assistant.js → ha-home-backend.js} +32 -7
- package/lib/assistant/domains/ha-home-backend.js.map +1 -0
- package/lib/assistant/domains/ha-ws-transport.d.ts +59 -0
- package/lib/assistant/domains/ha-ws-transport.d.ts.map +1 -0
- package/lib/assistant/domains/ha-ws-transport.js +135 -0
- package/lib/assistant/domains/ha-ws-transport.js.map +1 -0
- package/lib/assistant/domains/home-entity.d.ts +5 -0
- package/lib/assistant/domains/home-entity.d.ts.map +1 -0
- package/lib/assistant/domains/home-entity.js +8 -0
- package/lib/assistant/domains/home-entity.js.map +1 -0
- package/lib/assistant/domains/home-state-watch.d.ts +40 -0
- package/lib/assistant/domains/home-state-watch.d.ts.map +1 -0
- package/lib/assistant/domains/home-state-watch.js +118 -0
- package/lib/assistant/domains/home-state-watch.js.map +1 -0
- package/lib/assistant/home-config.d.ts +21 -7
- package/lib/assistant/home-config.d.ts.map +1 -1
- package/lib/assistant/home-config.js +5 -0
- package/lib/assistant/home-config.js.map +1 -1
- package/lib/assistant/home-facade.d.ts +73 -0
- package/lib/assistant/home-facade.d.ts.map +1 -0
- package/lib/assistant/home-facade.js +144 -0
- package/lib/assistant/home-facade.js.map +1 -0
- package/lib/assistant/home-policy.d.ts +3 -2
- package/lib/assistant/home-policy.d.ts.map +1 -1
- package/lib/assistant/home-policy.js +8 -36
- package/lib/assistant/home-policy.js.map +1 -1
- package/lib/assistant/home-tools.d.ts +9 -12
- package/lib/assistant/home-tools.d.ts.map +1 -1
- package/lib/assistant/home-tools.js +94 -135
- package/lib/assistant/home-tools.js.map +1 -1
- package/lib/assistant/index.d.ts +18 -11
- package/lib/assistant/index.d.ts.map +1 -1
- package/lib/assistant/index.js +10 -7
- package/lib/assistant/index.js.map +1 -1
- package/lib/assistant/job-creator.d.ts +3 -3
- package/lib/assistant/job-creator.d.ts.map +1 -1
- package/lib/assistant/job-creator.js +6 -11
- package/lib/assistant/job-creator.js.map +1 -1
- package/lib/assistant/job-engine.d.ts +1 -1
- package/lib/assistant/job-engine.d.ts.map +1 -1
- package/lib/assistant/job-engine.js +11 -22
- package/lib/assistant/job-engine.js.map +1 -1
- package/lib/assistant/job-scheduler.d.ts +0 -3
- package/lib/assistant/job-scheduler.d.ts.map +1 -1
- package/lib/assistant/job-scheduler.js +5 -3
- package/lib/assistant/job-scheduler.js.map +1 -1
- package/lib/assistant/job-store.d.ts.map +1 -1
- package/lib/assistant/job-store.js +31 -3
- package/lib/assistant/job-store.js.map +1 -1
- package/lib/assistant/job-worker.d.ts +2 -9
- package/lib/assistant/job-worker.d.ts.map +1 -1
- package/lib/assistant/job-worker.js +42 -36
- package/lib/assistant/job-worker.js.map +1 -1
- package/lib/assistant/notification-router.d.ts +2 -1
- package/lib/assistant/notification-router.d.ts.map +1 -1
- package/lib/assistant/notification-router.js +18 -9
- package/lib/assistant/notification-router.js.map +1 -1
- package/lib/assistant/runtime-registry.d.ts +4 -3
- package/lib/assistant/runtime-registry.d.ts.map +1 -1
- package/lib/assistant/runtime-registry.js +7 -16
- package/lib/assistant/runtime-registry.js.map +1 -1
- package/lib/assistant/schedule-execution.d.ts +0 -17
- package/lib/assistant/schedule-execution.d.ts.map +1 -1
- package/lib/assistant/schedule-execution.js +0 -41
- package/lib/assistant/schedule-execution.js.map +1 -1
- package/lib/assistant/schedule-job-service.d.ts +4 -2
- package/lib/assistant/schedule-job-service.d.ts.map +1 -1
- package/lib/assistant/schedule-job-service.js +38 -8
- package/lib/assistant/schedule-job-service.js.map +1 -1
- package/lib/assistant/types.d.ts +3 -0
- package/lib/assistant/types.d.ts.map +1 -1
- package/lib/assistant/types.js.map +1 -1
- package/lib/authoring/entries/tools.d.ts +1 -1
- package/lib/authoring/entries/tools.d.ts.map +1 -1
- package/lib/authoring/entries/tools.js +1 -1
- package/lib/authoring/entries/tools.js.map +1 -1
- package/lib/authoring/index.d.ts +1 -1
- package/lib/authoring/index.d.ts.map +1 -1
- package/lib/authoring/index.js +1 -1
- package/lib/authoring/index.js.map +1 -1
- package/lib/authoring/tool-policy.d.ts +1 -1
- package/lib/authoring/tool-policy.d.ts.map +1 -1
- package/lib/authoring/tool-policy.js +1 -1
- package/lib/authoring/tool-policy.js.map +1 -1
- package/lib/bootstrap.d.ts +14 -3
- package/lib/bootstrap.d.ts.map +1 -1
- package/lib/bootstrap.js +66 -12
- package/lib/bootstrap.js.map +1 -1
- package/lib/builtin/analyze-media-tool.d.ts.map +1 -1
- package/lib/builtin/analyze-media-tool.js +0 -12
- package/lib/builtin/analyze-media-tool.js.map +1 -1
- package/lib/builtin/bash-tool.d.ts.map +1 -1
- package/lib/builtin/bash-tool.js +0 -6
- package/lib/builtin/bash-tool.js.map +1 -1
- package/lib/builtin/bing-search-html.d.ts +1 -17
- package/lib/builtin/bing-search-html.d.ts.map +1 -1
- package/lib/builtin/bing-search-html.js +12 -10
- package/lib/builtin/bing-search-html.js.map +1 -1
- package/lib/builtin/edit-file-tool.d.ts.map +1 -1
- package/lib/builtin/edit-file-tool.js +0 -7
- package/lib/builtin/edit-file-tool.js.map +1 -1
- package/lib/builtin/glob-tool.d.ts.map +1 -1
- package/lib/builtin/glob-tool.js +0 -5
- package/lib/builtin/glob-tool.js.map +1 -1
- package/lib/builtin/grep-tool.d.ts.map +1 -1
- package/lib/builtin/grep-tool.js +0 -5
- package/lib/builtin/grep-tool.js.map +1 -1
- package/lib/builtin/list-dir-tool.d.ts.map +1 -1
- package/lib/builtin/list-dir-tool.js +0 -5
- package/lib/builtin/list-dir-tool.js.map +1 -1
- package/lib/builtin/memory-search-tool.js +1 -1
- package/lib/builtin/memory-search-tool.js.map +1 -1
- package/lib/builtin/memory-upsert-tool.js +1 -1
- package/lib/builtin/memory-upsert-tool.js.map +1 -1
- package/lib/builtin/read-file-tool.d.ts.map +1 -1
- package/lib/builtin/read-file-tool.js +0 -13
- package/lib/builtin/read-file-tool.js.map +1 -1
- package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
- package/lib/builtin/spawn-task-tool.js +8 -10
- package/lib/builtin/spawn-task-tool.js.map +1 -1
- package/lib/builtin/web-fetch-tool.d.ts.map +1 -1
- package/lib/builtin/web-fetch-tool.js +9 -28
- package/lib/builtin/web-fetch-tool.js.map +1 -1
- package/lib/builtin/web-search-tool.d.ts.map +1 -1
- package/lib/builtin/web-search-tool.js +10 -0
- package/lib/builtin/web-search-tool.js.map +1 -1
- package/lib/builtin/write-file-tool.d.ts.map +1 -1
- package/lib/builtin/write-file-tool.js +0 -7
- package/lib/builtin/write-file-tool.js.map +1 -1
- package/lib/builtin-tools.d.ts +3 -14
- package/lib/builtin-tools.d.ts.map +1 -1
- package/lib/builtin-tools.js +3 -14
- package/lib/builtin-tools.js.map +1 -1
- package/lib/collaboration/collab-admin-gate.d.ts +1 -1
- package/lib/collaboration/collab-admin-gate.d.ts.map +1 -1
- package/lib/collaboration/collab-admin-gate.js +8 -8
- package/lib/collaboration/collab-admin-gate.js.map +1 -1
- package/lib/collaboration/collab-utils.d.ts +15 -0
- package/lib/collaboration/collab-utils.d.ts.map +1 -0
- package/lib/collaboration/collab-utils.js +37 -0
- package/lib/collaboration/collab-utils.js.map +1 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts +2 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts.map +1 -1
- package/lib/collaboration/collaboration-artifact-repository.js +17 -5
- package/lib/collaboration/collaboration-artifact-repository.js.map +1 -1
- package/lib/collaboration/collaboration-commands.d.ts +3 -3
- package/lib/collaboration/collaboration-commands.d.ts.map +1 -1
- package/lib/collaboration/collaboration-commands.js +25 -156
- package/lib/collaboration/collaboration-commands.js.map +1 -1
- package/lib/collaboration/collaboration-config.d.ts +5 -5
- package/lib/collaboration/collaboration-config.d.ts.map +1 -1
- package/lib/collaboration/collaboration-config.js +19 -19
- package/lib/collaboration/collaboration-config.js.map +1 -1
- package/lib/collaboration/collaboration-context.d.ts +5 -2
- package/lib/collaboration/collaboration-context.d.ts.map +1 -1
- package/lib/collaboration/collaboration-context.js +39 -27
- package/lib/collaboration/collaboration-context.js.map +1 -1
- package/lib/collaboration/collaboration-db-model.d.ts +2 -2
- package/lib/collaboration/collaboration-db-model.d.ts.map +1 -1
- package/lib/collaboration/collaboration-db-model.js +2 -2
- package/lib/collaboration/collaboration-db-model.js.map +1 -1
- package/lib/collaboration/collaboration-delegation.d.ts +2 -2
- package/lib/collaboration/collaboration-delegation.d.ts.map +1 -1
- package/lib/collaboration/collaboration-delegation.js +4 -6
- package/lib/collaboration/collaboration-delegation.js.map +1 -1
- package/lib/collaboration/collaboration-dispatch.d.ts +4 -4
- package/lib/collaboration/collaboration-dispatch.d.ts.map +1 -1
- package/lib/collaboration/collaboration-dispatch.js +12 -12
- package/lib/collaboration/collaboration-dispatch.js.map +1 -1
- package/lib/collaboration/collaboration-kernel-bridge.d.ts +3 -3
- package/lib/collaboration/collaboration-kernel-bridge.d.ts.map +1 -1
- package/lib/collaboration/collaboration-kernel-bridge.js +15 -16
- package/lib/collaboration/collaboration-kernel-bridge.js.map +1 -1
- package/lib/collaboration/collaboration-outbound.d.ts +7 -7
- package/lib/collaboration/collaboration-outbound.d.ts.map +1 -1
- package/lib/collaboration/collaboration-outbound.js +38 -41
- package/lib/collaboration/collaboration-outbound.js.map +1 -1
- package/lib/collaboration/collaboration-scene-repository.d.ts +17 -15
- package/lib/collaboration/collaboration-scene-repository.d.ts.map +1 -1
- package/lib/collaboration/collaboration-scene-repository.js +43 -32
- package/lib/collaboration/collaboration-scene-repository.js.map +1 -1
- package/lib/collaboration/collaboration-turn-snapshot.d.ts +3 -3
- package/lib/collaboration/collaboration-turn-snapshot.d.ts.map +1 -1
- package/lib/collaboration/collaboration-turn-snapshot.js +6 -6
- package/lib/collaboration/collaboration-turn-snapshot.js.map +1 -1
- package/lib/collaboration/delegation-state.d.ts +6 -6
- package/lib/collaboration/delegation-state.d.ts.map +1 -1
- package/lib/collaboration/delegation-state.js +17 -17
- package/lib/collaboration/delegation-state.js.map +1 -1
- package/lib/collaboration/endpoint-identity.d.ts +4 -4
- package/lib/collaboration/endpoint-identity.d.ts.map +1 -1
- package/lib/collaboration/endpoint-identity.js +17 -25
- package/lib/collaboration/endpoint-identity.js.map +1 -1
- package/lib/collaboration/group-message.d.ts +5 -5
- package/lib/collaboration/group-message.d.ts.map +1 -1
- package/lib/collaboration/group-message.js +10 -71
- package/lib/collaboration/group-message.js.map +1 -1
- package/lib/collaboration/im-mention-delegate.d.ts +1 -1
- package/lib/collaboration/im-mention-delegate.d.ts.map +1 -1
- package/lib/collaboration/im-mention-delegate.js +2 -2
- package/lib/collaboration/im-mention-delegate.js.map +1 -1
- package/lib/collaboration/inbound-peer-handback.d.ts +1 -1
- package/lib/collaboration/inbound-peer-handback.d.ts.map +1 -1
- package/lib/collaboration/inbound-peer-handback.js +13 -17
- package/lib/collaboration/inbound-peer-handback.js.map +1 -1
- package/lib/collaboration/inbound-spawn-task.d.ts.map +1 -1
- package/lib/collaboration/inbound-spawn-task.js +7 -8
- package/lib/collaboration/inbound-spawn-task.js.map +1 -1
- package/lib/collaboration/inbound-turn-tools.d.ts +1 -1
- package/lib/collaboration/inbound-turn-tools.d.ts.map +1 -1
- package/lib/collaboration/inbound-turn-tools.js +8 -3
- package/lib/collaboration/inbound-turn-tools.js.map +1 -1
- package/lib/collaboration/index.d.ts +1 -5
- package/lib/collaboration/index.d.ts.map +1 -1
- package/lib/collaboration/index.js +1 -4
- package/lib/collaboration/index.js.map +1 -1
- package/lib/collaboration/init-observe-hook.d.ts +8 -11
- package/lib/collaboration/init-observe-hook.d.ts.map +1 -1
- package/lib/collaboration/init-observe-hook.js +18 -40
- package/lib/collaboration/init-observe-hook.js.map +1 -1
- package/lib/collaboration/init-wizard-service.d.ts +2 -2
- package/lib/collaboration/init-wizard-service.d.ts.map +1 -1
- package/lib/collaboration/init-wizard-service.js +9 -11
- package/lib/collaboration/init-wizard-service.js.map +1 -1
- package/lib/collaboration/outbound-resolver.d.ts +3 -3
- package/lib/collaboration/outbound-resolver.d.ts.map +1 -1
- package/lib/collaboration/outbound-resolver.js +18 -18
- package/lib/collaboration/outbound-resolver.js.map +1 -1
- package/lib/collaboration/peer-policy.d.ts +7 -7
- package/lib/collaboration/peer-policy.d.ts.map +1 -1
- package/lib/collaboration/peer-policy.js +19 -19
- package/lib/collaboration/peer-policy.js.map +1 -1
- package/lib/collaboration/resolve-agent-session-key.js +2 -2
- package/lib/collaboration/resolve-agent-session-key.js.map +1 -1
- package/lib/collaboration/runtime-inbound-gate.d.ts.map +1 -1
- package/lib/collaboration/runtime-inbound-gate.js +26 -32
- package/lib/collaboration/runtime-inbound-gate.js.map +1 -1
- package/lib/collaboration/scene-identity-service.d.ts +13 -11
- package/lib/collaboration/scene-identity-service.d.ts.map +1 -1
- package/lib/collaboration/scene-identity-service.js +33 -22
- package/lib/collaboration/scene-identity-service.js.map +1 -1
- package/lib/collaboration/scene-service.d.ts +5 -3
- package/lib/collaboration/scene-service.d.ts.map +1 -1
- package/lib/collaboration/scene-service.js +17 -12
- package/lib/collaboration/scene-service.js.map +1 -1
- package/lib/collaboration/structured-ai-outbound.d.ts +1 -1
- package/lib/collaboration/structured-ai-outbound.d.ts.map +1 -1
- package/lib/collaboration/structured-ai-outbound.js +8 -9
- package/lib/collaboration/structured-ai-outbound.js.map +1 -1
- package/lib/collaboration/turn-plan-resolver.d.ts +2 -2
- package/lib/collaboration/turn-plan-resolver.d.ts.map +1 -1
- package/lib/collaboration/turn-plan-resolver.js +12 -12
- package/lib/collaboration/turn-plan-resolver.js.map +1 -1
- package/lib/collaboration/types.d.ts +6 -6
- package/lib/collaboration/types.d.ts.map +1 -1
- package/lib/collaboration/wire-collaboration-storage.d.ts.map +1 -1
- package/lib/collaboration/wire-collaboration-storage.js +0 -2
- package/lib/collaboration/wire-collaboration-storage.js.map +1 -1
- package/lib/common-adapter-tools.js +1 -1
- package/lib/common-adapter-tools.js.map +1 -1
- package/lib/config/agent-interfaces.d.ts +1 -2
- package/lib/config/agent-interfaces.d.ts.map +1 -1
- package/lib/config/fix-ai-config.d.ts.map +1 -1
- package/lib/config/fix-ai-config.js +52 -3
- package/lib/config/fix-ai-config.js.map +1 -1
- package/lib/config/index.d.ts +1 -1
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js.map +1 -1
- package/lib/config/normalize-ai-config.d.ts +4 -2
- package/lib/config/normalize-ai-config.d.ts.map +1 -1
- package/lib/config/normalize-ai-config.js +29 -81
- package/lib/config/normalize-ai-config.js.map +1 -1
- package/lib/config/validate-ai-config.d.ts.map +1 -1
- package/lib/config/validate-ai-config.js +10 -0
- package/lib/config/validate-ai-config.js.map +1 -1
- package/lib/config/zhin-agent-config.d.ts +20 -0
- package/lib/config/zhin-agent-config.d.ts.map +1 -1
- package/lib/config/zhin-agent-defaults.d.ts.map +1 -1
- package/lib/config/zhin-agent-defaults.js +14 -0
- package/lib/config/zhin-agent-defaults.js.map +1 -1
- package/lib/config/zhin-agent-dependencies.d.ts +1 -0
- package/lib/config/zhin-agent-dependencies.d.ts.map +1 -1
- package/lib/context/context-system.d.ts +4 -2
- package/lib/context/context-system.d.ts.map +1 -1
- package/lib/context/context-system.js +15 -12
- package/lib/context/context-system.js.map +1 -1
- package/lib/context/contracts.d.ts +3 -3
- package/lib/context/contracts.d.ts.map +1 -1
- package/lib/context/default-builders.js +3 -3
- package/lib/context/default-builders.js.map +1 -1
- package/lib/context/im-turn-context-adapter.d.ts +9 -0
- package/lib/context/im-turn-context-adapter.d.ts.map +1 -0
- package/lib/context/im-turn-context-adapter.js +54 -0
- package/lib/context/im-turn-context-adapter.js.map +1 -0
- package/lib/context/index.d.ts +2 -2
- package/lib/context/index.d.ts.map +1 -1
- package/lib/context/index.js +1 -1
- package/lib/context/index.js.map +1 -1
- package/lib/context/turn-envelope.d.ts +5 -4
- package/lib/context/turn-envelope.d.ts.map +1 -1
- package/lib/context/turn-envelope.js +43 -50
- package/lib/context/turn-envelope.js.map +1 -1
- package/lib/core/agent-core-run.d.ts +37 -14
- package/lib/core/agent-core-run.d.ts.map +1 -1
- package/lib/core/agent-core-run.js +79 -182
- package/lib/core/agent-core-run.js.map +1 -1
- package/lib/core/agent-loop-standalone.d.ts.map +1 -1
- package/lib/core/agent-loop-standalone.js +35 -34
- package/lib/core/agent-loop-standalone.js.map +1 -1
- package/lib/core/agent-run-shared.d.ts +4 -0
- package/lib/core/agent-run-shared.d.ts.map +1 -0
- package/lib/core/agent-run-shared.js +8 -0
- package/lib/core/agent-run-shared.js.map +1 -0
- package/lib/core/compose-deps.d.ts.map +1 -1
- package/lib/core/compose-deps.js +1 -2
- package/lib/core/compose-deps.js.map +1 -1
- package/lib/core/spawn-delegation.d.ts +23 -0
- package/lib/core/spawn-delegation.d.ts.map +1 -0
- package/lib/core/spawn-delegation.js +64 -0
- package/lib/core/spawn-delegation.js.map +1 -0
- package/lib/core/tool-execution-authority.d.ts +21 -0
- package/lib/core/tool-execution-authority.d.ts.map +1 -0
- package/lib/core/tool-execution-authority.js +2 -0
- package/lib/core/tool-execution-authority.js.map +1 -0
- package/lib/core/turn-event-mapper.d.ts.map +1 -1
- package/lib/core/turn-event-mapper.js +13 -0
- package/lib/core/turn-event-mapper.js.map +1 -1
- package/lib/deferred-worker-runner.d.ts.map +1 -1
- package/lib/deferred-worker-runner.js +9 -23
- package/lib/deferred-worker-runner.js.map +1 -1
- package/lib/discovery/agent-surface-info.d.ts.map +1 -1
- package/lib/discovery/agent-surface-info.js +7 -2
- package/lib/discovery/agent-surface-info.js.map +1 -1
- package/lib/discovery/skills.js +3 -3
- package/lib/discovery/skills.js.map +1 -1
- package/lib/discovery/tools.js +2 -2
- package/lib/discovery/tools.js.map +1 -1
- package/lib/event/event-emitter.d.ts.map +1 -1
- package/lib/event/event-emitter.js +2 -13
- package/lib/event/event-emitter.js.map +1 -1
- package/lib/event/session-events.d.ts +3 -2
- package/lib/event/session-events.d.ts.map +1 -1
- package/lib/event/session-events.js.map +1 -1
- package/lib/event/turn-event.d.ts +35 -2
- package/lib/event/turn-event.d.ts.map +1 -1
- package/lib/event/turn-event.js +4 -1
- package/lib/event/turn-event.js.map +1 -1
- package/lib/event/turn-to-agent-stream.js +20 -0
- package/lib/event/turn-to-agent-stream.js.map +1 -1
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.d.ts.map +1 -1
- package/lib/index.d.ts +34 -27
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +26 -21
- package/lib/index.js.map +1 -1
- package/lib/ingress/capability-ingress.d.ts +3 -1
- package/lib/ingress/capability-ingress.d.ts.map +1 -1
- package/lib/ingress/capability-ingress.js +10 -6
- package/lib/ingress/capability-ingress.js.map +1 -1
- package/lib/init/configure-zhin-agent.d.ts +7 -34
- package/lib/init/configure-zhin-agent.d.ts.map +1 -1
- package/lib/init/configure-zhin-agent.js +5 -1
- package/lib/init/configure-zhin-agent.js.map +1 -1
- package/lib/init/create-zhin-agent.d.ts.map +1 -1
- package/lib/init/create-zhin-agent.js +64 -78
- package/lib/init/create-zhin-agent.js.map +1 -1
- package/lib/init/dispose-zhin-agent.d.ts +6 -22
- package/lib/init/dispose-zhin-agent.d.ts.map +1 -1
- package/lib/init/dispose-zhin-agent.js +1 -2
- package/lib/init/dispose-zhin-agent.js.map +1 -1
- package/lib/init/introspection-collectors.js +2 -2
- package/lib/init/introspection-collectors.js.map +1 -1
- package/lib/init/register-ai-service.d.ts.map +1 -1
- package/lib/init/register-ai-service.js +3 -4
- package/lib/init/register-ai-service.js.map +1 -1
- package/lib/init/register-builtin-tools.d.ts.map +1 -1
- package/lib/init/register-builtin-tools.js +20 -31
- package/lib/init/register-builtin-tools.js.map +1 -1
- package/lib/init/register-db-upgrade.d.ts.map +1 -1
- package/lib/init/register-db-upgrade.js +5 -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 +15 -10
- package/lib/init/register-group-session-passive.js.map +1 -1
- package/lib/init/register-init-wizard-guardrail.d.ts.map +1 -1
- package/lib/init/register-init-wizard-guardrail.js +6 -11
- package/lib/init/register-init-wizard-guardrail.js.map +1 -1
- package/lib/init/register-introspection-commands.d.ts.map +1 -1
- package/lib/init/register-introspection-commands.js +20 -1
- package/lib/init/register-introspection-commands.js.map +1 -1
- package/lib/init/register-mcp-from-config.js +4 -4
- package/lib/init/register-mcp-from-config.js.map +1 -1
- package/lib/init/upgrade-endpoint-id-schema.d.ts +2 -2
- package/lib/init/upgrade-endpoint-id-schema.d.ts.map +1 -1
- package/lib/init/upgrade-endpoint-id-schema.js +3 -3
- package/lib/init/upgrade-endpoint-id-schema.js.map +1 -1
- package/lib/init.d.ts +4 -22
- package/lib/init.d.ts.map +1 -1
- package/lib/init.js +6 -57
- package/lib/init.js.map +1 -1
- package/lib/interaction/index.d.ts +2 -0
- package/lib/interaction/index.d.ts.map +1 -0
- package/lib/interaction/index.js +2 -0
- package/lib/interaction/index.js.map +1 -0
- package/lib/interaction/interaction-router.d.ts +20 -0
- package/lib/interaction/interaction-router.d.ts.map +1 -0
- package/lib/interaction/interaction-router.js +146 -0
- package/lib/interaction/interaction-router.js.map +1 -0
- package/lib/internal/agent-host.d.ts +59 -67
- package/lib/internal/agent-host.d.ts.map +1 -1
- package/lib/internal/ai-service-refs.d.ts +8 -0
- package/lib/internal/ai-service-refs.d.ts.map +1 -0
- package/lib/internal/ai-service-refs.js +7 -0
- package/lib/internal/ai-service-refs.js.map +1 -0
- package/lib/internal/as-private.d.ts +3 -6
- package/lib/internal/as-private.d.ts.map +1 -1
- package/lib/internal/as-private.js.map +1 -1
- package/lib/internal/host-types.d.ts +26 -3
- package/lib/internal/host-types.d.ts.map +1 -1
- package/lib/internal/prompt-trace.d.ts.map +1 -1
- package/lib/internal/prompt-trace.js +4 -15
- package/lib/internal/prompt-trace.js.map +1 -1
- package/lib/internal/turn-context.d.ts +1 -6
- package/lib/internal/turn-context.d.ts.map +1 -1
- package/lib/internal/turn-context.js +0 -9
- package/lib/internal/turn-context.js.map +1 -1
- package/lib/journal/file-journal-store.d.ts +21 -0
- package/lib/journal/file-journal-store.d.ts.map +1 -0
- package/lib/journal/file-journal-store.js +200 -0
- package/lib/journal/file-journal-store.js.map +1 -0
- package/lib/journal/index.d.ts +3 -0
- package/lib/journal/index.d.ts.map +1 -0
- package/lib/journal/index.js +3 -0
- package/lib/journal/index.js.map +1 -0
- package/lib/journal/persistent-turn-journal.d.ts +13 -0
- package/lib/journal/persistent-turn-journal.d.ts.map +1 -0
- package/lib/journal/persistent-turn-journal.js +72 -0
- package/lib/journal/persistent-turn-journal.js.map +1 -0
- package/lib/media/index.d.ts +0 -1
- package/lib/media/index.d.ts.map +1 -1
- package/lib/media/index.js +0 -1
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capabilities.d.ts.map +1 -1
- package/lib/media/media-capabilities.js +0 -6
- package/lib/media/media-capabilities.js.map +1 -1
- package/lib/media/media-normalize.d.ts +1 -7
- package/lib/media/media-normalize.d.ts.map +1 -1
- package/lib/media/media-normalize.js +0 -47
- package/lib/media/media-normalize.js.map +1 -1
- package/lib/media/media-router.d.ts +1 -2
- package/lib/media/media-router.d.ts.map +1 -1
- package/lib/media/media-router.js +2 -10
- package/lib/media/media-router.js.map +1 -1
- package/lib/media/resolve-config.d.ts.map +1 -1
- package/lib/media/resolve-config.js +1 -28
- package/lib/media/resolve-config.js.map +1 -1
- package/lib/media/subagent-inbound.d.ts +2 -2
- package/lib/media/subagent-inbound.d.ts.map +1 -1
- package/lib/media/subagent-inbound.js +2 -7
- package/lib/media/subagent-inbound.js.map +1 -1
- package/lib/media/vision-capability.d.ts +1 -3
- package/lib/media/vision-capability.d.ts.map +1 -1
- package/lib/media/vision-capability.js +0 -15
- package/lib/media/vision-capability.js.map +1 -1
- package/lib/memory/compaction-runtime.d.ts +3 -4
- package/lib/memory/compaction-runtime.d.ts.map +1 -1
- package/lib/memory/compaction-runtime.js +0 -10
- package/lib/memory/compaction-runtime.js.map +1 -1
- package/lib/memory/memory-system.d.ts.map +1 -1
- package/lib/memory/memory-system.js +1 -2
- package/lib/memory/memory-system.js.map +1 -1
- package/lib/memory-entry-registry.d.ts +6 -0
- package/lib/memory-entry-registry.d.ts.map +1 -1
- package/lib/memory-entry-registry.js +19 -3
- package/lib/memory-entry-registry.js.map +1 -1
- package/lib/memory-layers.d.ts +2 -2
- package/lib/memory-layers.d.ts.map +1 -1
- package/lib/memory-layers.js +11 -22
- package/lib/memory-layers.js.map +1 -1
- package/lib/orchestration-runtime-registry.d.ts +3 -1
- package/lib/orchestration-runtime-registry.d.ts.map +1 -1
- package/lib/orchestration-runtime-registry.js +9 -4
- package/lib/orchestration-runtime-registry.js.map +1 -1
- package/lib/orchestrator/agent-dispatcher.d.ts +3 -38
- package/lib/orchestrator/agent-dispatcher.d.ts.map +1 -1
- package/lib/orchestrator/agent-dispatcher.js +2 -155
- package/lib/orchestrator/agent-dispatcher.js.map +1 -1
- package/lib/orchestrator/bootstrap-executors.d.ts +5 -1
- package/lib/orchestrator/bootstrap-executors.d.ts.map +1 -1
- package/lib/orchestrator/bootstrap-executors.js +65 -36
- package/lib/orchestrator/bootstrap-executors.js.map +1 -1
- package/lib/orchestrator/index.d.ts +1 -1
- package/lib/orchestrator/index.d.ts.map +1 -1
- package/lib/orchestrator/index.js +1 -1
- package/lib/orchestrator/index.js.map +1 -1
- package/lib/orchestrator/orchestration-mappers.js +8 -8
- package/lib/orchestrator/orchestration-mappers.js.map +1 -1
- package/lib/orchestrator/orchestration-service.d.ts +18 -9
- package/lib/orchestrator/orchestration-service.d.ts.map +1 -1
- package/lib/orchestrator/orchestration-service.js +50 -47
- package/lib/orchestrator/orchestration-service.js.map +1 -1
- package/lib/orchestrator/remote-agent-registry.d.ts +3 -3
- package/lib/orchestrator/remote-agent-registry.d.ts.map +1 -1
- package/lib/orchestrator/remote-agent-registry.js +9 -13
- 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 +12 -4
- package/lib/orchestrator/remote-task-executor.js.map +1 -1
- package/lib/orchestrator/remote-task-poller.d.ts +3 -2
- package/lib/orchestrator/remote-task-poller.d.ts.map +1 -1
- package/lib/orchestrator/remote-task-poller.js +18 -15
- package/lib/orchestrator/remote-task-poller.js.map +1 -1
- package/lib/orchestrator/role-configs.d.ts +30 -0
- package/lib/orchestrator/role-configs.d.ts.map +1 -0
- package/lib/orchestrator/role-configs.js +133 -0
- package/lib/orchestrator/role-configs.js.map +1 -0
- package/lib/orchestrator/task-queue.d.ts +3 -2
- package/lib/orchestrator/task-queue.d.ts.map +1 -1
- package/lib/orchestrator/task-queue.js +12 -11
- package/lib/orchestrator/task-queue.js.map +1 -1
- package/lib/orchestrator/tool-selection.d.ts +4 -3
- package/lib/orchestrator/tool-selection.d.ts.map +1 -1
- package/lib/orchestrator/tool-selection.js +17 -14
- package/lib/orchestrator/tool-selection.js.map +1 -1
- package/lib/orchestrator/types.d.ts +3 -2
- package/lib/orchestrator/types.d.ts.map +1 -1
- package/lib/outbound/send-proactive.js +1 -1
- package/lib/outbound/send-proactive.js.map +1 -1
- package/lib/plugin-ai-hook-bus.d.ts +3 -6
- package/lib/plugin-ai-hook-bus.d.ts.map +1 -1
- package/lib/plugin-ai-hook-bus.js +2 -20
- package/lib/plugin-ai-hook-bus.js.map +1 -1
- package/lib/plugin-runtime/agent-host-port.d.ts +25 -0
- package/lib/plugin-runtime/agent-host-port.d.ts.map +1 -1
- package/lib/plugin-runtime/agent-host-port.js.map +1 -1
- package/lib/plugin-runtime/agent-runtime.d.ts +61 -8
- package/lib/plugin-runtime/agent-runtime.d.ts.map +1 -1
- package/lib/plugin-runtime/agent-runtime.js +226 -11
- package/lib/plugin-runtime/agent-runtime.js.map +1 -1
- package/lib/plugin-runtime/capability-ingress.d.ts +4 -4
- package/lib/plugin-runtime/capability-ingress.d.ts.map +1 -1
- package/lib/plugin-runtime/capability-ingress.js +46 -20
- package/lib/plugin-runtime/capability-ingress.js.map +1 -1
- package/lib/plugin-runtime/capability-tools.d.ts +17 -0
- package/lib/plugin-runtime/capability-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/capability-tools.js +55 -0
- package/lib/plugin-runtime/capability-tools.js.map +1 -0
- package/lib/plugin-runtime/deferred-capability-plan.d.ts +30 -0
- package/lib/plugin-runtime/deferred-capability-plan.d.ts.map +1 -0
- package/lib/plugin-runtime/deferred-capability-plan.js +152 -0
- package/lib/plugin-runtime/deferred-capability-plan.js.map +1 -0
- package/lib/plugin-runtime/full-agent-turn-engine.d.ts +17 -0
- package/lib/plugin-runtime/full-agent-turn-engine.d.ts.map +1 -0
- package/lib/plugin-runtime/full-agent-turn-engine.js +174 -0
- package/lib/plugin-runtime/full-agent-turn-engine.js.map +1 -0
- package/lib/plugin-runtime/host-mcp-projection.d.ts +10 -0
- package/lib/plugin-runtime/host-mcp-projection.d.ts.map +1 -0
- package/lib/plugin-runtime/host-mcp-projection.js +33 -0
- package/lib/plugin-runtime/host-mcp-projection.js.map +1 -0
- package/lib/plugin-runtime/host-tool-projection.d.ts +21 -0
- package/lib/plugin-runtime/host-tool-projection.d.ts.map +1 -0
- package/lib/plugin-runtime/host-tool-projection.js +22 -0
- package/lib/plugin-runtime/host-tool-projection.js.map +1 -0
- package/lib/plugin-runtime/index.d.ts +10 -0
- package/lib/plugin-runtime/index.d.ts.map +1 -1
- package/lib/plugin-runtime/index.js +10 -0
- package/lib/plugin-runtime/index.js.map +1 -1
- package/lib/plugin-runtime/native-file-tools.d.ts +9 -0
- package/lib/plugin-runtime/native-file-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/native-file-tools.js +240 -0
- package/lib/plugin-runtime/native-file-tools.js.map +1 -0
- package/lib/plugin-runtime/native-interaction-tools.d.ts +8 -0
- package/lib/plugin-runtime/native-interaction-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/native-interaction-tools.js +72 -0
- package/lib/plugin-runtime/native-interaction-tools.js.map +1 -0
- package/lib/plugin-runtime/native-todo-tools.d.ts +26 -0
- package/lib/plugin-runtime/native-todo-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/native-todo-tools.js +152 -0
- package/lib/plugin-runtime/native-todo-tools.js.map +1 -0
- package/lib/plugin-runtime/native-web-tools.d.ts +10 -0
- package/lib/plugin-runtime/native-web-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/native-web-tools.js +120 -0
- package/lib/plugin-runtime/native-web-tools.js.map +1 -0
- package/lib/prompt/assembly.d.ts +19 -9
- package/lib/prompt/assembly.d.ts.map +1 -1
- package/lib/prompt/assembly.js +64 -25
- package/lib/prompt/assembly.js.map +1 -1
- package/lib/prompt/git-context.d.ts +7 -0
- package/lib/prompt/git-context.d.ts.map +1 -0
- package/lib/prompt/git-context.js +75 -0
- package/lib/prompt/git-context.js.map +1 -0
- package/lib/prompt/index.d.ts +3 -2
- package/lib/prompt/index.d.ts.map +1 -1
- package/lib/prompt/index.js +2 -2
- package/lib/prompt/index.js.map +1 -1
- package/lib/prompt/model-aware-builder.d.ts +8 -0
- package/lib/prompt/model-aware-builder.d.ts.map +1 -0
- package/lib/prompt/model-aware-builder.js +61 -0
- package/lib/prompt/model-aware-builder.js.map +1 -0
- package/lib/prompt/model-prompt-strategy.d.ts +12 -0
- package/lib/prompt/model-prompt-strategy.d.ts.map +1 -0
- package/lib/prompt/model-prompt-strategy.js +171 -0
- package/lib/prompt/model-prompt-strategy.js.map +1 -0
- package/lib/prompt/rules/code-references.d.ts +2 -0
- package/lib/prompt/rules/code-references.d.ts.map +1 -0
- package/lib/prompt/rules/code-references.js +11 -0
- package/lib/prompt/rules/code-references.js.map +1 -0
- package/lib/prompt/rules/critical-rules.d.ts +2 -0
- package/lib/prompt/rules/critical-rules.d.ts.map +1 -0
- package/lib/prompt/rules/critical-rules.js +17 -0
- package/lib/prompt/rules/critical-rules.js.map +1 -0
- package/lib/prompt/rules/editing.d.ts +2 -0
- package/lib/prompt/rules/editing.d.ts.map +1 -0
- package/lib/prompt/rules/editing.js +18 -0
- package/lib/prompt/rules/editing.js.map +1 -0
- package/lib/prompt/rules/error-handling.d.ts +2 -0
- package/lib/prompt/rules/error-handling.d.ts.map +1 -0
- package/lib/prompt/rules/error-handling.js +18 -0
- package/lib/prompt/rules/error-handling.js.map +1 -0
- package/lib/prompt/rules/index.d.ts +8 -0
- package/lib/prompt/rules/index.d.ts.map +1 -0
- package/lib/prompt/rules/index.js +8 -0
- package/lib/prompt/rules/index.js.map +1 -0
- package/lib/prompt/rules/memory.d.ts +2 -0
- package/lib/prompt/rules/memory.d.ts.map +1 -0
- package/lib/prompt/rules/memory.js +13 -0
- package/lib/prompt/rules/memory.js.map +1 -0
- package/lib/prompt/rules/task-completion.d.ts +2 -0
- package/lib/prompt/rules/task-completion.d.ts.map +1 -0
- package/lib/prompt/rules/task-completion.js +11 -0
- package/lib/prompt/rules/task-completion.js.map +1 -0
- package/lib/prompt/rules/workflow-rules.d.ts +2 -0
- package/lib/prompt/rules/workflow-rules.d.ts.map +1 -0
- package/lib/prompt/rules/workflow-rules.js +27 -0
- package/lib/prompt/rules/workflow-rules.js.map +1 -0
- package/lib/prompt/system-prompt.d.ts +19 -22
- package/lib/prompt/system-prompt.d.ts.map +1 -1
- package/lib/prompt/system-prompt.js +82 -262
- package/lib/prompt/system-prompt.js.map +1 -1
- package/lib/prompt/templates.d.ts +3 -6
- package/lib/prompt/templates.d.ts.map +1 -1
- package/lib/prompt/templates.js +17 -21
- package/lib/prompt/templates.js.map +1 -1
- package/lib/prompt/turn-prompt-profile.d.ts +16 -0
- package/lib/prompt/turn-prompt-profile.d.ts.map +1 -0
- package/lib/prompt/turn-prompt-profile.js +2 -0
- package/lib/prompt/turn-prompt-profile.js.map +1 -0
- package/lib/routing/route-matcher.d.ts +2 -2
- package/lib/routing/route-matcher.d.ts.map +1 -1
- package/lib/routing/route-matcher.js +1 -1
- package/lib/routing/route-matcher.js.map +1 -1
- package/lib/routing/subagent-summarize.d.ts.map +1 -1
- package/lib/routing/subagent-summarize.js +1 -6
- package/lib/routing/subagent-summarize.js.map +1 -1
- package/lib/schedule-domain/audit-logger.d.ts +38 -0
- package/lib/schedule-domain/audit-logger.d.ts.map +1 -0
- package/lib/schedule-domain/audit-logger.js +27 -0
- package/lib/schedule-domain/audit-logger.js.map +1 -0
- package/lib/schedule-domain/budget-guard.d.ts +27 -0
- package/lib/schedule-domain/budget-guard.d.ts.map +1 -0
- package/lib/schedule-domain/budget-guard.js +48 -0
- package/lib/schedule-domain/budget-guard.js.map +1 -0
- package/lib/schedule-domain/execution-domain.d.ts +49 -0
- package/lib/schedule-domain/execution-domain.d.ts.map +1 -0
- package/lib/schedule-domain/execution-domain.js +125 -0
- package/lib/schedule-domain/execution-domain.js.map +1 -0
- package/lib/schedule-domain/index.d.ts +8 -0
- package/lib/schedule-domain/index.d.ts.map +1 -0
- package/lib/schedule-domain/index.js +8 -0
- package/lib/schedule-domain/index.js.map +1 -0
- package/lib/schedule-domain/output-validator.d.ts +7 -0
- package/lib/schedule-domain/output-validator.d.ts.map +1 -0
- package/lib/schedule-domain/output-validator.js +36 -0
- package/lib/schedule-domain/output-validator.js.map +1 -0
- package/lib/schedule-domain/prompt-assembler.d.ts +22 -0
- package/lib/schedule-domain/prompt-assembler.d.ts.map +1 -0
- package/lib/schedule-domain/prompt-assembler.js +75 -0
- package/lib/schedule-domain/prompt-assembler.js.map +1 -0
- package/lib/schedule-domain/security-harness.d.ts +19 -0
- package/lib/schedule-domain/security-harness.d.ts.map +1 -0
- package/lib/schedule-domain/security-harness.js +89 -0
- package/lib/schedule-domain/security-harness.js.map +1 -0
- package/lib/schedule-domain/tool-resolver.d.ts +20 -0
- package/lib/schedule-domain/tool-resolver.d.ts.map +1 -0
- package/lib/schedule-domain/tool-resolver.js +80 -0
- package/lib/schedule-domain/tool-resolver.js.map +1 -0
- package/lib/schedule-domain/turn-context.d.ts +9 -0
- package/lib/schedule-domain/turn-context.d.ts.map +1 -0
- package/lib/schedule-domain/turn-context.js +36 -0
- package/lib/schedule-domain/turn-context.js.map +1 -0
- package/lib/schedule-manager.d.ts +12 -13
- package/lib/schedule-manager.d.ts.map +1 -1
- package/lib/schedule-manager.js +91 -155
- package/lib/schedule-manager.js.map +1 -1
- package/lib/security/anomaly-detection.d.ts +3 -6
- package/lib/security/anomaly-detection.d.ts.map +1 -1
- package/lib/security/anomaly-detection.js +24 -31
- package/lib/security/anomaly-detection.js.map +1 -1
- package/lib/security/audit-logger.d.ts +5 -4
- package/lib/security/audit-logger.d.ts.map +1 -1
- package/lib/security/audit-logger.js +17 -25
- package/lib/security/audit-logger.js.map +1 -1
- package/lib/security/dangerous-tool-policy.d.ts +1 -1
- package/lib/security/dangerous-tool-policy.d.ts.map +1 -1
- package/lib/security/dangerous-tool-policy.js +6 -25
- package/lib/security/dangerous-tool-policy.js.map +1 -1
- package/lib/security/exec-policy.d.ts +2 -1
- package/lib/security/exec-policy.d.ts.map +1 -1
- package/lib/security/exec-policy.js +6 -11
- package/lib/security/exec-policy.js.map +1 -1
- package/lib/security/file-policy.d.ts.map +1 -1
- package/lib/security/file-policy.js +1 -0
- package/lib/security/file-policy.js.map +1 -1
- package/lib/security/file-role-policy.d.ts.map +1 -1
- package/lib/security/file-role-policy.js +1 -4
- package/lib/security/file-role-policy.js.map +1 -1
- package/lib/security/index.d.ts +0 -2
- package/lib/security/index.d.ts.map +1 -1
- package/lib/security/index.js +0 -2
- package/lib/security/index.js.map +1 -1
- package/lib/security/network-policy-context.d.ts +7 -0
- package/lib/security/network-policy-context.d.ts.map +1 -0
- package/lib/security/network-policy-context.js +9 -0
- package/lib/security/network-policy-context.js.map +1 -0
- package/lib/security/network-policy.d.ts +14 -1
- package/lib/security/network-policy.d.ts.map +1 -1
- package/lib/security/network-policy.js +70 -3
- package/lib/security/network-policy.js.map +1 -1
- 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 +12 -12
- package/lib/security/owner-approve-always-store.js.map +1 -1
- package/lib/security/policy-facade.d.ts +27 -0
- package/lib/security/policy-facade.d.ts.map +1 -1
- package/lib/security/policy-facade.js +190 -3
- package/lib/security/policy-facade.js.map +1 -1
- package/lib/security/sandbox.d.ts +2 -7
- package/lib/security/sandbox.d.ts.map +1 -1
- package/lib/security/sandbox.js +12 -21
- package/lib/security/sandbox.js.map +1 -1
- package/lib/security/turn-file-authority.d.ts +14 -0
- package/lib/security/turn-file-authority.d.ts.map +1 -0
- package/lib/security/turn-file-authority.js +101 -0
- package/lib/security/turn-file-authority.js.map +1 -0
- package/lib/security/turn-network-client.d.ts +30 -0
- package/lib/security/turn-network-client.d.ts.map +1 -0
- package/lib/security/turn-network-client.js +111 -0
- package/lib/security/turn-network-client.js.map +1 -0
- package/lib/service.d.ts +3 -13
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +3 -35
- package/lib/service.js.map +1 -1
- package/lib/session/{session-interaction-port.d.ts → approval-port.d.ts} +4 -7
- package/lib/session/approval-port.d.ts.map +1 -0
- package/lib/session/{session-interaction-port.js → approval-port.js} +1 -1
- package/lib/session/approval-port.js.map +1 -0
- package/lib/session/http-approval-adapter.d.ts +2 -2
- package/lib/session/http-approval-adapter.d.ts.map +1 -1
- package/lib/session/http-approval-adapter.js +1 -1
- package/lib/session/http-approval-adapter.js.map +1 -1
- package/lib/session/http-approval-waiter.d.ts +1 -1
- package/lib/session/http-approval-waiter.d.ts.map +1 -1
- package/lib/session/http-approval-waiter.js +25 -2
- package/lib/session/http-approval-waiter.js.map +1 -1
- package/lib/session/index.d.ts +6 -3
- package/lib/session/index.d.ts.map +1 -1
- package/lib/session/index.js +3 -2
- package/lib/session/index.js.map +1 -1
- package/lib/session/passive-group-session.d.ts +8 -10
- package/lib/session/passive-group-session.d.ts.map +1 -1
- package/lib/session/passive-group-session.js +23 -27
- package/lib/session/passive-group-session.js.map +1 -1
- package/lib/session/resolve-approval-port.d.ts +7 -0
- package/lib/session/resolve-approval-port.d.ts.map +1 -0
- package/lib/session/resolve-approval-port.js +13 -0
- package/lib/session/resolve-approval-port.js.map +1 -0
- package/lib/session/session-io.d.ts +3 -4
- package/lib/session/session-io.d.ts.map +1 -1
- package/lib/session/session-io.js +7 -15
- package/lib/session/session-io.js.map +1 -1
- package/lib/session/session-system.d.ts +22 -1
- package/lib/session/session-system.d.ts.map +1 -1
- package/lib/session/session-system.js +72 -10
- package/lib/session/session-system.js.map +1 -1
- package/lib/session/session-tree-commands.d.ts.map +1 -1
- package/lib/session/session-tree-commands.js +2 -4
- package/lib/session/session-tree-commands.js.map +1 -1
- package/lib/session/turn-ingress-session.d.ts +23 -0
- package/lib/session/turn-ingress-session.d.ts.map +1 -0
- package/lib/session/turn-ingress-session.js +89 -0
- package/lib/session/turn-ingress-session.js.map +1 -0
- package/lib/session-tree-runtime-registry.d.ts +3 -1
- package/lib/session-tree-runtime-registry.d.ts.map +1 -1
- package/lib/session-tree-runtime-registry.js +6 -4
- package/lib/session-tree-runtime-registry.js.map +1 -1
- package/lib/stability/memory-pressure.d.ts.map +1 -1
- package/lib/stability/memory-pressure.js +4 -21
- package/lib/stability/memory-pressure.js.map +1 -1
- package/lib/subagent/subagent-runtime.d.ts.map +1 -1
- package/lib/subagent/subagent-runtime.js +1 -5
- package/lib/subagent/subagent-runtime.js.map +1 -1
- package/lib/subagent/subagent-system-init.js +2 -2
- package/lib/subagent/subagent-system-init.js.map +1 -1
- package/lib/subagent-ai-events.d.ts +3 -0
- package/lib/subagent-ai-events.d.ts.map +1 -1
- package/lib/subagent-ai-events.js +4 -1
- package/lib/subagent-ai-events.js.map +1 -1
- package/lib/subagent-goal-notify.d.ts +1 -1
- package/lib/subagent-goal-notify.d.ts.map +1 -1
- package/lib/subagent-goal-notify.js +1 -1
- package/lib/subagent-goal-notify.js.map +1 -1
- package/lib/subagent-parent-context.d.ts +9 -0
- package/lib/subagent-parent-context.d.ts.map +1 -1
- package/lib/subagent-parent-context.js +8 -0
- package/lib/subagent-parent-context.js.map +1 -1
- package/lib/task-executor.d.ts +14 -25
- package/lib/task-executor.d.ts.map +1 -1
- package/lib/task-executor.js +106 -137
- package/lib/task-executor.js.map +1 -1
- package/lib/tool/builtin-policy-extractors.d.ts +2 -0
- package/lib/tool/builtin-policy-extractors.d.ts.map +1 -0
- package/lib/tool/builtin-policy-extractors.js +65 -0
- package/lib/tool/builtin-policy-extractors.js.map +1 -0
- package/lib/tool/classic-tool-execution-authority.d.ts +22 -0
- package/lib/tool/classic-tool-execution-authority.d.ts.map +1 -0
- package/lib/tool/classic-tool-execution-authority.js +79 -0
- package/lib/tool/classic-tool-execution-authority.js.map +1 -0
- package/lib/tool/contracts.d.ts +2 -2
- package/lib/tool/contracts.d.ts.map +1 -1
- package/lib/tool/contracts.js +1 -1
- package/lib/tool/deferred-resolution.d.ts +5 -3
- package/lib/tool/deferred-resolution.d.ts.map +1 -1
- package/lib/tool/deferred-resolution.js +31 -5
- package/lib/tool/deferred-resolution.js.map +1 -1
- package/lib/tool/index.d.ts +2 -0
- package/lib/tool/index.d.ts.map +1 -1
- package/lib/tool/index.js +1 -0
- package/lib/tool/index.js.map +1 -1
- package/lib/tool/prepare-turn-tools.d.ts +2 -0
- package/lib/tool/prepare-turn-tools.d.ts.map +1 -1
- package/lib/tool/prepare-turn-tools.js +62 -10
- package/lib/tool/prepare-turn-tools.js.map +1 -1
- package/lib/tool/runtime.d.ts +1 -1
- package/lib/tool/runtime.d.ts.map +1 -1
- package/lib/tool/runtime.js +1 -1
- package/lib/tool/runtime.js.map +1 -1
- package/lib/tool/sources.d.ts +5 -2
- package/lib/tool/sources.d.ts.map +1 -1
- package/lib/tool/sources.js +4 -4
- package/lib/tool/sources.js.map +1 -1
- package/lib/tool/tool-approval-gate.d.ts +3 -3
- package/lib/tool/tool-approval-gate.d.ts.map +1 -1
- package/lib/tool/tool-approval-gate.js +2 -1
- package/lib/tool/tool-approval-gate.js.map +1 -1
- package/lib/tool/tool-runtime.d.ts +52 -0
- package/lib/tool/tool-runtime.d.ts.map +1 -0
- package/lib/tool/tool-runtime.js +101 -0
- package/lib/tool/tool-runtime.js.map +1 -0
- package/lib/tool/tool-system.d.ts +7 -3
- package/lib/tool/tool-system.d.ts.map +1 -1
- package/lib/tool/tool-system.js +12 -6
- package/lib/tool/tool-system.js.map +1 -1
- package/lib/tool/turn-tool-runtime.d.ts +29 -0
- package/lib/tool/turn-tool-runtime.d.ts.map +1 -0
- package/lib/tool/turn-tool-runtime.js +89 -0
- package/lib/tool/turn-tool-runtime.js.map +1 -0
- package/lib/tool-catalog/deferred-turn-controller.d.ts +30 -0
- package/lib/tool-catalog/deferred-turn-controller.d.ts.map +1 -0
- package/lib/tool-catalog/deferred-turn-controller.js +126 -0
- package/lib/tool-catalog/deferred-turn-controller.js.map +1 -0
- package/lib/turn/auto-continue.d.ts +6 -15
- package/lib/turn/auto-continue.d.ts.map +1 -1
- package/lib/turn/auto-continue.js +43 -31
- package/lib/turn/auto-continue.js.map +1 -1
- package/lib/turn/deferred-turn-state.d.ts +29 -0
- package/lib/turn/deferred-turn-state.d.ts.map +1 -0
- package/lib/turn/deferred-turn-state.js +35 -0
- package/lib/turn/deferred-turn-state.js.map +1 -0
- package/lib/turn/execute-agent-turn.d.ts +14 -0
- package/lib/turn/execute-agent-turn.d.ts.map +1 -0
- package/lib/turn/execute-agent-turn.js +171 -0
- package/lib/turn/execute-agent-turn.js.map +1 -0
- package/lib/turn/inbound-media.d.ts +3 -3
- package/lib/turn/inbound-media.d.ts.map +1 -1
- package/lib/turn/inbound-media.js +11 -4
- package/lib/turn/inbound-media.js.map +1 -1
- package/lib/turn/index.d.ts +8 -1
- package/lib/turn/index.d.ts.map +1 -1
- package/lib/turn/index.js +5 -1
- package/lib/turn/index.js.map +1 -1
- package/lib/turn/journal-integrity.d.ts +5 -0
- package/lib/turn/journal-integrity.d.ts.map +1 -0
- package/lib/turn/journal-integrity.js +8 -0
- package/lib/turn/journal-integrity.js.map +1 -0
- package/lib/turn/process-stream.d.ts.map +1 -1
- package/lib/turn/process-stream.js +21 -55
- package/lib/turn/process-stream.js.map +1 -1
- package/lib/turn/prompt-controller.d.ts +7 -4
- package/lib/turn/prompt-controller.d.ts.map +1 -1
- package/lib/turn/prompt-controller.js +23 -11
- package/lib/turn/prompt-controller.js.map +1 -1
- package/lib/turn/subagent-auto-continue.d.ts +2 -0
- package/lib/turn/subagent-auto-continue.d.ts.map +1 -1
- package/lib/turn/subagent-auto-continue.js +17 -1
- package/lib/turn/subagent-auto-continue.js.map +1 -1
- package/lib/turn/task-continuation.d.ts +3 -6
- package/lib/turn/task-continuation.d.ts.map +1 -1
- package/lib/turn/task-continuation.js +10 -13
- package/lib/turn/task-continuation.js.map +1 -1
- package/lib/turn/turn-complete.d.ts +1 -0
- package/lib/turn/turn-complete.d.ts.map +1 -1
- package/lib/turn/turn-complete.js +3 -2
- package/lib/turn/turn-complete.js.map +1 -1
- package/lib/turn/turn-context-bridge.d.ts +0 -4
- package/lib/turn/turn-context-bridge.d.ts.map +1 -1
- package/lib/turn/turn-context-bridge.js +0 -10
- package/lib/turn/turn-context-bridge.js.map +1 -1
- package/lib/turn/turn-event-source.d.ts +15 -0
- package/lib/turn/turn-event-source.d.ts.map +1 -0
- package/lib/turn/turn-event-source.js +61 -0
- package/lib/turn/turn-event-source.js.map +1 -0
- package/lib/turn/turn-ingress.d.ts +157 -0
- package/lib/turn/turn-ingress.d.ts.map +1 -0
- package/lib/turn/turn-ingress.js +76 -0
- package/lib/turn/turn-ingress.js.map +1 -0
- package/lib/turn/turn-metrics.d.ts.map +1 -1
- package/lib/turn/turn-metrics.js +10 -9
- package/lib/turn/turn-metrics.js.map +1 -1
- package/lib/turn/turn-pipeline.d.ts +10 -3
- package/lib/turn/turn-pipeline.d.ts.map +1 -1
- package/lib/turn/turn-pipeline.js +73 -41
- package/lib/turn/turn-pipeline.js.map +1 -1
- package/lib/typing-indicator/adapter-integration.d.ts +3 -5
- package/lib/typing-indicator/adapter-integration.d.ts.map +1 -1
- package/lib/typing-indicator/adapter-integration.js.map +1 -1
- package/lib/typing-indicator/index.d.ts +4 -4
- package/lib/typing-indicator/index.d.ts.map +1 -1
- package/lib/typing-indicator/index.js +25 -29
- package/lib/typing-indicator/index.js.map +1 -1
- package/lib/typing-indicator/integration.d.ts +6 -8
- package/lib/typing-indicator/integration.d.ts.map +1 -1
- package/lib/typing-indicator/integration.js +12 -10
- package/lib/typing-indicator/integration.js.map +1 -1
- package/lib/utils/keyed-mutex.d.ts +10 -0
- package/lib/utils/keyed-mutex.d.ts.map +1 -0
- package/lib/utils/keyed-mutex.js +34 -0
- package/lib/utils/keyed-mutex.js.map +1 -0
- package/lib/zhin-agent/index.d.ts +71 -76
- package/lib/zhin-agent/index.d.ts.map +1 -1
- package/lib/zhin-agent/index.js +51 -157
- package/lib/zhin-agent/index.js.map +1 -1
- package/lib/zhin-agent/runtime-modules.d.ts +1 -0
- package/lib/zhin-agent/runtime-modules.d.ts.map +1 -1
- package/lib/zhin-agent/runtime-modules.js +16 -0
- package/lib/zhin-agent/runtime-modules.js.map +1 -1
- package/package.json +13 -11
- package/lib/assistant/domains/home-assistant.d.ts.map +0 -1
- package/lib/assistant/domains/home-assistant.js.map +0 -1
- package/lib/assistant/schedule-message.d.ts +0 -9
- package/lib/assistant/schedule-message.d.ts.map +0 -1
- package/lib/assistant/schedule-message.js +0 -23
- package/lib/assistant/schedule-message.js.map +0 -1
- package/lib/assistant/schedule-tool-runtime.d.ts +0 -7
- package/lib/assistant/schedule-tool-runtime.d.ts.map +0 -1
- package/lib/assistant/schedule-tool-runtime.js +0 -50
- package/lib/assistant/schedule-tool-runtime.js.map +0 -1
- package/lib/builtin/ask-user-session-service.d.ts +0 -40
- package/lib/builtin/ask-user-session-service.d.ts.map +0 -1
- package/lib/builtin/ask-user-session-service.js +0 -258
- package/lib/builtin/ask-user-session-service.js.map +0 -1
- package/lib/builtin/ask-user-session.d.ts +0 -18
- package/lib/builtin/ask-user-session.d.ts.map +0 -1
- package/lib/builtin/ask-user-session.js +0 -21
- package/lib/builtin/ask-user-session.js.map +0 -1
- package/lib/builtin/ask-user-tool.d.ts +0 -22
- package/lib/builtin/ask-user-tool.d.ts.map +0 -1
- package/lib/builtin/ask-user-tool.js +0 -148
- package/lib/builtin/ask-user-tool.js.map +0 -1
- package/lib/builtin/deferred-tool-meta.d.ts +0 -51
- package/lib/builtin/deferred-tool-meta.d.ts.map +0 -1
- package/lib/builtin/deferred-tool-meta.js +0 -143
- package/lib/builtin/deferred-tool-meta.js.map +0 -1
- package/lib/collaboration/ask-user-bridge.d.ts +0 -9
- package/lib/collaboration/ask-user-bridge.d.ts.map +0 -1
- package/lib/collaboration/ask-user-bridge.js +0 -73
- package/lib/collaboration/ask-user-bridge.js.map +0 -1
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts +0 -22
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts.map +0 -1
- package/lib/collaboration/bootstrap-agent-runtimes.js +0 -106
- package/lib/collaboration/bootstrap-agent-runtimes.js.map +0 -1
- package/lib/collaboration/inbound-turn-compat.d.ts +0 -32
- package/lib/collaboration/inbound-turn-compat.d.ts.map +0 -1
- package/lib/collaboration/inbound-turn-compat.js +0 -30
- package/lib/collaboration/inbound-turn-compat.js.map +0 -1
- package/lib/collaboration/runtime-registry.d.ts +0 -18
- package/lib/collaboration/runtime-registry.d.ts.map +0 -1
- package/lib/collaboration/runtime-registry.js +0 -45
- package/lib/collaboration/runtime-registry.js.map +0 -1
- package/lib/init/management-command-guard.d.ts +0 -6
- package/lib/init/management-command-guard.d.ts.map +0 -1
- package/lib/init/management-command-guard.js +0 -6
- package/lib/init/management-command-guard.js.map +0 -1
- package/lib/init/output-renderer.d.ts +0 -7
- package/lib/init/output-renderer.d.ts.map +0 -1
- package/lib/init/output-renderer.js +0 -44
- package/lib/init/output-renderer.js.map +0 -1
- package/lib/init/register-home-tools.d.ts +0 -2
- package/lib/init/register-home-tools.d.ts.map +0 -1
- package/lib/init/register-home-tools.js +0 -51
- package/lib/init/register-home-tools.js.map +0 -1
- package/lib/init/register-owner-approve-commands.d.ts +0 -10
- package/lib/init/register-owner-approve-commands.d.ts.map +0 -1
- package/lib/init/register-owner-approve-commands.js +0 -12
- package/lib/init/register-owner-approve-commands.js.map +0 -1
- package/lib/media/constants.d.ts +0 -3
- package/lib/media/constants.d.ts.map +0 -1
- package/lib/media/constants.js +0 -3
- package/lib/media/constants.js.map +0 -1
- package/lib/orchestrator/owner-confirm-orchestration.d.ts +0 -39
- package/lib/orchestrator/owner-confirm-orchestration.d.ts.map +0 -1
- package/lib/orchestrator/owner-confirm-orchestration.js +0 -92
- package/lib/orchestrator/owner-confirm-orchestration.js.map +0 -1
- package/lib/orchestrator/owner-orchestration-constants.d.ts +0 -6
- package/lib/orchestrator/owner-orchestration-constants.d.ts.map +0 -1
- package/lib/orchestrator/owner-orchestration-constants.js +0 -10
- package/lib/orchestrator/owner-orchestration-constants.js.map +0 -1
- package/lib/security/dangerous-tool-policy-hook.d.ts +0 -6
- package/lib/security/dangerous-tool-policy-hook.d.ts.map +0 -1
- package/lib/security/dangerous-tool-policy-hook.js +0 -41
- package/lib/security/dangerous-tool-policy-hook.js.map +0 -1
- package/lib/security/exec-policy-hook.d.ts +0 -7
- package/lib/security/exec-policy-hook.d.ts.map +0 -1
- package/lib/security/exec-policy-hook.js +0 -29
- package/lib/security/exec-policy-hook.js.map +0 -1
- package/lib/security/file-policy-hook.d.ts +0 -6
- package/lib/security/file-policy-hook.d.ts.map +0 -1
- package/lib/security/file-policy-hook.js +0 -30
- package/lib/security/file-policy-hook.js.map +0 -1
- package/lib/security/sandbox-enhanced.d.ts +0 -173
- package/lib/security/sandbox-enhanced.d.ts.map +0 -1
- package/lib/security/sandbox-enhanced.js +0 -665
- package/lib/security/sandbox-enhanced.js.map +0 -1
- package/lib/session/im-approval-adapter.d.ts +0 -12
- package/lib/session/im-approval-adapter.d.ts.map +0 -1
- package/lib/session/im-approval-adapter.js +0 -24
- package/lib/session/im-approval-adapter.js.map +0 -1
- package/lib/session/resolve-session-interaction-port.d.ts +0 -9
- package/lib/session/resolve-session-interaction-port.d.ts.map +0 -1
- package/lib/session/resolve-session-interaction-port.js +0 -17
- package/lib/session/resolve-session-interaction-port.js.map +0 -1
- package/lib/session/session-interaction-port.d.ts.map +0 -1
- package/lib/session/session-interaction-port.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AIProvider, type AgentTool, type AgentMessage, type
|
|
1
|
+
import { type AIProvider, type AgentTool, type AgentMessage, type MediaContentBlock, type Usage, type AgentEvent, type OutputElement, type ModelRegistry, type AgentSessionStore, type ContextRepository, type IMSessionStore, type ImTranscriptStore, type ImTranscriptWriteInput, type MemoryAgentSessionStore, MemoryIMSessionStore, ConversationMemory, RateLimiter } from '@zhin.js/ai';
|
|
2
2
|
import type { Tool, Message } from '../orchestrator/types.js';
|
|
3
3
|
import type { SkillRegistry } from '../orchestrator/skill-registry.js';
|
|
4
4
|
import type { SkillSystem } from '../skill/skill-system.js';
|
|
@@ -14,14 +14,20 @@ import { type ZhinAgentTurnMetrics } from '../turn/turn-metrics.js';
|
|
|
14
14
|
import { TurnTracker } from '../turn/turn-tracker.js';
|
|
15
15
|
import { ZhinAgentEventEmitter } from '../event/event-emitter.js';
|
|
16
16
|
import { UserProfileStore } from '../user-profile.js';
|
|
17
|
-
import { SubagentSystem, type SubagentOrigin, type
|
|
17
|
+
import { SubagentSystem, type SubagentOrigin, type SubagentCompletePayload } from '../subagent/index.js';
|
|
18
18
|
import { type ZhinAgentConfig, type OnChunkCallback, type ZhinAgentDependencies } from '../config/index.js';
|
|
19
|
-
import
|
|
20
|
-
import { type
|
|
19
|
+
import { DeferredTurnState } from '../turn/deferred-turn-state.js';
|
|
20
|
+
import { type PassiveGroupObservation } from '../session/passive-group-session.js';
|
|
21
|
+
import { PromptController } from '../turn/prompt-controller.js';
|
|
22
|
+
import type { HostScheduleTurnContext as ScheduleTurnContext } from '../internal/host-types.js';
|
|
21
23
|
import type { ResolvedAgentBinding } from '../config/types.js';
|
|
22
|
-
import type {
|
|
24
|
+
import type { InboundTurnQueue } from '../turn/inbound-turn-queue.js';
|
|
23
25
|
import { type AgentTurnConfiguration } from '../turn/agent-turn-context.js';
|
|
24
|
-
import { type TurnContextRunOptions } from '../turn/turn-context-bridge.js';
|
|
26
|
+
import { type TurnContextBridgeState, type TurnContextRunOptions } from '../turn/turn-context-bridge.js';
|
|
27
|
+
import { type SessionCompactInfo } from '../event/session-events.js';
|
|
28
|
+
import type { PhaseTraceConfig } from '../internal/phase-trace.js';
|
|
29
|
+
import type { HttpApprovalAdapter } from '../session/http-approval-adapter.js';
|
|
30
|
+
import type { ApprovalPort } from '../session/approval-port.js';
|
|
25
31
|
import type { TurnEvent } from '../event/turn-event.js';
|
|
26
32
|
import type { IAgentTurnProcessor, IAgentSessionManager, IAgentDiagnostics, IAgentConfigurator } from '../config/agent-interfaces.js';
|
|
27
33
|
export type { ZhinAgentConfig, OnChunkCallback } from '../config/index.js';
|
|
@@ -44,79 +50,78 @@ export interface AgentTurnRequest {
|
|
|
44
50
|
readonly activityFeedbackEligible?: boolean;
|
|
45
51
|
/** Per-message routing state. Never call configure() for these values. */
|
|
46
52
|
readonly configuration?: AgentTurnConfiguration;
|
|
53
|
+
/** Unattended execution state owned by ScheduleExecutionDomain. */
|
|
54
|
+
readonly scheduleContext?: ScheduleTurnContext;
|
|
55
|
+
/** Structured turn telemetry for execution domains. */
|
|
56
|
+
readonly onTurnEvent?: (event: TurnEvent) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Snapshot generation for ToolRuntime (Plugin Runtime hosts).
|
|
59
|
+
* Must match stamps applied by agentToolsFromCapabilities / stampToolGeneration.
|
|
60
|
+
*/
|
|
61
|
+
readonly generation?: number;
|
|
47
62
|
}
|
|
48
63
|
export declare class ZhinAgent implements IAgentTurnProcessor, IAgentSessionManager, IAgentDiagnostics, IAgentConfigurator {
|
|
49
64
|
private provider;
|
|
50
|
-
|
|
65
|
+
providerResolver: ((alias: string) => AIProvider) | null;
|
|
51
66
|
private configuredActiveBinding;
|
|
52
|
-
|
|
67
|
+
config: Required<ZhinAgentConfig>;
|
|
53
68
|
/** ideal 模块槽位;经 getter/setter 供 configure 与 asPrivate(host) 读写 */
|
|
54
69
|
private readonly runtimeModules;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
readonly imSessionStore: IMSessionStore | MemoryIMSessionStore;
|
|
71
|
+
agentSessionStore: AgentSessionStore | MemoryAgentSessionStore;
|
|
72
|
+
contextRepository: ContextRepository;
|
|
73
|
+
imTranscriptStore: ImTranscriptStore;
|
|
74
|
+
memory: ConversationMemory;
|
|
75
|
+
readonly externalTools: Map<string, RegisteredAgentTool>;
|
|
76
|
+
userProfiles: UserProfileStore;
|
|
77
|
+
rateLimiter: RateLimiter;
|
|
78
|
+
subagentSystem: SubagentSystem | null;
|
|
64
79
|
private configuredBootstrapContext;
|
|
65
|
-
private
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
private resolveMemoryPersistenceReady;
|
|
80
|
-
private memoryPersistenceDone;
|
|
80
|
+
private configuredGlobalContext;
|
|
81
|
+
alwaysSkillsBaseline: string;
|
|
82
|
+
skillsSummaryXML: string;
|
|
83
|
+
modelRegistry: ModelRegistry | null;
|
|
84
|
+
readonly emitter: ZhinAgentEventEmitter;
|
|
85
|
+
readonly deferred: DeferredTurnState;
|
|
86
|
+
readonly promptController: PromptController;
|
|
87
|
+
/** HTTP approval adapter — AgentSessionHostPort 装配时写入(ADR 0041)。 */
|
|
88
|
+
httpApprovalAdapter?: HttpApprovalAdapter;
|
|
89
|
+
/** 无交互审批面传输的 host 级回退。 */
|
|
90
|
+
approvalPort?: ApprovalPort;
|
|
91
|
+
/** Per-turn instructions from defineDynamic resolvers (ADR 0039 P2)。 */
|
|
92
|
+
turnDynamicInstructions?: string;
|
|
93
|
+
lastTurnMetrics: ZhinAgentTurnMetrics | null;
|
|
81
94
|
private readonly inboundQueueConfig;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
readonly inboundTurnQueue: InboundTurnQueue;
|
|
96
|
+
readonly turnContextState: TurnContextBridgeState;
|
|
97
|
+
skillRegistry: SkillRegistry | null;
|
|
98
|
+
skillSystem: SkillSystem | null;
|
|
99
|
+
orchestrator: AgentOrchestrator | null;
|
|
100
|
+
agentCore: AgentCore | null;
|
|
101
|
+
toolSystem: ToolSystem | null;
|
|
102
|
+
contextSystem: ContextSystem | null;
|
|
103
|
+
memorySystem: MemorySystem | null;
|
|
104
|
+
sessionSystem: SessionSystem | null;
|
|
105
|
+
eventSystem: EventSystem | null;
|
|
90
106
|
get activeBinding(): ResolvedAgentBinding | null;
|
|
91
107
|
set activeBinding(value: ResolvedAgentBinding | null);
|
|
92
108
|
get bootstrapContext(): string;
|
|
93
109
|
set bootstrapContext(value: string);
|
|
94
|
-
get
|
|
95
|
-
set
|
|
96
|
-
get
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
set memorySystem(value: MemorySystem | null);
|
|
102
|
-
get sessionSystem(): SessionSystem | null;
|
|
103
|
-
set sessionSystem(value: SessionSystem | null);
|
|
104
|
-
get eventSystem(): EventSystem | null;
|
|
105
|
-
set eventSystem(value: EventSystem | null);
|
|
106
|
-
private get phaseConfig();
|
|
107
|
-
private get promptTraceConfig();
|
|
108
|
-
private get autoContinueHost();
|
|
110
|
+
get globalContext(): string;
|
|
111
|
+
set globalContext(value: string);
|
|
112
|
+
get phaseConfig(): PhaseTraceConfig;
|
|
113
|
+
get promptTraceConfig(): {
|
|
114
|
+
promptTraceEnabled: boolean;
|
|
115
|
+
promptTraceVerbose: boolean;
|
|
116
|
+
};
|
|
109
117
|
constructor(provider: AIProvider, config?: ZhinAgentConfig);
|
|
110
118
|
configure(deps: Partial<ZhinAgentDependencies>): void;
|
|
111
119
|
getTurnActiveSkills(): string;
|
|
112
|
-
/** @deprecated 使用 getTurnActiveSkills() */
|
|
113
|
-
get activeSkillsContext(): string;
|
|
114
120
|
getAlwaysSkillsBaseline(): string;
|
|
115
|
-
initScheduleTurnContext(ctx: ScheduleTurnContext): void;
|
|
116
121
|
initInboundTurnContext(): void;
|
|
117
122
|
appendActiveSkillsContext(fragment: string): void;
|
|
118
123
|
buildDisciplinedPrompt(basePrompt: string): string;
|
|
119
|
-
|
|
124
|
+
wireLlmApiLayer(): void;
|
|
120
125
|
getActiveBinding(): ResolvedAgentBinding | null;
|
|
121
126
|
getTurnProvider(): AIProvider;
|
|
122
127
|
waitForMemoryPersistence(): Promise<void>;
|
|
@@ -134,12 +139,8 @@ export declare class ZhinAgent implements IAgentTurnProcessor, IAgentSessionMana
|
|
|
134
139
|
* 群/频道旁听:未触发 AI 的共享会话消息写入会话背景(Passive Group Context),
|
|
135
140
|
* 供后续 @ 触发时带入上下文。仅群/频道场景调用(私聊/sandbox 由 Host 侧过滤)。
|
|
136
141
|
*/
|
|
137
|
-
|
|
142
|
+
recordPassiveGroupObservation(observation: PassiveGroupObservation): Promise<void>;
|
|
138
143
|
initSubagentSystem(createTools: () => AgentTool[]): void;
|
|
139
|
-
getDeferredResultSender(): SubagentResultSender | null;
|
|
140
|
-
getDeferredAutoContinueDepth(sessionKey: string): number;
|
|
141
|
-
resetDeferredAutoContinueDepth(sessionKey: string): void;
|
|
142
|
-
continueAfterDeferredWorker(commMessage: Message, taskId: string, goal: string, result: DeferredWorkerResult): Promise<void>;
|
|
143
144
|
continueAfterSubagent(payload: SubagentCompletePayload): Promise<void>;
|
|
144
145
|
getActiveTurnTracker(): TurnTracker | undefined;
|
|
145
146
|
runInTurnContext<T>(turnId: string, fn: () => Promise<T>, options?: TurnContextRunOptions): Promise<T>;
|
|
@@ -155,15 +156,12 @@ export declare class ZhinAgent implements IAgentTurnProcessor, IAgentSessionMana
|
|
|
155
156
|
tools: string[];
|
|
156
157
|
skills: string[];
|
|
157
158
|
};
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
beginActiveTurn(): void;
|
|
160
|
+
finalizeActiveTurn(partial: Omit<ZhinAgentTurnMetrics, 'usage' | 'mainUsage' | 'subagentUsage'> & {
|
|
161
|
+
usage: Usage;
|
|
162
|
+
}): Promise<void>;
|
|
160
163
|
emitSessionNewEvent(sessionId: string, commMessage: Message, mode: 'text' | 'multimodal', content: string, reply: string): void;
|
|
161
|
-
emitSessionCompactEvent(sessionId: string, commMessage: Message, mode: 'text' | 'multimodal', info:
|
|
162
|
-
microSavedTokens: number;
|
|
163
|
-
autoSavedTokens: number;
|
|
164
|
-
totalTokensBefore: number;
|
|
165
|
-
totalTokensAfter: number;
|
|
166
|
-
}): void;
|
|
164
|
+
emitSessionCompactEvent(sessionId: string, commMessage: Message, mode: 'text' | 'multimodal', info: SessionCompactInfo): void;
|
|
167
165
|
subscribe(listener: (event: AgentEvent, signal: AbortSignal) => void | Promise<void>): () => void;
|
|
168
166
|
abort(): void;
|
|
169
167
|
waitForIdle(): Promise<void>;
|
|
@@ -176,7 +174,6 @@ export declare class ZhinAgent implements IAgentTurnProcessor, IAgentSessionMana
|
|
|
176
174
|
media?: MediaContentBlock[];
|
|
177
175
|
onChunk?: OnChunkCallback;
|
|
178
176
|
}): Promise<OutputElement[]>;
|
|
179
|
-
appendPassiveGroupChatter(_commMessage: Message, _rawContent: string): Promise<void>;
|
|
180
177
|
archiveSessionForCommMessage(commMessage: Message): Promise<boolean>;
|
|
181
178
|
compactSessionForCommMessage(commMessage: Message): Promise<{
|
|
182
179
|
ok: boolean;
|
|
@@ -190,8 +187,6 @@ export declare class ZhinAgent implements IAgentTurnProcessor, IAgentSessionMana
|
|
|
190
187
|
*/
|
|
191
188
|
processTurn(request: AgentTurnRequest): Promise<OutputElement[]>;
|
|
192
189
|
processStream(content: string, commMessage: Message, externalTools?: Tool[]): AsyncGenerator<TurnEvent, void, undefined>;
|
|
193
|
-
/** Compatibility entry: translate legacy ContentPart[] into canonical media blocks. */
|
|
194
|
-
processMultimodal(parts: ContentPart[], commMessage: Message, onChunk?: OnChunkCallback): Promise<OutputElement[]>;
|
|
195
190
|
isReady(): boolean;
|
|
196
191
|
dispose(): void;
|
|
197
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zhin-agent/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zhin-agent/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB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M,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAE,IAAI,EAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAIrI;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAiC/D,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAE,IAAI,EAAO,GAAG,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC;IASnI,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;CAShB"}
|
package/lib/zhin-agent/index.js
CHANGED
|
@@ -8,13 +8,13 @@ import { MemoryIMSessionStore, ConversationMemory, createMemoryContextRepository
|
|
|
8
8
|
import { createMemorySystemForHost } from '../memory/memory-system.js';
|
|
9
9
|
import { ZhinAgentEventEmitter } from '../event/event-emitter.js';
|
|
10
10
|
import { UserProfileStore } from '../user-profile.js';
|
|
11
|
-
import {
|
|
11
|
+
import { buildParentContextSnapshot } from '../subagent-parent-context.js';
|
|
12
12
|
import { DEFAULT_CONFIG, isPhaseTraceEnabled, isPromptTraceEnabled, isPromptTraceVerbose, } from '../config/index.js';
|
|
13
13
|
import { processTextTurn } from '../turn/turn-pipeline.js';
|
|
14
|
-
import {
|
|
14
|
+
import { DeferredTurnState } from '../turn/deferred-turn-state.js';
|
|
15
15
|
import { resolveContextTailMessageLimit } from '../context/context-tail-limit.js';
|
|
16
16
|
import { archiveSessionByKey } from '../session/session-io.js';
|
|
17
|
-
import {
|
|
17
|
+
import { recordPassiveGroupObservation as recordPassiveGroupObservationInternal, } from '../session/passive-group-session.js';
|
|
18
18
|
import { asPrivate } from '../internal/as-private.js';
|
|
19
19
|
import { PromptController } from '../turn/prompt-controller.js';
|
|
20
20
|
import { getActiveTurnTracker } from '../internal/turn-context.js';
|
|
@@ -22,16 +22,16 @@ import { computeDeferredDelta } from '../turn/turn-deferred-delta.js';
|
|
|
22
22
|
import { resolveDeferredToolsConfig } from '../tool-catalog/resolve-config.js';
|
|
23
23
|
import { buildDisciplinedPrompt as assembleDisciplinedPrompt } from '../prompt/assembly.js';
|
|
24
24
|
import { createInboundTurnQueue, runWithInboundQueue } from '../turn/inbound-queue-runtime.js';
|
|
25
|
-
import {
|
|
25
|
+
import { continueAfterSubagent } from '../turn/auto-continue.js';
|
|
26
26
|
import { createSubagentSystem } from '../subagent/subagent-system-init.js';
|
|
27
27
|
import { processTextTurnStream } from '../turn/process-stream.js';
|
|
28
28
|
import { followUpMessage, runPromptTurn, steerMessage } from '../turn/prompt-api.js';
|
|
29
29
|
import { getAgentTurnConfiguration, runWithAgentTurnConfiguration, } from '../turn/agent-turn-context.js';
|
|
30
|
-
import { appendActiveSkills, getTurnActiveSkills, initInboundTurnContext as bridgeInitInboundTurnContext,
|
|
30
|
+
import { appendActiveSkills, getTurnActiveSkills, initInboundTurnContext as bridgeInitInboundTurnContext, runInTurnContext as bridgeRunInTurnContext, } from '../turn/turn-context-bridge.js';
|
|
31
31
|
import { emitSessionCompactEvent, emitSessionNewEvent } from '../event/session-events.js';
|
|
32
32
|
import { applyZhinAgentConfigure, wireZhinAgentLlmApiLayer } from '../init/configure-zhin-agent.js';
|
|
33
33
|
import { disposeZhinAgentResources } from '../init/dispose-zhin-agent.js';
|
|
34
|
-
import { clearZhinAgentRuntimeModules, createZhinAgentRuntimeModules, } from './runtime-modules.js';
|
|
34
|
+
import { bindModuleProperties, clearZhinAgentRuntimeModules, createZhinAgentRuntimeModules, } from './runtime-modules.js';
|
|
35
35
|
export { PromptAccessDeniedError } from '../turn/prompt-access.js';
|
|
36
36
|
export { formatAiHandlerCompleteLog, formatAiHandlerTurnTable, formatZhinAgentTurnUsage } from '../turn/turn-metrics.js';
|
|
37
37
|
export * from '../prompt/prompt-builder.js';
|
|
@@ -55,33 +55,25 @@ export class ZhinAgent {
|
|
|
55
55
|
rateLimiter;
|
|
56
56
|
subagentSystem = null;
|
|
57
57
|
configuredBootstrapContext = '';
|
|
58
|
+
configuredGlobalContext = '';
|
|
58
59
|
alwaysSkillsBaseline = '';
|
|
59
60
|
skillsSummaryXML = '';
|
|
60
61
|
modelRegistry = null;
|
|
61
|
-
phaseTraceEnabled;
|
|
62
|
-
promptTraceEnabled;
|
|
63
|
-
promptTraceVerbose;
|
|
64
62
|
emitter = new ZhinAgentEventEmitter();
|
|
65
|
-
|
|
66
|
-
lastToolSearchDeferredStats;
|
|
63
|
+
deferred = new DeferredTurnState();
|
|
67
64
|
promptController;
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
/** HTTP approval adapter — AgentSessionHostPort 装配时写入(ADR 0041)。 */
|
|
66
|
+
httpApprovalAdapter;
|
|
67
|
+
/** 无交互审批面传输的 host 级回退。 */
|
|
68
|
+
approvalPort;
|
|
69
|
+
/** Per-turn instructions from defineDynamic resolvers (ADR 0039 P2)。 */
|
|
70
|
+
turnDynamicInstructions;
|
|
70
71
|
lastTurnMetrics = null;
|
|
71
|
-
memoryPersistenceReady;
|
|
72
|
-
resolveMemoryPersistenceReady;
|
|
73
|
-
memoryPersistenceDone = false;
|
|
74
72
|
inboundQueueConfig;
|
|
75
73
|
inboundTurnQueue;
|
|
76
74
|
turnContextState = {
|
|
77
75
|
alwaysSkillsBaseline: '',
|
|
78
76
|
};
|
|
79
|
-
get skillRegistry() { return this.runtimeModules.skillRegistry; }
|
|
80
|
-
set skillRegistry(value) { this.runtimeModules.skillRegistry = value; }
|
|
81
|
-
get skillSystem() { return this.runtimeModules.skillSystem; }
|
|
82
|
-
set skillSystem(value) { this.runtimeModules.skillSystem = value; }
|
|
83
|
-
get orchestrator() { return this.runtimeModules.orchestrator; }
|
|
84
|
-
set orchestrator(value) { this.runtimeModules.orchestrator = value; }
|
|
85
77
|
get activeBinding() {
|
|
86
78
|
return getAgentTurnConfiguration()?.activeBinding ?? this.configuredActiveBinding;
|
|
87
79
|
}
|
|
@@ -94,48 +86,22 @@ export class ZhinAgent {
|
|
|
94
86
|
set bootstrapContext(value) {
|
|
95
87
|
this.configuredBootstrapContext = value;
|
|
96
88
|
}
|
|
97
|
-
get
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
set
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
get memorySystem() { return this.runtimeModules.memorySystem; }
|
|
104
|
-
set memorySystem(value) { this.runtimeModules.memorySystem = value; }
|
|
105
|
-
get sessionSystem() { return this.runtimeModules.sessionSystem; }
|
|
106
|
-
set sessionSystem(value) { this.runtimeModules.sessionSystem = value; }
|
|
107
|
-
get eventSystem() { return this.runtimeModules.eventSystem; }
|
|
108
|
-
set eventSystem(value) { this.runtimeModules.eventSystem = value; }
|
|
89
|
+
get globalContext() {
|
|
90
|
+
return this.configuredGlobalContext;
|
|
91
|
+
}
|
|
92
|
+
set globalContext(value) {
|
|
93
|
+
this.configuredGlobalContext = value;
|
|
94
|
+
}
|
|
109
95
|
get phaseConfig() {
|
|
110
|
-
return { phaseTraceEnabled: this.
|
|
96
|
+
return { phaseTraceEnabled: isPhaseTraceEnabled(this.config), onPhaseTrace: this.config.onPhaseTrace };
|
|
111
97
|
}
|
|
112
98
|
get promptTraceConfig() {
|
|
113
|
-
return {
|
|
114
|
-
promptTraceEnabled: this.promptTraceEnabled,
|
|
115
|
-
promptTraceVerbose: this.promptTraceVerbose,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
get autoContinueHost() {
|
|
119
|
-
return {
|
|
120
|
-
config: this.config,
|
|
121
|
-
promptController: this.promptController,
|
|
122
|
-
getDeferredAutoContinueDepth: (k) => this.getDeferredAutoContinueDepth(k),
|
|
123
|
-
setDeferredAutoContinueDepth: (k, d) => this.deferredAutoContinueDepthBySession.set(k, d),
|
|
124
|
-
resetDeferredAutoContinueDepth: (k) => this.resetDeferredAutoContinueDepth(k),
|
|
125
|
-
getDeferredResultSender: () => this.getDeferredResultSender(),
|
|
126
|
-
runInTurnContext: (turnId, fn) => this.runInTurnContext(turnId, fn),
|
|
127
|
-
};
|
|
99
|
+
return { promptTraceEnabled: isPromptTraceEnabled(this.config), promptTraceVerbose: isPromptTraceVerbose(this.config) };
|
|
128
100
|
}
|
|
129
101
|
constructor(provider, config) {
|
|
130
102
|
this.provider = provider;
|
|
131
103
|
const merged = { ...DEFAULT_CONFIG, ...config };
|
|
132
104
|
this.config = merged;
|
|
133
|
-
this.phaseTraceEnabled = isPhaseTraceEnabled(this.config);
|
|
134
|
-
this.promptTraceEnabled = isPromptTraceEnabled(this.config);
|
|
135
|
-
this.promptTraceVerbose = isPromptTraceVerbose(this.config);
|
|
136
|
-
this.memoryPersistenceReady = new Promise((resolve) => {
|
|
137
|
-
this.resolveMemoryPersistenceReady = resolve;
|
|
138
|
-
});
|
|
139
105
|
this.memory = new ConversationMemory({
|
|
140
106
|
minTopicRounds: this.config.minTopicRounds,
|
|
141
107
|
slidingWindowSize: this.config.slidingWindowSize,
|
|
@@ -157,6 +123,7 @@ export class ZhinAgent {
|
|
|
157
123
|
this.imTranscriptStore = new MemoryImTranscriptStore();
|
|
158
124
|
this.turnContextState.alwaysSkillsBaseline = this.alwaysSkillsBaseline;
|
|
159
125
|
this.runtimeModules = createZhinAgentRuntimeModules(asPrivate(this));
|
|
126
|
+
bindModuleProperties(this, this.runtimeModules);
|
|
160
127
|
this.wireLlmApiLayer();
|
|
161
128
|
}
|
|
162
129
|
configure(deps) {
|
|
@@ -165,16 +132,9 @@ export class ZhinAgent {
|
|
|
165
132
|
getTurnActiveSkills() {
|
|
166
133
|
return getTurnActiveSkills(this.turnContextState);
|
|
167
134
|
}
|
|
168
|
-
/** @deprecated 使用 getTurnActiveSkills() */
|
|
169
|
-
get activeSkillsContext() {
|
|
170
|
-
return this.getTurnActiveSkills();
|
|
171
|
-
}
|
|
172
135
|
getAlwaysSkillsBaseline() {
|
|
173
136
|
return this.alwaysSkillsBaseline;
|
|
174
137
|
}
|
|
175
|
-
initScheduleTurnContext(ctx) {
|
|
176
|
-
bridgeInitScheduleTurnContext(this.turnContextState, ctx);
|
|
177
|
-
}
|
|
178
138
|
initInboundTurnContext() {
|
|
179
139
|
bridgeInitInboundTurnContext(this.turnContextState);
|
|
180
140
|
}
|
|
@@ -203,27 +163,10 @@ export class ZhinAgent {
|
|
|
203
163
|
return this.provider;
|
|
204
164
|
}
|
|
205
165
|
async waitForMemoryPersistence() {
|
|
206
|
-
|
|
207
|
-
return;
|
|
208
|
-
const timeoutMs = process.env.NODE_ENV === 'test' ? 50 : 5_000;
|
|
209
|
-
await Promise.race([
|
|
210
|
-
this.memoryPersistenceReady,
|
|
211
|
-
new Promise((resolve) => {
|
|
212
|
-
setTimeout(() => {
|
|
213
|
-
if (!this.memoryPersistenceDone) {
|
|
214
|
-
logger.warn('waitForMemoryPersistence: timeout, proceeding with in-memory session/history');
|
|
215
|
-
this.markMemoryPersistenceReady();
|
|
216
|
-
}
|
|
217
|
-
resolve();
|
|
218
|
-
}, timeoutMs);
|
|
219
|
-
}),
|
|
220
|
-
]);
|
|
166
|
+
return this.requireSessionSystem().waitForPersistence();
|
|
221
167
|
}
|
|
222
168
|
markMemoryPersistenceReady() {
|
|
223
|
-
|
|
224
|
-
return;
|
|
225
|
-
this.memoryPersistenceDone = true;
|
|
226
|
-
this.resolveMemoryPersistenceReady?.();
|
|
169
|
+
this.requireSessionSystem().markPersistenceReady();
|
|
227
170
|
}
|
|
228
171
|
sharePersistenceWith(target) {
|
|
229
172
|
target.configure({
|
|
@@ -232,7 +175,7 @@ export class ZhinAgent {
|
|
|
232
175
|
contextRepository: this.contextRepository,
|
|
233
176
|
imTranscriptStore: this.imTranscriptStore,
|
|
234
177
|
});
|
|
235
|
-
if (this.
|
|
178
|
+
if (this.requireSessionSystem().isPersistenceReady()) {
|
|
236
179
|
target.markMemoryPersistenceReady();
|
|
237
180
|
}
|
|
238
181
|
}
|
|
@@ -254,8 +197,8 @@ export class ZhinAgent {
|
|
|
254
197
|
* 群/频道旁听:未触发 AI 的共享会话消息写入会话背景(Passive Group Context),
|
|
255
198
|
* 供后续 @ 触发时带入上下文。仅群/频道场景调用(私聊/sandbox 由 Host 侧过滤)。
|
|
256
199
|
*/
|
|
257
|
-
async
|
|
258
|
-
await
|
|
200
|
+
async recordPassiveGroupObservation(observation) {
|
|
201
|
+
await recordPassiveGroupObservationInternal(asPrivate(this), observation);
|
|
259
202
|
}
|
|
260
203
|
initSubagentSystem(createTools) {
|
|
261
204
|
this.subagentSystem = createSubagentSystem({
|
|
@@ -267,20 +210,8 @@ export class ZhinAgent {
|
|
|
267
210
|
onSubagentComplete: (payload) => this.continueAfterSubagent(payload),
|
|
268
211
|
});
|
|
269
212
|
}
|
|
270
|
-
getDeferredResultSender() {
|
|
271
|
-
return this.deferredResultSender;
|
|
272
|
-
}
|
|
273
|
-
getDeferredAutoContinueDepth(sessionKey) {
|
|
274
|
-
return this.deferredAutoContinueDepthBySession.get(sessionKey) ?? 0;
|
|
275
|
-
}
|
|
276
|
-
resetDeferredAutoContinueDepth(sessionKey) {
|
|
277
|
-
this.deferredAutoContinueDepthBySession.delete(sessionKey);
|
|
278
|
-
}
|
|
279
|
-
async continueAfterDeferredWorker(commMessage, taskId, goal, result) {
|
|
280
|
-
return continueAfterDeferredWorker(this.autoContinueHost, asPrivate(this), commMessage, taskId, goal, result);
|
|
281
|
-
}
|
|
282
213
|
async continueAfterSubagent(payload) {
|
|
283
|
-
return continueAfterSubagent(
|
|
214
|
+
return continueAfterSubagent(asPrivate(this), payload);
|
|
284
215
|
}
|
|
285
216
|
getActiveTurnTracker() {
|
|
286
217
|
return getActiveTurnTracker();
|
|
@@ -293,12 +224,7 @@ export class ZhinAgent {
|
|
|
293
224
|
}
|
|
294
225
|
async buildParentContextSnapshotForSubagent(origin) {
|
|
295
226
|
const sessionKey = resolveIMSessionIdFromMessage(origin.message);
|
|
296
|
-
|
|
297
|
-
if (!active)
|
|
298
|
-
return undefined;
|
|
299
|
-
const ctx = await this.contextRepository.loadContext(active.session_id);
|
|
300
|
-
const preamble = buildParentContextPreamble(ctx.messages);
|
|
301
|
-
return preamble || undefined;
|
|
227
|
+
return buildParentContextSnapshot(this.agentSessionStore, this.contextRepository, sessionKey);
|
|
302
228
|
}
|
|
303
229
|
getEventEmitter() {
|
|
304
230
|
return this.emitter;
|
|
@@ -322,9 +248,9 @@ export class ZhinAgent {
|
|
|
322
248
|
}
|
|
323
249
|
getLastTurnToolSnapshot() {
|
|
324
250
|
const priv = asPrivate(this);
|
|
325
|
-
const snap = priv.
|
|
251
|
+
const snap = priv.deferred.lastSessionSnapshot ?? { loadedTools: {}, loadedSkills: [] };
|
|
326
252
|
const deferredCfg = resolveDeferredToolsConfig(this.config);
|
|
327
|
-
return computeDeferredDelta(snap, deferredCfg.alwaysLoadedTools, priv.
|
|
253
|
+
return computeDeferredDelta(snap, deferredCfg.alwaysLoadedTools, priv.deferred.lastSnapshotBefore);
|
|
328
254
|
}
|
|
329
255
|
beginActiveTurn() {
|
|
330
256
|
getActiveTurnTracker()?.begin();
|
|
@@ -369,13 +295,9 @@ export class ZhinAgent {
|
|
|
369
295
|
async prompt(input, commMessage, options) {
|
|
370
296
|
return runPromptTurn(asPrivate(this), input, commMessage, (id, fn) => this.runInTurnContext(id, fn), options);
|
|
371
297
|
}
|
|
372
|
-
async appendPassiveGroupChatter(_commMessage, _rawContent) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
298
|
async archiveSessionForCommMessage(commMessage) {
|
|
376
299
|
const sessionKey = resolveIMSessionIdFromMessage(commMessage);
|
|
377
300
|
return archiveSessionByKey({
|
|
378
|
-
imSessionStore: this.imSessionStore,
|
|
379
301
|
agentSessionStore: this.agentSessionStore,
|
|
380
302
|
contextRepository: this.contextRepository,
|
|
381
303
|
}, sessionKey);
|
|
@@ -393,77 +315,49 @@ export class ZhinAgent {
|
|
|
393
315
|
return system;
|
|
394
316
|
}
|
|
395
317
|
async process(content, commMessage, externalTools = [], onChunk) {
|
|
396
|
-
return this.processTurn({
|
|
397
|
-
content,
|
|
398
|
-
message: commMessage,
|
|
399
|
-
tools: externalTools,
|
|
400
|
-
...(onChunk ? { onChunk } : {}),
|
|
401
|
-
});
|
|
318
|
+
return this.processTurn({ content, message: commMessage, tools: externalTools, onChunk });
|
|
402
319
|
}
|
|
403
320
|
/**
|
|
404
321
|
* Executes one immutable, generation-owned Agent turn. This prevents two
|
|
405
322
|
* concurrent IM messages from overwriting activeBinding/bootstrapContext.
|
|
406
323
|
*/
|
|
407
324
|
async processTurn(request) {
|
|
408
|
-
|
|
409
|
-
content: request.content,
|
|
325
|
+
const executeTurn = (content) => processTextTurn(asPrivate(this), content, request.message, [...(request.tools ?? [])], request.onChunk, {
|
|
410
326
|
signal: request.signal,
|
|
411
|
-
|
|
412
|
-
|
|
327
|
+
onTurnEvent: request.onTurnEvent,
|
|
328
|
+
isolated: request.scheduleContext !== undefined,
|
|
329
|
+
generation: request.generation,
|
|
330
|
+
scheduleContext: request.scheduleContext,
|
|
331
|
+
});
|
|
332
|
+
return runWithAgentTurnConfiguration(request.configuration ?? {}, () => this.runInTurnContext(randomUUID(), () => request.scheduleContext
|
|
333
|
+
? executeTurn(request.content)
|
|
334
|
+
: runWithInboundQueue(request.message, this.inboundQueueConfig, this.inboundTurnQueue, {
|
|
335
|
+
content: request.content,
|
|
336
|
+
signal: request.signal,
|
|
337
|
+
run: executeTurn,
|
|
338
|
+
}), request.activityFeedbackEligible === undefined
|
|
413
339
|
? undefined
|
|
414
|
-
: {
|
|
340
|
+
: {
|
|
341
|
+
activityFeedbackEligible: request.activityFeedbackEligible,
|
|
342
|
+
}));
|
|
415
343
|
}
|
|
416
344
|
async *processStream(content, commMessage, externalTools = []) {
|
|
417
345
|
yield* processTextTurnStream(asPrivate(this), {
|
|
418
|
-
content,
|
|
419
|
-
|
|
420
|
-
externalTools,
|
|
421
|
-
inboundQueueConfig: this.inboundQueueConfig,
|
|
422
|
-
inboundTurnQueue: this.inboundTurnQueue,
|
|
346
|
+
content, commMessage, externalTools,
|
|
347
|
+
inboundQueueConfig: this.inboundQueueConfig, inboundTurnQueue: this.inboundTurnQueue,
|
|
423
348
|
runInTurnContext: (id, fn) => this.runInTurnContext(id, fn),
|
|
424
349
|
});
|
|
425
350
|
}
|
|
426
|
-
/** Compatibility entry: translate legacy ContentPart[] into canonical media blocks. */
|
|
427
|
-
async processMultimodal(parts, commMessage, onChunk) {
|
|
428
|
-
const payloads = await normalizeContentPartsToPayloads(parts, 26_214_400);
|
|
429
|
-
const mediaBlocks = payloads.flatMap((payload) => {
|
|
430
|
-
const block = payloadToVisionPart(payload);
|
|
431
|
-
return block ? [block] : [];
|
|
432
|
-
});
|
|
433
|
-
const content = summarizeContentParts(parts);
|
|
434
|
-
return this.runInTurnContext(randomUUID(), () => runWithInboundQueue(commMessage, this.inboundQueueConfig, this.inboundTurnQueue, {
|
|
435
|
-
coalesce: false,
|
|
436
|
-
run: () => processTextTurn(asPrivate(this), content, commMessage, [], onChunk, { mediaBlocks }),
|
|
437
|
-
}));
|
|
438
|
-
}
|
|
439
351
|
isReady() {
|
|
440
352
|
return true;
|
|
441
353
|
}
|
|
442
354
|
dispose() {
|
|
443
355
|
disposeZhinAgentResources(this);
|
|
444
356
|
this.subagentSystem = null;
|
|
445
|
-
this.deferredAutoContinueDepthBySession.clear();
|
|
446
|
-
this.deferredCatalog = [];
|
|
447
357
|
this.lastTurnMetrics = null;
|
|
448
358
|
this.provider = null;
|
|
449
359
|
this.providerResolver = null;
|
|
450
360
|
clearZhinAgentRuntimeModules(this.runtimeModules);
|
|
451
361
|
}
|
|
452
362
|
}
|
|
453
|
-
function summarizeContentParts(parts) {
|
|
454
|
-
const text = parts
|
|
455
|
-
.filter((part) => part.type === 'text')
|
|
456
|
-
.map((part) => part.text)
|
|
457
|
-
.join(' ')
|
|
458
|
-
.trim();
|
|
459
|
-
if (text)
|
|
460
|
-
return text;
|
|
461
|
-
if (parts.some((part) => part.type === 'image_url'))
|
|
462
|
-
return '[图片]';
|
|
463
|
-
if (parts.some((part) => part.type === 'audio'))
|
|
464
|
-
return '[音频]';
|
|
465
|
-
if (parts.some((part) => part.type === 'video_url'))
|
|
466
|
-
return '[视频]';
|
|
467
|
-
return '[多模态消息]';
|
|
468
|
-
}
|
|
469
363
|
//# sourceMappingURL=index.js.map
|