@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,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ask_user 挂起会话注册表 — 委托 AskUserSessionService(常驻 middleware)。
|
|
3
|
-
*/
|
|
4
|
-
import type { Message, Plugin } from '@zhin.js/core';
|
|
5
|
-
import { AskUserSessionService } from './ask-user-session-service.js';
|
|
6
|
-
export interface PendingAskUserSession {
|
|
7
|
-
endpointId: string;
|
|
8
|
-
masterId: string;
|
|
9
|
-
groupOrigin?: Message;
|
|
10
|
-
registeredAt: number;
|
|
11
|
-
}
|
|
12
|
-
export declare function registerPendingAskUser(_session: PendingAskUserSession): void;
|
|
13
|
-
export declare function clearPendingAskUser(_endpointId: string, _masterId: string): void;
|
|
14
|
-
export declare function getPendingAskUser(_endpointId: string, _masterId: string): PendingAskUserSession | undefined;
|
|
15
|
-
/** 该私聊消息是否应作为 ask_user 回复消费(勿再触发 AI Handler)。 */
|
|
16
|
-
export declare function isAskUserPendingReply(message: Message, root?: Plugin): boolean;
|
|
17
|
-
export declare function ensureAskUserSessionService(plugin: Plugin): AskUserSessionService;
|
|
18
|
-
//# sourceMappingURL=ask-user-session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-session.d.ts","sourceRoot":"","sources":["../../src/builtin/ask-user-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAE5E;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAEhF;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAE3G;AAED,iDAAiD;AACjD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAIT;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CAEjF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AskUserSessionService } from './ask-user-session-service.js';
|
|
2
|
-
export function registerPendingAskUser(_session) {
|
|
3
|
-
// legacy no-op:排队与会话状态由 AskUserSessionService 管理
|
|
4
|
-
}
|
|
5
|
-
export function clearPendingAskUser(_endpointId, _masterId) {
|
|
6
|
-
// legacy no-op
|
|
7
|
-
}
|
|
8
|
-
export function getPendingAskUser(_endpointId, _masterId) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
/** 该私聊消息是否应作为 ask_user 回复消费(勿再触发 AI Handler)。 */
|
|
12
|
-
export function isAskUserPendingReply(message, root) {
|
|
13
|
-
const service = AskUserSessionService.get();
|
|
14
|
-
if (!service)
|
|
15
|
-
return false;
|
|
16
|
-
return service.isPendingReply(message, root);
|
|
17
|
-
}
|
|
18
|
-
export function ensureAskUserSessionService(plugin) {
|
|
19
|
-
return AskUserSessionService.install(plugin);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=ask-user-session.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-session.js","sourceRoot":"","sources":["../../src/builtin/ask-user-session.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAStE,MAAM,UAAU,sBAAsB,CAAC,QAA+B;IACpE,iDAAiD;AACnD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,SAAiB;IACxE,eAAe;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAAmB,EAAE,SAAiB;IACtE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,qBAAqB,CACnC,OAAgB,EAChB,IAAa;IAEb,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE,CAAC;IAC5C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,MAAc;IACxD,OAAO,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ask_user — 默认在当前会话(群/频道/私聊)Prompt 提问;敏感确认走私聊 master(群来源带 parent)。
|
|
3
|
-
*/
|
|
4
|
-
import { type Plugin, type Message, type Tool, type ToolParametersSchema, type ToolResult, type Adapter } from '@zhin.js/core';
|
|
5
|
-
import { BuiltinBaseTool } from './builtin-base-tool.js';
|
|
6
|
-
export declare function askViaPrompt(plugin: Plugin, message: Message, args: Record<string, unknown>, questionType: string, timeoutMs: number): Promise<string>;
|
|
7
|
-
export declare function formatOwnerResponse(raw: string, questionType: string, args: Record<string, unknown>): string;
|
|
8
|
-
export declare function buildSensitiveOwnerQuestionText(commMessage: Message, question: string, questionType: string, options?: string[]): string;
|
|
9
|
-
export declare function askOwnerViaPrivateWithParent(plugin: Plugin, commMessage: Message, args: Record<string, unknown>, questionType: string, timeoutMs: number, botMaster: string, adapter: Adapter): Promise<string>;
|
|
10
|
-
export declare const ASK_USER_PARAMETERS: ToolParametersSchema;
|
|
11
|
-
export declare function createAskUserTool(plugin: Plugin): Tool;
|
|
12
|
-
export declare class AskUserBuiltinTool extends BuiltinBaseTool {
|
|
13
|
-
private readonly plugin;
|
|
14
|
-
readonly name = "ask_user";
|
|
15
|
-
readonly description = "Ask the user and wait for a reply. Default: prompt in the current session (group/channel/private) to the triggering user. Set sensitive=true only to confirm with the Endpoint Owner via private DM (group origin uses parent; no group-visible trace). Owner private chat: /approve always bash, /approve rule <regex>, /approve list, /approve revoke. write_file / edit_file / web_fetch hard-orchestration still requires per-action Owner confirm.";
|
|
16
|
-
readonly parameters: ToolParametersSchema<Record<string, any>>;
|
|
17
|
-
readonly kind = "interaction";
|
|
18
|
-
readonly executionTimeoutMs = 150000;
|
|
19
|
-
constructor(plugin: Plugin);
|
|
20
|
-
run(args: Record<string, unknown>, commMessage?: Message): Promise<ToolResult>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=ask-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Q,eAAe;IAQzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPnC,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,6bACwa;IAC5b,QAAQ,CAAC,UAAU,4CAAuB;IAC1C,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,kBAAkB,UAAW;gBAET,MAAM,EAAE,MAAM;IAgBrC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;CAiDrF"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { BuiltinBaseTool } from './builtin-base-tool.js';
|
|
3
|
-
import { shouldBlockDelegationAskUser } from '../collaboration/ask-user-bridge.js';
|
|
4
|
-
import { ensureAskUserSessionService } from './ask-user-session.js';
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Prompt / Owner 回复格式化
|
|
7
|
-
// ============================================================================
|
|
8
|
-
export async function askViaPrompt(plugin, message, args, questionType, timeoutMs) {
|
|
9
|
-
const service = ensureAskUserSessionService(plugin);
|
|
10
|
-
return service.open({
|
|
11
|
-
sessionId: randomUUID(),
|
|
12
|
-
kind: 'prompt',
|
|
13
|
-
message,
|
|
14
|
-
questionType,
|
|
15
|
-
args,
|
|
16
|
-
timeoutMs,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export function formatOwnerResponse(raw, questionType, args) {
|
|
20
|
-
switch (questionType) {
|
|
21
|
-
case 'confirm':
|
|
22
|
-
return raw.trim().toLowerCase() === 'yes' ? 'yes' : 'no';
|
|
23
|
-
case 'number':
|
|
24
|
-
return String(Number(raw) || 0);
|
|
25
|
-
case 'pick': {
|
|
26
|
-
const idx = Number(raw.trim());
|
|
27
|
-
const options = args.options || [];
|
|
28
|
-
if (idx >= 1 && idx <= options.length)
|
|
29
|
-
return options[idx - 1];
|
|
30
|
-
return raw;
|
|
31
|
-
}
|
|
32
|
-
case 'text':
|
|
33
|
-
default:
|
|
34
|
-
return raw;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export function buildSensitiveOwnerQuestionText(commMessage, question, questionType, options) {
|
|
38
|
-
const sourceInfo = commMessage.$channel?.type !== 'private'
|
|
39
|
-
? `来源: ${commMessage.$channel?.type}(${commMessage.$channel?.id}) 用户: ${commMessage.$sender.id}`
|
|
40
|
-
: `来源: 私聊 用户: ${commMessage.$sender.id}`;
|
|
41
|
-
let questionText = `请求确认:\n${sourceInfo}\n\n${question}`;
|
|
42
|
-
if (questionType === 'confirm') {
|
|
43
|
-
questionText += '\n输入"yes"以确认';
|
|
44
|
-
}
|
|
45
|
-
else if (questionType === 'pick' && options?.length) {
|
|
46
|
-
questionText += '\n' + options.map((o, i) => `${i + 1}.${o}`).join('\n');
|
|
47
|
-
}
|
|
48
|
-
else if (questionType === 'number') {
|
|
49
|
-
questionText += '\n(请输入数字)';
|
|
50
|
-
}
|
|
51
|
-
return questionText;
|
|
52
|
-
}
|
|
53
|
-
function isGroupOrChannelScope(message) {
|
|
54
|
-
const scope = message.$channel?.type;
|
|
55
|
-
return scope === 'group' || scope === 'channel';
|
|
56
|
-
}
|
|
57
|
-
export async function askOwnerViaPrivateWithParent(plugin, commMessage, args, questionType, timeoutMs, botMaster, adapter) {
|
|
58
|
-
const service = ensureAskUserSessionService(plugin);
|
|
59
|
-
return service.open({
|
|
60
|
-
sessionId: randomUUID(),
|
|
61
|
-
kind: 'sensitive_dm',
|
|
62
|
-
message: commMessage,
|
|
63
|
-
questionType,
|
|
64
|
-
args,
|
|
65
|
-
timeoutMs,
|
|
66
|
-
botMaster,
|
|
67
|
-
adapter,
|
|
68
|
-
groupOrigin: commMessage,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
export const ASK_USER_PARAMETERS = {
|
|
72
|
-
type: 'object',
|
|
73
|
-
properties: {
|
|
74
|
-
question: { type: 'string', description: 'Question text to ask the user or Endpoint Owner' },
|
|
75
|
-
type: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
enum: ['text', 'number', 'confirm', 'pick'],
|
|
78
|
-
description: 'Response type: text, number, confirm (yes/no), or pick (numbered options). Default: text',
|
|
79
|
-
},
|
|
80
|
-
options: {
|
|
81
|
-
type: 'array',
|
|
82
|
-
items: { type: 'string' },
|
|
83
|
-
description: 'Option labels when type=pick (required), e.g. ["Option A","Option B"]',
|
|
84
|
-
},
|
|
85
|
-
default_value: { type: 'string', description: 'Fallback value if the user does not reply before timeout' },
|
|
86
|
-
timeout: { type: 'number', description: 'Wait timeout in seconds. Default: 120' },
|
|
87
|
-
sensitive: {
|
|
88
|
-
type: 'boolean',
|
|
89
|
-
description: 'When true, send a private confirmation to the Endpoint Owner (group/channel origin includes parent scene). Use for exec approval, secrets, or other sensitive confirms. Do not set for ordinary clarification.',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
required: ['question'],
|
|
93
|
-
};
|
|
94
|
-
export function createAskUserTool(plugin) {
|
|
95
|
-
ensureAskUserSessionService(plugin);
|
|
96
|
-
return new AskUserBuiltinTool(plugin).toTool();
|
|
97
|
-
}
|
|
98
|
-
export class AskUserBuiltinTool extends BuiltinBaseTool {
|
|
99
|
-
plugin;
|
|
100
|
-
name = 'ask_user';
|
|
101
|
-
description = 'Ask the user and wait for a reply. Default: prompt in the current session (group/channel/private) to the triggering user. Set sensitive=true only to confirm with the Endpoint Owner via private DM (group origin uses parent; no group-visible trace). Owner private chat: /approve always bash, /approve rule <regex>, /approve list, /approve revoke. write_file / edit_file / web_fetch hard-orchestration still requires per-action Owner confirm.';
|
|
102
|
-
parameters = ASK_USER_PARAMETERS;
|
|
103
|
-
kind = 'interaction';
|
|
104
|
-
executionTimeoutMs = 150_000;
|
|
105
|
-
constructor(plugin) {
|
|
106
|
-
super();
|
|
107
|
-
this.plugin = plugin;
|
|
108
|
-
this.tags.push('interaction', 'prompt');
|
|
109
|
-
this.keywords.push('询问', '确认', '提问', '用户输入', 'ask', 'confirm', 'prompt', '选择', '请问');
|
|
110
|
-
}
|
|
111
|
-
async run(args, commMessage) {
|
|
112
|
-
if (!commMessage) {
|
|
113
|
-
return 'Error: 当前上下文没有消息来源,无法提问。请改为在回复中直接询问。';
|
|
114
|
-
}
|
|
115
|
-
if (!this.plugin) {
|
|
116
|
-
return 'Error: 插件实例不可用,无法创建交互式提问。请改为在回复中直接询问。';
|
|
117
|
-
}
|
|
118
|
-
const timeoutMs = (args.timeout ?? 120) * 1000;
|
|
119
|
-
const questionType = args.type || 'text';
|
|
120
|
-
const recordArgs = args;
|
|
121
|
-
const question = String(args.question ?? '');
|
|
122
|
-
const platform = commMessage.$adapter;
|
|
123
|
-
const endpointId = commMessage.$endpoint;
|
|
124
|
-
const adapter = this.plugin.inject(platform);
|
|
125
|
-
const bot = adapter?.endpoints?.get(endpointId);
|
|
126
|
-
const botMaster = bot?.$config?.master;
|
|
127
|
-
const isPrivateMaster = commMessage.$channel?.type === 'private'
|
|
128
|
-
&& botMaster != null && String(commMessage.$sender.id) === String(botMaster);
|
|
129
|
-
if (isPrivateMaster) {
|
|
130
|
-
return askViaPrompt(this.plugin, commMessage, recordArgs, questionType, timeoutMs);
|
|
131
|
-
}
|
|
132
|
-
const delegationBlock = shouldBlockDelegationAskUser(commMessage, question, questionType);
|
|
133
|
-
if (delegationBlock)
|
|
134
|
-
return delegationBlock;
|
|
135
|
-
const sensitive = args.sensitive === true;
|
|
136
|
-
if (sensitive && isGroupOrChannelScope(commMessage)) {
|
|
137
|
-
if (!botMaster) {
|
|
138
|
-
return 'Error: 当前 Endpoint 未配置 master,无法进行敏感确认。请在 endpoints 配置中设置 master 字段。';
|
|
139
|
-
}
|
|
140
|
-
if (!adapter || typeof adapter.sendMessage !== 'function') {
|
|
141
|
-
return `Error: 无法获取适配器 ${platform},无法向 Owner 发送私聊确认。`;
|
|
142
|
-
}
|
|
143
|
-
return askOwnerViaPrivateWithParent(this.plugin, commMessage, recordArgs, questionType, timeoutMs, botMaster, adapter);
|
|
144
|
-
}
|
|
145
|
-
return askViaPrompt(this.plugin, commMessage, recordArgs, questionType, timeoutMs);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=ask-user-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-tool.js","sourceRoot":"","sources":["../../src/builtin/ask-user-tool.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,OAAgB,EAChB,IAA6B,EAC7B,YAAoB,EACpB,SAAiB;IAEjB,MAAM,OAAO,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACpD,OAAO,OAAO,CAAC,IAAI,CAAC;QAClB,SAAS,EAAE,UAAU,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,YAAY;QACZ,IAAI;QACJ,SAAS;KACV,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAW,EAAE,YAAoB,EAAE,IAA6B;IAClG,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAClC,KAAK,MAAM,CAAC,CAAC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O,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deferred schema meta tools: discover, load_tool, load_skill
|
|
3
|
-
*/
|
|
4
|
-
import { type DeferredToolSessionSnapshot } from '@zhin.js/ai';
|
|
5
|
-
import type { Message, Tool, ToolParametersSchema, ToolResult } from '@zhin.js/core';
|
|
6
|
-
import type { SkillRegistry } from '../orchestrator/skill-registry.js';
|
|
7
|
-
import type { ToolCatalogItem } from '../tool-catalog/types.js';
|
|
8
|
-
import { type LoadSkillToolOptions } from './load-skill-tool.js';
|
|
9
|
-
import { BuiltinBaseTool } from './builtin-base-tool.js';
|
|
10
|
-
export declare const TOOLS_MUTATED_MARKER = "__zhin_tools_mutated__";
|
|
11
|
-
export interface DeferredToolRuntime {
|
|
12
|
-
sessionId: string;
|
|
13
|
-
catalog: ToolCatalogItem[];
|
|
14
|
-
skillRegistry: SkillRegistry | null;
|
|
15
|
-
snapshot: DeferredToolSessionSnapshot;
|
|
16
|
-
maxLoadedPerSession: number;
|
|
17
|
-
discoverTopK: number;
|
|
18
|
-
persistSnapshot: (snapshot: DeferredToolSessionSnapshot) => Promise<void>;
|
|
19
|
-
onSkillLoaded?: (name: string, instructions: string, toolNames: string[]) => void;
|
|
20
|
-
skillLoadOpts: LoadSkillToolOptions;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* 在独立 deferred runtime 下执行:load_tool / discover 的 snapshot 变更只影响本上下文,
|
|
24
|
-
* 不会污染父会话(此前 subagent 的 load_tool 会写父会话 snapshot)。
|
|
25
|
-
*/
|
|
26
|
-
export declare function runWithDeferredToolRuntime<T>(runtime: DeferredToolRuntime, fn: () => Promise<T>): Promise<T>;
|
|
27
|
-
export declare function bindDeferredToolRuntime(message: Message, runtime: DeferredToolRuntime): void;
|
|
28
|
-
export declare function getDeferredToolRuntime(message?: Message): DeferredToolRuntime | undefined;
|
|
29
|
-
export declare class DiscoverBuiltinTool extends BuiltinBaseTool {
|
|
30
|
-
readonly name = "discover";
|
|
31
|
-
readonly description = "Search deferred tools and skills by query. kind: tool|skill|all (default all). Empty query returns platform-matched skills.";
|
|
32
|
-
readonly parameters: ToolParametersSchema;
|
|
33
|
-
run(args: Record<string, unknown>, commMessage?: Message): Promise<ToolResult>;
|
|
34
|
-
}
|
|
35
|
-
export declare class LoadToolBuiltinTool extends BuiltinBaseTool {
|
|
36
|
-
readonly name = "load_tool";
|
|
37
|
-
readonly description = "Load a deferred tool schema into the session so it can be called.";
|
|
38
|
-
readonly parameters: ToolParametersSchema;
|
|
39
|
-
run(args: Record<string, unknown>, commMessage?: Message): Promise<ToolResult>;
|
|
40
|
-
}
|
|
41
|
-
export declare class LoadSkillBuiltinToolMeta extends BuiltinBaseTool {
|
|
42
|
-
private readonly skillOpts;
|
|
43
|
-
readonly name = "load_skill";
|
|
44
|
-
readonly description = "Load full skill instructions and unlock associated tools for this session.";
|
|
45
|
-
readonly parameters: ToolParametersSchema;
|
|
46
|
-
constructor(skillOpts: LoadSkillToolOptions);
|
|
47
|
-
run(args: Record<string, unknown>, commMessage?: Message): Promise<ToolResult>;
|
|
48
|
-
}
|
|
49
|
-
export declare function createDeferredMetaTools(skillOpts: LoadSkillToolOptions): Tool[];
|
|
50
|
-
export declare function isToolsMutatedResult(result: ToolResult): boolean;
|
|
51
|
-
//# sourceMappingURL=deferred-tool-meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferred-tool-meta.d.ts","sourceRoot":"","sources":["../../src/builtin/deferred-tool-meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAkB,KAAK,2BAA2B,EAAiE,MAAM,aAAa,CAAC;AAC9I,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAA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AOvC;IAEI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;CAkBrF;AAED,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,uEAAuE;IAC3F,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAMvC;IAEI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;CAUrF;AAED,qBAAa,wBAAyB,SAAQ,eAAe;IAY/C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAXtC,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gFAC2D;IAC/E,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAMvC;gBAE2B,SAAS,EAAE,oBAAoB;IAItD,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;CAiBrF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,EAAE,CAM/E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAGhE"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deferred schema meta tools: discover, load_tool, load_skill
|
|
3
|
-
*/
|
|
4
|
-
import { addSkillToSnapshot, touchToolInSnapshot, touchToolsInSnapshot } from '@zhin.js/ai';
|
|
5
|
-
import { catalogToolByName, discoverInCatalog, } from '../tool-catalog/tool-catalog.js';
|
|
6
|
-
import { readSkillInstructions } from './load-skill-tool.js';
|
|
7
|
-
import { BuiltinBaseTool } from './builtin-base-tool.js';
|
|
8
|
-
export const TOOLS_MUTATED_MARKER = '__zhin_tools_mutated__';
|
|
9
|
-
const deferredRuntime = new WeakMap();
|
|
10
|
-
/** 异步上下文级 runtime:优先于 WeakMap——subagent / standalone loop 的隔离通道 */
|
|
11
|
-
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
12
|
-
const deferredRuntimeAls = new AsyncLocalStorage();
|
|
13
|
-
/**
|
|
14
|
-
* 在独立 deferred runtime 下执行:load_tool / discover 的 snapshot 变更只影响本上下文,
|
|
15
|
-
* 不会污染父会话(此前 subagent 的 load_tool 会写父会话 snapshot)。
|
|
16
|
-
*/
|
|
17
|
-
export function runWithDeferredToolRuntime(runtime, fn) {
|
|
18
|
-
return deferredRuntimeAls.run(runtime, fn);
|
|
19
|
-
}
|
|
20
|
-
export function bindDeferredToolRuntime(message, runtime) {
|
|
21
|
-
deferredRuntime.set(message, runtime);
|
|
22
|
-
}
|
|
23
|
-
export function getDeferredToolRuntime(message) {
|
|
24
|
-
const scoped = deferredRuntimeAls.getStore();
|
|
25
|
-
if (scoped)
|
|
26
|
-
return scoped;
|
|
27
|
-
if (!message)
|
|
28
|
-
return undefined;
|
|
29
|
-
return deferredRuntime.get(message);
|
|
30
|
-
}
|
|
31
|
-
function formatDiscoverResults(items) {
|
|
32
|
-
if (items.length === 0)
|
|
33
|
-
return 'No matches.';
|
|
34
|
-
return items
|
|
35
|
-
.map(i => `- [${i.kind}] ${i.name}: ${i.brief}`)
|
|
36
|
-
.join('\n');
|
|
37
|
-
}
|
|
38
|
-
function schemaSummary(tool) {
|
|
39
|
-
const params = tool.parameters;
|
|
40
|
-
if (!params)
|
|
41
|
-
return `Loaded tool "${tool.name}".`;
|
|
42
|
-
return `Loaded tool "${tool.name}".\nParameters schema:\n${JSON.stringify(params, null, 2)}`;
|
|
43
|
-
}
|
|
44
|
-
export class DiscoverBuiltinTool extends BuiltinBaseTool {
|
|
45
|
-
name = 'discover';
|
|
46
|
-
description = 'Search deferred tools and skills by query. kind: tool|skill|all (default all). Empty query returns platform-matched skills.';
|
|
47
|
-
parameters = {
|
|
48
|
-
type: 'object',
|
|
49
|
-
properties: {
|
|
50
|
-
query: { type: 'string', description: 'Search query (user intent keywords)' },
|
|
51
|
-
kind: { type: 'string', enum: ['tool', 'skill', 'all'], description: 'What to search (default all)' },
|
|
52
|
-
mcp_server: { type: 'string', description: 'Filter tools by MCP server name' },
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
async run(args, commMessage) {
|
|
56
|
-
const runtime = getDeferredToolRuntime(commMessage);
|
|
57
|
-
if (!runtime)
|
|
58
|
-
return 'deferred runtime not available';
|
|
59
|
-
const kind = (typeof args.kind === 'string' ? args.kind : 'all');
|
|
60
|
-
const query = typeof args.query === 'string' ? args.query : '';
|
|
61
|
-
const mcpServer = typeof args.mcp_server === 'string' ? args.mcp_server : undefined;
|
|
62
|
-
const platform = commMessage ? String(commMessage.$adapter) : undefined;
|
|
63
|
-
const items = discoverInCatalog({
|
|
64
|
-
query,
|
|
65
|
-
kind,
|
|
66
|
-
topK: runtime.discoverTopK,
|
|
67
|
-
platform,
|
|
68
|
-
mcpServer,
|
|
69
|
-
skillRegistry: runtime.skillRegistry,
|
|
70
|
-
catalog: runtime.catalog,
|
|
71
|
-
});
|
|
72
|
-
return formatDiscoverResults(items);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
export class LoadToolBuiltinTool extends BuiltinBaseTool {
|
|
76
|
-
name = 'load_tool';
|
|
77
|
-
description = 'Load a deferred tool schema into the session so it can be called.';
|
|
78
|
-
parameters = {
|
|
79
|
-
type: 'object',
|
|
80
|
-
properties: {
|
|
81
|
-
name: { type: 'string', description: 'Tool name from discover results' },
|
|
82
|
-
},
|
|
83
|
-
required: ['name'],
|
|
84
|
-
};
|
|
85
|
-
async run(args, commMessage) {
|
|
86
|
-
const runtime = getDeferredToolRuntime(commMessage);
|
|
87
|
-
if (!runtime)
|
|
88
|
-
return 'deferred runtime not available';
|
|
89
|
-
const name = String(args.name);
|
|
90
|
-
const item = catalogToolByName(runtime.catalog).get(name);
|
|
91
|
-
if (!item)
|
|
92
|
-
return `Tool "${name}" not found in catalog.`;
|
|
93
|
-
runtime.snapshot = touchToolInSnapshot(runtime.snapshot, name, runtime.maxLoadedPerSession);
|
|
94
|
-
await runtime.persistSnapshot(runtime.snapshot);
|
|
95
|
-
return `${schemaSummary(item.fullTool)}\n${TOOLS_MUTATED_MARKER}`;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
export class LoadSkillBuiltinToolMeta extends BuiltinBaseTool {
|
|
99
|
-
skillOpts;
|
|
100
|
-
name = 'load_skill';
|
|
101
|
-
description = 'Load full skill instructions and unlock associated tools for this session.';
|
|
102
|
-
parameters = {
|
|
103
|
-
type: 'object',
|
|
104
|
-
properties: {
|
|
105
|
-
name: { type: 'string', description: 'Skill name from discover results' },
|
|
106
|
-
},
|
|
107
|
-
required: ['name'],
|
|
108
|
-
};
|
|
109
|
-
constructor(skillOpts) {
|
|
110
|
-
super();
|
|
111
|
-
this.skillOpts = skillOpts;
|
|
112
|
-
}
|
|
113
|
-
async run(args, commMessage) {
|
|
114
|
-
const runtime = getDeferredToolRuntime(commMessage);
|
|
115
|
-
if (!runtime)
|
|
116
|
-
return 'deferred runtime not available';
|
|
117
|
-
const name = String(args.name);
|
|
118
|
-
const instructions = await readSkillInstructions(name, this.skillOpts);
|
|
119
|
-
if (instructions.startsWith(`Skill '${name}' not found`)) {
|
|
120
|
-
return instructions;
|
|
121
|
-
}
|
|
122
|
-
runtime.snapshot = addSkillToSnapshot(runtime.snapshot, name);
|
|
123
|
-
const skill = runtime.skillRegistry?.getByName(name);
|
|
124
|
-
const toolNames = skill?.tools?.map(t => t.name) ?? [];
|
|
125
|
-
runtime.snapshot = touchToolsInSnapshot(runtime.snapshot, toolNames, runtime.maxLoadedPerSession);
|
|
126
|
-
await runtime.persistSnapshot(runtime.snapshot);
|
|
127
|
-
runtime.onSkillLoaded?.(name, instructions, toolNames);
|
|
128
|
-
const unlock = toolNames.length > 0 ? `\nUnlocked tools: ${toolNames.join(', ')}` : '';
|
|
129
|
-
return `${instructions}${unlock}\n${TOOLS_MUTATED_MARKER}`;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
export function createDeferredMetaTools(skillOpts) {
|
|
133
|
-
return [
|
|
134
|
-
new DiscoverBuiltinTool().toTool(),
|
|
135
|
-
new LoadToolBuiltinTool().toTool(),
|
|
136
|
-
new LoadSkillBuiltinToolMeta(skillOpts).toTool(),
|
|
137
|
-
];
|
|
138
|
-
}
|
|
139
|
-
export function isToolsMutatedResult(result) {
|
|
140
|
-
const text = typeof result === 'string' ? result : JSON.stringify(result);
|
|
141
|
-
return text.includes(TOOLS_MUTATED_MARKER);
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=deferred-tool-meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferred-tool-meta.js","sourceRoot":"","sources":["../../src/builtin/deferred-tool-meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAoD,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG9I,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAA6B,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAc7D,MAAM,eAAe,GAAG,IAAI,OAAO,EAAgC,CAAC;AAEpE,mEAAmE;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,EAAuB,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA4B,EAC5B,EAAoB;IAEpB,OAAO,kBAAkB,CAAC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AAG,YAAY,GAAG,MAAM,KAAK,oBAAoB,EAAE,CAAC;IAC7D,CAAC;CACF;AAED,MAAM,UAAU,uBAAuB,CAAC,SAA+B;IACrE,OAAO;QACL,IAAI,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAClC,IAAI,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAClC,IAAI,wBAAwB,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE;KACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAkB;IACrD,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 群协作场景下 ask_user 与 kernel 委派的衔接。
|
|
3
|
-
*/
|
|
4
|
-
import type { Message } from '@zhin.js/core';
|
|
5
|
-
/** 群内禁止用 ask_user 向 Owner 申请「委派授权」——应走 OrchestrationKernel / spawn_task。 */
|
|
6
|
-
export declare function shouldBlockDelegationAskUser(commMessage: Message, question: string, questionType: string): string | undefined;
|
|
7
|
-
export declare function buildGroupAskUserFollowUp(commMessage: Message, answer: string): string;
|
|
8
|
-
export declare function notifyGroupOwnerAskUserResolved(commMessage: Message, answer: string): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=ask-user-bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-bridge.d.ts","sourceRoot":"","sources":["../../src/collaboration/ask-user-bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAO7C,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,MAAM,GAAG,SAAS,CAmBpB;AAiBD,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAuBtF;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { resolveCellForScene } from './collaboration-config.js';
|
|
2
|
-
import { publishCollaborationGroupFeed, resolveActorPipelineRole, } from './group-feed.js';
|
|
3
|
-
/** 群内禁止用 ask_user 向 Owner 申请「委派授权」——应走 OrchestrationKernel / spawn_task。 */
|
|
4
|
-
export function shouldBlockDelegationAskUser(commMessage, question, questionType) {
|
|
5
|
-
const scope = commMessage.$channel?.type;
|
|
6
|
-
if (scope !== 'group' && scope !== 'channel')
|
|
7
|
-
return undefined;
|
|
8
|
-
const sceneId = commMessage.$channel?.id;
|
|
9
|
-
if (!sceneId)
|
|
10
|
-
return undefined;
|
|
11
|
-
const cell = resolveCellForScene(String(commMessage.$adapter ?? ''), sceneId);
|
|
12
|
-
if (!cell || cell.members.length < 2)
|
|
13
|
-
return undefined;
|
|
14
|
-
const q = question.trim();
|
|
15
|
-
if (questionType !== 'confirm')
|
|
16
|
-
return undefined;
|
|
17
|
-
if (looksLikeDelegationAuthorization(q)) {
|
|
18
|
-
return 'Error: In group collaboration, do not ask_owner to authorize delegation. Use orchestration_add_task (internal_room) or spawn_task with the peer endpoint.';
|
|
19
|
-
}
|
|
20
|
-
if (mentionsPipelineRole(q) && containsAny(q.toLowerCase(), ['是否', 'authorize', '授权', '调用'])) {
|
|
21
|
-
return 'Error: In group collaboration, dispatch peers via OrchestrationKernel (internal_room task) — do not ask_owner for role authorization.';
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
function looksLikeDelegationAuthorization(text) {
|
|
26
|
-
const lower = text.toLowerCase();
|
|
27
|
-
if (text.includes('授权') || lower.includes('authorize'))
|
|
28
|
-
return true;
|
|
29
|
-
if (text.includes('是否') && containsAny(text, ['调用', '使用', '委派', '派遣']))
|
|
30
|
-
return true;
|
|
31
|
-
return lower.includes('allow') && containsAny(lower, ['researcher', 'executor', 'delegate', 'agent']);
|
|
32
|
-
}
|
|
33
|
-
function mentionsPipelineRole(text) {
|
|
34
|
-
return containsAny(text.toLowerCase(), ['researcher', 'evaluator', 'executor', 'reviewer']);
|
|
35
|
-
}
|
|
36
|
-
function containsAny(text, needles) {
|
|
37
|
-
return needles.some((needle) => text.includes(needle));
|
|
38
|
-
}
|
|
39
|
-
export function buildGroupAskUserFollowUp(commMessage, answer) {
|
|
40
|
-
const scope = commMessage.$channel?.type;
|
|
41
|
-
if (scope !== 'group' && scope !== 'channel')
|
|
42
|
-
return answer;
|
|
43
|
-
const sceneId = commMessage.$channel?.id;
|
|
44
|
-
if (!sceneId)
|
|
45
|
-
return answer;
|
|
46
|
-
const cell = resolveCellForScene(String(commMessage.$adapter ?? ''), sceneId);
|
|
47
|
-
if (!cell || cell.members.length < 2)
|
|
48
|
-
return answer;
|
|
49
|
-
const peer = cell.members.find((m) => m.endpointId !== String(commMessage.$endpoint));
|
|
50
|
-
const peerEp = peer?.endpointId ?? '<peerEndpoint>';
|
|
51
|
-
const roleLabel = peer?.pipelineRole ?? peer?.primary ?? 'next peer';
|
|
52
|
-
return [
|
|
53
|
-
answer,
|
|
54
|
-
'',
|
|
55
|
-
`[Collaboration] Owner replied via private. Active scene: group ${sceneId}.`,
|
|
56
|
-
`Next: orchestration_add_task with executor internal_room assigned_to ${peerEp}, or spawn_task for local work (${roleLabel}).`,
|
|
57
|
-
'Optional group visibility: project_to_im true or a separate im_projection task; #taskId is only required for im_projection handback.',
|
|
58
|
-
'Do NOT answer from memory or skip kernel task dispatch.',
|
|
59
|
-
].join('\n');
|
|
60
|
-
}
|
|
61
|
-
export async function notifyGroupOwnerAskUserResolved(commMessage, answer) {
|
|
62
|
-
const scope = commMessage.$channel?.type;
|
|
63
|
-
if (scope !== 'group' && scope !== 'channel')
|
|
64
|
-
return;
|
|
65
|
-
await publishCollaborationGroupFeed({
|
|
66
|
-
message: commMessage,
|
|
67
|
-
role: resolveActorPipelineRole(commMessage),
|
|
68
|
-
emoji: '✅',
|
|
69
|
-
headline: 'Owner 已确认',
|
|
70
|
-
detail: answer,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=ask-user-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-bridge.js","sourceRoot":"","sources":["../../src/collaboration/ask-user-bridge.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,4EAA4E;AAC5E,MAAM,UAAU,4BAA4B,CAC1C,WAAoB,EACpB,QAAgB,EAChB,YAAoB;IAEpB,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC;IACzC,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/D,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC;IACzC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,mBAAmB,CAC9B,MAAM,CAAC,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC,EAClC,OAAO,CACR,CAAC;IACF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACvD,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,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B,CAAC,WAAW,CAAC;QAC3C,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bootstrap per-endpoint ZhinAgent runtimes for multi-bot collaboration cells.
|
|
3
|
-
*/
|
|
4
|
-
import type { Plugin } from '@zhin.js/core';
|
|
5
|
-
import { ZhinAgent } from '../zhin-agent/index.js';
|
|
6
|
-
import type { AIService } from '../service.js';
|
|
7
|
-
import type { AIServiceRefs } from '../init/shared-refs.js';
|
|
8
|
-
import type { ZhinAgentConfig } from '../config/index.js';
|
|
9
|
-
export interface BootstrapRuntimesOptions {
|
|
10
|
-
refs: AIServiceRefs;
|
|
11
|
-
plugin: Plugin;
|
|
12
|
-
ai: AIService;
|
|
13
|
-
primaryAgent: ZhinAgent;
|
|
14
|
-
agentConfig?: ZhinAgentConfig;
|
|
15
|
-
}
|
|
16
|
-
/** DB 就绪后,将持久化层同步到协作 Cell 内各 Endpoint Runtime */
|
|
17
|
-
export declare function syncCollaborationRuntimePersistence(primary: ZhinAgent): void;
|
|
18
|
-
export declare function markAllRuntimesPersistenceReady(primary: ZhinAgent): void;
|
|
19
|
-
export declare function bootstrapEndpointRuntimes(options: BootstrapRuntimesOptions): void;
|
|
20
|
-
/** DB 加载协作单元后重新绑定 Endpoint Runtime */
|
|
21
|
-
export declare function rebootstrapEndpointRuntimes(): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=bootstrap-agent-runtimes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-agent-runtimes.d.ts","sourceRoot":"","sources":["../../src/collaboration/bootstrap-agent-runtimes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,SAAS,CAAC;IACd,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAyFD,iDAAiD;AACjD,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAQ5E;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAGxE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAGjF;AAED,sCAAsC;AACtC,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAGjE"}
|