@zhin.js/agent 1.1.36 → 1.1.39
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/lib/activity-feedback/adapter-integration.d.ts +0 -1
- package/lib/activity-feedback/adapter-integration.js.map +1 -1
- package/lib/activity-feedback/config-resolver.d.ts +0 -1
- package/lib/activity-feedback/config-resolver.js.map +1 -1
- package/lib/activity-feedback/event-context.d.ts +0 -1
- package/lib/activity-feedback/event-context.js.map +1 -1
- package/lib/activity-feedback/index.d.ts +0 -1
- package/lib/activity-feedback/index.js.map +1 -1
- package/lib/activity-feedback/manager.d.ts +0 -1
- package/lib/activity-feedback/manager.js.map +1 -1
- package/lib/activity-feedback/schedule-guard.d.ts +0 -1
- package/lib/activity-feedback/schedule-guard.js.map +1 -1
- package/lib/activity-feedback/subagent-prefix.d.ts +0 -1
- package/lib/activity-feedback/subagent-prefix.js.map +1 -1
- package/lib/activity-feedback/turn-event-projector.d.ts +0 -1
- package/lib/activity-feedback/turn-event-projector.js.map +1 -1
- package/lib/activity-feedback/types.d.ts +0 -1
- package/lib/activity-feedback/types.js.map +1 -1
- package/lib/ai-event-bus.d.ts +0 -1
- package/lib/ai-event-bus.js.map +1 -1
- package/lib/ai-event-contract.d.ts +0 -1
- package/lib/ai-event-contract.js.map +1 -1
- package/lib/ai-event-subscriber.d.ts +0 -1
- package/lib/ai-event-subscriber.js.map +1 -1
- package/lib/ai-hook-runtime-bus.d.ts +0 -1
- package/lib/ai-hook-runtime-bus.js.map +1 -1
- package/lib/assistant/bootstrap-assistant-home.d.ts +0 -1
- package/lib/assistant/bootstrap-assistant-home.js.map +1 -1
- package/lib/assistant/config.d.ts +0 -1
- package/lib/assistant/config.js.map +1 -1
- package/lib/assistant/deliver-schedule-to-adapter.d.ts +0 -1
- package/lib/assistant/deliver-schedule-to-adapter.js.map +1 -1
- package/lib/assistant/domains/ha-home-backend.d.ts +0 -1
- package/lib/assistant/domains/ha-home-backend.js.map +1 -1
- package/lib/assistant/domains/ha-ws-transport.d.ts +0 -1
- package/lib/assistant/domains/ha-ws-transport.js.map +1 -1
- package/lib/assistant/domains/home-entity.d.ts +0 -1
- package/lib/assistant/domains/home-entity.js.map +1 -1
- package/lib/assistant/domains/home-state-watch.d.ts +0 -1
- package/lib/assistant/domains/home-state-watch.js.map +1 -1
- package/lib/assistant/event-ingress.d.ts +0 -1
- package/lib/assistant/event-ingress.js.map +1 -1
- package/lib/assistant/event-types.d.ts +0 -1
- package/lib/assistant/event-types.js.map +1 -1
- package/lib/assistant/home-config.d.ts +0 -1
- package/lib/assistant/home-config.js.map +1 -1
- package/lib/assistant/home-facade.d.ts +0 -1
- package/lib/assistant/home-facade.js.map +1 -1
- package/lib/assistant/home-mcp-bridge.d.ts +0 -1
- package/lib/assistant/home-mcp-bridge.js.map +1 -1
- package/lib/assistant/home-policy.d.ts +0 -1
- package/lib/assistant/home-policy.js.map +1 -1
- package/lib/assistant/home-tools.d.ts +0 -1
- package/lib/assistant/home-tools.js.map +1 -1
- package/lib/assistant/index.d.ts +0 -1
- package/lib/assistant/index.js.map +1 -1
- package/lib/assistant/job-creator.d.ts +0 -1
- package/lib/assistant/job-creator.js.map +1 -1
- package/lib/assistant/job-engine.d.ts +5 -1
- package/lib/assistant/job-engine.js +20 -1
- package/lib/assistant/job-engine.js.map +1 -1
- package/lib/assistant/job-scheduler.d.ts +0 -1
- package/lib/assistant/job-scheduler.js.map +1 -1
- package/lib/assistant/job-store.d.ts +0 -1
- package/lib/assistant/job-store.js.map +1 -1
- package/lib/assistant/job-utils.d.ts +0 -1
- package/lib/assistant/job-utils.js.map +1 -1
- package/lib/assistant/job-worker.d.ts +0 -1
- package/lib/assistant/job-worker.js.map +1 -1
- package/lib/assistant/notification-router.d.ts +0 -1
- package/lib/assistant/notification-router.js.map +1 -1
- package/lib/assistant/profile-loader.d.ts +0 -1
- package/lib/assistant/profile-loader.js.map +1 -1
- package/lib/assistant/profile-types.d.ts +0 -1
- package/lib/assistant/profile-types.js.map +1 -1
- package/lib/assistant/runtime-contract.d.ts +0 -1
- package/lib/assistant/runtime-contract.js.map +1 -1
- package/lib/assistant/schedule-execution.d.ts +0 -1
- package/lib/assistant/schedule-execution.js.map +1 -1
- package/lib/assistant/schedule-job-service.d.ts +0 -1
- package/lib/assistant/schedule-job-service.js.map +1 -1
- package/lib/assistant/schedule-skills.d.ts +0 -1
- package/lib/assistant/schedule-skills.js.map +1 -1
- package/lib/assistant/types.d.ts +0 -1
- package/lib/assistant/types.js.map +1 -1
- package/lib/authoring/bridge.d.ts +0 -1
- package/lib/authoring/bridge.js.map +1 -1
- package/lib/authoring/define-eval.d.ts +0 -1
- package/lib/authoring/define-eval.js.map +1 -1
- package/lib/authoring/define-hook.d.ts +0 -1
- package/lib/authoring/define-hook.js.map +1 -1
- package/lib/authoring/define-skill.d.ts +0 -1
- package/lib/authoring/define-skill.js.map +1 -1
- package/lib/authoring/disable-tool.d.ts +0 -1
- package/lib/authoring/disable-tool.js.map +1 -1
- package/lib/authoring/entries/evals.d.ts +0 -1
- package/lib/authoring/entries/evals.js.map +1 -1
- package/lib/authoring/entries/hooks.d.ts +0 -1
- package/lib/authoring/entries/hooks.js.map +1 -1
- package/lib/authoring/entries/skills.d.ts +0 -1
- package/lib/authoring/entries/skills.js.map +1 -1
- package/lib/authoring/index.d.ts +0 -1
- package/lib/authoring/index.js.map +1 -1
- package/lib/authoring/types.d.ts +0 -1
- package/lib/authoring/types.js.map +1 -1
- package/lib/bootstrap.d.ts +0 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/builtins/builtin-tool-service.d.ts +0 -1
- package/lib/builtins/builtin-tool-service.js.map +1 -1
- package/lib/common-adapter-tools.d.ts +0 -1
- package/lib/common-adapter-tools.js.map +1 -1
- package/lib/config/agent-binding-registry.d.ts +0 -1
- package/lib/config/agent-binding-registry.js.map +1 -1
- package/lib/config/agent-bindings.d.ts +0 -1
- package/lib/config/agent-bindings.js.map +1 -1
- package/lib/config/agent-interfaces.d.ts +0 -1
- package/lib/config/agent-interfaces.js.map +1 -1
- package/lib/config/deprecated-agent-binding-keys.d.ts +0 -1
- package/lib/config/deprecated-agent-binding-keys.js.map +1 -1
- package/lib/config/deprecated-agent-keys.d.ts +0 -1
- package/lib/config/deprecated-agent-keys.js.map +1 -1
- package/lib/config/fix-ai-config.d.ts +0 -1
- package/lib/config/fix-ai-config.js.map +1 -1
- package/lib/config/index.d.ts +0 -1
- package/lib/config/index.js.map +1 -1
- package/lib/config/keyword-triggers.d.ts +0 -1
- package/lib/config/keyword-triggers.js.map +1 -1
- package/lib/config/model-harness-runtime.d.ts +0 -1
- package/lib/config/model-harness-runtime.js.map +1 -1
- package/lib/config/model-harness.d.ts +0 -1
- package/lib/config/model-harness.js.map +1 -1
- package/lib/config/normalize-ai-config.d.ts +0 -1
- package/lib/config/normalize-ai-config.js.map +1 -1
- package/lib/config/perception-config.d.ts +0 -1
- package/lib/config/perception-config.js.map +1 -1
- package/lib/config/provider-instance.d.ts +0 -1
- package/lib/config/provider-instance.js.map +1 -1
- package/lib/config/resolve-five-agent-binding.d.ts +0 -1
- package/lib/config/resolve-five-agent-binding.js.map +1 -1
- package/lib/config/types.d.ts +0 -1
- package/lib/config/types.js.map +1 -1
- package/lib/config/validate-ai-config.d.ts +0 -1
- package/lib/config/validate-ai-config.js.map +1 -1
- package/lib/config/zhin-agent-config.d.ts +0 -1
- package/lib/config/zhin-agent-config.js.map +1 -1
- package/lib/config/zhin-agent-constants.d.ts +0 -1
- package/lib/config/zhin-agent-constants.js.map +1 -1
- package/lib/config/zhin-agent-defaults.d.ts +0 -1
- package/lib/config/zhin-agent-defaults.js +1 -1
- package/lib/config/zhin-agent-defaults.js.map +1 -1
- package/lib/config/zhin-agent-dependencies.d.ts +0 -1
- package/lib/config/zhin-agent-dependencies.js.map +1 -1
- package/lib/config/zhin-agent-runtime.d.ts +0 -1
- package/lib/config/zhin-agent-runtime.js.map +1 -1
- package/lib/context/agents-instruction.d.ts +0 -1
- package/lib/context/agents-instruction.js.map +1 -1
- package/lib/context/context-system.d.ts +0 -1
- package/lib/context/context-system.js.map +1 -1
- package/lib/context/context-tail-limit.d.ts +0 -1
- package/lib/context/context-tail-limit.js.map +1 -1
- package/lib/context/contracts.d.ts +0 -1
- package/lib/context/contracts.js.map +1 -1
- package/lib/context/default-builders.d.ts +0 -1
- package/lib/context/default-builders.js.map +1 -1
- package/lib/context/envelope-parts.d.ts +0 -1
- package/lib/context/envelope-parts.js.map +1 -1
- package/lib/context/im-turn-context-adapter.d.ts +0 -1
- package/lib/context/im-turn-context-adapter.js.map +1 -1
- package/lib/context/index.d.ts +1 -2
- package/lib/context/index.js +1 -1
- package/lib/context/index.js.map +1 -1
- package/lib/context/model-resolver.d.ts +0 -1
- package/lib/context/model-resolver.js.map +1 -1
- package/lib/context/turn-envelope.d.ts +3 -2
- package/lib/context/turn-envelope.js +6 -0
- package/lib/context/turn-envelope.js.map +1 -1
- package/lib/context/turn-user-message.d.ts +0 -1
- package/lib/context/turn-user-message.js.map +1 -1
- package/lib/core/agent-core-run.d.ts +3 -1
- package/lib/core/agent-core-run.js +40 -36
- package/lib/core/agent-core-run.js.map +1 -1
- package/lib/core/agent-core.d.ts +0 -1
- package/lib/core/agent-core.js.map +1 -1
- package/lib/core/agent-loop-standalone.d.ts +0 -1
- package/lib/core/agent-loop-standalone.js.map +1 -1
- package/lib/core/agent-loop-turn.d.ts +0 -1
- package/lib/core/agent-loop-turn.js.map +1 -1
- package/lib/core/agent-run-shared.d.ts +0 -1
- package/lib/core/agent-run-shared.js.map +1 -1
- package/lib/core/compose-deps.d.ts +0 -1
- package/lib/core/compose-deps.js.map +1 -1
- package/lib/core/contracts.d.ts +0 -1
- package/lib/core/contracts.js.map +1 -1
- package/lib/core/exhausted-turn-reply.d.ts +0 -1
- package/lib/core/exhausted-turn-reply.js.map +1 -1
- package/lib/core/exploration-budget.d.ts +0 -1
- package/lib/core/exploration-budget.js.map +1 -1
- package/lib/core/index.d.ts +0 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/missing-tool-resolver.d.ts +0 -1
- package/lib/core/missing-tool-resolver.js.map +1 -1
- package/lib/core/progress-reporter.d.ts +0 -1
- package/lib/core/progress-reporter.js.map +1 -1
- package/lib/core/spawn-delegation.d.ts +0 -1
- package/lib/core/spawn-delegation.js.map +1 -1
- package/lib/core/structured-reply-recovery.d.ts +18 -3
- package/lib/core/structured-reply-recovery.js +28 -7
- package/lib/core/structured-reply-recovery.js.map +1 -1
- package/lib/core/text-sanitize.d.ts +0 -1
- package/lib/core/text-sanitize.js.map +1 -1
- package/lib/core/tool-calls-user-format.d.ts +0 -1
- package/lib/core/tool-calls-user-format.js.map +1 -1
- package/lib/core/tool-execution-authority.d.ts +0 -1
- package/lib/core/tool-execution-authority.js.map +1 -1
- package/lib/core/turn-completion-usage.d.ts +0 -1
- package/lib/core/turn-completion-usage.js.map +1 -1
- package/lib/core/turn-event-mapper.d.ts +0 -1
- package/lib/core/turn-event-mapper.js.map +1 -1
- package/lib/core/turn-progress.d.ts +0 -1
- package/lib/core/turn-progress.js.map +1 -1
- package/lib/create-agent-session.d.ts +0 -1
- package/lib/create-agent-session.js.map +1 -1
- package/lib/decision/approval-judgment.d.ts +0 -1
- package/lib/decision/approval-judgment.js.map +1 -1
- package/lib/decision/approval.d.ts +0 -1
- package/lib/decision/approval.js.map +1 -1
- package/lib/decision/config.d.ts +0 -1
- package/lib/decision/config.js.map +1 -1
- package/lib/decision/index.d.ts +0 -1
- package/lib/decision/index.js.map +1 -1
- package/lib/decision/rank.d.ts +0 -1
- package/lib/decision/rank.js.map +1 -1
- package/lib/decision/retrieval.d.ts +0 -1
- package/lib/decision/retrieval.js.map +1 -1
- package/lib/decision/types.d.ts +0 -1
- package/lib/decision/types.js.map +1 -1
- package/lib/deferred-worker-runner.d.ts +0 -1
- package/lib/deferred-worker-runner.js.map +1 -1
- package/lib/deferred-worker-tool-load.d.ts +0 -1
- package/lib/deferred-worker-tool-load.js.map +1 -1
- package/lib/detached-task/index.d.ts +0 -1
- package/lib/detached-task/index.js.map +1 -1
- package/lib/detached-task/interjection.d.ts +0 -1
- package/lib/detached-task/interjection.js.map +1 -1
- package/lib/detached-task/runner.d.ts +0 -1
- package/lib/detached-task/runner.js.map +1 -1
- package/lib/detached-task/store.d.ts +0 -1
- package/lib/detached-task/store.js.map +1 -1
- package/lib/detached-task/token.d.ts +0 -1
- package/lib/detached-task/token.js.map +1 -1
- package/lib/detached-task/types.d.ts +0 -1
- package/lib/detached-task/types.js.map +1 -1
- package/lib/discovery/agent-surface-info.d.ts +0 -1
- package/lib/discovery/agent-surface-info.js.map +1 -1
- package/lib/discovery/agent-surface.d.ts +0 -1
- package/lib/discovery/agent-surface.js.map +1 -1
- package/lib/discovery/agents.d.ts +0 -1
- package/lib/discovery/agents.js.map +1 -1
- package/lib/discovery/utils.d.ts +0 -1
- package/lib/discovery/utils.js.map +1 -1
- package/lib/event/agent-stream-bus.d.ts +0 -1
- package/lib/event/agent-stream-bus.js.map +1 -1
- package/lib/event/agent-stream-hooks.d.ts +0 -1
- package/lib/event/agent-stream-hooks.js.map +1 -1
- package/lib/event/ai-event-bus.d.ts +0 -1
- package/lib/event/ai-event-bus.js.map +1 -1
- package/lib/event/contracts.d.ts +0 -1
- package/lib/event/contracts.js.map +1 -1
- package/lib/event/event-emitter.d.ts +0 -1
- package/lib/event/event-emitter.js.map +1 -1
- package/lib/event/event-system.d.ts +0 -1
- package/lib/event/event-system.js.map +1 -1
- package/lib/event/filtering-middleware.d.ts +0 -1
- package/lib/event/filtering-middleware.js.map +1 -1
- package/lib/event/hook-stream-sink.d.ts +0 -1
- package/lib/event/hook-stream-sink.js.map +1 -1
- package/lib/event/index.d.ts +0 -1
- package/lib/event/index.js.map +1 -1
- package/lib/event/logging-middleware.d.ts +0 -1
- package/lib/event/logging-middleware.js.map +1 -1
- package/lib/event/publish-agent-stream.d.ts +0 -1
- package/lib/event/publish-agent-stream.js.map +1 -1
- package/lib/event/session-events.d.ts +0 -1
- package/lib/event/session-events.js.map +1 -1
- package/lib/event/turn-event.d.ts +0 -1
- package/lib/event/turn-event.js.map +1 -1
- package/lib/event/turn-to-agent-stream.d.ts +0 -1
- package/lib/event/turn-to-agent-stream.js.map +1 -1
- package/lib/index.d.ts +4 -5
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/init/activate-ai-database-storage.d.ts +0 -1
- package/lib/init/activate-ai-database-storage.js.map +1 -1
- package/lib/init/compose-zhin-agent-runtime.d.ts +0 -1
- package/lib/init/compose-zhin-agent-runtime.js.map +1 -1
- package/lib/init/configure-zhin-agent.d.ts +0 -1
- package/lib/init/configure-zhin-agent.js.map +1 -1
- package/lib/init/define-ai-database-models.d.ts +0 -1
- package/lib/init/define-ai-database-models.js.map +1 -1
- package/lib/init/dispose-zhin-agent.d.ts +0 -1
- package/lib/init/dispose-zhin-agent.js.map +1 -1
- package/lib/init/introspection-output.d.ts +0 -1
- package/lib/init/introspection-output.js.map +1 -1
- package/lib/init/runtime-management-commands.d.ts +0 -1
- package/lib/init/runtime-management-commands.js.map +1 -1
- package/lib/interaction/index.d.ts +0 -1
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/interaction-router.d.ts +0 -1
- package/lib/interaction/interaction-router.js.map +1 -1
- package/lib/internal/agent-host.d.ts +0 -1
- package/lib/internal/agent-host.js.map +1 -1
- package/lib/internal/ai-service-refs.d.ts +0 -1
- package/lib/internal/ai-service-refs.js.map +1 -1
- package/lib/internal/as-private.d.ts +0 -1
- package/lib/internal/as-private.js.map +1 -1
- package/lib/internal/host-types.d.ts +0 -1
- package/lib/internal/host-types.js.map +1 -1
- package/lib/internal/phase-trace.d.ts +0 -1
- package/lib/internal/phase-trace.js.map +1 -1
- package/lib/internal/prompt-trace.d.ts +0 -1
- package/lib/internal/prompt-trace.js.map +1 -1
- package/lib/internal/turn-context.d.ts +0 -1
- package/lib/internal/turn-context.js.map +1 -1
- package/lib/journal/file-journal-store.d.ts +0 -1
- package/lib/journal/file-journal-store.js.map +1 -1
- package/lib/journal/index.d.ts +0 -1
- package/lib/journal/index.js.map +1 -1
- package/lib/journal/persistent-turn-journal.d.ts +0 -1
- package/lib/journal/persistent-turn-journal.js.map +1 -1
- package/lib/mcp-client/bridge.d.ts +0 -1
- package/lib/mcp-client/bridge.js.map +1 -1
- package/lib/mcp-client/connection.d.ts +0 -1
- package/lib/mcp-client/connection.js.map +1 -1
- package/lib/mcp-client/index.d.ts +0 -1
- package/lib/mcp-client/index.js.map +1 -1
- package/lib/media/deliver-subagent-result.d.ts +0 -1
- package/lib/media/deliver-subagent-result.js +4 -1
- package/lib/media/deliver-subagent-result.js.map +1 -1
- package/lib/media/inbound-refs.d.ts +0 -1
- package/lib/media/inbound-refs.js.map +1 -1
- package/lib/media/index.d.ts +0 -1
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capabilities.d.ts +0 -1
- package/lib/media/media-capabilities.js.map +1 -1
- package/lib/media/media-normalize.d.ts +31 -3
- package/lib/media/media-normalize.js +38 -5
- package/lib/media/media-normalize.js.map +1 -1
- package/lib/media/media-publisher.d.ts +4 -2
- package/lib/media/media-publisher.js +50 -31
- package/lib/media/media-publisher.js.map +1 -1
- package/lib/media/media-router.d.ts +0 -1
- package/lib/media/media-router.js.map +1 -1
- package/lib/media/media-spool.d.ts +0 -1
- package/lib/media/media-spool.js.map +1 -1
- package/lib/media/media-tool-bridge.d.ts +0 -1
- package/lib/media/media-tool-bridge.js.map +1 -1
- package/lib/media/media-types.d.ts +0 -1
- package/lib/media/media-types.js.map +1 -1
- package/lib/media/perception.d.ts +8 -2
- package/lib/media/perception.js +55 -5
- package/lib/media/perception.js.map +1 -1
- package/lib/media/resolve-config.d.ts +0 -1
- package/lib/media/resolve-config.js.map +1 -1
- package/lib/media/subagent-inbound.d.ts +0 -1
- package/lib/media/subagent-inbound.js.map +1 -1
- package/lib/media/subagent-user-delivery.d.ts +0 -1
- package/lib/media/subagent-user-delivery.js.map +1 -1
- package/lib/media/vision-capability.d.ts +0 -1
- package/lib/media/vision-capability.js.map +1 -1
- package/lib/memory/ai-compaction-strategy.d.ts +0 -1
- package/lib/memory/ai-compaction-strategy.js.map +1 -1
- package/lib/memory/compaction-runtime.d.ts +0 -1
- package/lib/memory/compaction-runtime.js.map +1 -1
- package/lib/memory/context-repository-store.d.ts +0 -1
- package/lib/memory/context-repository-store.js.map +1 -1
- package/lib/memory/contracts.d.ts +0 -1
- package/lib/memory/contracts.js.map +1 -1
- package/lib/memory/index.d.ts +0 -1
- package/lib/memory/index.js.map +1 -1
- package/lib/memory/memory-system.d.ts +0 -1
- package/lib/memory/memory-system.js.map +1 -1
- package/lib/memory/memory-write-policy.d.ts +0 -1
- package/lib/memory/memory-write-policy.js.map +1 -1
- package/lib/memory/semantic-recall.d.ts +0 -1
- package/lib/memory/semantic-recall.js.map +1 -1
- package/lib/memory/told-ledger.d.ts +0 -1
- package/lib/memory/told-ledger.js.map +1 -1
- package/lib/memory-layers.d.ts +0 -1
- package/lib/memory-layers.js.map +1 -1
- package/lib/orchestration/five-agent/index.d.ts +0 -1
- package/lib/orchestration/five-agent/index.js.map +1 -1
- package/lib/orchestration/five-agent/prompts.d.ts +0 -1
- package/lib/orchestration/five-agent/prompts.js.map +1 -1
- package/lib/orchestration/five-agent/role-capability-policy.d.ts +0 -1
- package/lib/orchestration/five-agent/role-capability-policy.js.map +1 -1
- package/lib/orchestration/five-agent/roles.d.ts +0 -1
- package/lib/orchestration/five-agent/roles.js.map +1 -1
- package/lib/outbound/agent-output.d.ts +5 -1
- package/lib/outbound/agent-output.js +14 -0
- package/lib/outbound/agent-output.js.map +1 -1
- package/lib/outbound/send-proactive.d.ts +0 -1
- package/lib/outbound/send-proactive.js.map +1 -1
- package/lib/outbound/structured-reply.d.ts +6 -2
- package/lib/outbound/structured-reply.js +85 -14
- package/lib/outbound/structured-reply.js.map +1 -1
- package/lib/plugin-ai-hook-bus.d.ts +0 -1
- package/lib/plugin-ai-hook-bus.js.map +1 -1
- package/lib/plugin-loop-hooks.d.ts +0 -1
- package/lib/plugin-loop-hooks.js.map +1 -1
- package/lib/plugin-runtime/agent-event-bus.d.ts +0 -1
- package/lib/plugin-runtime/agent-event-bus.js.map +1 -1
- package/lib/plugin-runtime/agent-host-port.d.ts +0 -1
- package/lib/plugin-runtime/agent-host-port.js.map +1 -1
- package/lib/plugin-runtime/agent-runtime.d.ts +0 -1
- package/lib/plugin-runtime/agent-runtime.js.map +1 -1
- package/lib/plugin-runtime/agent-trace-runtime.d.ts +0 -1
- package/lib/plugin-runtime/agent-trace-runtime.js.map +1 -1
- package/lib/plugin-runtime/ai-completion.d.ts +11 -43
- package/lib/plugin-runtime/ai-completion.js +28 -10
- package/lib/plugin-runtime/ai-completion.js.map +1 -1
- package/lib/plugin-runtime/capability-ingress.d.ts +0 -1
- package/lib/plugin-runtime/capability-ingress.js.map +1 -1
- package/lib/plugin-runtime/capability-tools.d.ts +0 -1
- package/lib/plugin-runtime/capability-tools.js.map +1 -1
- package/lib/plugin-runtime/decision-runtime.d.ts +0 -1
- package/lib/plugin-runtime/decision-runtime.js.map +1 -1
- package/lib/plugin-runtime/deferred-capability-plan.d.ts +20 -1
- package/lib/plugin-runtime/deferred-capability-plan.js +40 -0
- package/lib/plugin-runtime/deferred-capability-plan.js.map +1 -1
- package/lib/plugin-runtime/file-edit-quote-utils.d.ts +0 -1
- package/lib/plugin-runtime/file-edit-quote-utils.js.map +1 -1
- package/lib/plugin-runtime/file-search-scope.d.ts +0 -1
- package/lib/plugin-runtime/file-search-scope.js.map +1 -1
- package/lib/plugin-runtime/full-agent-turn-engine.d.ts +0 -1
- package/lib/plugin-runtime/full-agent-turn-engine.js +13 -3
- package/lib/plugin-runtime/full-agent-turn-engine.js.map +1 -1
- package/lib/plugin-runtime/host-mcp-projection.d.ts +0 -1
- package/lib/plugin-runtime/host-mcp-projection.js.map +1 -1
- package/lib/plugin-runtime/host-tool-projection.d.ts +0 -1
- package/lib/plugin-runtime/host-tool-projection.js.map +1 -1
- package/lib/plugin-runtime/index.d.ts +0 -1
- package/lib/plugin-runtime/index.js.map +1 -1
- package/lib/plugin-runtime/native-bash-tool.d.ts +0 -1
- package/lib/plugin-runtime/native-bash-tool.js.map +1 -1
- package/lib/plugin-runtime/native-file-tools.d.ts +0 -1
- package/lib/plugin-runtime/native-file-tools.js.map +1 -1
- package/lib/plugin-runtime/native-image-tool.d.ts +0 -1
- package/lib/plugin-runtime/native-image-tool.js.map +1 -1
- package/lib/plugin-runtime/native-interaction-tools.d.ts +0 -1
- package/lib/plugin-runtime/native-interaction-tools.js.map +1 -1
- package/lib/plugin-runtime/native-knowledge-tool.d.ts +0 -1
- package/lib/plugin-runtime/native-knowledge-tool.js.map +1 -1
- package/lib/plugin-runtime/native-semantic-memory-tools.d.ts +0 -1
- package/lib/plugin-runtime/native-semantic-memory-tools.js.map +1 -1
- package/lib/plugin-runtime/native-todo-tools.d.ts +0 -1
- package/lib/plugin-runtime/native-todo-tools.js.map +1 -1
- package/lib/plugin-runtime/native-tool-suite.d.ts +0 -1
- package/lib/plugin-runtime/native-tool-suite.js.map +1 -1
- package/lib/plugin-runtime/native-web-tools.d.ts +0 -1
- package/lib/plugin-runtime/native-web-tools.js.map +1 -1
- package/lib/plugin-runtime/schedule-capability-plan.d.ts +0 -1
- package/lib/plugin-runtime/schedule-capability-plan.js.map +1 -1
- package/lib/plugin-runtime/subagent-turn-capability.d.ts +0 -1
- package/lib/plugin-runtime/subagent-turn-capability.js.map +1 -1
- package/lib/plugin-runtime/turn-intent-resolver.d.ts +0 -1
- package/lib/plugin-runtime/turn-intent-resolver.js.map +1 -1
- package/lib/prompt/assembly.d.ts +0 -1
- package/lib/prompt/assembly.js +2 -2
- package/lib/prompt/assembly.js.map +1 -1
- package/lib/prompt/estimate-tokens.d.ts +0 -1
- package/lib/prompt/estimate-tokens.js.map +1 -1
- package/lib/prompt/git-context.d.ts +0 -1
- package/lib/prompt/git-context.js.map +1 -1
- package/lib/prompt/index.d.ts +0 -1
- package/lib/prompt/index.js.map +1 -1
- package/lib/prompt/model-aware-builder.d.ts +0 -1
- package/lib/prompt/model-aware-builder.js.map +1 -1
- package/lib/prompt/model-prompt-strategy.d.ts +0 -1
- package/lib/prompt/model-prompt-strategy.js.map +1 -1
- package/lib/prompt/prompt-assembly-registry.d.ts +0 -1
- package/lib/prompt/prompt-assembly-registry.js.map +1 -1
- package/lib/prompt/prompt-budget.d.ts +0 -1
- package/lib/prompt/prompt-budget.js.map +1 -1
- package/lib/prompt/prompt-builder.d.ts +0 -1
- package/lib/prompt/prompt-builder.js.map +1 -1
- package/lib/prompt/rules/chat-rules.d.ts +6 -0
- package/lib/prompt/rules/chat-rules.js +20 -0
- package/lib/prompt/rules/chat-rules.js.map +1 -0
- package/lib/prompt/rules/code-references.d.ts +0 -1
- package/lib/prompt/rules/code-references.js.map +1 -1
- package/lib/prompt/rules/critical-rules.d.ts +0 -1
- package/lib/prompt/rules/critical-rules.js +2 -2
- package/lib/prompt/rules/critical-rules.js.map +1 -1
- package/lib/prompt/rules/editing.d.ts +0 -1
- package/lib/prompt/rules/editing.js.map +1 -1
- package/lib/prompt/rules/error-handling.d.ts +0 -1
- package/lib/prompt/rules/error-handling.js.map +1 -1
- package/lib/prompt/rules/index.d.ts +1 -1
- package/lib/prompt/rules/index.js +1 -0
- package/lib/prompt/rules/index.js.map +1 -1
- package/lib/prompt/rules/memory.d.ts +0 -1
- package/lib/prompt/rules/memory.js.map +1 -1
- package/lib/prompt/rules/task-completion.d.ts +0 -1
- package/lib/prompt/rules/task-completion.js.map +1 -1
- package/lib/prompt/rules/workflow-rules.d.ts +0 -1
- package/lib/prompt/rules/workflow-rules.js.map +1 -1
- package/lib/prompt/system-prompt.d.ts +7 -1
- package/lib/prompt/system-prompt.js +31 -12
- package/lib/prompt/system-prompt.js.map +1 -1
- package/lib/prompt/templates.d.ts +0 -1
- package/lib/prompt/templates.js.map +1 -1
- package/lib/prompt/tokens.d.ts +0 -1
- package/lib/prompt/tokens.js.map +1 -1
- package/lib/prompt/turn-prompt-profile.d.ts +0 -1
- package/lib/prompt/turn-prompt-profile.js.map +1 -1
- package/lib/prompt/workspace-prompt.d.ts +0 -1
- package/lib/prompt/workspace-prompt.js.map +1 -1
- package/lib/reserved-tools.d.ts +0 -1
- package/lib/reserved-tools.js.map +1 -1
- package/lib/resource-hub/hook-registry.d.ts +0 -1
- package/lib/resource-hub/hook-registry.js.map +1 -1
- package/lib/resource-hub/index.d.ts +0 -1
- package/lib/resource-hub/index.js.map +1 -1
- package/lib/resource-hub/mcp-lifecycle.d.ts +0 -1
- package/lib/resource-hub/mcp-lifecycle.js.map +1 -1
- package/lib/resource-hub/mcp-registry.d.ts +0 -1
- package/lib/resource-hub/mcp-registry.js.map +1 -1
- package/lib/resource-hub/public-api.d.ts +0 -1
- package/lib/resource-hub/public-api.js.map +1 -1
- package/lib/resource-hub/resolve-subagent-tools.d.ts +0 -1
- package/lib/resource-hub/resolve-subagent-tools.js.map +1 -1
- package/lib/resource-hub/resource-registry.d.ts +0 -1
- package/lib/resource-hub/resource-registry.js.map +1 -1
- package/lib/resource-hub/role-configs.d.ts +0 -1
- package/lib/resource-hub/role-configs.js.map +1 -1
- package/lib/resource-hub/skill-registry.d.ts +0 -1
- package/lib/resource-hub/skill-registry.js.map +1 -1
- package/lib/resource-hub/subagent-registry.d.ts +0 -1
- package/lib/resource-hub/subagent-registry.js.map +1 -1
- package/lib/resource-hub/tool-selection.d.ts +0 -1
- package/lib/resource-hub/tool-selection.js.map +1 -1
- package/lib/resource-hub/types.d.ts +0 -1
- package/lib/resource-hub/types.js.map +1 -1
- package/lib/routing/runtime-binding.d.ts +0 -1
- package/lib/routing/runtime-binding.js.map +1 -1
- package/lib/routing/subagent-summarize.d.ts +0 -1
- package/lib/routing/subagent-summarize.js.map +1 -1
- package/lib/schedule-cron.d.ts +0 -1
- package/lib/schedule-cron.js.map +1 -1
- package/lib/schedule-domain/audit-logger.d.ts +0 -1
- package/lib/schedule-domain/audit-logger.js.map +1 -1
- package/lib/schedule-domain/budget-guard.d.ts +0 -1
- package/lib/schedule-domain/budget-guard.js.map +1 -1
- package/lib/schedule-domain/execution-domain.d.ts +0 -1
- package/lib/schedule-domain/execution-domain.js.map +1 -1
- package/lib/schedule-domain/index.d.ts +0 -1
- package/lib/schedule-domain/index.js.map +1 -1
- package/lib/schedule-domain/output-validator.d.ts +0 -1
- package/lib/schedule-domain/output-validator.js.map +1 -1
- package/lib/schedule-domain/prompt-assembler.d.ts +0 -1
- package/lib/schedule-domain/prompt-assembler.js.map +1 -1
- package/lib/schedule-domain/schedule-execution-queue.d.ts +0 -1
- package/lib/schedule-domain/schedule-execution-queue.js.map +1 -1
- package/lib/schedule-domain/security-harness.d.ts +0 -1
- package/lib/schedule-domain/security-harness.js.map +1 -1
- package/lib/schedule-manager.d.ts +0 -1
- package/lib/schedule-manager.js.map +1 -1
- package/lib/seam/index.d.ts +0 -1
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/seam-integration.d.ts +0 -1
- package/lib/seam/seam-integration.js.map +1 -1
- package/lib/seam/seam-provider.d.ts +0 -1
- package/lib/seam/seam-provider.js.map +1 -1
- package/lib/seam/skill-service.d.ts +0 -1
- package/lib/seam/skill-service.js.map +1 -1
- package/lib/seam/tokens.d.ts +0 -1
- package/lib/seam/tokens.js.map +1 -1
- package/lib/seam/tool-service.d.ts +0 -1
- package/lib/seam/tool-service.js.map +1 -1
- package/lib/security/anomaly-detection.d.ts +0 -1
- package/lib/security/anomaly-detection.js.map +1 -1
- package/lib/security/audit-logger.d.ts +0 -1
- package/lib/security/audit-logger.js.map +1 -1
- package/lib/security/comm-message-context.d.ts +0 -1
- package/lib/security/comm-message-context.js.map +1 -1
- package/lib/security/dangerous-tool-policy.d.ts +0 -1
- package/lib/security/dangerous-tool-policy.js.map +1 -1
- package/lib/security/exec-policy.d.ts +0 -1
- package/lib/security/exec-policy.js.map +1 -1
- package/lib/security/file-policy.d.ts +0 -1
- package/lib/security/file-policy.js.map +1 -1
- package/lib/security/file-role-policy.d.ts +0 -1
- package/lib/security/file-role-policy.js.map +1 -1
- package/lib/security/index.d.ts +0 -1
- package/lib/security/index.js.map +1 -1
- package/lib/security/network-authority.d.ts +0 -1
- package/lib/security/network-authority.js.map +1 -1
- package/lib/security/network-policy-context.d.ts +0 -1
- package/lib/security/network-policy-context.js.map +1 -1
- package/lib/security/network-policy.d.ts +0 -1
- package/lib/security/network-policy.js.map +1 -1
- package/lib/security/outbound-leak-guard.d.ts +0 -1
- package/lib/security/outbound-leak-guard.js.map +1 -1
- package/lib/security/owner-approval-contracts.d.ts +0 -1
- package/lib/security/owner-approval-contracts.js.map +1 -1
- package/lib/security/owner-approval-runtime.d.ts +0 -1
- package/lib/security/owner-approval-runtime.js.map +1 -1
- package/lib/security/owner-approval-store.d.ts +0 -1
- package/lib/security/owner-approval-store.js.map +1 -1
- package/lib/security/policy-facade.d.ts +0 -1
- package/lib/security/policy-facade.js.map +1 -1
- package/lib/security/policy-narrowing.d.ts +0 -1
- package/lib/security/policy-narrowing.js.map +1 -1
- package/lib/security/provenance.d.ts +0 -1
- package/lib/security/provenance.js.map +1 -1
- package/lib/security/sandbox-docker.d.ts +0 -1
- package/lib/security/sandbox-docker.js.map +1 -1
- package/lib/security/sandbox.d.ts +0 -1
- package/lib/security/sandbox.js.map +1 -1
- package/lib/security/trust-level.d.ts +0 -1
- package/lib/security/trust-level.js.map +1 -1
- package/lib/security/turn-file-authority.d.ts +0 -1
- package/lib/security/turn-file-authority.js.map +1 -1
- package/lib/security/turn-network-client.d.ts +0 -1
- package/lib/security/turn-network-client.js.map +1 -1
- package/lib/security/usage-quota.d.ts +3 -7
- package/lib/security/usage-quota.js.map +1 -1
- package/lib/segment/filter-im-delivery.d.ts +0 -1
- package/lib/segment/filter-im-delivery.js.map +1 -1
- package/lib/service.d.ts +0 -1
- package/lib/service.js.map +1 -1
- package/lib/session/approval-port.d.ts +0 -1
- package/lib/session/approval-port.js.map +1 -1
- package/lib/session/approval-review-agent.d.ts +0 -1
- package/lib/session/approval-review-agent.js.map +1 -1
- package/lib/session/branch-summarization-runtime.d.ts +0 -1
- package/lib/session/branch-summarization-runtime.js.map +1 -1
- package/lib/session/contracts.d.ts +0 -1
- package/lib/session/contracts.js.map +1 -1
- package/lib/session/index.d.ts +0 -1
- package/lib/session/index.js.map +1 -1
- package/lib/session/session-io.d.ts +0 -1
- package/lib/session/session-io.js.map +1 -1
- package/lib/session/session-key.d.ts +0 -1
- package/lib/session/session-key.js.map +1 -1
- package/lib/session/session-system.d.ts +7 -1
- package/lib/session/session-system.js +26 -12
- package/lib/session/session-system.js.map +1 -1
- package/lib/session/session-tree-commands.d.ts +0 -1
- package/lib/session/session-tree-commands.js.map +1 -1
- package/lib/session/strategies.d.ts +0 -1
- package/lib/session/strategies.js.map +1 -1
- package/lib/session/turn-ingress-session.d.ts +0 -1
- package/lib/session/turn-ingress-session.js.map +1 -1
- package/lib/session-tree-runtime.d.ts +0 -1
- package/lib/session-tree-runtime.js.map +1 -1
- package/lib/skill/capability-catalog.d.ts +0 -1
- package/lib/skill/capability-catalog.js.map +1 -1
- package/lib/skill/contracts.d.ts +0 -1
- package/lib/skill/contracts.js.map +1 -1
- package/lib/skill/index.d.ts +0 -1
- package/lib/skill/index.js.map +1 -1
- package/lib/skill/progressive-disclosure.d.ts +0 -1
- package/lib/skill/progressive-disclosure.js.map +1 -1
- package/lib/skill/skill-instruction-reader-factory.d.ts +0 -1
- package/lib/skill/skill-instruction-reader-factory.js.map +1 -1
- package/lib/skill/skill-instruction-reader.d.ts +0 -1
- package/lib/skill/skill-instruction-reader.js.map +1 -1
- package/lib/skill/skill-instructions.d.ts +0 -1
- package/lib/skill/skill-instructions.js.map +1 -1
- package/lib/skill/skill-registry-as-service.d.ts +0 -1
- package/lib/skill/skill-registry-as-service.js.map +1 -1
- package/lib/skill/skill-system.d.ts +0 -1
- package/lib/skill/skill-system.js.map +1 -1
- package/lib/spawn/permission-task.d.ts +0 -1
- package/lib/spawn/permission-task.js.map +1 -1
- package/lib/spawn/spawn-task-tool.d.ts +0 -1
- package/lib/spawn/spawn-task-tool.js.map +1 -1
- package/lib/stability/memory-pressure.d.ts +0 -1
- package/lib/stability/memory-pressure.js.map +1 -1
- package/lib/standalone/standalone-tool-catalog.d.ts +0 -1
- package/lib/standalone/standalone-tool-catalog.js.map +1 -1
- package/lib/subagent/contracts.d.ts +0 -1
- package/lib/subagent/contracts.js.map +1 -1
- package/lib/subagent/im-result-sink.d.ts +0 -1
- package/lib/subagent/im-result-sink.js.map +1 -1
- package/lib/subagent/index.d.ts +0 -1
- package/lib/subagent/index.js.map +1 -1
- package/lib/subagent/subagent-runtime.d.ts +0 -1
- package/lib/subagent/subagent-runtime.js.map +1 -1
- package/lib/subagent/subagent-system-init.d.ts +0 -1
- package/lib/subagent/subagent-system-init.js.map +1 -1
- package/lib/subagent/subagent-system.d.ts +0 -1
- package/lib/subagent/subagent-system.js.map +1 -1
- package/lib/subagent-ai-events.d.ts +0 -1
- package/lib/subagent-ai-events.js.map +1 -1
- package/lib/subagent-artifact.d.ts +0 -1
- package/lib/subagent-artifact.js.map +1 -1
- package/lib/subagent-goal-notify.d.ts +0 -1
- package/lib/subagent-goal-notify.js.map +1 -1
- package/lib/subagent-parent-context.d.ts +0 -1
- package/lib/subagent-parent-context.js.map +1 -1
- package/lib/subagent-preset.d.ts +0 -1
- package/lib/subagent-preset.js.map +1 -1
- package/lib/subagent-prompt.d.ts +0 -1
- package/lib/subagent-prompt.js.map +1 -1
- package/lib/task-executor.d.ts +0 -1
- package/lib/task-executor.js.map +1 -1
- package/lib/tool/builtin-policy-extractors.d.ts +0 -1
- package/lib/tool/builtin-policy-extractors.js.map +1 -1
- package/lib/tool/context-tools.d.ts +0 -1
- package/lib/tool/context-tools.js.map +1 -1
- package/lib/tool/contracts.d.ts +0 -1
- package/lib/tool/contracts.js.map +1 -1
- package/lib/tool/conversation-reference-tool.d.ts +0 -1
- package/lib/tool/conversation-reference-tool.js.map +1 -1
- package/lib/tool/deferred-resolution.d.ts +0 -1
- package/lib/tool/deferred-resolution.js.map +1 -1
- package/lib/tool/executable-tool-registry.d.ts +0 -1
- package/lib/tool/executable-tool-registry.js.map +1 -1
- package/lib/tool/index.d.ts +0 -1
- package/lib/tool/index.js.map +1 -1
- package/lib/tool/pre-exec.d.ts +0 -1
- package/lib/tool/pre-exec.js.map +1 -1
- package/lib/tool/prepare-turn-tools.d.ts +0 -1
- package/lib/tool/prepare-turn-tools.js.map +1 -1
- package/lib/tool/runtime.d.ts +0 -1
- package/lib/tool/runtime.js.map +1 -1
- package/lib/tool/sources.d.ts +0 -1
- package/lib/tool/sources.js.map +1 -1
- package/lib/tool/tool-approval-gate.d.ts +0 -1
- package/lib/tool/tool-approval-gate.js.map +1 -1
- package/lib/tool/tool-approval-once-store.d.ts +0 -1
- package/lib/tool/tool-approval-once-store.js.map +1 -1
- package/lib/tool/tool-execution-authority.d.ts +0 -1
- package/lib/tool/tool-execution-authority.js.map +1 -1
- package/lib/tool/tool-model-output.d.ts +0 -1
- package/lib/tool/tool-model-output.js.map +1 -1
- package/lib/tool/tool-runtime.d.ts +0 -1
- package/lib/tool/tool-runtime.js.map +1 -1
- package/lib/tool/tool-system.d.ts +0 -1
- package/lib/tool/tool-system.js.map +1 -1
- package/lib/tool/turn-tool-runtime.d.ts +0 -1
- package/lib/tool/turn-tool-runtime.js.map +1 -1
- package/lib/tool-bridge.d.ts +0 -1
- package/lib/tool-bridge.js.map +1 -1
- package/lib/tool-catalog/deferred-turn-controller.d.ts +0 -1
- package/lib/tool-catalog/deferred-turn-controller.js.map +1 -1
- package/lib/tool-catalog/index.d.ts +0 -1
- package/lib/tool-catalog/index.js.map +1 -1
- package/lib/tool-catalog/resolve-config.d.ts +0 -1
- package/lib/tool-catalog/resolve-config.js.map +1 -1
- package/lib/tool-catalog/session-deferred-store.d.ts +0 -1
- package/lib/tool-catalog/session-deferred-store.js.map +1 -1
- package/lib/tool-catalog/tool-catalog.d.ts +8 -1
- package/lib/tool-catalog/tool-catalog.js +15 -0
- package/lib/tool-catalog/tool-catalog.js.map +1 -1
- package/lib/tool-catalog/types.d.ts +0 -1
- package/lib/tool-catalog/types.js.map +1 -1
- package/lib/trace/context-budget.d.ts +0 -1
- package/lib/trace/context-budget.js.map +1 -1
- package/lib/trace/index.d.ts +0 -1
- package/lib/trace/index.js.map +1 -1
- package/lib/trace/turn-trace-archive.d.ts +0 -1
- package/lib/trace/turn-trace-archive.js.map +1 -1
- package/lib/trace/turn-trace-format.d.ts +0 -1
- package/lib/trace/turn-trace-format.js.map +1 -1
- package/lib/trace/turn-trace-registry.d.ts +0 -1
- package/lib/trace/turn-trace-registry.js.map +1 -1
- package/lib/trace/turn-trace-store.d.ts +0 -1
- package/lib/trace/turn-trace-store.js.map +1 -1
- package/lib/trace/turn-trace.d.ts +0 -1
- package/lib/trace/turn-trace.js.map +1 -1
- package/lib/turn/agent-turn-context.d.ts +0 -1
- package/lib/turn/agent-turn-context.js.map +1 -1
- package/lib/turn/auto-continue.d.ts +0 -1
- package/lib/turn/auto-continue.js.map +1 -1
- package/lib/turn/cancel-intent.d.ts +0 -1
- package/lib/turn/cancel-intent.js.map +1 -1
- package/lib/turn/deferred-auto-continue.d.ts +0 -1
- package/lib/turn/deferred-auto-continue.js.map +1 -1
- package/lib/turn/deferred-delivery.d.ts +0 -1
- package/lib/turn/deferred-delivery.js.map +1 -1
- package/lib/turn/deferred-turn-state.d.ts +0 -1
- package/lib/turn/deferred-turn-state.js.map +1 -1
- package/lib/turn/execute-agent-turn.d.ts +0 -1
- package/lib/turn/execute-agent-turn.js.map +1 -1
- package/lib/turn/inbound-media.d.ts +3 -2
- package/lib/turn/inbound-media.js +15 -2
- package/lib/turn/inbound-media.js.map +1 -1
- package/lib/turn/inbound-queue-config.d.ts +0 -1
- package/lib/turn/inbound-queue-config.js.map +1 -1
- package/lib/turn/inbound-queue-runtime.d.ts +0 -1
- package/lib/turn/inbound-queue-runtime.js.map +1 -1
- package/lib/turn/inbound-turn-queue.d.ts +0 -1
- package/lib/turn/inbound-turn-queue.js.map +1 -1
- package/lib/turn/index.d.ts +0 -1
- package/lib/turn/index.js.map +1 -1
- package/lib/turn/journal-feed.d.ts +0 -1
- package/lib/turn/journal-feed.js.map +1 -1
- package/lib/turn/journal-integrity.d.ts +0 -1
- package/lib/turn/journal-integrity.js.map +1 -1
- package/lib/turn/persist-deferred-context.d.ts +0 -1
- package/lib/turn/persist-deferred-context.js.map +1 -1
- package/lib/turn/persist-subagent-context.d.ts +0 -1
- package/lib/turn/persist-subagent-context.js.map +1 -1
- package/lib/turn/process-stream.d.ts +0 -1
- package/lib/turn/process-stream.js.map +1 -1
- package/lib/turn/prompt-access.d.ts +0 -1
- package/lib/turn/prompt-access.js.map +1 -1
- package/lib/turn/prompt-api.d.ts +0 -1
- package/lib/turn/prompt-api.js.map +1 -1
- package/lib/turn/prompt-controller.d.ts +0 -1
- package/lib/turn/prompt-controller.js.map +1 -1
- package/lib/turn/prompt-input.d.ts +0 -1
- package/lib/turn/prompt-input.js.map +1 -1
- package/lib/turn/session-message-queue.d.ts +0 -1
- package/lib/turn/session-message-queue.js.map +1 -1
- package/lib/turn/subagent-auto-continue.d.ts +0 -1
- package/lib/turn/subagent-auto-continue.js.map +1 -1
- package/lib/turn/task-continuation.d.ts +0 -1
- package/lib/turn/task-continuation.js.map +1 -1
- package/lib/turn/trigger-cancelled-error.d.ts +0 -1
- package/lib/turn/trigger-cancelled-error.js.map +1 -1
- package/lib/turn/turn-admission-gate.d.ts +0 -1
- package/lib/turn/turn-admission-gate.js.map +1 -1
- package/lib/turn/turn-complete.d.ts +0 -1
- package/lib/turn/turn-complete.js.map +1 -1
- package/lib/turn/turn-context-bridge.d.ts +0 -1
- package/lib/turn/turn-context-bridge.js.map +1 -1
- package/lib/turn/turn-deferred-delta.d.ts +0 -1
- package/lib/turn/turn-deferred-delta.js.map +1 -1
- package/lib/turn/turn-event-source.d.ts +0 -1
- package/lib/turn/turn-event-source.js.map +1 -1
- package/lib/turn/turn-ingress.d.ts +3 -1
- package/lib/turn/turn-ingress.js.map +1 -1
- package/lib/turn/turn-metrics.d.ts +0 -1
- package/lib/turn/turn-metrics.js.map +1 -1
- package/lib/turn/turn-pipeline.d.ts +0 -1
- package/lib/turn/turn-pipeline.js.map +1 -1
- package/lib/turn/turn-terminal.d.ts +0 -1
- package/lib/turn/turn-terminal.js.map +1 -1
- package/lib/turn/turn-tracker.d.ts +0 -1
- package/lib/turn/turn-tracker.js.map +1 -1
- package/lib/types/disposable.d.ts +0 -1
- package/lib/types/disposable.js.map +1 -1
- package/lib/typing-indicator/adapter-integration.d.ts +0 -1
- package/lib/typing-indicator/adapter-integration.js.map +1 -1
- package/lib/typing-indicator/index.d.ts +0 -1
- package/lib/typing-indicator/index.js.map +1 -1
- package/lib/user-profile.d.ts +0 -1
- package/lib/user-profile.js.map +1 -1
- package/lib/utils/config-env.d.ts +0 -1
- package/lib/utils/config-env.js.map +1 -1
- package/lib/utils/keyed-mutex.d.ts +0 -1
- package/lib/utils/keyed-mutex.js.map +1 -1
- package/lib/web/bing-search-html.d.ts +0 -1
- package/lib/web/bing-search-html.js.map +1 -1
- package/lib/web/web-search-locale.d.ts +0 -1
- package/lib/web/web-search-locale.js.map +1 -1
- package/lib/web/web-tool-utils.d.ts +0 -1
- package/lib/web/web-tool-utils.js.map +1 -1
- package/lib/zhin-agent/index.d.ts +0 -1
- package/lib/zhin-agent/index.js.map +1 -1
- package/lib/zhin-agent/runtime-modules.d.ts +0 -1
- package/lib/zhin-agent/runtime-modules.js.map +1 -1
- package/package.json +12 -12
- package/lib/activity-feedback/adapter-integration.d.ts.map +0 -1
- package/lib/activity-feedback/config-resolver.d.ts.map +0 -1
- package/lib/activity-feedback/event-context.d.ts.map +0 -1
- package/lib/activity-feedback/index.d.ts.map +0 -1
- package/lib/activity-feedback/manager.d.ts.map +0 -1
- package/lib/activity-feedback/schedule-guard.d.ts.map +0 -1
- package/lib/activity-feedback/subagent-prefix.d.ts.map +0 -1
- package/lib/activity-feedback/turn-event-projector.d.ts.map +0 -1
- package/lib/activity-feedback/types.d.ts.map +0 -1
- package/lib/ai-event-bus.d.ts.map +0 -1
- package/lib/ai-event-contract.d.ts.map +0 -1
- package/lib/ai-event-subscriber.d.ts.map +0 -1
- package/lib/ai-hook-runtime-bus.d.ts.map +0 -1
- package/lib/assistant/bootstrap-assistant-home.d.ts.map +0 -1
- package/lib/assistant/config.d.ts.map +0 -1
- package/lib/assistant/deliver-schedule-to-adapter.d.ts.map +0 -1
- package/lib/assistant/domains/ha-home-backend.d.ts.map +0 -1
- package/lib/assistant/domains/ha-ws-transport.d.ts.map +0 -1
- package/lib/assistant/domains/home-entity.d.ts.map +0 -1
- package/lib/assistant/domains/home-state-watch.d.ts.map +0 -1
- package/lib/assistant/event-ingress.d.ts.map +0 -1
- package/lib/assistant/event-types.d.ts.map +0 -1
- package/lib/assistant/home-config.d.ts.map +0 -1
- package/lib/assistant/home-facade.d.ts.map +0 -1
- package/lib/assistant/home-mcp-bridge.d.ts.map +0 -1
- package/lib/assistant/home-policy.d.ts.map +0 -1
- package/lib/assistant/home-tools.d.ts.map +0 -1
- package/lib/assistant/index.d.ts.map +0 -1
- package/lib/assistant/job-creator.d.ts.map +0 -1
- package/lib/assistant/job-engine.d.ts.map +0 -1
- package/lib/assistant/job-scheduler.d.ts.map +0 -1
- package/lib/assistant/job-store.d.ts.map +0 -1
- package/lib/assistant/job-utils.d.ts.map +0 -1
- package/lib/assistant/job-worker.d.ts.map +0 -1
- package/lib/assistant/notification-router.d.ts.map +0 -1
- package/lib/assistant/profile-loader.d.ts.map +0 -1
- package/lib/assistant/profile-types.d.ts.map +0 -1
- package/lib/assistant/runtime-contract.d.ts.map +0 -1
- package/lib/assistant/schedule-execution.d.ts.map +0 -1
- package/lib/assistant/schedule-job-service.d.ts.map +0 -1
- package/lib/assistant/schedule-skills.d.ts.map +0 -1
- package/lib/assistant/types.d.ts.map +0 -1
- package/lib/authoring/bridge.d.ts.map +0 -1
- package/lib/authoring/define-eval.d.ts.map +0 -1
- package/lib/authoring/define-hook.d.ts.map +0 -1
- package/lib/authoring/define-skill.d.ts.map +0 -1
- package/lib/authoring/disable-tool.d.ts.map +0 -1
- package/lib/authoring/entries/evals.d.ts.map +0 -1
- package/lib/authoring/entries/hooks.d.ts.map +0 -1
- package/lib/authoring/entries/skills.d.ts.map +0 -1
- package/lib/authoring/index.d.ts.map +0 -1
- package/lib/authoring/types.d.ts.map +0 -1
- package/lib/bootstrap.d.ts.map +0 -1
- package/lib/builtins/builtin-tool-service.d.ts.map +0 -1
- package/lib/common-adapter-tools.d.ts.map +0 -1
- package/lib/config/agent-binding-registry.d.ts.map +0 -1
- package/lib/config/agent-bindings.d.ts.map +0 -1
- package/lib/config/agent-interfaces.d.ts.map +0 -1
- package/lib/config/deprecated-agent-binding-keys.d.ts.map +0 -1
- package/lib/config/deprecated-agent-keys.d.ts.map +0 -1
- package/lib/config/fix-ai-config.d.ts.map +0 -1
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/keyword-triggers.d.ts.map +0 -1
- package/lib/config/model-harness-runtime.d.ts.map +0 -1
- package/lib/config/model-harness.d.ts.map +0 -1
- package/lib/config/normalize-ai-config.d.ts.map +0 -1
- package/lib/config/perception-config.d.ts.map +0 -1
- package/lib/config/provider-instance.d.ts.map +0 -1
- package/lib/config/resolve-five-agent-binding.d.ts.map +0 -1
- package/lib/config/types.d.ts.map +0 -1
- package/lib/config/validate-ai-config.d.ts.map +0 -1
- package/lib/config/zhin-agent-config.d.ts.map +0 -1
- package/lib/config/zhin-agent-constants.d.ts.map +0 -1
- package/lib/config/zhin-agent-defaults.d.ts.map +0 -1
- package/lib/config/zhin-agent-dependencies.d.ts.map +0 -1
- package/lib/config/zhin-agent-runtime.d.ts.map +0 -1
- package/lib/context/agents-instruction.d.ts.map +0 -1
- package/lib/context/context-system.d.ts.map +0 -1
- package/lib/context/context-tail-limit.d.ts.map +0 -1
- package/lib/context/contracts.d.ts.map +0 -1
- package/lib/context/default-builders.d.ts.map +0 -1
- package/lib/context/envelope-parts.d.ts.map +0 -1
- package/lib/context/im-turn-context-adapter.d.ts.map +0 -1
- package/lib/context/index.d.ts.map +0 -1
- package/lib/context/model-resolver.d.ts.map +0 -1
- package/lib/context/turn-envelope.d.ts.map +0 -1
- package/lib/context/turn-user-message.d.ts.map +0 -1
- package/lib/core/agent-core-run.d.ts.map +0 -1
- package/lib/core/agent-core.d.ts.map +0 -1
- package/lib/core/agent-loop-standalone.d.ts.map +0 -1
- package/lib/core/agent-loop-turn.d.ts.map +0 -1
- package/lib/core/agent-run-shared.d.ts.map +0 -1
- package/lib/core/compose-deps.d.ts.map +0 -1
- package/lib/core/contracts.d.ts.map +0 -1
- package/lib/core/exhausted-turn-reply.d.ts.map +0 -1
- package/lib/core/exploration-budget.d.ts.map +0 -1
- package/lib/core/index.d.ts.map +0 -1
- package/lib/core/missing-tool-resolver.d.ts.map +0 -1
- package/lib/core/progress-reporter.d.ts.map +0 -1
- package/lib/core/spawn-delegation.d.ts.map +0 -1
- package/lib/core/structured-reply-recovery.d.ts.map +0 -1
- package/lib/core/text-sanitize.d.ts.map +0 -1
- package/lib/core/tool-calls-user-format.d.ts.map +0 -1
- package/lib/core/tool-execution-authority.d.ts.map +0 -1
- package/lib/core/turn-completion-usage.d.ts.map +0 -1
- package/lib/core/turn-event-mapper.d.ts.map +0 -1
- package/lib/core/turn-progress.d.ts.map +0 -1
- package/lib/create-agent-session.d.ts.map +0 -1
- package/lib/decision/approval-judgment.d.ts.map +0 -1
- package/lib/decision/approval.d.ts.map +0 -1
- package/lib/decision/config.d.ts.map +0 -1
- package/lib/decision/index.d.ts.map +0 -1
- package/lib/decision/rank.d.ts.map +0 -1
- package/lib/decision/retrieval.d.ts.map +0 -1
- package/lib/decision/types.d.ts.map +0 -1
- package/lib/deferred-worker-runner.d.ts.map +0 -1
- package/lib/deferred-worker-tool-load.d.ts.map +0 -1
- package/lib/detached-task/index.d.ts.map +0 -1
- package/lib/detached-task/interjection.d.ts.map +0 -1
- package/lib/detached-task/runner.d.ts.map +0 -1
- package/lib/detached-task/store.d.ts.map +0 -1
- package/lib/detached-task/token.d.ts.map +0 -1
- package/lib/detached-task/types.d.ts.map +0 -1
- package/lib/discovery/agent-surface-info.d.ts.map +0 -1
- package/lib/discovery/agent-surface.d.ts.map +0 -1
- package/lib/discovery/agents.d.ts.map +0 -1
- package/lib/discovery/utils.d.ts.map +0 -1
- package/lib/event/agent-stream-bus.d.ts.map +0 -1
- package/lib/event/agent-stream-hooks.d.ts.map +0 -1
- package/lib/event/ai-event-bus.d.ts.map +0 -1
- package/lib/event/contracts.d.ts.map +0 -1
- package/lib/event/event-emitter.d.ts.map +0 -1
- package/lib/event/event-system.d.ts.map +0 -1
- package/lib/event/filtering-middleware.d.ts.map +0 -1
- package/lib/event/hook-stream-sink.d.ts.map +0 -1
- package/lib/event/index.d.ts.map +0 -1
- package/lib/event/logging-middleware.d.ts.map +0 -1
- package/lib/event/publish-agent-stream.d.ts.map +0 -1
- package/lib/event/session-events.d.ts.map +0 -1
- package/lib/event/turn-event.d.ts.map +0 -1
- package/lib/event/turn-to-agent-stream.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/init/activate-ai-database-storage.d.ts.map +0 -1
- package/lib/init/compose-zhin-agent-runtime.d.ts.map +0 -1
- package/lib/init/configure-zhin-agent.d.ts.map +0 -1
- package/lib/init/define-ai-database-models.d.ts.map +0 -1
- package/lib/init/dispose-zhin-agent.d.ts.map +0 -1
- package/lib/init/introspection-output.d.ts.map +0 -1
- package/lib/init/runtime-management-commands.d.ts.map +0 -1
- package/lib/interaction/index.d.ts.map +0 -1
- package/lib/interaction/interaction-router.d.ts.map +0 -1
- package/lib/internal/agent-host.d.ts.map +0 -1
- package/lib/internal/ai-service-refs.d.ts.map +0 -1
- package/lib/internal/as-private.d.ts.map +0 -1
- package/lib/internal/host-types.d.ts.map +0 -1
- package/lib/internal/phase-trace.d.ts.map +0 -1
- package/lib/internal/prompt-trace.d.ts.map +0 -1
- package/lib/internal/turn-context.d.ts.map +0 -1
- package/lib/journal/file-journal-store.d.ts.map +0 -1
- package/lib/journal/index.d.ts.map +0 -1
- package/lib/journal/persistent-turn-journal.d.ts.map +0 -1
- package/lib/mcp-client/bridge.d.ts.map +0 -1
- package/lib/mcp-client/connection.d.ts.map +0 -1
- package/lib/mcp-client/index.d.ts.map +0 -1
- package/lib/media/deliver-subagent-result.d.ts.map +0 -1
- package/lib/media/inbound-refs.d.ts.map +0 -1
- package/lib/media/index.d.ts.map +0 -1
- package/lib/media/media-capabilities.d.ts.map +0 -1
- package/lib/media/media-normalize.d.ts.map +0 -1
- package/lib/media/media-publisher.d.ts.map +0 -1
- package/lib/media/media-router.d.ts.map +0 -1
- package/lib/media/media-spool.d.ts.map +0 -1
- package/lib/media/media-tool-bridge.d.ts.map +0 -1
- package/lib/media/media-types.d.ts.map +0 -1
- package/lib/media/perception.d.ts.map +0 -1
- package/lib/media/resolve-config.d.ts.map +0 -1
- package/lib/media/subagent-inbound.d.ts.map +0 -1
- package/lib/media/subagent-user-delivery.d.ts.map +0 -1
- package/lib/media/vision-capability.d.ts.map +0 -1
- package/lib/memory/ai-compaction-strategy.d.ts.map +0 -1
- package/lib/memory/compaction-runtime.d.ts.map +0 -1
- package/lib/memory/context-repository-store.d.ts.map +0 -1
- package/lib/memory/contracts.d.ts.map +0 -1
- package/lib/memory/index.d.ts.map +0 -1
- package/lib/memory/memory-system.d.ts.map +0 -1
- package/lib/memory/memory-write-policy.d.ts.map +0 -1
- package/lib/memory/semantic-recall.d.ts.map +0 -1
- package/lib/memory/told-ledger.d.ts.map +0 -1
- package/lib/memory-layers.d.ts.map +0 -1
- package/lib/orchestration/five-agent/index.d.ts.map +0 -1
- package/lib/orchestration/five-agent/prompts.d.ts.map +0 -1
- package/lib/orchestration/five-agent/role-capability-policy.d.ts.map +0 -1
- package/lib/orchestration/five-agent/roles.d.ts.map +0 -1
- package/lib/outbound/agent-output.d.ts.map +0 -1
- package/lib/outbound/send-proactive.d.ts.map +0 -1
- package/lib/outbound/structured-reply.d.ts.map +0 -1
- package/lib/plugin-ai-hook-bus.d.ts.map +0 -1
- package/lib/plugin-loop-hooks.d.ts.map +0 -1
- package/lib/plugin-runtime/agent-event-bus.d.ts.map +0 -1
- package/lib/plugin-runtime/agent-host-port.d.ts.map +0 -1
- package/lib/plugin-runtime/agent-runtime.d.ts.map +0 -1
- package/lib/plugin-runtime/agent-trace-runtime.d.ts.map +0 -1
- package/lib/plugin-runtime/ai-completion.d.ts.map +0 -1
- package/lib/plugin-runtime/capability-ingress.d.ts.map +0 -1
- package/lib/plugin-runtime/capability-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/decision-runtime.d.ts.map +0 -1
- package/lib/plugin-runtime/deferred-capability-plan.d.ts.map +0 -1
- package/lib/plugin-runtime/file-edit-quote-utils.d.ts.map +0 -1
- package/lib/plugin-runtime/file-search-scope.d.ts.map +0 -1
- package/lib/plugin-runtime/full-agent-turn-engine.d.ts.map +0 -1
- package/lib/plugin-runtime/host-mcp-projection.d.ts.map +0 -1
- package/lib/plugin-runtime/host-tool-projection.d.ts.map +0 -1
- package/lib/plugin-runtime/index.d.ts.map +0 -1
- package/lib/plugin-runtime/native-bash-tool.d.ts.map +0 -1
- package/lib/plugin-runtime/native-file-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/native-image-tool.d.ts.map +0 -1
- package/lib/plugin-runtime/native-interaction-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/native-knowledge-tool.d.ts.map +0 -1
- package/lib/plugin-runtime/native-semantic-memory-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/native-todo-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/native-tool-suite.d.ts.map +0 -1
- package/lib/plugin-runtime/native-web-tools.d.ts.map +0 -1
- package/lib/plugin-runtime/schedule-capability-plan.d.ts.map +0 -1
- package/lib/plugin-runtime/subagent-turn-capability.d.ts.map +0 -1
- package/lib/plugin-runtime/turn-intent-resolver.d.ts.map +0 -1
- package/lib/prompt/assembly.d.ts.map +0 -1
- package/lib/prompt/estimate-tokens.d.ts.map +0 -1
- package/lib/prompt/git-context.d.ts.map +0 -1
- package/lib/prompt/index.d.ts.map +0 -1
- package/lib/prompt/model-aware-builder.d.ts.map +0 -1
- package/lib/prompt/model-prompt-strategy.d.ts.map +0 -1
- package/lib/prompt/prompt-assembly-registry.d.ts.map +0 -1
- package/lib/prompt/prompt-budget.d.ts.map +0 -1
- package/lib/prompt/prompt-builder.d.ts.map +0 -1
- package/lib/prompt/rules/code-references.d.ts.map +0 -1
- package/lib/prompt/rules/critical-rules.d.ts.map +0 -1
- package/lib/prompt/rules/editing.d.ts.map +0 -1
- package/lib/prompt/rules/error-handling.d.ts.map +0 -1
- package/lib/prompt/rules/index.d.ts.map +0 -1
- package/lib/prompt/rules/memory.d.ts.map +0 -1
- package/lib/prompt/rules/task-completion.d.ts.map +0 -1
- package/lib/prompt/rules/workflow-rules.d.ts.map +0 -1
- package/lib/prompt/system-prompt.d.ts.map +0 -1
- package/lib/prompt/templates.d.ts.map +0 -1
- package/lib/prompt/tokens.d.ts.map +0 -1
- package/lib/prompt/turn-prompt-profile.d.ts.map +0 -1
- package/lib/prompt/workspace-prompt.d.ts.map +0 -1
- package/lib/reserved-tools.d.ts.map +0 -1
- package/lib/resource-hub/hook-registry.d.ts.map +0 -1
- package/lib/resource-hub/index.d.ts.map +0 -1
- package/lib/resource-hub/mcp-lifecycle.d.ts.map +0 -1
- package/lib/resource-hub/mcp-registry.d.ts.map +0 -1
- package/lib/resource-hub/public-api.d.ts.map +0 -1
- package/lib/resource-hub/resolve-subagent-tools.d.ts.map +0 -1
- package/lib/resource-hub/resource-registry.d.ts.map +0 -1
- package/lib/resource-hub/role-configs.d.ts.map +0 -1
- package/lib/resource-hub/skill-registry.d.ts.map +0 -1
- package/lib/resource-hub/subagent-registry.d.ts.map +0 -1
- package/lib/resource-hub/tool-selection.d.ts.map +0 -1
- package/lib/resource-hub/types.d.ts.map +0 -1
- package/lib/routing/runtime-binding.d.ts.map +0 -1
- package/lib/routing/subagent-summarize.d.ts.map +0 -1
- package/lib/schedule-cron.d.ts.map +0 -1
- package/lib/schedule-domain/audit-logger.d.ts.map +0 -1
- package/lib/schedule-domain/budget-guard.d.ts.map +0 -1
- package/lib/schedule-domain/execution-domain.d.ts.map +0 -1
- package/lib/schedule-domain/index.d.ts.map +0 -1
- package/lib/schedule-domain/output-validator.d.ts.map +0 -1
- package/lib/schedule-domain/prompt-assembler.d.ts.map +0 -1
- package/lib/schedule-domain/schedule-execution-queue.d.ts.map +0 -1
- package/lib/schedule-domain/security-harness.d.ts.map +0 -1
- package/lib/schedule-manager.d.ts.map +0 -1
- package/lib/seam/index.d.ts.map +0 -1
- package/lib/seam/seam-integration.d.ts.map +0 -1
- package/lib/seam/seam-provider.d.ts.map +0 -1
- package/lib/seam/skill-service.d.ts.map +0 -1
- package/lib/seam/tokens.d.ts.map +0 -1
- package/lib/seam/tool-service.d.ts.map +0 -1
- package/lib/security/anomaly-detection.d.ts.map +0 -1
- package/lib/security/audit-logger.d.ts.map +0 -1
- package/lib/security/comm-message-context.d.ts.map +0 -1
- package/lib/security/dangerous-tool-policy.d.ts.map +0 -1
- package/lib/security/exec-policy.d.ts.map +0 -1
- package/lib/security/file-policy.d.ts.map +0 -1
- package/lib/security/file-role-policy.d.ts.map +0 -1
- package/lib/security/index.d.ts.map +0 -1
- package/lib/security/network-authority.d.ts.map +0 -1
- package/lib/security/network-policy-context.d.ts.map +0 -1
- package/lib/security/network-policy.d.ts.map +0 -1
- package/lib/security/outbound-leak-guard.d.ts.map +0 -1
- package/lib/security/owner-approval-contracts.d.ts.map +0 -1
- package/lib/security/owner-approval-runtime.d.ts.map +0 -1
- package/lib/security/owner-approval-store.d.ts.map +0 -1
- package/lib/security/policy-facade.d.ts.map +0 -1
- package/lib/security/policy-narrowing.d.ts.map +0 -1
- package/lib/security/provenance.d.ts.map +0 -1
- package/lib/security/sandbox-docker.d.ts.map +0 -1
- package/lib/security/sandbox.d.ts.map +0 -1
- package/lib/security/trust-level.d.ts.map +0 -1
- package/lib/security/turn-file-authority.d.ts.map +0 -1
- package/lib/security/turn-network-client.d.ts.map +0 -1
- package/lib/security/usage-quota.d.ts.map +0 -1
- package/lib/segment/filter-im-delivery.d.ts.map +0 -1
- package/lib/service.d.ts.map +0 -1
- package/lib/session/approval-port.d.ts.map +0 -1
- package/lib/session/approval-review-agent.d.ts.map +0 -1
- package/lib/session/branch-summarization-runtime.d.ts.map +0 -1
- package/lib/session/contracts.d.ts.map +0 -1
- package/lib/session/index.d.ts.map +0 -1
- package/lib/session/session-io.d.ts.map +0 -1
- package/lib/session/session-key.d.ts.map +0 -1
- package/lib/session/session-system.d.ts.map +0 -1
- package/lib/session/session-tree-commands.d.ts.map +0 -1
- package/lib/session/strategies.d.ts.map +0 -1
- package/lib/session/turn-ingress-session.d.ts.map +0 -1
- package/lib/session-tree-runtime.d.ts.map +0 -1
- package/lib/skill/capability-catalog.d.ts.map +0 -1
- package/lib/skill/contracts.d.ts.map +0 -1
- package/lib/skill/index.d.ts.map +0 -1
- package/lib/skill/progressive-disclosure.d.ts.map +0 -1
- package/lib/skill/skill-instruction-reader-factory.d.ts.map +0 -1
- package/lib/skill/skill-instruction-reader.d.ts.map +0 -1
- package/lib/skill/skill-instructions.d.ts.map +0 -1
- package/lib/skill/skill-registry-as-service.d.ts.map +0 -1
- package/lib/skill/skill-system.d.ts.map +0 -1
- package/lib/spawn/permission-task.d.ts.map +0 -1
- package/lib/spawn/spawn-task-tool.d.ts.map +0 -1
- package/lib/stability/memory-pressure.d.ts.map +0 -1
- package/lib/standalone/standalone-tool-catalog.d.ts.map +0 -1
- package/lib/subagent/contracts.d.ts.map +0 -1
- package/lib/subagent/im-result-sink.d.ts.map +0 -1
- package/lib/subagent/index.d.ts.map +0 -1
- package/lib/subagent/subagent-runtime.d.ts.map +0 -1
- package/lib/subagent/subagent-system-init.d.ts.map +0 -1
- package/lib/subagent/subagent-system.d.ts.map +0 -1
- package/lib/subagent-ai-events.d.ts.map +0 -1
- package/lib/subagent-artifact.d.ts.map +0 -1
- package/lib/subagent-goal-notify.d.ts.map +0 -1
- package/lib/subagent-parent-context.d.ts.map +0 -1
- package/lib/subagent-preset.d.ts.map +0 -1
- package/lib/subagent-prompt.d.ts.map +0 -1
- package/lib/task-executor.d.ts.map +0 -1
- package/lib/tool/builtin-policy-extractors.d.ts.map +0 -1
- package/lib/tool/context-tools.d.ts.map +0 -1
- package/lib/tool/contracts.d.ts.map +0 -1
- package/lib/tool/conversation-reference-tool.d.ts.map +0 -1
- package/lib/tool/deferred-resolution.d.ts.map +0 -1
- package/lib/tool/executable-tool-registry.d.ts.map +0 -1
- package/lib/tool/index.d.ts.map +0 -1
- package/lib/tool/pre-exec.d.ts.map +0 -1
- package/lib/tool/prepare-turn-tools.d.ts.map +0 -1
- package/lib/tool/runtime.d.ts.map +0 -1
- package/lib/tool/sources.d.ts.map +0 -1
- package/lib/tool/tool-approval-gate.d.ts.map +0 -1
- package/lib/tool/tool-approval-once-store.d.ts.map +0 -1
- package/lib/tool/tool-execution-authority.d.ts.map +0 -1
- package/lib/tool/tool-model-output.d.ts.map +0 -1
- package/lib/tool/tool-runtime.d.ts.map +0 -1
- package/lib/tool/tool-system.d.ts.map +0 -1
- package/lib/tool/turn-tool-runtime.d.ts.map +0 -1
- package/lib/tool-bridge.d.ts.map +0 -1
- package/lib/tool-catalog/deferred-turn-controller.d.ts.map +0 -1
- package/lib/tool-catalog/index.d.ts.map +0 -1
- package/lib/tool-catalog/resolve-config.d.ts.map +0 -1
- package/lib/tool-catalog/session-deferred-store.d.ts.map +0 -1
- package/lib/tool-catalog/tool-catalog.d.ts.map +0 -1
- package/lib/tool-catalog/types.d.ts.map +0 -1
- package/lib/trace/context-budget.d.ts.map +0 -1
- package/lib/trace/index.d.ts.map +0 -1
- package/lib/trace/turn-trace-archive.d.ts.map +0 -1
- package/lib/trace/turn-trace-format.d.ts.map +0 -1
- package/lib/trace/turn-trace-registry.d.ts.map +0 -1
- package/lib/trace/turn-trace-store.d.ts.map +0 -1
- package/lib/trace/turn-trace.d.ts.map +0 -1
- package/lib/turn/agent-turn-context.d.ts.map +0 -1
- package/lib/turn/auto-continue.d.ts.map +0 -1
- package/lib/turn/cancel-intent.d.ts.map +0 -1
- package/lib/turn/deferred-auto-continue.d.ts.map +0 -1
- package/lib/turn/deferred-delivery.d.ts.map +0 -1
- package/lib/turn/deferred-turn-state.d.ts.map +0 -1
- package/lib/turn/execute-agent-turn.d.ts.map +0 -1
- package/lib/turn/inbound-media.d.ts.map +0 -1
- package/lib/turn/inbound-queue-config.d.ts.map +0 -1
- package/lib/turn/inbound-queue-runtime.d.ts.map +0 -1
- package/lib/turn/inbound-turn-queue.d.ts.map +0 -1
- package/lib/turn/index.d.ts.map +0 -1
- package/lib/turn/journal-feed.d.ts.map +0 -1
- package/lib/turn/journal-integrity.d.ts.map +0 -1
- package/lib/turn/persist-deferred-context.d.ts.map +0 -1
- package/lib/turn/persist-subagent-context.d.ts.map +0 -1
- package/lib/turn/process-stream.d.ts.map +0 -1
- package/lib/turn/prompt-access.d.ts.map +0 -1
- package/lib/turn/prompt-api.d.ts.map +0 -1
- package/lib/turn/prompt-controller.d.ts.map +0 -1
- package/lib/turn/prompt-input.d.ts.map +0 -1
- package/lib/turn/session-message-queue.d.ts.map +0 -1
- package/lib/turn/subagent-auto-continue.d.ts.map +0 -1
- package/lib/turn/task-continuation.d.ts.map +0 -1
- package/lib/turn/trigger-cancelled-error.d.ts.map +0 -1
- package/lib/turn/turn-admission-gate.d.ts.map +0 -1
- package/lib/turn/turn-complete.d.ts.map +0 -1
- package/lib/turn/turn-context-bridge.d.ts.map +0 -1
- package/lib/turn/turn-deferred-delta.d.ts.map +0 -1
- package/lib/turn/turn-event-source.d.ts.map +0 -1
- package/lib/turn/turn-ingress.d.ts.map +0 -1
- package/lib/turn/turn-metrics.d.ts.map +0 -1
- package/lib/turn/turn-pipeline.d.ts.map +0 -1
- package/lib/turn/turn-terminal.d.ts.map +0 -1
- package/lib/turn/turn-tracker.d.ts.map +0 -1
- package/lib/types/disposable.d.ts.map +0 -1
- package/lib/typing-indicator/adapter-integration.d.ts.map +0 -1
- package/lib/typing-indicator/index.d.ts.map +0 -1
- package/lib/user-profile.d.ts.map +0 -1
- package/lib/utils/config-env.d.ts.map +0 -1
- package/lib/utils/keyed-mutex.d.ts.map +0 -1
- package/lib/web/bing-search-html.d.ts.map +0 -1
- package/lib/web/web-search-locale.d.ts.map +0 -1
- package/lib/web/web-tool-utils.d.ts.map +0 -1
- package/lib/zhin-agent/index.d.ts.map +0 -1
- package/lib/zhin-agent/runtime-modules.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/context/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/context/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Context System — 模块契约(与实现同步)。\n *\n * 实现:builder/injector 链 + `buildTextTurnContext`(turn 级编排入口)。\n * `BuildContext.host` 为生产路径注入的 `ZhinAgentPrivate` 只读面。\n */\n\nimport type { AgentMessage } from '@zhin.js/ai';\nimport type { ZhinAgentPrivate } from '../internal/agent-host.js';\nimport type { TurnEnvelopeParts } from './envelope-parts.js';\nimport type { TurnContextView } from './turn-envelope.js';\n\nexport interface BuildContext {\n turn: TurnContextView;\n inboundContent?: string;\n sessionKey?: string;\n /** 生产 turn 路径注入;builder 写入 envelope 片段 */\n host?: ZhinAgentPrivate;\n envelope?: Partial<TurnEnvelopeParts>;\n}\n\nexport interface InjectContext {\n turn: TurnContextView;\n inboundContent?: string;\n envelope?: Partial<TurnEnvelopeParts>;\n}\n\nexport interface ContextBuilder {\n name: string;\n build(context: BuildContext): Promise<AgentMessage[]>;\n}\n\nexport interface ContextInjector {\n name: string;\n inject(messages: AgentMessage[], context: InjectContext): AgentMessage[];\n}\n\nexport interface ContextSystemConfig {\n /** 预留扩展面 */\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-builders.js","sourceRoot":"","sources":["../../src/context/default-builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5D,MAAM,OAAO,qBAAqB;IAGH;IAF7B,IAAI,GAAG,SAAS,CAAC;IAEjB,YAA6B,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;IAAG,CAAC;IAEvD,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;YACpB,OAAO,CAAC,QAAQ,CAAC,cAAc,GAAG,OAAO,CAAC;QAC5C,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED,MAAM,OAAO,YAAY;IAGM;IAF7B,IAAI,GAAG,MAAM,CAAC;IAEd,YAA6B,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;IAAG,CAAC;IAEvD,MAAM,CAAC,QAAwB,EAAE,OAAsB;QACrD,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;gBACxD,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI;gBACzC,CAAC,CAAC,E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Q,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;gBACxD,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI;gBACzC,CAAC,CAAC,EAAE,CAAC;QACT,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,MAAM,UAAU,4BAA4B,CAAC,IAAsB;IAIjE,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,qBAAqB,CAAC,IAAI,CAAC;SAChC;QACD,SAAS,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { type AgentMessage, detectTone } from '@zhin.js/ai';\nimport type { ZhinAgentPrivate } from '../internal/agent-host.js';\nimport type { BuildContext, ContextBuilder, ContextInjector, InjectContext } from './contracts.js';\nexport class ProfileContextBuilder implements ContextBuilder {\n name = 'profile';\n\n constructor(private readonly host: ZhinAgentPrivate) {}\n\n async build(context: BuildContext): Promise<AgentMessage[]> {\n if (!context.envelope) return [];\n const userId = context.turn.principal.subjectId;\n const summary = await this.host.userProfiles.buildProfileSummary(userId);\n if (summary?.trim()) {\n context.envelope.profileSummary = summary;\n }\n return [];\n }\n}\n\nexport class ToneInjector implements ContextInjector {\n name = 'tone';\n\n constructor(private readonly host: ZhinAgentPrivate) {}\n\n inject(messages: AgentMessage[], context: InjectContext): AgentMessage[] {\n if (context.envelope && context.inboundContent !== undefined) {\n context.envelope.toneHint = this.host.config.toneAwareness\n ? detectTone(context.inboundContent).hint\n : '';\n }\n return messages;\n }\n}\n\nexport function createDefaultContextBuilders(host: ZhinAgentPrivate): {\n builders: ContextBuilder[];\n injectors: ContextInjector[];\n} {\n return {\n builders: [\n new ProfileContextBuilder(host),\n ],\n injectors: [new ToneInjector(host)],\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope-parts.js","sourceRoot":"","sources":["../../src/context/envelope-parts.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"envelope-parts.js","sourceRoot":"","sources":["../../src/context/envelope-parts.ts"],"names":[],"mappings":"","sourcesContent":["/** Turn envelope 片段 — builder/injector pipeline 写入,buildTextTurnContext 读取。 */\nexport interface TurnEnvelopeParts {\n profileSummary?: string;\n toneHint?: string;\n deferredStats?: string;\n activeSkillsContext?: string;\n quoteSystemHint?: string;\n modelLine?: string;\n sdk?: string;\n agentsContext?: string;\n}\n"]}
|
|
@@ -5,4 +5,3 @@ import type { TurnMedia } from '../turn/turn-ingress.js';
|
|
|
5
5
|
export declare function turnContextViewFromMessage(message: Message): TurnContextView;
|
|
6
6
|
/** IM ingress-only projection into the canonical Turn media contract. */
|
|
7
7
|
export declare function turnMediaFromMessage(message: Message): readonly TurnMedia[];
|
|
8
|
-
//# sourceMappingURL=im-turn-context-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"im-turn-context-adapter.js","sourceRoot":"","sources":["../../src/context/im-turn-context-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,GAEvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,sFAAsF;AACtF,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC;IACxC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACpE,MAAM,IAAI,SAAS,CAAC,6DAA6D,CAAC,CAAC;IACrF,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/F,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,UAA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essage,\n senderRolesFromMessage,\n type Message,\n} from '@zhin.js/core';\nimport type { TurnContextView } from './turn-envelope.js';\nimport { readInboundMediaRefs } from '../media/inbound-refs.js';\nimport type { TurnMedia } from '../turn/turn-ingress.js';\n\n/** IM ingress-only adapter. Agent context implementation consumes TurnContextView. */\nexport function turnContextViewFromMessage(message: Message): TurnContextView {\n const scope = message.conversation.kind;\n if (scope !== 'private' && scope !== 'group' && scope !== 'channel') {\n throw new TypeError('IM Turn context requires a private, group, or channel scope');\n }\n const platform = String(message.clientAdapter ?? message.conversation.endpoint.adapter).trim();\n const endpoint = String(message.endpointId ?? message.conversation.endpoint.id).trim();\n const sceneId = String(message.conversation.id ?? '').trim();\n const subjectId = String(message.sender?.id ?? '').trim();\n if (!platform || !endpoint || !sceneId || !subjectId) {\n throw new TypeError('IM Turn context requires platform, endpoint, scene, and sender identity');\n }\n return Object.freeze({\n origin: Object.freeze({\n kind: 'im',\n platform,\n endpoint,\n scope,\n sceneId,\n ...(message.id ? { messageId: String(message.id) } : {}),\n }),\n principal: Object.freeze({\n subjectId,\n ...(message.sender?.name ? { displayName: message.sender.name } : {}),\n roles: Object.freeze([...senderRolesFromMessage(message)]),\n }),\n session: Object.freeze({ key: resolveIMSessionIdFromMessage(message) }),\n });\n}\n\n/** IM ingress-only projection into the canonical Turn media contract. */\nexport function turnMediaFromMessage(message: Message): readonly TurnMedia[] {\n return Object.freeze(readInboundMediaRefs(message).map(({ type, media }) => Object.freeze({\n kind: normalizeMediaKind(type),\n source: Object.freeze({\n kind: media.kind === 'file' ? 'platform_ref' as const : media.kind,\n value: media.value,\n }),\n ...(media.mime_type ? { mimeType: media.mime_type } : {}),\n ...(media.file_name ? { name: media.file_name } : {}),\n })));\n}\n\nfunction normalizeMediaKind(type: string): TurnMedia['kind'] {\n if (type === 'image' || type === 'video' || type === 'file') return type;\n return 'audio';\n}\n"]}
|
package/lib/context/index.d.ts
CHANGED
|
@@ -8,9 +8,8 @@ export type { TurnContextEnvelopeInput, TurnContextView } from './turn-envelope.
|
|
|
8
8
|
export type { AgentsInstructionEntry } from './agents-instruction.js';
|
|
9
9
|
export type { ModelResolverConfig } from './model-resolver.js';
|
|
10
10
|
export { ContextSystem, createContextSystemForHost, ProfileContextBuilder, ToneInjector, createDefaultContextBuilders, } from './context-system.js';
|
|
11
|
-
export { buildTurnContextEnvelope, prependTurnContextEnvelope, formatSessionContextLine, TURN_CONTEXT_BEGIN, TURN_CONTEXT_END, } from './turn-envelope.js';
|
|
11
|
+
export { buildTurnContextEnvelope, prependTurnContextEnvelope, formatSessionContextLine, TURN_CONTEXT_BEGIN, TURN_CONTEXT_END, AMBIENT_ENGAGEMENT_METADATA_KEY, } from './turn-envelope.js';
|
|
12
12
|
export { buildTurnUserMessages, applyTurnContextToUserMessages, prependEnvelopeToFirstUserText, } from './turn-user-message.js';
|
|
13
13
|
export { buildAgentsEnvelopeContext, collectAgentsInstructionChain, } from './agents-instruction.js';
|
|
14
14
|
export { resolveModel, resolveModelCandidates } from './model-resolver.js';
|
|
15
15
|
export { DEFAULT_CONTEXT_TAIL_MESSAGE_LIMIT, resolveContextTailMessageLimit, } from './context-tail-limit.js';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/context/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Context System — builder/injector 链 + turn 上下文构建。
|
|
3
3
|
*/
|
|
4
4
|
export { ContextSystem, createContextSystemForHost, ProfileContextBuilder, ToneInjector, createDefaultContextBuilders, } from './context-system.js';
|
|
5
|
-
export { buildTurnContextEnvelope, prependTurnContextEnvelope, formatSessionContextLine, TURN_CONTEXT_BEGIN, TURN_CONTEXT_END, } from './turn-envelope.js';
|
|
5
|
+
export { buildTurnContextEnvelope, prependTurnContextEnvelope, formatSessionContextLine, TURN_CONTEXT_BEGIN, TURN_CONTEXT_END, AMBIENT_ENGAGEMENT_METADATA_KEY, } from './turn-envelope.js';
|
|
6
6
|
export { buildTurnUserMessages, applyTurnContextToUserMessages, prependEnvelopeToFirstUserText, } from './turn-user-message.js';
|
|
7
7
|
export { buildAgentsEnvelopeContext, collectAgentsInstructionChain, } from './agents-instruction.js';
|
|
8
8
|
export { resolveModel, resolveModelCandidates } from './model-resolver.js';
|
package/lib/context/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,YAAY,EACZ,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,YAAY,EACZ,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EACL,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC","sourcesContent":["/**\n * Context System — builder/injector 链 + turn 上下文构建。\n */\n\nexport type {\n BuildContext,\n InjectContext,\n ContextBuilder,\n ContextInjector,\n ContextSystemConfig,\n} from './contracts.js';\n\nexport type { TurnEnvelopeParts } from './envelope-parts.js';\nexport type { TextTurnContextInput, TextTurnContextOutput } from './context-system.js';\nexport type { TurnContextEnvelopeInput, TurnContextView } from './turn-envelope.js';\nexport type { AgentsInstructionEntry } from './agents-instruction.js';\nexport type { ModelResolverConfig } from './model-resolver.js';\n\nexport {\n ContextSystem,\n createContextSystemForHost,\n ProfileContextBuilder,\n ToneInjector,\n createDefaultContextBuilders,\n} from './context-system.js';\n\nexport {\n buildTurnContextEnvelope,\n prependTurnContextEnvelope,\n formatSessionContextLine,\n TURN_CONTEXT_BEGIN,\n TURN_CONTEXT_END,\n AMBIENT_ENGAGEMENT_METADATA_KEY,\n} from './turn-envelope.js';\n\nexport {\n buildTurnUserMessages,\n applyTurnContextToUserMessages,\n prependEnvelopeToFirstUserText,\n} from './turn-user-message.js';\n\nexport {\n buildAgentsEnvelopeContext,\n collectAgentsInstructionChain,\n} from './agents-instruction.js';\n\nexport { resolveModel, resolveModelCandidates } from './model-resolver.js';\n\nexport {\n DEFAULT_CONTEXT_TAIL_MESSAGE_LIMIT,\n resolveContextTailMessageLimit,\n} from './context-tail-limit.js';\n"]}
|
|
@@ -6,4 +6,3 @@ export interface ModelResolverConfig {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function resolveModel(providerModels: string[], modelRegistry: ModelRegistry | null, providerName: string, config: ModelResolverConfig, task?: 'chat' | 'vision' | 'tool_call' | 'summary', preferred?: string): string;
|
|
8
8
|
export declare function resolveModelCandidates(providerModels: string[], modelRegistry: ModelRegistry | null, providerName: string, config: ModelResolverConfig, task?: 'chat' | 'vision' | 'tool_call' | 'summary', preferred?: string): string[];
|
|
9
|
-
//# sourceMappingURL=model-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-resolver.js","sourceRoot":"","sources":["../../src/context/model-resolver.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,YAAY,CAC1B,cAAwB,EACxB,aAAmC,EACnC,YAAoB,EACpB,MAA2B,EAC3B,OAAoD,MAAM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E,CAAC;QAClB,KAAK,MAAM,EAAE,IAAI,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YACnE,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAAE,SAAS;YACxE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,KAAK,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { ModelRegistry } from '@zhin.js/ai';\n\nexport interface ModelResolverConfig {\n chatModel?: string;\n /** @deprecated See `ZhinAgentConfig.visionModel`; removed in the next minor. */\n visionModel?: string;\n}\n\nexport function resolveModel(\n providerModels: string[],\n modelRegistry: ModelRegistry | null,\n providerName: string,\n config: ModelResolverConfig,\n task: 'chat' | 'vision' | 'tool_call' | 'summary' = 'chat',\n preferred?: string,\n): string {\n return resolveModelCandidates(providerModels, modelRegistry, providerName, config, task, preferred)[0];\n}\n\nexport function resolveModelCandidates(\n providerModels: string[],\n modelRegistry: ModelRegistry | null,\n providerName: string,\n config: ModelResolverConfig,\n task: 'chat' | 'vision' | 'tool_call' | 'summary' = 'chat',\n preferred?: string,\n): string[] {\n const candidates: string[] = [];\n\n if (preferred) candidates.push(preferred);\n // The bound model (`ai.agents.<name>.model`) stays first for image turns too: a text-only\n // bound model gets the image through the perception pre-pass or a placeholder, instead of\n // the turn silently switching to whichever registry model looks vision-capable.\n if ((task === 'chat' || task === 'vision') && config.chatModel && !candidates.includes(config.chatModel)) {\n candidates.push(config.chatModel);\n }\n if (task === 'vision' && config.visionModel && !candidates.includes(config.visionModel)) {\n candidates.push(config.visionModel);\n }\n\n if (modelRegistry) {\n for (const id of modelRegistry.selectModels(providerName, task, 5)) {\n if (providerModels.length > 0 && !providerModels.includes(id)) continue;\n if (!candidates.includes(id)) candidates.push(id);\n }\n }\n\n for (const id of providerModels) {\n if (!candidates.includes(id)) candidates.push(id);\n }\n\n return candidates;\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { TurnRequest } from '../turn/turn-ingress.js';
|
|
2
2
|
export declare const TURN_CONTEXT_BEGIN = "[Turn context]";
|
|
3
3
|
export declare const TURN_CONTEXT_END = "[/Turn context]";
|
|
4
|
-
export type TurnContextView = Pick<TurnRequest, 'origin' | 'principal' | 'session'> & Partial<Pick<TurnRequest, 'policy'>>;
|
|
4
|
+
export type TurnContextView = Pick<TurnRequest, 'origin' | 'principal' | 'session'> & Partial<Pick<TurnRequest, 'policy' | 'input'>>;
|
|
5
|
+
/** Trusted turn metadata key the IM ingress sets for a turn nobody addressed. */
|
|
6
|
+
export declare const AMBIENT_ENGAGEMENT_METADATA_KEY = "zhinEngagement";
|
|
5
7
|
export interface TurnContextEnvelopeInput {
|
|
6
8
|
turn?: TurnContextView;
|
|
7
9
|
profileSummary?: string;
|
|
@@ -21,4 +23,3 @@ export declare function formatSessionContextLine(turn: TurnContextView): string;
|
|
|
21
23
|
export declare function formatSenderContextLine(turn: TurnContextView): string;
|
|
22
24
|
export declare function buildTurnContextEnvelope(input: TurnContextEnvelopeInput): string | null;
|
|
23
25
|
export declare function prependTurnContextEnvelope(content: string, envelope: string | null | undefined): string;
|
|
24
|
-
//# sourceMappingURL=turn-envelope.d.ts.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { getFileMemoryContext, formatMemoryPathsHint } from '../memory-layers.js';
|
|
2
2
|
export const TURN_CONTEXT_BEGIN = '[Turn context]';
|
|
3
3
|
export const TURN_CONTEXT_END = '[/Turn context]';
|
|
4
|
+
/** Trusted turn metadata key the IM ingress sets for a turn nobody addressed. */
|
|
5
|
+
export const AMBIENT_ENGAGEMENT_METADATA_KEY = 'zhinEngagement';
|
|
6
|
+
const AMBIENT_ENGAGEMENT_LINE = 'Engagement: ambient. Nobody called you; you are reading the group chat and chose to look. '
|
|
7
|
+
+ 'Reply only if a group member like you would naturally chime in here; otherwise return {"messages":[]} and stay quiet.';
|
|
4
8
|
export function formatSessionContextLine(turn) {
|
|
5
9
|
const origin = turn.origin;
|
|
6
10
|
if (origin.kind === 'im') {
|
|
@@ -34,6 +38,8 @@ export function buildTurnContextEnvelope(input) {
|
|
|
34
38
|
if (input.turn) {
|
|
35
39
|
lines.push(formatSessionContextLine(input.turn));
|
|
36
40
|
lines.push(formatSenderContextLine(input.turn));
|
|
41
|
+
if (input.turn.input?.metadata?.[AMBIENT_ENGAGEMENT_METADATA_KEY] === 'ambient')
|
|
42
|
+
lines.push(AMBIENT_ENGAGEMENT_LINE);
|
|
37
43
|
if (input.turn.policy?.filesystem) {
|
|
38
44
|
const filesystem = input.turn.policy.filesystem;
|
|
39
45
|
lines.push(`Workspace: ${filesystem.workingDirectory ?? filesystem.workspaceRoot} | access:${filesystem.access ?? 'workspace-write'}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-envelope.js","sourceRoot":"","sources":["../../src/context/turn-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"turn-envelope.js","sourceRoot":"","sources":["../../src/context/turn-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAg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BAAmB,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;IACpF,IAAI,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,IAAI,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,IAAI,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAClE,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAE1E,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,GAAG,kBAAkB,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,gBAAgB,EAAE,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,QAAmC;IAC7F,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE;QAAE,OAAO,OAAO,CAAC;IACtC,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { getFileMemoryContext, formatMemoryPathsHint } from '../memory-layers.js';\nimport type { TurnRequest } from '../turn/turn-ingress.js';\n\nexport const TURN_CONTEXT_BEGIN = '[Turn context]';\nexport const TURN_CONTEXT_END = '[/Turn context]';\n\nexport type TurnContextView = Pick<TurnRequest, 'origin' | 'principal' | 'session'>\n & Partial<Pick<TurnRequest, 'policy' | 'input'>>;\n\n/** Trusted turn metadata key the IM ingress sets for a turn nobody addressed. */\nexport const AMBIENT_ENGAGEMENT_METADATA_KEY = 'zhinEngagement';\n\nconst AMBIENT_ENGAGEMENT_LINE = 'Engagement: ambient. Nobody called you; you are reading the group chat and chose to look. '\n + 'Reply only if a group member like you would naturally chime in here; otherwise return {\"messages\":[]} and stay quiet.';\n\nexport interface TurnContextEnvelopeInput {\n turn?: TurnContextView;\n profileSummary?: string;\n toneHint?: string;\n deferredStats?: string;\n activeSkillsContext?: string;\n quoteSystemHint?: string;\n modelLine?: string;\n sdk?: string;\n agentsContext?: string;\n /** Rendered \"already told the user\" ledger (#730). */\n toldLedger?: string;\n /** BM25-recalled semantic memory for this message (#734). */\n relevantMemory?: string;\n}\n\nexport function formatSessionContextLine(turn: TurnContextView): string {\n const origin = turn.origin;\n if (origin.kind === 'im') {\n return `Session: platform:${origin.platform} | endpoint:${origin.endpoint} | ${origin.scope}_id:${origin.sceneId}`;\n }\n if (origin.kind === 'http') return `Session: origin:http | session_id:${origin.sessionId}`;\n if (origin.kind === 'a2a') return `Session: origin:a2a | task_id:${origin.taskId}`;\n if (origin.kind === 'schedule') return `Session: origin:schedule | job_id:${origin.jobId}`;\n return `Session: origin:internal | source:${origin.source}`;\n}\n\nexport function formatSenderContextLine(turn: TurnContextView): string {\n const { principal } = turn;\n const roles = principal.roles.length > 0 ? principal.roles.join(',') : 'user';\n return principal.displayName?.trim()\n ? `Sender: id=${principal.subjectId} name=${principal.displayName.trim()} roles=${roles}`\n : `Sender: id=${principal.subjectId} roles=${roles}`;\n}\n\nexport function buildTurnContextEnvelope(input: TurnContextEnvelopeInput): string | null {\n const lines: string[] = [];\n const now = new Date();\n const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;\n const timeStr = now.toLocaleString('zh-CN', { timeZone: tz });\n lines.push(`Time: ${timeStr} (${tz})`);\n\n if (input.modelLine?.trim()) lines.push(`Model: ${input.modelLine.trim()}`);\n if (input.sdk?.trim()) lines.push(`Sdk: ${input.sdk.trim()}`);\n\n if (input.turn) {\n lines.push(formatSessionContextLine(input.turn));\n lines.push(formatSenderContextLine(input.turn));\n if (input.turn.input?.metadata?.[AMBIENT_ENGAGEMENT_METADATA_KEY] === 'ambient') lines.push(AMBIENT_ENGAGEMENT_LINE);\n if (input.turn.policy?.filesystem) {\n const filesystem = input.turn.policy.filesystem;\n lines.push(`Workspace: ${filesystem.workingDirectory ?? filesystem.workspaceRoot} | access:${filesystem.access ?? 'workspace-write'}`);\n }\n if (input.turn.origin.kind === 'im') {\n const platform = input.turn.origin.platform;\n const sessionKey = input.turn.session.key;\n const memoryPaths = formatMemoryPathsHint(platform, sessionKey);\n if (memoryPaths) lines.push(`Memory paths: ${memoryPaths}`);\n const fileMemory = getFileMemoryContext(undefined, platform, sessionKey);\n if (fileMemory?.trim()) {\n lines.push('Memory snapshot:');\n lines.push(fileMemory.trim());\n }\n }\n }\n\n if (input.deferredStats?.trim()) lines.push(`Deferred catalog: ${input.deferredStats.trim()}`);\n if (input.profileSummary?.trim()) lines.push(input.profileSummary.trim());\n if (input.toneHint?.trim()) lines.push(`[Tone hint] ${input.toneHint.trim()}`);\n if (input.activeSkillsContext?.trim()) lines.push(input.activeSkillsContext.trim());\n if (input.quoteSystemHint?.trim()) lines.push(input.quoteSystemHint.trim());\n if (input.agentsContext?.trim()) lines.push(input.agentsContext.trim());\n if (input.toldLedger?.trim()) lines.push(input.toldLedger.trim());\n if (input.relevantMemory?.trim()) lines.push(input.relevantMemory.trim());\n\n return lines.length === 0\n ? null\n : `${TURN_CONTEXT_BEGIN}\\n${lines.join('\\n')}\\n${TURN_CONTEXT_END}`;\n}\n\nexport function prependTurnContextEnvelope(content: string, envelope: string | null | undefined): string {\n if (!envelope?.trim()) return content;\n return `${envelope.trim()}\\n\\n${content}`;\n}\n"]}
|
|
@@ -7,4 +7,3 @@ export declare function buildTurnUserMessages(commMessage: Message, rawContent:
|
|
|
7
7
|
};
|
|
8
8
|
export declare function applyTurnContextToUserMessages(messages: UserMessage[], envelope: string | null | undefined): UserMessage[];
|
|
9
9
|
export declare function prependEnvelopeToFirstUserText(messages: AgentMessage[], envelope: string | null | undefined): AgentMessage[];
|
|
10
|
-
//# sourceMappingURL=turn-user-message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-user-message.js","sourceRoot":"","sources":["../../src/context/turn-user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnI,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,MAAM,UAAU,qBAAqB,CACnC,WAAoB,EACpB,UAAkB;IAMlB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,sBAAsB,CACpD,WAAuD,EACvD,UAAU,CACX,CAAC;IACF,OAAO;QACL,UAAU,EAAE,OAAO;QACnB,cAAc,EAAE,CAAC,UAAU,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,QAAuB,EACvB,QAAmC;IAEnC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,GAAG,CAAC;QAC/C,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACvC,OAAO,iBAAiB,CACtB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC1C,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,KAAK,CACV,CAAC;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W,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACxD,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { type AgentMessageExtra, type AgentMessage, type UserMessage, createUserMessage, userMessagePlainText } from '@zhin.js/ai';\nimport type { Message } from '@zhin.js/core';\nimport { resolveTurnUserMessage } from '../session/session-io.js';\nimport { prependTurnContextEnvelope } from './turn-envelope.js';\nexport function buildTurnUserMessages(\n commMessage: Message,\n rawContent: string,\n): {\n rawContent: string;\n userMessageExtra?: AgentMessageExtra;\n promptMessages: UserMessage[];\n} {\n const { content, llmMessage } = resolveTurnUserMessage(\n commMessage as import('@zhin.js/core').AgentTurnMessage,\n rawContent,\n );\n return {\n rawContent: content,\n promptMessages: [llmMessage],\n };\n}\n\nexport function applyTurnContextToUserMessages(\n messages: UserMessage[],\n envelope: string | null | undefined,\n): UserMessage[] {\n if (!envelope?.trim() || messages.length === 0) return messages;\n return messages.map((msg, i) => {\n if (i !== 0 || msg.role !== 'user') return msg;\n const text = userMessagePlainText(msg);\n return createUserMessage(\n prependTurnContextEnvelope(text, envelope),\n msg.media,\n msg.timestamp,\n msg.actor,\n msg.cause,\n );\n });\n}\n\nexport function prependEnvelopeToFirstUserText(\n messages: AgentMessage[],\n envelope: string | null | undefined,\n): AgentMessage[] {\n if (!envelope?.trim() || messages.length === 0) return messages;\n const first = messages[0];\n if (!first || first.role !== 'user') return messages;\n\n const content = first.content;\n if (!Array.isArray(content)) return messages;\n\n const textIdx = content.findIndex((b) => b?.type === 'text');\n if (textIdx < 0) {\n return [\n { ...first, content: [{ type: 'text', text: envelope.trim() }, ...content] },\n ...messages.slice(1),\n ];\n }\n\n const block = content[textIdx];\n if (block.type !== 'text') return messages;\n const nextText = prependTurnContextEnvelope(block.text, envelope);\n if (nextText === block.text) return messages;\n\n const nextContent = [...content];\n nextContent[textIdx] = { type: 'text', text: nextText };\n return [{ ...first, content: nextContent }, ...messages.slice(1)];\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agentLoop turn runner (ADR 0009) — used when ContextRepository is wired.
|
|
3
3
|
*/
|
|
4
|
+
import type { AiOutboundSegmentProfile } from '@zhin.js/core';
|
|
4
5
|
import { type AgentOutputElement } from '../outbound/agent-output.js';
|
|
5
6
|
import { type AgentTool, type Usage, type AgentMessage, type ModelInputModality } from '@zhin.js/ai';
|
|
6
7
|
import type { AgentRunJournal } from '@zhin.js/ai/agent-stream';
|
|
@@ -25,6 +26,8 @@ export interface AgentLoopTurnInput {
|
|
|
25
26
|
rawContent: string;
|
|
26
27
|
promptProfile: AgentPromptProfile;
|
|
27
28
|
turnContext: TurnContextView;
|
|
29
|
+
/** What the IM reply endpoint lets the model author (ReplyPort.segments). */
|
|
30
|
+
replySegments?: AiOutboundSegmentProfile;
|
|
28
31
|
allTools: AgentTool[];
|
|
29
32
|
resolvedTools: AgentTool[];
|
|
30
33
|
toolExecution: ToolExecutionAuthority;
|
|
@@ -119,4 +122,3 @@ export type AgentLoopVisionTurnResult = AgentLoopTurnResult & {
|
|
|
119
122
|
export declare function runAgentLoopVisionTurnRun(input: AgentLoopVisionTurnInput): AsyncGenerator<TurnEvent, AgentLoopVisionTurnResult>;
|
|
120
123
|
export declare function collectAgentLoopTurnRun<R>(gen: AsyncGenerator<TurnEvent, R>, onTurnEvent?: (event: TurnEvent) => void): Promise<R>;
|
|
121
124
|
export declare function runAgentLoopTextTurnRun(input: AgentLoopTurnInput): AsyncGenerator<TurnEvent, AgentLoopTurnResult>;
|
|
122
|
-
//# sourceMappingURL=agent-core-run.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agentLoop turn runner (ADR 0009) — used when ContextRepository is wired.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { decodeStructuredReply, STRUCTURED_REPLY_INSTRUCTION } from '../outbound/structured-reply.js';
|
|
4
|
+
import { decodeStructuredReply, structuredReplyInstruction, structuredReplySchema } from '../outbound/structured-reply.js';
|
|
6
5
|
import { renderAgentOutput } from '../outbound/agent-output.js';
|
|
7
6
|
import { mergeToolOutboundElements } from '../media/media-tool-bridge.js';
|
|
8
7
|
import { formatCompact, truncatePreview, getLogger } from '@zhin.js/logger';
|
|
@@ -16,7 +15,7 @@ import { planToolRun } from '../tool/runtime.js';
|
|
|
16
15
|
import { sanitizeAssistantReply, unwrapJsonStringLayers } from './text-sanitize.js';
|
|
17
16
|
import { formatToolCallsForUser } from './tool-calls-user-format.js';
|
|
18
17
|
import { summarizeExhaustedTurn } from './exhausted-turn-reply.js';
|
|
19
|
-
import { recoverStructuredReply } from './structured-reply-recovery.js';
|
|
18
|
+
import { decodeLenientStructuredReply, recoverStructuredReply, STRUCTURED_REPLY_FAILURE } from './structured-reply-recovery.js';
|
|
20
19
|
import { trackTurnCompletionUsage } from './turn-completion-usage.js';
|
|
21
20
|
import { shouldSuppressReplyForSpawnDelegation } from './spawn-delegation.js';
|
|
22
21
|
import { logPhase, tokenUsageLogFields, logAgentLoopIterationEnd } from '../internal/phase-trace.js';
|
|
@@ -24,7 +23,7 @@ import { buildAgentPromptCacheStreamOptions } from '../config/index.js';
|
|
|
24
23
|
import { buildLlmToolsForProvider } from '../tool/deferred-resolution.js';
|
|
25
24
|
import { applyToolToModelOutput } from '../tool/tool-model-output.js';
|
|
26
25
|
import { resolveAlwaysLoadedSet } from '../tool-catalog/resolve-config.js';
|
|
27
|
-
import { resolveDeferredApiTools } from '../tool-catalog/tool-catalog.js';
|
|
26
|
+
import { resolveDeferredApiTools, residentToolNames } from '../tool-catalog/tool-catalog.js';
|
|
28
27
|
import { createTurnEventMapperState, mapAgentEventToTurnEvents, turnUsageEvent, } from './turn-event-mapper.js';
|
|
29
28
|
import { TurnJournalCommitError } from '../turn/journal-integrity.js';
|
|
30
29
|
import { ExecutableToolRegistry } from '../tool/executable-tool-registry.js';
|
|
@@ -133,14 +132,6 @@ function logAssistantIterationFailure(assistant, modelId, sessionId) {
|
|
|
133
132
|
error: truncatePreview(assistant.errorMessage, 500),
|
|
134
133
|
}));
|
|
135
134
|
}
|
|
136
|
-
/** ai.agent.outputSchema 配置 → 传给 LLM 的 JSON Schema(true/'segments' 用 zhin 出站契约)。 */
|
|
137
|
-
function resolveAgentOutputSchema(value) {
|
|
138
|
-
if (!value)
|
|
139
|
-
return undefined;
|
|
140
|
-
if (value === true || value === 'segments')
|
|
141
|
-
return aiOutboundJsonSchema;
|
|
142
|
-
return value;
|
|
143
|
-
}
|
|
144
135
|
function toolResultToAgentMessage(toolCall, result, isError) {
|
|
145
136
|
const text = typeof result === 'string'
|
|
146
137
|
? result
|
|
@@ -340,13 +331,13 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
340
331
|
const preData = toolRun.preExecution.data;
|
|
341
332
|
// IM conversations get a message contract. Detached/programmatic turns keep
|
|
342
333
|
// their text/custom-schema contract and never inherit the IM preset.
|
|
334
|
+
// ai.agent.outputSchema: true / 'segments' → zhin message contract; an object → caller's own schema.
|
|
343
335
|
const configuredSchema = host.config.outputSchema ?? 'segments';
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
&&
|
|
347
|
-
const outputSchema =
|
|
348
|
-
|
|
349
|
-
: configuredSchema);
|
|
336
|
+
const messagePreset = configuredSchema === true || configuredSchema === 'segments';
|
|
337
|
+
const imReply = messagePreset && input.turnContext.origin.kind === 'im'
|
|
338
|
+
&& input.conversationPersistence !== 'none';
|
|
339
|
+
const outputSchema = imReply ? structuredReplySchema(input.replySegments)
|
|
340
|
+
: messagePreset || !configuredSchema ? undefined : configuredSchema;
|
|
350
341
|
const turnShellPolicy = input.turnContext.policy?.shell;
|
|
351
342
|
const execPolicyConfig = turnShellPolicy
|
|
352
343
|
? {
|
|
@@ -371,7 +362,7 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
371
362
|
: buildChatPathSystemPrompt(host, personaEnhanced, input.promptProfile, input.promptRuntime);
|
|
372
363
|
const proseSystemPrompt = systemPrompt;
|
|
373
364
|
if (imReply) {
|
|
374
|
-
systemPrompt = `${systemPrompt}\n\n${
|
|
365
|
+
systemPrompt = `${systemPrompt}\n\n${structuredReplyInstruction(input.replySegments)}`;
|
|
375
366
|
}
|
|
376
367
|
const agentTools = hasTools
|
|
377
368
|
? turnShellPolicy
|
|
@@ -385,10 +376,12 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
385
376
|
if (!directTools && hasTools && (!deferredController || catalog.length === 0)) {
|
|
386
377
|
throw new Error('Deferred tool loading requires a turn-owned controller and catalog');
|
|
387
378
|
}
|
|
379
|
+
// Config names plus tools the capability plan pinned (platform tools, `alwaysLoaded` plugin tools).
|
|
380
|
+
const turnResidentTools = () => residentToolNames(catalog, resolveAlwaysLoadedSet(host.config));
|
|
388
381
|
const refreshResolvedTools = () => {
|
|
389
382
|
if (directTools)
|
|
390
383
|
return resolvedTools;
|
|
391
|
-
const alwaysLoaded =
|
|
384
|
+
const alwaysLoaded = turnResidentTools();
|
|
392
385
|
const loaded = deferredController.loadedToolNames();
|
|
393
386
|
return resolveDeferredApiTools(catalog, alwaysLoaded, loaded);
|
|
394
387
|
};
|
|
@@ -448,7 +441,7 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
448
441
|
const executableTools = new ExecutableToolRegistry(agentTools);
|
|
449
442
|
let llmTools = directTools
|
|
450
443
|
? agentToolsToLlmTools(agentTools)
|
|
451
|
-
: buildLlmToolsForProvider(llmModel.sdk, catalog, agentTools,
|
|
444
|
+
: buildLlmToolsForProvider(llmModel.sdk, catalog, agentTools, turnResidentTools(), deferredController?.loadedToolNames() ?? []);
|
|
452
445
|
if (hasTools) {
|
|
453
446
|
noteTurnTrace(traceTurnId(input.turnContext), {
|
|
454
447
|
kind: 'context_budget',
|
|
@@ -491,7 +484,7 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
491
484
|
executableTools.replace(nextAgentTools);
|
|
492
485
|
llmTools = directTools
|
|
493
486
|
? agentToolsToLlmTools(nextAgentTools)
|
|
494
|
-
: buildLlmToolsForProvider(llmModel.sdk, catalog, nextAgentTools,
|
|
487
|
+
: buildLlmToolsForProvider(llmModel.sdk, catalog, nextAgentTools, turnResidentTools(), deferredController?.loadedToolNames() ?? []);
|
|
495
488
|
return llmTools;
|
|
496
489
|
};
|
|
497
490
|
const contextWindow = llmModel.contextWindow ?? host.config.contextTokens;
|
|
@@ -907,7 +900,8 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
907
900
|
hostReply = !summary.assistant;
|
|
908
901
|
}
|
|
909
902
|
const structuredReply = imReply && !hostReply;
|
|
910
|
-
|
|
903
|
+
// A chat member does not announce how many steps a task took; only non-IM callers get the notice.
|
|
904
|
+
const continuationPrefix = continuations > 0 && input.turnContext.origin.kind !== 'im'
|
|
911
905
|
? `(任务步骤较多,已自动续跑 ${continuations} 次)\n\n` : '';
|
|
912
906
|
const proseReply = structuredReply ? ''
|
|
913
907
|
: sanitizeAssistantReply(rawReply, { toolSummary: formatToolCallsForUser(toolCalls) });
|
|
@@ -915,25 +909,35 @@ export async function* runAgentLoopTextTurnRun(input) {
|
|
|
915
909
|
let output = delegatedOnly || structuredReply ? [] : parseOutput(textReply);
|
|
916
910
|
if (!delegatedOnly && structuredReply) {
|
|
917
911
|
try {
|
|
918
|
-
output = decodeStructuredReply(rawReply);
|
|
912
|
+
output = decodeStructuredReply(rawReply, input.replySegments);
|
|
919
913
|
}
|
|
920
914
|
catch (error) {
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
915
|
+
const messages = conversationBatches.at(-1)?.messages;
|
|
916
|
+
const rejected = messages?.at(-1);
|
|
917
|
+
const lenient = decodeLenientStructuredReply(rawReply, input.replySegments);
|
|
918
|
+
if (lenient) {
|
|
919
|
+
output = lenient.output;
|
|
920
|
+
if (messages && rejected?.role === 'assistant') {
|
|
921
|
+
messages[messages.length - 1] = { ...rejected, content: [{ type: 'text', text: lenient.text }] };
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
const recovery = await recoverStructuredReply({
|
|
926
|
+
transport: completionUsage.transport, model: llmModel, raw: rawReply,
|
|
927
|
+
error: error instanceof Error ? error : new Error('Invalid structured reply'), signal,
|
|
928
|
+
segments: input.replySegments,
|
|
929
|
+
});
|
|
930
|
+
output = recovery.output;
|
|
931
|
+
// History must match what the user saw: the corrected reply, or the failure text. Never the
|
|
932
|
+
// correction prompt (it embeds the rejected raw text) and never the rejected raw reply.
|
|
933
|
+
if (messages && rejected?.role === 'assistant') {
|
|
934
|
+
messages[messages.length - 1] = recovery.assistant
|
|
935
|
+
?? { ...rejected, content: [{ type: 'text', text: STRUCTURED_REPLY_FAILURE }] };
|
|
936
|
+
}
|
|
930
937
|
}
|
|
931
938
|
}
|
|
932
939
|
}
|
|
933
940
|
if (!delegatedOnly) {
|
|
934
|
-
if (structuredReply && continuationPrefix && output[0]?.type === 'message') {
|
|
935
|
-
output[0].segments.unshift({ type: 'text', data: { text: continuationPrefix } });
|
|
936
|
-
}
|
|
937
941
|
output = mergeToolOutboundElements(output, toolCalls);
|
|
938
942
|
}
|
|
939
943
|
const finalReply = imReply ? renderAgentOutput(output) : textReply;
|