@zhin.js/agent 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -50
- package/lib/a2a/delegation-message.d.ts +14 -0
- package/lib/a2a/delegation-message.d.ts.map +1 -0
- package/lib/a2a/delegation-message.js +53 -0
- package/lib/a2a/delegation-message.js.map +1 -0
- package/lib/a2a/task-state.d.ts +9 -0
- package/lib/a2a/task-state.d.ts.map +1 -0
- package/lib/a2a/task-state.js +53 -0
- package/lib/a2a/task-state.js.map +1 -0
- package/lib/activity-feedback/adapter-integration.d.ts +52 -0
- package/lib/activity-feedback/adapter-integration.d.ts.map +1 -0
- package/lib/activity-feedback/adapter-integration.js +138 -0
- package/lib/activity-feedback/adapter-integration.js.map +1 -0
- package/lib/activity-feedback/config-resolver.d.ts +3 -0
- package/lib/activity-feedback/config-resolver.d.ts.map +1 -0
- package/lib/activity-feedback/config-resolver.js +89 -0
- package/lib/activity-feedback/config-resolver.js.map +1 -0
- package/lib/activity-feedback/event-context.d.ts +22 -0
- package/lib/activity-feedback/event-context.d.ts.map +1 -0
- package/lib/activity-feedback/event-context.js +69 -0
- package/lib/activity-feedback/event-context.js.map +1 -0
- package/lib/activity-feedback/index.d.ts +10 -0
- package/lib/activity-feedback/index.d.ts.map +1 -0
- package/lib/activity-feedback/index.js +7 -0
- package/lib/activity-feedback/index.js.map +1 -0
- package/lib/activity-feedback/manager.d.ts +15 -0
- package/lib/activity-feedback/manager.d.ts.map +1 -0
- package/lib/activity-feedback/manager.js +47 -0
- package/lib/activity-feedback/manager.js.map +1 -0
- package/lib/activity-feedback/schedule-guard.d.ts +8 -0
- package/lib/activity-feedback/schedule-guard.d.ts.map +1 -0
- package/lib/activity-feedback/schedule-guard.js +26 -0
- package/lib/activity-feedback/schedule-guard.js.map +1 -0
- package/lib/activity-feedback/types.d.ts +24 -0
- package/lib/activity-feedback/types.d.ts.map +1 -0
- package/lib/activity-feedback/types.js +11 -0
- package/lib/activity-feedback/types.js.map +1 -0
- package/lib/agent-prompt/registry.d.ts +1 -1
- package/lib/agent-prompt/registry.d.ts.map +1 -1
- package/lib/agent-prompt/registry.js.map +1 -1
- package/lib/agent-prompt/resolver.d.ts +2 -2
- package/lib/agent-prompt/resolver.d.ts.map +1 -1
- package/lib/agent-prompt/resolver.js +4 -2
- package/lib/agent-prompt/resolver.js.map +1 -1
- package/lib/ai-event-bus.d.ts +1 -1
- package/lib/ai-event-bus.d.ts.map +1 -1
- package/lib/ai-event-bus.js +2 -3
- package/lib/ai-event-bus.js.map +1 -1
- package/lib/ai-event-subscriber.d.ts +7 -2
- package/lib/ai-event-subscriber.d.ts.map +1 -1
- package/lib/ai-event-subscriber.js +5 -0
- package/lib/ai-event-subscriber.js.map +1 -1
- package/lib/aop/coordination/index.d.ts +7 -0
- package/lib/aop/coordination/index.d.ts.map +1 -0
- package/lib/aop/coordination/index.js +7 -0
- package/lib/aop/coordination/index.js.map +1 -0
- package/lib/aop/inbound/index.d.ts +7 -0
- package/lib/aop/inbound/index.d.ts.map +1 -0
- package/lib/aop/inbound/index.js +6 -0
- package/lib/aop/inbound/index.js.map +1 -0
- package/lib/aop/index.d.ts +11 -0
- package/lib/aop/index.d.ts.map +1 -0
- package/lib/aop/index.js +11 -0
- package/lib/aop/index.js.map +1 -0
- package/lib/aop/pipeline/index.d.ts +12 -0
- package/lib/aop/pipeline/index.d.ts.map +1 -0
- package/lib/aop/pipeline/index.js +12 -0
- package/lib/aop/pipeline/index.js.map +1 -0
- package/lib/aop/pipeline/pipeline-flow.d.ts +25 -0
- package/lib/aop/pipeline/pipeline-flow.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-flow.js +115 -0
- package/lib/aop/pipeline/pipeline-flow.js.map +1 -0
- package/lib/aop/pipeline/pipeline-mode.d.ts +10 -0
- package/lib/aop/pipeline/pipeline-mode.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-mode.js +16 -0
- package/lib/aop/pipeline/pipeline-mode.js.map +1 -0
- package/lib/aop/pipeline/pipeline-service.d.ts +121 -0
- package/lib/aop/pipeline/pipeline-service.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-service.js +226 -0
- package/lib/aop/pipeline/pipeline-service.js.map +1 -0
- package/lib/aop/pipeline/pipeline-transitions.d.ts +14 -0
- package/lib/aop/pipeline/pipeline-transitions.d.ts.map +1 -0
- package/lib/aop/pipeline/pipeline-transitions.js +31 -0
- package/lib/aop/pipeline/pipeline-transitions.js.map +1 -0
- package/lib/aop/pipeline/ports.d.ts +16 -0
- package/lib/aop/pipeline/ports.d.ts.map +1 -0
- package/lib/aop/pipeline/ports.js +2 -0
- package/lib/aop/pipeline/ports.js.map +1 -0
- package/lib/aop/pipeline/role-capability-policy.d.ts +16 -0
- package/lib/aop/pipeline/role-capability-policy.d.ts.map +1 -0
- package/lib/aop/pipeline/role-capability-policy.js +29 -0
- package/lib/aop/pipeline/role-capability-policy.js.map +1 -0
- package/lib/aop/runtime/index.d.ts +9 -0
- package/lib/aop/runtime/index.d.ts.map +1 -0
- package/lib/aop/runtime/index.js +9 -0
- package/lib/aop/runtime/index.js.map +1 -0
- package/lib/assistant/deliver-schedule-to-adapter.d.ts +21 -0
- package/lib/assistant/deliver-schedule-to-adapter.d.ts.map +1 -0
- package/lib/assistant/deliver-schedule-to-adapter.js +19 -0
- package/lib/assistant/deliver-schedule-to-adapter.js.map +1 -0
- package/lib/assistant/domains/home-assistant.d.ts +1 -1
- package/lib/assistant/domains/home-assistant.d.ts.map +1 -1
- package/lib/assistant/domains/home-assistant.js.map +1 -1
- package/lib/assistant/event-ingress.d.ts +5 -5
- package/lib/assistant/event-ingress.d.ts.map +1 -1
- package/lib/assistant/event-ingress.js.map +1 -1
- package/lib/assistant/home-mcp-bridge.d.ts +1 -1
- package/lib/assistant/home-mcp-bridge.d.ts.map +1 -1
- package/lib/assistant/home-mcp-bridge.js.map +1 -1
- package/lib/assistant/home-policy.d.ts +4 -1
- package/lib/assistant/home-policy.d.ts.map +1 -1
- package/lib/assistant/home-policy.js +1 -1
- package/lib/assistant/home-policy.js.map +1 -1
- package/lib/assistant/home-tools.d.ts.map +1 -1
- package/lib/assistant/home-tools.js +1 -2
- package/lib/assistant/home-tools.js.map +1 -1
- package/lib/assistant/index.d.ts +18 -9
- package/lib/assistant/index.d.ts.map +1 -1
- package/lib/assistant/index.js +13 -6
- package/lib/assistant/index.js.map +1 -1
- package/lib/assistant/job-creator.d.ts +14 -0
- package/lib/assistant/job-creator.d.ts.map +1 -0
- package/lib/assistant/job-creator.js +44 -0
- package/lib/assistant/job-creator.js.map +1 -0
- package/lib/assistant/job-engine.d.ts +17 -17
- package/lib/assistant/job-engine.d.ts.map +1 -1
- package/lib/assistant/job-engine.js +29 -35
- package/lib/assistant/job-engine.js.map +1 -1
- package/lib/assistant/job-scheduler.d.ts +8 -4
- package/lib/assistant/job-scheduler.d.ts.map +1 -1
- package/lib/assistant/job-scheduler.js +59 -33
- package/lib/assistant/job-scheduler.js.map +1 -1
- package/lib/assistant/job-store.d.ts +24 -33
- package/lib/assistant/job-store.d.ts.map +1 -1
- package/lib/assistant/job-store.js +69 -184
- package/lib/assistant/job-store.js.map +1 -1
- package/lib/assistant/job-utils.d.ts +2 -0
- package/lib/assistant/job-utils.d.ts.map +1 -0
- package/lib/assistant/job-utils.js +7 -0
- package/lib/assistant/job-utils.js.map +1 -0
- package/lib/assistant/job-worker.d.ts +6 -2
- package/lib/assistant/job-worker.d.ts.map +1 -1
- package/lib/assistant/job-worker.js +8 -0
- package/lib/assistant/job-worker.js.map +1 -1
- package/lib/assistant/notification-router.d.ts +6 -3
- package/lib/assistant/notification-router.d.ts.map +1 -1
- package/lib/assistant/notification-router.js +75 -32
- package/lib/assistant/notification-router.js.map +1 -1
- package/lib/assistant/profile-loader.d.ts +15 -10
- package/lib/assistant/profile-loader.d.ts.map +1 -1
- package/lib/assistant/profile-loader.js +88 -25
- package/lib/assistant/profile-loader.js.map +1 -1
- package/lib/assistant/profile-types.d.ts +6 -1
- package/lib/assistant/profile-types.d.ts.map +1 -1
- package/lib/assistant/profile-types.js.map +1 -1
- package/lib/assistant/runtime-registry.d.ts +3 -3
- package/lib/assistant/runtime-registry.d.ts.map +1 -1
- package/lib/assistant/runtime-registry.js +3 -0
- package/lib/assistant/runtime-registry.js.map +1 -1
- package/lib/assistant/schedule-execution.d.ts +22 -0
- package/lib/assistant/schedule-execution.d.ts.map +1 -0
- package/lib/assistant/schedule-execution.js +99 -0
- package/lib/assistant/schedule-execution.js.map +1 -0
- package/lib/assistant/schedule-job-service.d.ts +25 -0
- package/lib/assistant/schedule-job-service.d.ts.map +1 -0
- package/lib/assistant/schedule-job-service.js +129 -0
- package/lib/assistant/schedule-job-service.js.map +1 -0
- package/lib/assistant/schedule-message.d.ts +9 -0
- package/lib/assistant/schedule-message.d.ts.map +1 -0
- package/lib/assistant/schedule-message.js +23 -0
- package/lib/assistant/schedule-message.js.map +1 -0
- package/lib/assistant/schedule-skills.d.ts +3 -0
- package/lib/assistant/schedule-skills.d.ts.map +1 -0
- package/lib/assistant/schedule-skills.js +24 -0
- package/lib/assistant/schedule-skills.js.map +1 -0
- package/lib/assistant/schedule-tool-runtime.d.ts +7 -0
- package/lib/assistant/schedule-tool-runtime.d.ts.map +1 -0
- package/lib/assistant/schedule-tool-runtime.js +50 -0
- package/lib/assistant/schedule-tool-runtime.js.map +1 -0
- package/lib/assistant/types.d.ts +70 -18
- package/lib/assistant/types.d.ts.map +1 -1
- package/lib/assistant/types.js +6 -5
- package/lib/assistant/types.js.map +1 -1
- package/lib/authoring/bridge.d.ts +40 -0
- package/lib/authoring/bridge.d.ts.map +1 -0
- package/lib/authoring/bridge.js +113 -0
- package/lib/authoring/bridge.js.map +1 -0
- package/lib/authoring/define-agent.d.ts +4 -0
- package/lib/authoring/define-agent.d.ts.map +1 -0
- package/lib/authoring/define-agent.js +8 -0
- package/lib/authoring/define-agent.js.map +1 -0
- package/lib/authoring/define-connection.d.ts +5 -0
- package/lib/authoring/define-connection.d.ts.map +1 -0
- package/lib/authoring/define-connection.js +8 -0
- package/lib/authoring/define-connection.js.map +1 -0
- package/lib/authoring/define-dynamic.d.ts +4 -0
- package/lib/authoring/define-dynamic.d.ts.map +1 -0
- package/lib/authoring/define-dynamic.js +8 -0
- package/lib/authoring/define-dynamic.js.map +1 -0
- package/lib/authoring/define-eval.d.ts +5 -0
- package/lib/authoring/define-eval.d.ts.map +1 -0
- package/lib/authoring/define-eval.js +8 -0
- package/lib/authoring/define-eval.js.map +1 -0
- package/lib/authoring/define-hook.d.ts +4 -0
- package/lib/authoring/define-hook.d.ts.map +1 -0
- package/lib/authoring/define-hook.js +8 -0
- package/lib/authoring/define-hook.js.map +1 -0
- package/lib/authoring/define-schedule.d.ts +4 -0
- package/lib/authoring/define-schedule.d.ts.map +1 -0
- package/lib/authoring/define-schedule.js +8 -0
- package/lib/authoring/define-schedule.js.map +1 -0
- package/lib/authoring/define-skill.d.ts +6 -0
- package/lib/authoring/define-skill.d.ts.map +1 -0
- package/lib/authoring/define-skill.js +9 -0
- package/lib/authoring/define-skill.js.map +1 -0
- package/lib/authoring/define-state.d.ts +4 -0
- package/lib/authoring/define-state.d.ts.map +1 -0
- package/lib/authoring/define-state.js +8 -0
- package/lib/authoring/define-state.js.map +1 -0
- package/lib/authoring/define-tool.d.ts +5 -0
- package/lib/authoring/define-tool.d.ts.map +1 -0
- package/lib/authoring/define-tool.js +8 -0
- package/lib/authoring/define-tool.js.map +1 -0
- package/lib/authoring/disable-tool.d.ts +13 -0
- package/lib/authoring/disable-tool.d.ts.map +1 -0
- package/lib/authoring/disable-tool.js +36 -0
- package/lib/authoring/disable-tool.js.map +1 -0
- package/lib/authoring/entries/connections.d.ts +3 -0
- package/lib/authoring/entries/connections.d.ts.map +1 -0
- package/lib/authoring/entries/connections.js +2 -0
- package/lib/authoring/entries/connections.js.map +1 -0
- package/lib/authoring/entries/evals.d.ts +3 -0
- package/lib/authoring/entries/evals.d.ts.map +1 -0
- package/lib/authoring/entries/evals.js +2 -0
- package/lib/authoring/entries/evals.js.map +1 -0
- package/lib/authoring/entries/hooks.d.ts +3 -0
- package/lib/authoring/entries/hooks.d.ts.map +1 -0
- package/lib/authoring/entries/hooks.js +2 -0
- package/lib/authoring/entries/hooks.js.map +1 -0
- package/lib/authoring/entries/schedules.d.ts +3 -0
- package/lib/authoring/entries/schedules.d.ts.map +1 -0
- package/lib/authoring/entries/schedules.js +2 -0
- package/lib/authoring/entries/schedules.js.map +1 -0
- package/lib/authoring/entries/skills.d.ts +3 -0
- package/lib/authoring/entries/skills.d.ts.map +1 -0
- package/lib/authoring/entries/skills.js +2 -0
- package/lib/authoring/entries/skills.js.map +1 -0
- package/lib/authoring/entries/tools.d.ts +5 -0
- package/lib/authoring/entries/tools.d.ts.map +1 -0
- package/lib/authoring/entries/tools.js +3 -0
- package/lib/authoring/entries/tools.js.map +1 -0
- package/lib/authoring/index.d.ts +25 -0
- package/lib/authoring/index.d.ts.map +1 -0
- package/lib/authoring/index.js +14 -0
- package/lib/authoring/index.js.map +1 -0
- package/lib/authoring/tool-policy.d.ts +3 -0
- package/lib/authoring/tool-policy.d.ts.map +1 -0
- package/lib/authoring/tool-policy.js +2 -0
- package/lib/authoring/tool-policy.js.map +1 -0
- package/lib/authoring/types.d.ts +209 -0
- package/lib/authoring/types.d.ts.map +1 -0
- package/lib/authoring/types.js +10 -0
- package/lib/authoring/types.js.map +1 -0
- package/lib/authoring/zod-schema.d.ts +20 -0
- package/lib/authoring/zod-schema.d.ts.map +1 -0
- package/lib/authoring/zod-schema.js +79 -0
- package/lib/authoring/zod-schema.js.map +1 -0
- package/lib/builtin/analyze-media-tool.d.ts +1 -1
- package/lib/builtin/analyze-media-tool.d.ts.map +1 -1
- package/lib/builtin/analyze-media-tool.js +2 -2
- package/lib/builtin/analyze-media-tool.js.map +1 -1
- package/lib/builtin/ask-user-session-service.d.ts +40 -0
- package/lib/builtin/ask-user-session-service.d.ts.map +1 -0
- package/lib/builtin/ask-user-session-service.js +258 -0
- package/lib/builtin/ask-user-session-service.js.map +1 -0
- package/lib/builtin/ask-user-session.d.ts +18 -0
- package/lib/builtin/ask-user-session.d.ts.map +1 -0
- package/lib/builtin/ask-user-session.js +21 -0
- package/lib/builtin/ask-user-session.js.map +1 -0
- package/lib/builtin/ask-user-tool.d.ts +7 -15
- package/lib/builtin/ask-user-tool.d.ts.map +1 -1
- package/lib/builtin/ask-user-tool.js +73 -113
- package/lib/builtin/ask-user-tool.js.map +1 -1
- package/lib/builtin/bash-tool.d.ts +1 -1
- package/lib/builtin/bash-tool.d.ts.map +1 -1
- package/lib/builtin/bash-tool.js +4 -4
- package/lib/builtin/bash-tool.js.map +1 -1
- package/lib/builtin/deferred-tool-meta.d.ts +46 -0
- package/lib/builtin/deferred-tool-meta.d.ts.map +1 -0
- package/lib/builtin/deferred-tool-meta.js +130 -0
- package/lib/builtin/deferred-tool-meta.js.map +1 -0
- package/lib/builtin/edit-file-tool.d.ts +1 -1
- package/lib/builtin/edit-file-tool.d.ts.map +1 -1
- package/lib/builtin/edit-file-tool.js +4 -4
- package/lib/builtin/edit-file-tool.js.map +1 -1
- package/lib/builtin/five-agent/index.d.ts +20 -0
- package/lib/builtin/five-agent/index.d.ts.map +1 -0
- package/lib/builtin/five-agent/index.js +23 -0
- package/lib/builtin/five-agent/index.js.map +1 -0
- package/lib/builtin/five-agent/prompts.d.ts +11 -0
- package/lib/builtin/five-agent/prompts.d.ts.map +1 -0
- package/lib/builtin/five-agent/prompts.js +35 -0
- package/lib/builtin/five-agent/prompts.js.map +1 -0
- package/lib/builtin/five-agent/strategy.d.ts +4 -0
- package/lib/builtin/five-agent/strategy.d.ts.map +1 -0
- package/lib/builtin/five-agent/strategy.js +42 -0
- package/lib/builtin/five-agent/strategy.js.map +1 -0
- package/lib/builtin/generate-image-tool.d.ts +1 -1
- package/lib/builtin/generate-image-tool.d.ts.map +1 -1
- package/lib/builtin/generate-image-tool.js +9 -9
- package/lib/builtin/generate-image-tool.js.map +1 -1
- package/lib/builtin/glob-tool.d.ts +1 -1
- package/lib/builtin/glob-tool.d.ts.map +1 -1
- package/lib/builtin/glob-tool.js +3 -3
- package/lib/builtin/glob-tool.js.map +1 -1
- package/lib/builtin/grep-tool.d.ts +1 -1
- package/lib/builtin/grep-tool.d.ts.map +1 -1
- package/lib/builtin/grep-tool.js +10 -10
- package/lib/builtin/grep-tool.js.map +1 -1
- package/lib/builtin/install-skill-tool.d.ts +1 -1
- package/lib/builtin/install-skill-tool.d.ts.map +1 -1
- package/lib/builtin/install-skill-tool.js +3 -3
- package/lib/builtin/install-skill-tool.js.map +1 -1
- package/lib/builtin/knowledge-search-tool.js +3 -3
- package/lib/builtin/knowledge-search-tool.js.map +1 -1
- package/lib/builtin/list-dir-tool.d.ts +1 -1
- package/lib/builtin/list-dir-tool.d.ts.map +1 -1
- package/lib/builtin/list-dir-tool.js +2 -2
- package/lib/builtin/list-dir-tool.js.map +1 -1
- package/lib/builtin/load-skill-tool.d.ts +20 -0
- package/lib/builtin/load-skill-tool.d.ts.map +1 -0
- package/lib/builtin/load-skill-tool.js +60 -0
- package/lib/builtin/load-skill-tool.js.map +1 -0
- package/lib/builtin/memory-search-tool.d.ts.map +1 -1
- package/lib/builtin/memory-search-tool.js +8 -5
- package/lib/builtin/memory-search-tool.js.map +1 -1
- package/lib/builtin/memory-upsert-tool.d.ts.map +1 -1
- package/lib/builtin/memory-upsert-tool.js +11 -8
- package/lib/builtin/memory-upsert-tool.js.map +1 -1
- package/lib/builtin/orchestration-tools.d.ts +3 -4
- package/lib/builtin/orchestration-tools.d.ts.map +1 -1
- package/lib/builtin/orchestration-tools.js +101 -93
- package/lib/builtin/orchestration-tools.js.map +1 -1
- package/lib/builtin/read-file-tool.d.ts +1 -1
- package/lib/builtin/read-file-tool.d.ts.map +1 -1
- package/lib/builtin/read-file-tool.js +4 -4
- package/lib/builtin/read-file-tool.js.map +1 -1
- package/lib/builtin/run-deferred-task-tool.d.ts +1 -1
- package/lib/builtin/run-deferred-task-tool.d.ts.map +1 -1
- package/lib/builtin/run-deferred-task-tool.js +3 -3
- package/lib/builtin/run-deferred-task-tool.js.map +1 -1
- package/lib/builtin/spawn-task-tool.d.ts +13 -6
- package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
- package/lib/builtin/spawn-task-tool.js +135 -30
- package/lib/builtin/spawn-task-tool.js.map +1 -1
- package/lib/builtin/todo-read-tool.d.ts +1 -1
- package/lib/builtin/todo-read-tool.d.ts.map +1 -1
- package/lib/builtin/todo-read-tool.js +2 -2
- package/lib/builtin/todo-read-tool.js.map +1 -1
- package/lib/builtin/todo-write-tool.d.ts +1 -1
- package/lib/builtin/todo-write-tool.d.ts.map +1 -1
- package/lib/builtin/todo-write-tool.js +3 -3
- package/lib/builtin/todo-write-tool.js.map +1 -1
- package/lib/builtin/web-fetch-tool.d.ts +2 -2
- package/lib/builtin/web-fetch-tool.d.ts.map +1 -1
- package/lib/builtin/web-fetch-tool.js +6 -3
- package/lib/builtin/web-fetch-tool.js.map +1 -1
- package/lib/builtin/web-search-tool.d.ts +1 -1
- package/lib/builtin/web-search-tool.d.ts.map +1 -1
- package/lib/builtin/web-search-tool.js +5 -5
- package/lib/builtin/web-search-tool.js.map +1 -1
- package/lib/builtin/write-file-tool.d.ts +1 -1
- package/lib/builtin/write-file-tool.d.ts.map +1 -1
- package/lib/builtin/write-file-tool.js +3 -3
- package/lib/builtin/write-file-tool.js.map +1 -1
- package/lib/builtin-tools.d.ts +1 -1
- package/lib/builtin-tools.js +3 -3
- package/lib/builtin-tools.js.map +1 -1
- package/lib/collaboration/ask-user-bridge.d.ts +9 -0
- package/lib/collaboration/ask-user-bridge.d.ts.map +1 -0
- package/lib/collaboration/ask-user-bridge.js +73 -0
- package/lib/collaboration/ask-user-bridge.js.map +1 -0
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts +22 -0
- package/lib/collaboration/bootstrap-agent-runtimes.d.ts.map +1 -0
- package/lib/collaboration/bootstrap-agent-runtimes.js +106 -0
- package/lib/collaboration/bootstrap-agent-runtimes.js.map +1 -0
- package/lib/collaboration/collab-admin-gate.d.ts +21 -0
- package/lib/collaboration/collab-admin-gate.d.ts.map +1 -0
- package/lib/collaboration/collab-admin-gate.js +74 -0
- package/lib/collaboration/collab-admin-gate.js.map +1 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts +46 -0
- package/lib/collaboration/collaboration-artifact-repository.d.ts.map +1 -0
- package/lib/collaboration/collaboration-artifact-repository.js +102 -0
- package/lib/collaboration/collaboration-artifact-repository.js.map +1 -0
- package/lib/collaboration/collaboration-commands.d.ts +38 -0
- package/lib/collaboration/collaboration-commands.d.ts.map +1 -0
- package/lib/collaboration/collaboration-commands.js +504 -0
- package/lib/collaboration/collaboration-commands.js.map +1 -0
- package/lib/collaboration/collaboration-config.d.ts +30 -0
- package/lib/collaboration/collaboration-config.d.ts.map +1 -0
- package/lib/collaboration/collaboration-config.js +170 -0
- package/lib/collaboration/collaboration-config.js.map +1 -0
- package/lib/collaboration/collaboration-context.d.ts +12 -0
- package/lib/collaboration/collaboration-context.d.ts.map +1 -0
- package/lib/collaboration/collaboration-context.js +89 -0
- package/lib/collaboration/collaboration-context.js.map +1 -0
- package/lib/collaboration/collaboration-db-model.d.ts +350 -0
- package/lib/collaboration/collaboration-db-model.d.ts.map +1 -0
- package/lib/collaboration/collaboration-db-model.js +112 -0
- package/lib/collaboration/collaboration-db-model.js.map +1 -0
- package/lib/collaboration/collaboration-delegation.d.ts +21 -0
- package/lib/collaboration/collaboration-delegation.d.ts.map +1 -0
- package/lib/collaboration/collaboration-delegation.js +194 -0
- package/lib/collaboration/collaboration-delegation.js.map +1 -0
- package/lib/collaboration/collaboration-dispatch.d.ts +32 -0
- package/lib/collaboration/collaboration-dispatch.d.ts.map +1 -0
- package/lib/collaboration/collaboration-dispatch.js +93 -0
- package/lib/collaboration/collaboration-dispatch.js.map +1 -0
- package/lib/collaboration/collaboration-kernel-bridge.d.ts +23 -0
- package/lib/collaboration/collaboration-kernel-bridge.d.ts.map +1 -0
- package/lib/collaboration/collaboration-kernel-bridge.js +106 -0
- package/lib/collaboration/collaboration-kernel-bridge.js.map +1 -0
- package/lib/collaboration/collaboration-outbound.d.ts +64 -0
- package/lib/collaboration/collaboration-outbound.d.ts.map +1 -0
- package/lib/collaboration/collaboration-outbound.js +315 -0
- package/lib/collaboration/collaboration-outbound.js.map +1 -0
- package/lib/collaboration/collaboration-scene-repository.d.ts +152 -0
- package/lib/collaboration/collaboration-scene-repository.d.ts.map +1 -0
- package/lib/collaboration/collaboration-scene-repository.js +440 -0
- package/lib/collaboration/collaboration-scene-repository.js.map +1 -0
- package/lib/collaboration/collaboration-turn-snapshot.d.ts +18 -0
- package/lib/collaboration/collaboration-turn-snapshot.d.ts.map +1 -0
- package/lib/collaboration/collaboration-turn-snapshot.js +35 -0
- package/lib/collaboration/collaboration-turn-snapshot.js.map +1 -0
- package/lib/collaboration/delegation-state.d.ts +30 -0
- package/lib/collaboration/delegation-state.d.ts.map +1 -0
- package/lib/collaboration/delegation-state.js +86 -0
- package/lib/collaboration/delegation-state.js.map +1 -0
- package/lib/collaboration/endpoint-identity.d.ts +28 -0
- package/lib/collaboration/endpoint-identity.d.ts.map +1 -0
- package/lib/collaboration/endpoint-identity.js +88 -0
- package/lib/collaboration/endpoint-identity.js.map +1 -0
- package/lib/collaboration/group-feed.d.ts +30 -0
- package/lib/collaboration/group-feed.d.ts.map +1 -0
- package/lib/collaboration/group-feed.js +150 -0
- package/lib/collaboration/group-feed.js.map +1 -0
- package/lib/collaboration/group-message.d.ts +53 -0
- package/lib/collaboration/group-message.d.ts.map +1 -0
- package/lib/collaboration/group-message.js +162 -0
- package/lib/collaboration/group-message.js.map +1 -0
- package/lib/collaboration/im-mention-delegate.d.ts +22 -0
- package/lib/collaboration/im-mention-delegate.d.ts.map +1 -0
- package/lib/collaboration/im-mention-delegate.js +15 -0
- package/lib/collaboration/im-mention-delegate.js.map +1 -0
- package/lib/collaboration/inbound-peer-handback.d.ts +18 -0
- package/lib/collaboration/inbound-peer-handback.d.ts.map +1 -0
- package/lib/collaboration/inbound-peer-handback.js +69 -0
- package/lib/collaboration/inbound-peer-handback.js.map +1 -0
- package/lib/collaboration/inbound-spawn-task.d.ts +29 -0
- package/lib/collaboration/inbound-spawn-task.d.ts.map +1 -0
- package/lib/collaboration/inbound-spawn-task.js +97 -0
- package/lib/collaboration/inbound-spawn-task.js.map +1 -0
- package/lib/collaboration/inbound-turn-endpoint.d.ts +16 -0
- package/lib/collaboration/inbound-turn-endpoint.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-endpoint.js +26 -0
- package/lib/collaboration/inbound-turn-endpoint.js.map +1 -0
- package/lib/collaboration/inbound-turn-enrich.d.ts +25 -0
- package/lib/collaboration/inbound-turn-enrich.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-enrich.js +51 -0
- package/lib/collaboration/inbound-turn-enrich.js.map +1 -0
- package/lib/collaboration/inbound-turn-execute.d.ts +33 -0
- package/lib/collaboration/inbound-turn-execute.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-execute.js +73 -0
- package/lib/collaboration/inbound-turn-execute.js.map +1 -0
- package/lib/collaboration/inbound-turn-outbound-stage.d.ts +25 -0
- package/lib/collaboration/inbound-turn-outbound-stage.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-outbound-stage.js +73 -0
- package/lib/collaboration/inbound-turn-outbound-stage.js.map +1 -0
- package/lib/collaboration/inbound-turn-pipeline.d.ts +28 -0
- package/lib/collaboration/inbound-turn-pipeline.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-pipeline.js +201 -0
- package/lib/collaboration/inbound-turn-pipeline.js.map +1 -0
- package/lib/collaboration/inbound-turn-route.d.ts +42 -0
- package/lib/collaboration/inbound-turn-route.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-route.js +90 -0
- package/lib/collaboration/inbound-turn-route.js.map +1 -0
- package/lib/collaboration/inbound-turn-tools.d.ts +13 -0
- package/lib/collaboration/inbound-turn-tools.d.ts.map +1 -0
- package/lib/collaboration/inbound-turn-tools.js +19 -0
- package/lib/collaboration/inbound-turn-tools.js.map +1 -0
- package/lib/collaboration/index.d.ts +26 -0
- package/lib/collaboration/index.d.ts.map +1 -0
- package/lib/collaboration/index.js +24 -0
- package/lib/collaboration/index.js.map +1 -0
- package/lib/collaboration/init-observe-hook.d.ts +59 -0
- package/lib/collaboration/init-observe-hook.d.ts.map +1 -0
- package/lib/collaboration/init-observe-hook.js +190 -0
- package/lib/collaboration/init-observe-hook.js.map +1 -0
- package/lib/collaboration/init-wizard-service.d.ts +57 -0
- package/lib/collaboration/init-wizard-service.d.ts.map +1 -0
- package/lib/collaboration/init-wizard-service.js +189 -0
- package/lib/collaboration/init-wizard-service.js.map +1 -0
- package/lib/collaboration/outbound-resolver.d.ts +35 -0
- package/lib/collaboration/outbound-resolver.d.ts.map +1 -0
- package/lib/collaboration/outbound-resolver.js +188 -0
- package/lib/collaboration/outbound-resolver.js.map +1 -0
- package/lib/collaboration/peer-policy.d.ts +29 -0
- package/lib/collaboration/peer-policy.d.ts.map +1 -0
- package/lib/collaboration/peer-policy.js +118 -0
- package/lib/collaboration/peer-policy.js.map +1 -0
- package/lib/collaboration/resolve-agent-session-key.d.ts +21 -0
- package/lib/collaboration/resolve-agent-session-key.d.ts.map +1 -0
- package/lib/collaboration/resolve-agent-session-key.js +61 -0
- package/lib/collaboration/resolve-agent-session-key.js.map +1 -0
- package/lib/collaboration/runtime-registry.d.ts +18 -0
- package/lib/collaboration/runtime-registry.d.ts.map +1 -0
- package/lib/collaboration/runtime-registry.js +40 -0
- package/lib/collaboration/runtime-registry.js.map +1 -0
- package/lib/collaboration/scene-context.d.ts +17 -0
- package/lib/collaboration/scene-context.d.ts.map +1 -0
- package/lib/collaboration/scene-context.js +22 -0
- package/lib/collaboration/scene-context.js.map +1 -0
- package/lib/collaboration/scene-identity-service.d.ts +167 -0
- package/lib/collaboration/scene-identity-service.d.ts.map +1 -0
- package/lib/collaboration/scene-identity-service.js +468 -0
- package/lib/collaboration/scene-identity-service.js.map +1 -0
- package/lib/collaboration/scene-service.d.ts +65 -0
- package/lib/collaboration/scene-service.d.ts.map +1 -0
- package/lib/collaboration/scene-service.js +152 -0
- package/lib/collaboration/scene-service.js.map +1 -0
- package/lib/collaboration/structured-ai-outbound.d.ts +23 -0
- package/lib/collaboration/structured-ai-outbound.d.ts.map +1 -0
- package/lib/collaboration/structured-ai-outbound.js +179 -0
- package/lib/collaboration/structured-ai-outbound.js.map +1 -0
- package/lib/collaboration/turn-plan-resolver.d.ts +17 -0
- package/lib/collaboration/turn-plan-resolver.d.ts.map +1 -0
- package/lib/collaboration/turn-plan-resolver.js +63 -0
- package/lib/collaboration/turn-plan-resolver.js.map +1 -0
- package/lib/collaboration/types.d.ts +147 -0
- package/lib/collaboration/types.d.ts.map +1 -0
- package/lib/collaboration/types.js +16 -0
- package/lib/collaboration/types.js.map +1 -0
- package/lib/collaboration/wire-collaboration-storage.d.ts +4 -0
- package/lib/collaboration/wire-collaboration-storage.d.ts.map +1 -0
- package/lib/collaboration/wire-collaboration-storage.js +28 -0
- package/lib/collaboration/wire-collaboration-storage.js.map +1 -0
- package/lib/common-adapter-tools.d.ts +6 -7
- package/lib/common-adapter-tools.d.ts.map +1 -1
- package/lib/common-adapter-tools.js +9 -9
- package/lib/common-adapter-tools.js.map +1 -1
- package/lib/config/agent-binding-registry.d.ts +1 -1
- package/lib/config/agent-binding-registry.d.ts.map +1 -1
- package/lib/config/agent-binding-registry.js.map +1 -1
- package/lib/config/agent-bindings.d.ts +1 -1
- package/lib/config/agent-bindings.d.ts.map +1 -1
- package/lib/config/agent-bindings.js +2 -0
- package/lib/config/agent-bindings.js.map +1 -1
- package/lib/config/agent-interfaces.d.ts +58 -0
- package/lib/config/agent-interfaces.d.ts.map +1 -0
- package/lib/config/agent-interfaces.js +8 -0
- package/lib/config/agent-interfaces.js.map +1 -0
- package/lib/config/fix-ai-config.d.ts +1 -0
- package/lib/config/fix-ai-config.d.ts.map +1 -1
- package/lib/config/fix-ai-config.js +152 -15
- package/lib/config/fix-ai-config.js.map +1 -1
- package/lib/config/index.d.ts +13 -0
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +8 -0
- package/lib/config/index.js.map +1 -1
- package/lib/config/keyword-triggers.d.ts +6 -0
- package/lib/config/keyword-triggers.d.ts.map +1 -0
- package/lib/config/keyword-triggers.js +6 -0
- package/lib/config/keyword-triggers.js.map +1 -0
- package/lib/config/model-harness-runtime.d.ts +5 -0
- package/lib/config/model-harness-runtime.d.ts.map +1 -0
- package/lib/config/model-harness-runtime.js +65 -0
- package/lib/config/model-harness-runtime.js.map +1 -0
- package/lib/config/model-harness.d.ts +16 -0
- package/lib/config/model-harness.d.ts.map +1 -0
- package/lib/config/model-harness.js +2 -0
- package/lib/config/model-harness.js.map +1 -0
- package/lib/config/normalize-ai-config.d.ts +2 -2
- package/lib/config/normalize-ai-config.d.ts.map +1 -1
- package/lib/config/normalize-ai-config.js +49 -29
- package/lib/config/normalize-ai-config.js.map +1 -1
- package/lib/config/provider-instance.d.ts +1 -1
- package/lib/config/provider-instance.d.ts.map +1 -1
- package/lib/config/provider-instance.js.map +1 -1
- package/lib/config/resolve-pipeline-binding.d.ts +16 -0
- package/lib/config/resolve-pipeline-binding.d.ts.map +1 -0
- package/lib/config/resolve-pipeline-binding.js +35 -0
- package/lib/config/resolve-pipeline-binding.js.map +1 -0
- package/lib/config/types.d.ts +17 -9
- package/lib/config/types.d.ts.map +1 -1
- package/lib/config/types.js.map +1 -1
- package/lib/config/validate-ai-config.d.ts.map +1 -1
- package/lib/config/validate-ai-config.js +6 -1
- package/lib/config/validate-ai-config.js.map +1 -1
- package/lib/config/zhin-agent-config.d.ts +83 -0
- package/lib/config/zhin-agent-config.d.ts.map +1 -0
- package/lib/config/zhin-agent-config.js +2 -0
- package/lib/config/zhin-agent-config.js.map +1 -0
- package/lib/config/zhin-agent-constants.d.ts +11 -0
- package/lib/config/zhin-agent-constants.d.ts.map +1 -0
- package/lib/config/zhin-agent-constants.js +26 -0
- package/lib/config/zhin-agent-constants.js.map +1 -0
- package/lib/config/zhin-agent-defaults.d.ts +3 -0
- package/lib/config/zhin-agent-defaults.d.ts.map +1 -0
- package/lib/config/zhin-agent-defaults.js +63 -0
- package/lib/config/zhin-agent-defaults.js.map +1 -0
- package/lib/config/zhin-agent-dependencies.d.ts +37 -0
- package/lib/config/zhin-agent-dependencies.d.ts.map +1 -0
- package/lib/config/zhin-agent-dependencies.js +2 -0
- package/lib/config/zhin-agent-dependencies.js.map +1 -0
- package/lib/config/zhin-agent-runtime.d.ts +21 -0
- package/lib/config/zhin-agent-runtime.d.ts.map +1 -0
- package/lib/config/zhin-agent-runtime.js +91 -0
- package/lib/config/zhin-agent-runtime.js.map +1 -0
- package/lib/connection/authorization-flow.d.ts +26 -0
- package/lib/connection/authorization-flow.d.ts.map +1 -0
- package/lib/connection/authorization-flow.js +76 -0
- package/lib/connection/authorization-flow.js.map +1 -0
- package/lib/connection/index.d.ts +3 -0
- package/lib/connection/index.d.ts.map +1 -0
- package/lib/connection/index.js +2 -0
- package/lib/connection/index.js.map +1 -0
- package/lib/context/agents-instruction.d.ts +11 -0
- package/lib/context/agents-instruction.d.ts.map +1 -0
- package/lib/context/agents-instruction.js +94 -0
- package/lib/context/agents-instruction.js.map +1 -0
- package/lib/context/context-system.d.ts +47 -0
- package/lib/context/context-system.d.ts.map +1 -0
- package/lib/context/context-system.js +115 -0
- package/lib/context/context-system.js.map +1 -0
- package/lib/context/context-tail-limit.d.ts +7 -0
- package/lib/context/context-tail-limit.d.ts.map +1 -0
- package/lib/context/context-tail-limit.js +12 -0
- package/lib/context/context-tail-limit.js.map +1 -0
- package/lib/context/contracts.d.ts +34 -0
- package/lib/context/contracts.d.ts.map +1 -0
- package/lib/context/contracts.js +8 -0
- package/lib/context/contracts.js.map +1 -0
- package/lib/context/default-builders.d.ts +24 -0
- package/lib/context/default-builders.d.ts.map +1 -0
- package/lib/context/default-builders.js +56 -0
- package/lib/context/default-builders.js.map +1 -0
- package/lib/context/envelope-parts.d.ts +13 -0
- package/lib/context/envelope-parts.d.ts.map +1 -0
- package/lib/context/envelope-parts.js +2 -0
- package/lib/context/envelope-parts.js.map +1 -0
- package/lib/context/index.d.ts +16 -0
- package/lib/context/index.d.ts.map +1 -0
- package/lib/context/index.js +10 -0
- package/lib/context/index.js.map +1 -0
- package/lib/context/model-resolver.d.ts.map +1 -0
- package/lib/context/model-resolver.js +28 -0
- package/lib/context/model-resolver.js.map +1 -0
- package/lib/context/turn-envelope.d.ts +20 -0
- package/lib/context/turn-envelope.d.ts.map +1 -0
- package/lib/context/turn-envelope.js +80 -0
- package/lib/context/turn-envelope.js.map +1 -0
- package/lib/context/turn-user-message.d.ts +10 -0
- package/lib/context/turn-user-message.d.ts.map +1 -0
- package/lib/context/turn-user-message.js +48 -0
- package/lib/context/turn-user-message.js.map +1 -0
- package/lib/core/agent-core-run.d.ts +62 -0
- package/lib/core/agent-core-run.d.ts.map +1 -0
- package/lib/core/agent-core-run.js +612 -0
- package/lib/core/agent-core-run.js.map +1 -0
- package/lib/core/agent-core.d.ts +18 -0
- package/lib/core/agent-core.d.ts.map +1 -0
- package/lib/core/agent-core.js +73 -0
- package/lib/core/agent-core.js.map +1 -0
- package/lib/core/agent-loop-standalone.d.ts +42 -0
- package/lib/core/agent-loop-standalone.d.ts.map +1 -0
- package/lib/core/agent-loop-standalone.js +163 -0
- package/lib/core/agent-loop-standalone.js.map +1 -0
- package/lib/core/agent-loop-turn.d.ts +8 -0
- package/lib/core/agent-loop-turn.d.ts.map +1 -0
- package/lib/core/agent-loop-turn.js +17 -0
- package/lib/core/agent-loop-turn.js.map +1 -0
- package/lib/core/compose-deps.d.ts +13 -0
- package/lib/core/compose-deps.d.ts.map +1 -0
- package/lib/core/compose-deps.js +35 -0
- package/lib/core/compose-deps.js.map +1 -0
- package/lib/core/contracts.d.ts +50 -0
- package/lib/core/contracts.d.ts.map +1 -0
- package/lib/core/contracts.js +11 -0
- package/lib/core/contracts.js.map +1 -0
- package/lib/core/index.d.ts +13 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +9 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/text-sanitize.d.ts.map +1 -0
- package/lib/core/text-sanitize.js +52 -0
- package/lib/core/text-sanitize.js.map +1 -0
- package/lib/core/tool-calls-user-format.d.ts.map +1 -0
- package/lib/core/tool-calls-user-format.js +152 -0
- package/lib/core/tool-calls-user-format.js.map +1 -0
- package/lib/core/turn-event-mapper.d.ts +13 -0
- package/lib/core/turn-event-mapper.d.ts.map +1 -0
- package/lib/core/turn-event-mapper.js +55 -0
- package/lib/core/turn-event-mapper.js.map +1 -0
- package/lib/deferred-worker-runner.d.ts +7 -5
- package/lib/deferred-worker-runner.d.ts.map +1 -1
- package/lib/deferred-worker-runner.js +11 -12
- package/lib/deferred-worker-runner.js.map +1 -1
- package/lib/deferred-worker-tool-load.d.ts +1 -1
- package/lib/deferred-worker-tool-load.d.ts.map +1 -1
- package/lib/deferred-worker-tool-load.js +3 -0
- package/lib/deferred-worker-tool-load.js.map +1 -1
- package/lib/discovery/agent-surface-info.d.ts +42 -0
- package/lib/discovery/agent-surface-info.d.ts.map +1 -0
- package/lib/discovery/agent-surface-info.js +201 -0
- package/lib/discovery/agent-surface-info.js.map +1 -0
- package/lib/discovery/agent-surface.d.ts +32 -0
- package/lib/discovery/agent-surface.d.ts.map +1 -0
- package/lib/discovery/agent-surface.js +422 -0
- package/lib/discovery/agent-surface.js.map +1 -0
- package/lib/discovery/agents.d.ts +11 -12
- package/lib/discovery/agents.d.ts.map +1 -1
- package/lib/discovery/agents.js +87 -85
- package/lib/discovery/agents.js.map +1 -1
- package/lib/discovery/register-agent-surface.d.ts +27 -0
- package/lib/discovery/register-agent-surface.d.ts.map +1 -0
- package/lib/discovery/register-agent-surface.js +155 -0
- package/lib/discovery/register-agent-surface.js.map +1 -0
- package/lib/dynamic/dynamic-registry.d.ts +34 -0
- package/lib/dynamic/dynamic-registry.d.ts.map +1 -0
- package/lib/dynamic/dynamic-registry.js +52 -0
- package/lib/dynamic/dynamic-registry.js.map +1 -0
- package/lib/event/agent-stream-bus.d.ts +25 -0
- package/lib/event/agent-stream-bus.d.ts.map +1 -0
- package/lib/event/agent-stream-bus.js +22 -0
- package/lib/event/agent-stream-bus.js.map +1 -0
- package/lib/event/agent-stream-hooks.d.ts +10 -0
- package/lib/event/agent-stream-hooks.d.ts.map +1 -0
- package/lib/event/agent-stream-hooks.js +28 -0
- package/lib/event/agent-stream-hooks.js.map +1 -0
- package/lib/event/contracts.d.ts +26 -0
- package/lib/event/contracts.d.ts.map +1 -0
- package/lib/event/contracts.js +9 -0
- package/lib/event/contracts.js.map +1 -0
- package/lib/event/event-emitter.d.ts +17 -0
- package/lib/event/event-emitter.d.ts.map +1 -0
- package/lib/event/event-emitter.js +73 -0
- package/lib/event/event-emitter.js.map +1 -0
- package/lib/event/event-system.d.ts +13 -0
- package/lib/event/event-system.d.ts.map +1 -0
- package/lib/event/event-system.js +56 -0
- package/lib/event/event-system.js.map +1 -0
- package/lib/event/filtering-middleware.d.ts +13 -0
- package/lib/event/filtering-middleware.d.ts.map +1 -0
- package/lib/event/filtering-middleware.js +19 -0
- package/lib/event/filtering-middleware.js.map +1 -0
- package/lib/event/hook-stream-sink.d.ts +7 -0
- package/lib/event/hook-stream-sink.d.ts.map +1 -0
- package/lib/event/hook-stream-sink.js +9 -0
- package/lib/event/hook-stream-sink.js.map +1 -0
- package/lib/event/index.d.ts +17 -0
- package/lib/event/index.d.ts.map +1 -0
- package/lib/event/index.js +12 -0
- package/lib/event/index.js.map +1 -0
- package/lib/event/logging-middleware.d.ts +6 -0
- package/lib/event/logging-middleware.d.ts.map +1 -0
- package/lib/event/logging-middleware.js +16 -0
- package/lib/event/logging-middleware.js.map +1 -0
- package/lib/event/publish-agent-stream.d.ts +11 -0
- package/lib/event/publish-agent-stream.d.ts.map +1 -0
- package/lib/event/publish-agent-stream.js +14 -0
- package/lib/event/publish-agent-stream.js.map +1 -0
- package/lib/event/session-events.d.ts +10 -0
- package/lib/event/session-events.d.ts.map +1 -0
- package/lib/event/session-events.js +18 -0
- package/lib/event/session-events.js.map +1 -0
- package/lib/event/turn-event.d.ts +77 -0
- package/lib/event/turn-event.d.ts.map +1 -0
- package/lib/event/turn-event.js +2 -0
- package/lib/event/turn-event.js.map +1 -0
- package/lib/event/turn-to-agent-stream.d.ts +12 -0
- package/lib/event/turn-to-agent-stream.d.ts.map +1 -0
- package/lib/event/turn-to-agent-stream.js +124 -0
- package/lib/event/turn-to-agent-stream.js.map +1 -0
- package/lib/index.d.ts +70 -26
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +47 -16
- package/lib/index.js.map +1 -1
- package/lib/init/activate-ai-database-storage.d.ts +2 -2
- package/lib/init/activate-ai-database-storage.d.ts.map +1 -1
- package/lib/init/activate-ai-database-storage.js +17 -8
- package/lib/init/activate-ai-database-storage.js.map +1 -1
- package/lib/init/bootstrap-gate.d.ts +6 -0
- package/lib/init/bootstrap-gate.d.ts.map +1 -0
- package/lib/init/bootstrap-gate.js +28 -0
- package/lib/init/bootstrap-gate.js.map +1 -0
- package/lib/init/compose-zhin-agent-runtime.d.ts +29 -0
- package/lib/init/compose-zhin-agent-runtime.d.ts.map +1 -0
- package/lib/init/compose-zhin-agent-runtime.js +40 -0
- package/lib/init/compose-zhin-agent-runtime.js.map +1 -0
- package/lib/init/configure-zhin-agent.d.ts +46 -0
- package/lib/init/configure-zhin-agent.d.ts.map +1 -0
- package/lib/init/configure-zhin-agent.js +75 -0
- package/lib/init/configure-zhin-agent.js.map +1 -0
- package/lib/init/create-zhin-agent.d.ts.map +1 -1
- package/lib/init/create-zhin-agent.js +178 -135
- package/lib/init/create-zhin-agent.js.map +1 -1
- package/lib/init/dispose-zhin-agent.d.ts +28 -0
- package/lib/init/dispose-zhin-agent.d.ts.map +1 -0
- package/lib/init/dispose-zhin-agent.js +25 -0
- package/lib/init/dispose-zhin-agent.js.map +1 -0
- package/lib/init/introspection-args.d.ts +4 -1
- package/lib/init/introspection-args.d.ts.map +1 -1
- package/lib/init/introspection-args.js.map +1 -1
- package/lib/init/introspection-collectors.d.ts +5 -0
- package/lib/init/introspection-collectors.d.ts.map +1 -1
- package/lib/init/introspection-collectors.js +35 -0
- package/lib/init/introspection-collectors.js.map +1 -1
- package/lib/init/management-command-guard.d.ts +1 -1
- package/lib/init/management-command-guard.d.ts.map +1 -1
- package/lib/init/management-command-guard.js +1 -1
- package/lib/init/management-command-guard.js.map +1 -1
- package/lib/init/message-media.d.ts +1 -1
- package/lib/init/message-media.d.ts.map +1 -1
- package/lib/init/message-media.js.map +1 -1
- package/lib/init/register-ai-trigger.d.ts.map +1 -1
- package/lib/init/register-ai-trigger.js +29 -304
- package/lib/init/register-ai-trigger.js.map +1 -1
- package/lib/init/register-builtin-tools.d.ts.map +1 -1
- package/lib/init/register-builtin-tools.js +47 -17
- package/lib/init/register-builtin-tools.js.map +1 -1
- package/lib/init/register-collaboration-commands.d.ts +2 -0
- package/lib/init/register-collaboration-commands.d.ts.map +1 -0
- package/lib/init/register-collaboration-commands.js +110 -0
- package/lib/init/register-collaboration-commands.js.map +1 -0
- package/lib/init/register-db-models.d.ts.map +1 -1
- package/lib/init/register-db-models.js +11 -2
- package/lib/init/register-db-models.js.map +1 -1
- package/lib/init/register-db-upgrade.d.ts.map +1 -1
- package/lib/init/register-db-upgrade.js +34 -20
- package/lib/init/register-db-upgrade.js.map +1 -1
- package/lib/init/register-group-session-passive.d.ts.map +1 -1
- package/lib/init/register-group-session-passive.js +19 -13
- package/lib/init/register-group-session-passive.js.map +1 -1
- package/lib/init/register-im-segment-filter.d.ts +2 -0
- package/lib/init/register-im-segment-filter.d.ts.map +1 -0
- package/lib/init/register-im-segment-filter.js +23 -0
- package/lib/init/register-im-segment-filter.js.map +1 -0
- package/lib/init/register-init-wizard-guardrail.d.ts +2 -0
- package/lib/init/register-init-wizard-guardrail.d.ts.map +1 -0
- package/lib/init/register-init-wizard-guardrail.js +46 -0
- package/lib/init/register-init-wizard-guardrail.js.map +1 -0
- package/lib/init/register-introspection-commands.d.ts.map +1 -1
- package/lib/init/register-introspection-commands.js +18 -16
- package/lib/init/register-introspection-commands.js.map +1 -1
- package/lib/init/register-management-tools.d.ts.map +1 -1
- package/lib/init/register-management-tools.js +38 -32
- package/lib/init/register-management-tools.js.map +1 -1
- package/lib/init/register-owner-approve-commands.d.ts.map +1 -1
- package/lib/init/register-owner-approve-commands.js +7 -1
- package/lib/init/register-owner-approve-commands.js.map +1 -1
- package/lib/init/types.d.ts +2 -0
- package/lib/init/types.d.ts.map +1 -1
- package/lib/init.js +6 -6
- package/lib/init.js.map +1 -1
- package/lib/internal/agent-host.d.ts +91 -0
- package/lib/internal/agent-host.d.ts.map +1 -0
- package/lib/internal/agent-host.js +2 -0
- package/lib/internal/agent-host.js.map +1 -0
- package/lib/internal/as-private.d.ts +11 -0
- package/lib/internal/as-private.d.ts.map +1 -0
- package/lib/internal/as-private.js +4 -0
- package/lib/internal/as-private.js.map +1 -0
- package/lib/internal/host-types.d.ts +88 -0
- package/lib/internal/host-types.d.ts.map +1 -0
- package/lib/internal/host-types.js +2 -0
- package/lib/internal/host-types.js.map +1 -0
- package/lib/internal/phase-trace.d.ts +17 -0
- package/lib/internal/phase-trace.d.ts.map +1 -0
- package/lib/internal/phase-trace.js.map +1 -0
- package/lib/internal/prompt-trace.d.ts +17 -0
- package/lib/internal/prompt-trace.d.ts.map +1 -0
- package/lib/internal/prompt-trace.js.map +1 -0
- package/lib/internal/turn-context.d.ts +26 -0
- package/lib/internal/turn-context.d.ts.map +1 -0
- package/lib/internal/turn-context.js +64 -0
- package/lib/internal/turn-context.js.map +1 -0
- package/lib/mcp-client/bridge.d.ts.map +1 -1
- package/lib/mcp-client/bridge.js +3 -1
- package/lib/mcp-client/bridge.js.map +1 -1
- package/lib/media/deliver-subagent-result.d.ts +2 -2
- package/lib/media/deliver-subagent-result.d.ts.map +1 -1
- package/lib/media/media-publisher.d.ts +1 -1
- package/lib/media/media-publisher.d.ts.map +1 -1
- package/lib/media/media-publisher.js.map +1 -1
- package/lib/media/media-router.d.ts +1 -1
- package/lib/media/media-router.d.ts.map +1 -1
- package/lib/media/media-router.js.map +1 -1
- package/lib/media/media-tool-bridge.d.ts +1 -1
- package/lib/media/media-tool-bridge.d.ts.map +1 -1
- package/lib/media/subagent-user-delivery.d.ts +1 -1
- package/lib/media/subagent-user-delivery.d.ts.map +1 -1
- package/lib/media/subagent-user-delivery.js +57 -12
- package/lib/media/subagent-user-delivery.js.map +1 -1
- package/lib/memory/ai-compaction-strategy.d.ts +14 -0
- package/lib/memory/ai-compaction-strategy.d.ts.map +1 -0
- package/lib/memory/ai-compaction-strategy.js +31 -0
- package/lib/memory/ai-compaction-strategy.js.map +1 -0
- package/lib/memory/compaction-runtime.d.ts +28 -0
- package/lib/memory/compaction-runtime.d.ts.map +1 -0
- package/lib/memory/compaction-runtime.js +108 -0
- package/lib/memory/compaction-runtime.js.map +1 -0
- package/lib/memory/context-repository-store.d.ts +14 -0
- package/lib/memory/context-repository-store.d.ts.map +1 -0
- package/lib/memory/context-repository-store.js +22 -0
- package/lib/memory/context-repository-store.js.map +1 -0
- package/lib/memory/contracts.d.ts +24 -0
- package/lib/memory/contracts.d.ts.map +1 -0
- package/lib/memory/contracts.js +8 -0
- package/lib/memory/contracts.js.map +1 -0
- package/lib/memory/index.d.ts +11 -0
- package/lib/memory/index.d.ts.map +1 -0
- package/lib/memory/index.js +8 -0
- package/lib/memory/index.js.map +1 -0
- package/lib/memory/memory-system.d.ts +22 -0
- package/lib/memory/memory-system.d.ts.map +1 -0
- package/lib/memory/memory-system.js +71 -0
- package/lib/memory/memory-system.js.map +1 -0
- package/lib/memory-layers.d.ts +1 -1
- package/lib/memory-layers.d.ts.map +1 -1
- package/lib/memory-layers.js +1 -2
- package/lib/memory-layers.js.map +1 -1
- package/lib/orchestrator/agent-dispatcher.d.ts +7 -18
- package/lib/orchestrator/agent-dispatcher.d.ts.map +1 -1
- package/lib/orchestrator/agent-dispatcher.js +54 -116
- package/lib/orchestrator/agent-dispatcher.js.map +1 -1
- package/lib/orchestrator/bootstrap-executors.d.ts +7 -0
- package/lib/orchestrator/bootstrap-executors.d.ts.map +1 -0
- package/lib/orchestrator/bootstrap-executors.js +170 -0
- package/lib/orchestrator/bootstrap-executors.js.map +1 -0
- package/lib/orchestrator/hook-registry.d.ts +27 -4
- package/lib/orchestrator/hook-registry.d.ts.map +1 -1
- package/lib/orchestrator/hook-registry.js +102 -4
- package/lib/orchestrator/hook-registry.js.map +1 -1
- package/lib/orchestrator/index.d.ts +12 -1
- package/lib/orchestrator/index.d.ts.map +1 -1
- package/lib/orchestrator/index.js +14 -1
- package/lib/orchestrator/index.js.map +1 -1
- package/lib/orchestrator/mcp-registry.d.ts +8 -0
- package/lib/orchestrator/mcp-registry.d.ts.map +1 -1
- package/lib/orchestrator/mcp-registry.js +19 -0
- package/lib/orchestrator/mcp-registry.js.map +1 -1
- package/lib/orchestrator/orchestration-mappers.d.ts +9 -0
- package/lib/orchestrator/orchestration-mappers.d.ts.map +1 -0
- package/lib/orchestrator/orchestration-mappers.js +162 -0
- package/lib/orchestrator/orchestration-mappers.js.map +1 -0
- package/lib/orchestrator/orchestration-repository.d.ts +14 -14
- package/lib/orchestrator/orchestration-repository.d.ts.map +1 -1
- package/lib/orchestrator/orchestration-repository.js +87 -53
- package/lib/orchestrator/orchestration-repository.js.map +1 -1
- package/lib/orchestrator/orchestration-service.d.ts +82 -18
- package/lib/orchestrator/orchestration-service.d.ts.map +1 -1
- package/lib/orchestrator/orchestration-service.js +445 -103
- package/lib/orchestrator/orchestration-service.js.map +1 -1
- package/lib/orchestrator/orchestration-types.d.ts +88 -0
- package/lib/orchestrator/orchestration-types.d.ts.map +1 -0
- package/lib/orchestrator/orchestration-types.js +2 -0
- package/lib/orchestrator/orchestration-types.js.map +1 -0
- package/lib/orchestrator/owner-confirm-orchestration.d.ts +7 -1
- package/lib/orchestrator/owner-confirm-orchestration.d.ts.map +1 -1
- package/lib/orchestrator/owner-confirm-orchestration.js +1 -1
- package/lib/orchestrator/owner-confirm-orchestration.js.map +1 -1
- package/lib/orchestrator/remote-agent-registry.d.ts +10 -7
- package/lib/orchestrator/remote-agent-registry.d.ts.map +1 -1
- package/lib/orchestrator/remote-agent-registry.js +83 -51
- package/lib/orchestrator/remote-agent-registry.js.map +1 -1
- package/lib/orchestrator/remote-task-executor.d.ts.map +1 -1
- package/lib/orchestrator/remote-task-executor.js +179 -98
- package/lib/orchestrator/remote-task-executor.js.map +1 -1
- package/lib/orchestrator/remote-task-poller.js +1 -1
- package/lib/orchestrator/resolve-subagent-tools.d.ts +7 -3
- package/lib/orchestrator/resolve-subagent-tools.d.ts.map +1 -1
- package/lib/orchestrator/resolve-subagent-tools.js +36 -31
- package/lib/orchestrator/resolve-subagent-tools.js.map +1 -1
- package/lib/orchestrator/skill-registry.d.ts +10 -1
- package/lib/orchestrator/skill-registry.d.ts.map +1 -1
- package/lib/orchestrator/skill-registry.js +26 -37
- package/lib/orchestrator/skill-registry.js.map +1 -1
- package/lib/orchestrator/tool-registry.d.ts +1 -1
- package/lib/orchestrator/tool-registry.d.ts.map +1 -1
- package/lib/orchestrator/tool-registry.js.map +1 -1
- package/lib/orchestrator/tool-selection.d.ts +3 -3
- package/lib/orchestrator/tool-selection.d.ts.map +1 -1
- package/lib/orchestrator/tool-selection.js +5 -2
- package/lib/orchestrator/tool-selection.js.map +1 -1
- package/lib/orchestrator/types.d.ts +58 -1
- package/lib/orchestrator/types.d.ts.map +1 -1
- package/lib/outbound/send-proactive.d.ts +24 -0
- package/lib/outbound/send-proactive.d.ts.map +1 -0
- package/lib/outbound/send-proactive.js +54 -0
- package/lib/outbound/send-proactive.js.map +1 -0
- package/lib/prompt/assembly.d.ts +31 -0
- package/lib/prompt/assembly.d.ts.map +1 -0
- package/lib/prompt/assembly.js +92 -0
- package/lib/prompt/assembly.js.map +1 -0
- package/lib/prompt/index.d.ts +11 -0
- package/lib/prompt/index.d.ts.map +1 -0
- package/lib/prompt/index.js +9 -0
- package/lib/prompt/index.js.map +1 -0
- package/lib/prompt/prompt-builder.d.ts.map +1 -0
- package/lib/prompt/prompt-builder.js +574 -0
- package/lib/prompt/prompt-builder.js.map +1 -0
- package/lib/prompt/system-prompt.d.ts +63 -0
- package/lib/prompt/system-prompt.d.ts.map +1 -0
- package/lib/prompt/system-prompt.js +532 -0
- package/lib/prompt/system-prompt.js.map +1 -0
- package/lib/prompt/templates.d.ts +162 -0
- package/lib/prompt/templates.d.ts.map +1 -0
- package/lib/prompt/templates.js +447 -0
- package/lib/prompt/templates.js.map +1 -0
- package/lib/prompt/workspace-prompt.d.ts.map +1 -0
- package/lib/prompt/workspace-prompt.js.map +1 -0
- package/lib/reserved-tools.d.ts.map +1 -1
- package/lib/reserved-tools.js +9 -6
- package/lib/reserved-tools.js.map +1 -1
- package/lib/routing/route-matcher.d.ts +6 -1
- package/lib/routing/route-matcher.d.ts.map +1 -1
- package/lib/routing/route-matcher.js +53 -8
- package/lib/routing/route-matcher.js.map +1 -1
- package/lib/routing/runtime-binding.d.ts +1 -1
- package/lib/routing/runtime-binding.d.ts.map +1 -1
- package/lib/schedule-cron.d.ts +18 -0
- package/lib/schedule-cron.d.ts.map +1 -0
- package/lib/schedule-cron.js +62 -0
- package/lib/schedule-cron.js.map +1 -0
- package/lib/schedule-manager.d.ts +28 -0
- package/lib/schedule-manager.d.ts.map +1 -0
- package/lib/schedule-manager.js +150 -0
- package/lib/schedule-manager.js.map +1 -0
- package/lib/security/audit-logger.d.ts.map +1 -1
- package/lib/security/audit-logger.js +118 -13
- package/lib/security/audit-logger.js.map +1 -1
- package/lib/security/dangerous-tool-policy-hook.d.ts +6 -0
- package/lib/security/dangerous-tool-policy-hook.d.ts.map +1 -0
- package/lib/security/dangerous-tool-policy-hook.js +41 -0
- package/lib/security/dangerous-tool-policy-hook.js.map +1 -0
- package/lib/security/dangerous-tool-policy.d.ts +2 -2
- package/lib/security/dangerous-tool-policy.d.ts.map +1 -1
- package/lib/security/dangerous-tool-policy.js.map +1 -1
- package/lib/security/exec-policy-hook.d.ts +7 -0
- package/lib/security/exec-policy-hook.d.ts.map +1 -0
- package/lib/security/exec-policy-hook.js +29 -0
- package/lib/security/exec-policy-hook.js.map +1 -0
- package/lib/security/exec-policy.d.ts +1 -1
- package/lib/security/exec-policy.d.ts.map +1 -1
- package/lib/security/file-policy-hook.d.ts +6 -0
- package/lib/security/file-policy-hook.d.ts.map +1 -0
- package/lib/security/file-policy-hook.js +30 -0
- package/lib/security/file-policy-hook.js.map +1 -0
- package/lib/security/owner-approve-always-store.d.ts +1 -1
- package/lib/security/owner-approve-always-store.d.ts.map +1 -1
- package/lib/security/owner-approve-always-store.js.map +1 -1
- package/lib/security/sandbox-enhanced.d.ts.map +1 -1
- package/lib/security/sandbox-enhanced.js +27 -19
- package/lib/security/sandbox-enhanced.js.map +1 -1
- package/lib/security/sandbox.d.ts.map +1 -1
- package/lib/security/sandbox.js +6 -6
- package/lib/security/sandbox.js.map +1 -1
- package/lib/segment/filter-im-delivery.d.ts +7 -0
- package/lib/segment/filter-im-delivery.d.ts.map +1 -0
- package/lib/segment/filter-im-delivery.js +32 -0
- package/lib/segment/filter-im-delivery.js.map +1 -0
- package/lib/service.d.ts +5 -14
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +7 -12
- package/lib/service.js.map +1 -1
- package/lib/session/agent-session-host-port.d.ts +23 -0
- package/lib/session/agent-session-host-port.d.ts.map +1 -0
- package/lib/session/agent-session-host-port.js +61 -0
- package/lib/session/agent-session-host-port.js.map +1 -0
- package/lib/session/branch-summarization-runtime.d.ts +16 -0
- package/lib/session/branch-summarization-runtime.d.ts.map +1 -0
- package/lib/session/branch-summarization-runtime.js +58 -0
- package/lib/session/branch-summarization-runtime.js.map +1 -0
- package/lib/session/contracts.d.ts +27 -0
- package/lib/session/contracts.d.ts.map +1 -0
- package/lib/session/contracts.js +9 -0
- package/lib/session/contracts.js.map +1 -0
- package/lib/session/http-agent-session-store.d.ts +76 -0
- package/lib/session/http-agent-session-store.d.ts.map +1 -0
- package/lib/session/http-agent-session-store.js +211 -0
- package/lib/session/http-agent-session-store.js.map +1 -0
- package/lib/session/http-approval-adapter.d.ts +11 -0
- package/lib/session/http-approval-adapter.d.ts.map +1 -0
- package/lib/session/http-approval-adapter.js +19 -0
- package/lib/session/http-approval-adapter.js.map +1 -0
- package/lib/session/http-approval-waiter.d.ts +11 -0
- package/lib/session/http-approval-waiter.d.ts.map +1 -0
- package/lib/session/http-approval-waiter.js +38 -0
- package/lib/session/http-approval-waiter.js.map +1 -0
- package/lib/session/http-session-persistence.d.ts +28 -0
- package/lib/session/http-session-persistence.d.ts.map +1 -0
- package/lib/session/http-session-persistence.js +60 -0
- package/lib/session/http-session-persistence.js.map +1 -0
- package/lib/session/http-session-sink.d.ts +11 -0
- package/lib/session/http-session-sink.d.ts.map +1 -0
- package/lib/session/http-session-sink.js +32 -0
- package/lib/session/http-session-sink.js.map +1 -0
- package/lib/session/http-step-projector.d.ts +16 -0
- package/lib/session/http-step-projector.d.ts.map +1 -0
- package/lib/session/http-step-projector.js +118 -0
- package/lib/session/http-step-projector.js.map +1 -0
- package/lib/session/http-turn-runner.d.ts +16 -0
- package/lib/session/http-turn-runner.d.ts.map +1 -0
- package/lib/session/http-turn-runner.js +57 -0
- package/lib/session/http-turn-runner.js.map +1 -0
- package/lib/session/im-approval-adapter.d.ts +12 -0
- package/lib/session/im-approval-adapter.d.ts.map +1 -0
- package/lib/session/im-approval-adapter.js +24 -0
- package/lib/session/im-approval-adapter.js.map +1 -0
- package/lib/session/index.d.ts +17 -0
- package/lib/session/index.d.ts.map +1 -0
- package/lib/session/index.js +12 -0
- package/lib/session/index.js.map +1 -0
- package/lib/session/park-controller.d.ts +24 -0
- package/lib/session/park-controller.d.ts.map +1 -0
- package/lib/session/park-controller.js +58 -0
- package/lib/session/park-controller.js.map +1 -0
- package/lib/session/passive-group-buffer.d.ts +15 -0
- package/lib/session/passive-group-buffer.d.ts.map +1 -0
- package/lib/session/passive-group-buffer.js +45 -0
- package/lib/session/passive-group-buffer.js.map +1 -0
- package/lib/session/passive-group-session.d.ts +12 -0
- package/lib/session/passive-group-session.d.ts.map +1 -0
- package/lib/session/passive-group-session.js +36 -0
- package/lib/session/passive-group-session.js.map +1 -0
- package/lib/session/resolve-session-interaction-port.d.ts +9 -0
- package/lib/session/resolve-session-interaction-port.d.ts.map +1 -0
- package/lib/session/resolve-session-interaction-port.js +13 -0
- package/lib/session/resolve-session-interaction-port.js.map +1 -0
- package/lib/session/session-event-log.d.ts +17 -0
- package/lib/session/session-event-log.d.ts.map +1 -0
- package/lib/session/session-event-log.js +56 -0
- package/lib/session/session-event-log.js.map +1 -0
- package/lib/session/session-interaction-port.d.ts +15 -0
- package/lib/session/session-interaction-port.d.ts.map +1 -0
- package/lib/session/session-interaction-port.js +2 -0
- package/lib/session/session-interaction-port.js.map +1 -0
- package/lib/session/session-io.d.ts +43 -0
- package/lib/session/session-io.d.ts.map +1 -0
- package/lib/session/session-io.js +135 -0
- package/lib/session/session-io.js.map +1 -0
- package/lib/session/session-system.d.ts +31 -0
- package/lib/session/session-system.d.ts.map +1 -0
- package/lib/session/session-system.js +70 -0
- package/lib/session/session-system.js.map +1 -0
- package/lib/session/session-tree-commands.d.ts +5 -0
- package/lib/session/session-tree-commands.d.ts.map +1 -0
- package/lib/session/session-tree-commands.js +32 -0
- package/lib/session/session-tree-commands.js.map +1 -0
- package/lib/session/strategies.d.ts +11 -0
- package/lib/session/strategies.d.ts.map +1 -0
- package/lib/session/strategies.js +19 -0
- package/lib/session/strategies.js.map +1 -0
- package/lib/session-tree-runtime-registry.d.ts +1 -1
- package/lib/session-tree-runtime-registry.d.ts.map +1 -1
- package/lib/session-tree-runtime-registry.js +1 -1
- package/lib/session-tree-runtime-registry.js.map +1 -1
- package/lib/skill/contracts.d.ts +29 -0
- package/lib/skill/contracts.d.ts.map +1 -0
- package/lib/skill/contracts.js +7 -0
- package/lib/skill/contracts.js.map +1 -0
- package/lib/skill/index.d.ts +8 -0
- package/lib/skill/index.d.ts.map +1 -0
- package/lib/skill/index.js +6 -0
- package/lib/skill/index.js.map +1 -0
- package/lib/skill/progressive-disclosure.d.ts +9 -0
- package/lib/skill/progressive-disclosure.d.ts.map +1 -0
- package/lib/skill/progressive-disclosure.js +14 -0
- package/lib/skill/progressive-disclosure.js.map +1 -0
- package/lib/skill/skill-load-opts.d.ts +5 -0
- package/lib/skill/skill-load-opts.d.ts.map +1 -0
- package/lib/skill/skill-load-opts.js +14 -0
- package/lib/skill/skill-load-opts.js.map +1 -0
- package/lib/skill/skill-system.d.ts +17 -0
- package/lib/skill/skill-system.d.ts.map +1 -0
- package/lib/skill/skill-system.js +51 -0
- package/lib/skill/skill-system.js.map +1 -0
- package/lib/spawn/permission-task.d.ts +9 -0
- package/lib/spawn/permission-task.d.ts.map +1 -0
- package/lib/spawn/permission-task.js +37 -0
- package/lib/spawn/permission-task.js.map +1 -0
- package/lib/stability/memory-pressure.js +1 -1
- package/lib/stability/memory-pressure.js.map +1 -1
- package/lib/state/agent-state-store.d.ts +18 -0
- package/lib/state/agent-state-store.d.ts.map +1 -0
- package/lib/state/agent-state-store.js +50 -0
- package/lib/state/agent-state-store.js.map +1 -0
- package/lib/subagent/contracts.d.ts +37 -0
- package/lib/subagent/contracts.d.ts.map +1 -0
- package/lib/subagent/contracts.js +8 -0
- package/lib/subagent/contracts.js.map +1 -0
- package/lib/subagent/im-result-sink.d.ts +15 -0
- package/lib/subagent/im-result-sink.d.ts.map +1 -0
- package/lib/subagent/im-result-sink.js +47 -0
- package/lib/subagent/im-result-sink.js.map +1 -0
- package/lib/subagent/index.d.ts +12 -0
- package/lib/subagent/index.d.ts.map +1 -0
- package/lib/subagent/index.js +8 -0
- package/lib/subagent/index.js.map +1 -0
- package/lib/subagent/subagent-runtime.d.ts +173 -0
- package/lib/subagent/subagent-runtime.d.ts.map +1 -0
- package/lib/subagent/subagent-runtime.js +553 -0
- package/lib/subagent/subagent-runtime.js.map +1 -0
- package/lib/subagent/subagent-system-init.d.ts +15 -0
- package/lib/subagent/subagent-system-init.d.ts.map +1 -0
- package/lib/subagent/subagent-system-init.js +53 -0
- package/lib/subagent/subagent-system-init.js.map +1 -0
- package/lib/subagent/subagent-system.d.ts +31 -0
- package/lib/subagent/subagent-system.d.ts.map +1 -0
- package/lib/subagent/subagent-system.js +98 -0
- package/lib/subagent/subagent-system.js.map +1 -0
- package/lib/subagent-ai-events.d.ts +4 -4
- package/lib/subagent-ai-events.d.ts.map +1 -1
- package/lib/subagent-ai-events.js.map +1 -1
- package/lib/subagent-goal-notify.d.ts +11 -9
- package/lib/subagent-goal-notify.d.ts.map +1 -1
- package/lib/subagent-goal-notify.js +14 -8
- package/lib/subagent-goal-notify.js.map +1 -1
- package/lib/subagent-preset.js +3 -3
- package/lib/subagent-preset.js.map +1 -1
- package/lib/subagent-prompt.d.ts.map +1 -1
- package/lib/subagent-prompt.js +32 -8
- package/lib/subagent-prompt.js.map +1 -1
- package/lib/task-executor.d.ts +15 -10
- package/lib/task-executor.d.ts.map +1 -1
- package/lib/task-executor.js +100 -39
- package/lib/task-executor.js.map +1 -1
- package/lib/tool/context-tools.d.ts +10 -0
- package/lib/tool/context-tools.d.ts.map +1 -0
- package/lib/tool/context-tools.js +107 -0
- package/lib/tool/context-tools.js.map +1 -0
- package/lib/tool/contracts.d.ts +26 -0
- package/lib/tool/contracts.d.ts.map +1 -0
- package/lib/tool/contracts.js +8 -0
- package/lib/tool/contracts.js.map +1 -0
- package/lib/tool/deferred-resolution.d.ts +14 -0
- package/lib/tool/deferred-resolution.d.ts.map +1 -0
- package/lib/tool/deferred-resolution.js +66 -0
- package/lib/tool/deferred-resolution.js.map +1 -0
- package/lib/tool/index.d.ts +14 -0
- package/lib/tool/index.d.ts.map +1 -0
- package/lib/tool/index.js +9 -0
- package/lib/tool/index.js.map +1 -0
- package/lib/tool/pre-exec.d.ts.map +1 -0
- package/lib/tool/pre-exec.js.map +1 -0
- package/lib/tool/prepare-turn-tools.d.ts +22 -0
- package/lib/tool/prepare-turn-tools.d.ts.map +1 -0
- package/lib/tool/prepare-turn-tools.js +87 -0
- package/lib/tool/prepare-turn-tools.js.map +1 -0
- package/lib/tool/runtime.d.ts +24 -0
- package/lib/tool/runtime.d.ts.map +1 -0
- package/lib/tool/runtime.js +20 -0
- package/lib/tool/runtime.js.map +1 -0
- package/lib/tool/sources.d.ts +59 -0
- package/lib/tool/sources.d.ts.map +1 -0
- package/lib/tool/sources.js +110 -0
- package/lib/tool/sources.js.map +1 -0
- package/lib/tool/tool-approval-gate.d.ts +30 -0
- package/lib/tool/tool-approval-gate.d.ts.map +1 -0
- package/lib/tool/tool-approval-gate.js +74 -0
- package/lib/tool/tool-approval-gate.js.map +1 -0
- package/lib/tool/tool-approval-once-store.d.ts +10 -0
- package/lib/tool/tool-approval-once-store.d.ts.map +1 -0
- package/lib/tool/tool-approval-once-store.js +16 -0
- package/lib/tool/tool-approval-once-store.js.map +1 -0
- package/lib/tool/tool-model-output.d.ts +3 -0
- package/lib/tool/tool-model-output.d.ts.map +1 -0
- package/lib/tool/tool-model-output.js +7 -0
- package/lib/tool/tool-model-output.js.map +1 -0
- package/lib/tool/tool-system.d.ts +36 -0
- package/lib/tool/tool-system.d.ts.map +1 -0
- package/lib/tool/tool-system.js +84 -0
- package/lib/tool/tool-system.js.map +1 -0
- package/lib/tool/web-search-locale-attach.d.ts.map +1 -0
- package/lib/tool/web-search-locale-attach.js.map +1 -0
- package/lib/tool-bridge.d.ts +11 -0
- package/lib/tool-bridge.d.ts.map +1 -0
- package/lib/tool-bridge.js +10 -0
- package/lib/tool-bridge.js.map +1 -0
- package/lib/tool-catalog/index.d.ts +4 -0
- package/lib/tool-catalog/index.d.ts.map +1 -0
- package/lib/tool-catalog/index.js +4 -0
- package/lib/tool-catalog/index.js.map +1 -0
- package/lib/tool-catalog/resolve-config.d.ts +8 -0
- package/lib/tool-catalog/resolve-config.d.ts.map +1 -0
- package/lib/tool-catalog/resolve-config.js +22 -0
- package/lib/tool-catalog/resolve-config.js.map +1 -0
- package/lib/tool-catalog/session-deferred-store.d.ts +22 -0
- package/lib/tool-catalog/session-deferred-store.d.ts.map +1 -0
- package/lib/tool-catalog/session-deferred-store.js +50 -0
- package/lib/tool-catalog/session-deferred-store.js.map +1 -0
- package/lib/tool-catalog/tool-catalog.d.ts +24 -0
- package/lib/tool-catalog/tool-catalog.d.ts.map +1 -0
- package/lib/tool-catalog/tool-catalog.js +119 -0
- package/lib/tool-catalog/tool-catalog.js.map +1 -0
- package/lib/tool-catalog/types.d.ts +29 -0
- package/lib/tool-catalog/types.d.ts.map +1 -0
- package/lib/tool-catalog/types.js +18 -0
- package/lib/tool-catalog/types.js.map +1 -0
- package/lib/turn/auto-continue.d.ts +18 -0
- package/lib/turn/auto-continue.d.ts.map +1 -0
- package/lib/turn/auto-continue.js +76 -0
- package/lib/turn/auto-continue.js.map +1 -0
- package/lib/turn/deferred-auto-continue.d.ts +11 -0
- package/lib/turn/deferred-auto-continue.d.ts.map +1 -0
- package/lib/turn/deferred-auto-continue.js.map +1 -0
- package/lib/turn/deferred-delivery.d.ts +9 -0
- package/lib/turn/deferred-delivery.d.ts.map +1 -0
- package/lib/turn/deferred-delivery.js.map +1 -0
- package/lib/turn/inbound-queue-config.d.ts +14 -0
- package/lib/turn/inbound-queue-config.d.ts.map +1 -0
- package/lib/turn/inbound-queue-config.js +39 -0
- package/lib/turn/inbound-queue-config.js.map +1 -0
- package/lib/turn/inbound-queue-runtime.d.ts +15 -0
- package/lib/turn/inbound-queue-runtime.d.ts.map +1 -0
- package/lib/turn/inbound-queue-runtime.js +29 -0
- package/lib/turn/inbound-queue-runtime.js.map +1 -0
- package/lib/turn/inbound-turn-queue.d.ts +29 -0
- package/lib/turn/inbound-turn-queue.d.ts.map +1 -0
- package/lib/turn/inbound-turn-queue.js +132 -0
- package/lib/turn/inbound-turn-queue.js.map +1 -0
- package/lib/turn/index.d.ts +34 -0
- package/lib/turn/index.d.ts.map +1 -0
- package/lib/turn/index.js +26 -0
- package/lib/turn/index.js.map +1 -0
- package/lib/turn/multimodal-message.d.ts +9 -0
- package/lib/turn/multimodal-message.d.ts.map +1 -0
- package/lib/turn/multimodal-message.js +72 -0
- package/lib/turn/multimodal-message.js.map +1 -0
- package/lib/turn/persist-deferred-context.d.ts +5 -0
- package/lib/turn/persist-deferred-context.d.ts.map +1 -0
- package/lib/turn/persist-deferred-context.js +35 -0
- package/lib/turn/persist-deferred-context.js.map +1 -0
- package/lib/turn/persist-subagent-context.d.ts +5 -0
- package/lib/turn/persist-subagent-context.d.ts.map +1 -0
- package/lib/turn/persist-subagent-context.js +36 -0
- package/lib/turn/persist-subagent-context.js.map +1 -0
- package/lib/turn/process-stream.d.ts +14 -0
- package/lib/turn/process-stream.d.ts.map +1 -0
- package/lib/turn/process-stream.js +70 -0
- package/lib/turn/process-stream.js.map +1 -0
- package/lib/turn/prompt-access.d.ts.map +1 -0
- package/lib/turn/prompt-access.js.map +1 -0
- package/lib/turn/prompt-api.d.ts +14 -0
- package/lib/turn/prompt-api.d.ts.map +1 -0
- package/lib/turn/prompt-api.js +51 -0
- package/lib/turn/prompt-api.js.map +1 -0
- package/lib/turn/prompt-controller.d.ts +59 -0
- package/lib/turn/prompt-controller.d.ts.map +1 -0
- package/lib/turn/prompt-controller.js +190 -0
- package/lib/turn/prompt-controller.js.map +1 -0
- package/lib/turn/prompt-input.d.ts +3 -0
- package/lib/turn/prompt-input.d.ts.map +1 -0
- package/lib/turn/prompt-input.js.map +1 -0
- package/lib/turn/session-message-queue.d.ts +19 -0
- package/lib/turn/session-message-queue.d.ts.map +1 -0
- package/lib/turn/session-message-queue.js.map +1 -0
- package/lib/turn/subagent-auto-continue.d.ts +7 -0
- package/lib/turn/subagent-auto-continue.d.ts.map +1 -0
- package/lib/turn/subagent-auto-continue.js +16 -0
- package/lib/turn/subagent-auto-continue.js.map +1 -0
- package/lib/turn/task-continuation.d.ts.map +1 -0
- package/lib/turn/task-continuation.js.map +1 -0
- package/lib/turn/turn-complete.d.ts +25 -0
- package/lib/turn/turn-complete.d.ts.map +1 -0
- package/lib/turn/turn-complete.js +59 -0
- package/lib/turn/turn-complete.js.map +1 -0
- package/lib/turn/turn-context-bridge.d.ts +13 -0
- package/lib/turn/turn-context-bridge.d.ts.map +1 -0
- package/lib/turn/turn-context-bridge.js +33 -0
- package/lib/turn/turn-context-bridge.js.map +1 -0
- package/lib/turn/turn-deferred-delta.d.ts +6 -0
- package/lib/turn/turn-deferred-delta.d.ts.map +1 -0
- package/lib/turn/turn-deferred-delta.js +24 -0
- package/lib/turn/turn-deferred-delta.js.map +1 -0
- package/lib/turn/turn-metrics.d.ts +21 -0
- package/lib/turn/turn-metrics.d.ts.map +1 -0
- package/lib/turn/turn-metrics.js +88 -0
- package/lib/turn/turn-metrics.js.map +1 -0
- package/lib/turn/turn-pipeline.d.ts +14 -0
- package/lib/turn/turn-pipeline.d.ts.map +1 -0
- package/lib/turn/turn-pipeline.js +251 -0
- package/lib/turn/turn-pipeline.js.map +1 -0
- package/lib/turn/turn-tracker.d.ts.map +1 -0
- package/lib/turn/turn-tracker.js.map +1 -0
- package/lib/typing-indicator/adapter-integration.d.ts +3 -142
- package/lib/typing-indicator/adapter-integration.d.ts.map +1 -1
- package/lib/typing-indicator/adapter-integration.js +4 -332
- package/lib/typing-indicator/adapter-integration.js.map +1 -1
- package/lib/utils/config-env.js +30 -7
- package/lib/utils/config-env.js.map +1 -1
- package/lib/zhin-agent/index.d.ts +73 -83
- package/lib/zhin-agent/index.d.ts.map +1 -1
- package/lib/zhin-agent/index.js +168 -333
- package/lib/zhin-agent/index.js.map +1 -1
- package/lib/zhin-agent/runtime-modules.d.ts +27 -0
- package/lib/zhin-agent/runtime-modules.d.ts.map +1 -0
- package/lib/zhin-agent/runtime-modules.js +28 -0
- package/lib/zhin-agent/runtime-modules.js.map +1 -0
- package/package.json +100 -7
- package/lib/assistant/legacy-convert.d.ts +0 -43
- package/lib/assistant/legacy-convert.d.ts.map +0 -1
- package/lib/assistant/legacy-convert.js +0 -108
- package/lib/assistant/legacy-convert.js.map +0 -1
- package/lib/builtin/activate-skill-tool.d.ts +0 -21
- package/lib/builtin/activate-skill-tool.d.ts.map +0 -1
- package/lib/builtin/activate-skill-tool.js +0 -57
- package/lib/builtin/activate-skill-tool.js.map +0 -1
- package/lib/builtin/run-spec-dry-run-tool.d.ts +0 -3
- package/lib/builtin/run-spec-dry-run-tool.d.ts.map +0 -1
- package/lib/builtin/run-spec-dry-run-tool.js +0 -51
- package/lib/builtin/run-spec-dry-run-tool.js.map +0 -1
- package/lib/builtin/run-validation-spec-tool.d.ts +0 -5
- package/lib/builtin/run-validation-spec-tool.d.ts.map +0 -1
- package/lib/builtin/run-validation-spec-tool.js +0 -44
- package/lib/builtin/run-validation-spec-tool.js.map +0 -1
- package/lib/builtin/tool-search-tool.d.ts +0 -19
- package/lib/builtin/tool-search-tool.d.ts.map +0 -1
- package/lib/builtin/tool-search-tool.js +0 -54
- package/lib/builtin/tool-search-tool.js.map +0 -1
- package/lib/cron-engine.d.ts +0 -121
- package/lib/cron-engine.d.ts.map +0 -1
- package/lib/cron-engine.js +0 -360
- package/lib/cron-engine.js.map +0 -1
- package/lib/init/register-agent-mesh-mcp.d.ts +0 -2
- package/lib/init/register-agent-mesh-mcp.d.ts.map +0 -1
- package/lib/init/register-agent-mesh-mcp.js +0 -29
- package/lib/init/register-agent-mesh-mcp.js.map +0 -1
- package/lib/init/register-mcp-memory-default.d.ts +0 -2
- package/lib/init/register-mcp-memory-default.d.ts.map +0 -1
- package/lib/init/register-mcp-memory-default.js +0 -35
- package/lib/init/register-mcp-memory-default.js.map +0 -1
- package/lib/init/register-typing-indicator.d.ts +0 -10
- package/lib/init/register-typing-indicator.d.ts.map +0 -1
- package/lib/init/register-typing-indicator.js +0 -286
- package/lib/init/register-typing-indicator.js.map +0 -1
- package/lib/mcp-server/agent-mesh-tools.d.ts +0 -8
- package/lib/mcp-server/agent-mesh-tools.d.ts.map +0 -1
- package/lib/mcp-server/agent-mesh-tools.js +0 -138
- package/lib/mcp-server/agent-mesh-tools.js.map +0 -1
- package/lib/orchestrator/delegation-processor.d.ts +0 -34
- package/lib/orchestrator/delegation-processor.d.ts.map +0 -1
- package/lib/orchestrator/delegation-processor.js +0 -146
- package/lib/orchestrator/delegation-processor.js.map +0 -1
- package/lib/orchestrator/mission-milestone-notify.d.ts +0 -17
- package/lib/orchestrator/mission-milestone-notify.d.ts.map +0 -1
- package/lib/orchestrator/mission-milestone-notify.js +0 -54
- package/lib/orchestrator/mission-milestone-notify.js.map +0 -1
- package/lib/orchestrator/mission-negotiation.d.ts +0 -17
- package/lib/orchestrator/mission-negotiation.d.ts.map +0 -1
- package/lib/orchestrator/mission-negotiation.js +0 -89
- package/lib/orchestrator/mission-negotiation.js.map +0 -1
- package/lib/orchestrator/mission-patch-acl.d.ts +0 -9
- package/lib/orchestrator/mission-patch-acl.d.ts.map +0 -1
- package/lib/orchestrator/mission-patch-acl.js +0 -29
- package/lib/orchestrator/mission-patch-acl.js.map +0 -1
- package/lib/orchestrator/mission-runner.d.ts +0 -23
- package/lib/orchestrator/mission-runner.d.ts.map +0 -1
- package/lib/orchestrator/mission-runner.js +0 -181
- package/lib/orchestrator/mission-runner.js.map +0 -1
- package/lib/orchestrator/mission-spec.d.ts +0 -44
- package/lib/orchestrator/mission-spec.d.ts.map +0 -1
- package/lib/orchestrator/mission-spec.js +0 -121
- package/lib/orchestrator/mission-spec.js.map +0 -1
- package/lib/orchestrator/mission-state.d.ts +0 -48
- package/lib/orchestrator/mission-state.d.ts.map +0 -1
- package/lib/orchestrator/mission-state.js +0 -66
- package/lib/orchestrator/mission-state.js.map +0 -1
- package/lib/subagent.d.ts +0 -141
- package/lib/subagent.d.ts.map +0 -1
- package/lib/subagent.js +0 -483
- package/lib/subagent.js.map +0 -1
- package/lib/zhin-agent/agent-loop-standalone.d.ts +0 -43
- package/lib/zhin-agent/agent-loop-standalone.d.ts.map +0 -1
- package/lib/zhin-agent/agent-loop-standalone.js +0 -163
- package/lib/zhin-agent/agent-loop-standalone.js.map +0 -1
- package/lib/zhin-agent/agent-loop-turn.d.ts +0 -52
- package/lib/zhin-agent/agent-loop-turn.d.ts.map +0 -1
- package/lib/zhin-agent/agent-loop-turn.js +0 -395
- package/lib/zhin-agent/agent-loop-turn.js.map +0 -1
- package/lib/zhin-agent/agents-instruction.d.ts +0 -15
- package/lib/zhin-agent/agents-instruction.d.ts.map +0 -1
- package/lib/zhin-agent/agents-instruction.js +0 -98
- package/lib/zhin-agent/agents-instruction.js.map +0 -1
- package/lib/zhin-agent/branch-summarization-runtime.d.ts +0 -16
- package/lib/zhin-agent/branch-summarization-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/branch-summarization-runtime.js +0 -58
- package/lib/zhin-agent/branch-summarization-runtime.js.map +0 -1
- package/lib/zhin-agent/builtin-tools.d.ts +0 -14
- package/lib/zhin-agent/builtin-tools.d.ts.map +0 -1
- package/lib/zhin-agent/builtin-tools.js +0 -114
- package/lib/zhin-agent/builtin-tools.js.map +0 -1
- package/lib/zhin-agent/compaction-runtime.d.ts +0 -29
- package/lib/zhin-agent/compaction-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/compaction-runtime.js +0 -108
- package/lib/zhin-agent/compaction-runtime.js.map +0 -1
- package/lib/zhin-agent/config.d.ts +0 -190
- package/lib/zhin-agent/config.d.ts.map +0 -1
- package/lib/zhin-agent/config.js +0 -207
- package/lib/zhin-agent/config.js.map +0 -1
- package/lib/zhin-agent/context-budget.d.ts +0 -27
- package/lib/zhin-agent/context-budget.d.ts.map +0 -1
- package/lib/zhin-agent/context-budget.js +0 -50
- package/lib/zhin-agent/context-budget.js.map +0 -1
- package/lib/zhin-agent/deferred-auto-continue.d.ts +0 -11
- package/lib/zhin-agent/deferred-auto-continue.d.ts.map +0 -1
- package/lib/zhin-agent/deferred-auto-continue.js.map +0 -1
- package/lib/zhin-agent/deferred-delivery.d.ts +0 -9
- package/lib/zhin-agent/deferred-delivery.d.ts.map +0 -1
- package/lib/zhin-agent/deferred-delivery.js.map +0 -1
- package/lib/zhin-agent/event-emitter.d.ts +0 -11
- package/lib/zhin-agent/event-emitter.d.ts.map +0 -1
- package/lib/zhin-agent/event-emitter.js +0 -44
- package/lib/zhin-agent/event-emitter.js.map +0 -1
- package/lib/zhin-agent/interfaces.d.ts +0 -63
- package/lib/zhin-agent/interfaces.d.ts.map +0 -1
- package/lib/zhin-agent/interfaces.js +0 -8
- package/lib/zhin-agent/interfaces.js.map +0 -1
- package/lib/zhin-agent/model-harness.d.ts +0 -29
- package/lib/zhin-agent/model-harness.d.ts.map +0 -1
- package/lib/zhin-agent/model-harness.js +0 -67
- package/lib/zhin-agent/model-harness.js.map +0 -1
- package/lib/zhin-agent/model-resolver.d.ts.map +0 -1
- package/lib/zhin-agent/model-resolver.js +0 -27
- package/lib/zhin-agent/model-resolver.js.map +0 -1
- package/lib/zhin-agent/multimodal-message.d.ts +0 -9
- package/lib/zhin-agent/multimodal-message.d.ts.map +0 -1
- package/lib/zhin-agent/multimodal-message.js +0 -69
- package/lib/zhin-agent/multimodal-message.js.map +0 -1
- package/lib/zhin-agent/persist-deferred-context.d.ts +0 -5
- package/lib/zhin-agent/persist-deferred-context.d.ts.map +0 -1
- package/lib/zhin-agent/persist-deferred-context.js +0 -34
- package/lib/zhin-agent/persist-deferred-context.js.map +0 -1
- package/lib/zhin-agent/phase-trace.d.ts +0 -23
- package/lib/zhin-agent/phase-trace.d.ts.map +0 -1
- package/lib/zhin-agent/phase-trace.js.map +0 -1
- package/lib/zhin-agent/pre-exec.d.ts.map +0 -1
- package/lib/zhin-agent/pre-exec.js.map +0 -1
- package/lib/zhin-agent/prompt-access.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-access.js.map +0 -1
- package/lib/zhin-agent/prompt-assembly.d.ts +0 -31
- package/lib/zhin-agent/prompt-assembly.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-assembly.js +0 -87
- package/lib/zhin-agent/prompt-assembly.js.map +0 -1
- package/lib/zhin-agent/prompt-builder.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-builder.js +0 -579
- package/lib/zhin-agent/prompt-builder.js.map +0 -1
- package/lib/zhin-agent/prompt-controller.d.ts +0 -54
- package/lib/zhin-agent/prompt-controller.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-controller.js +0 -177
- package/lib/zhin-agent/prompt-controller.js.map +0 -1
- package/lib/zhin-agent/prompt-input.d.ts +0 -3
- package/lib/zhin-agent/prompt-input.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-input.js.map +0 -1
- package/lib/zhin-agent/prompt-templates.d.ts +0 -162
- package/lib/zhin-agent/prompt-templates.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-templates.js +0 -447
- package/lib/zhin-agent/prompt-templates.js.map +0 -1
- package/lib/zhin-agent/prompt-trace.d.ts +0 -20
- package/lib/zhin-agent/prompt-trace.d.ts.map +0 -1
- package/lib/zhin-agent/prompt-trace.js.map +0 -1
- package/lib/zhin-agent/prompt.d.ts +0 -83
- package/lib/zhin-agent/prompt.d.ts.map +0 -1
- package/lib/zhin-agent/prompt.js +0 -548
- package/lib/zhin-agent/prompt.js.map +0 -1
- package/lib/zhin-agent/session-io.d.ts +0 -37
- package/lib/zhin-agent/session-io.d.ts.map +0 -1
- package/lib/zhin-agent/session-io.js +0 -115
- package/lib/zhin-agent/session-io.js.map +0 -1
- package/lib/zhin-agent/session-message-queue.d.ts +0 -20
- package/lib/zhin-agent/session-message-queue.d.ts.map +0 -1
- package/lib/zhin-agent/session-message-queue.js.map +0 -1
- package/lib/zhin-agent/session-tree-commands.d.ts +0 -5
- package/lib/zhin-agent/session-tree-commands.d.ts.map +0 -1
- package/lib/zhin-agent/session-tree-commands.js +0 -32
- package/lib/zhin-agent/session-tree-commands.js.map +0 -1
- package/lib/zhin-agent/task-continuation.d.ts.map +0 -1
- package/lib/zhin-agent/task-continuation.js.map +0 -1
- package/lib/zhin-agent/text-sanitize.d.ts.map +0 -1
- package/lib/zhin-agent/text-sanitize.js +0 -37
- package/lib/zhin-agent/text-sanitize.js.map +0 -1
- package/lib/zhin-agent/tool-calls-user-format.d.ts.map +0 -1
- package/lib/zhin-agent/tool-calls-user-format.js +0 -138
- package/lib/zhin-agent/tool-calls-user-format.js.map +0 -1
- package/lib/zhin-agent/tool-catalog.d.ts +0 -15
- package/lib/zhin-agent/tool-catalog.d.ts.map +0 -1
- package/lib/zhin-agent/tool-catalog.js +0 -60
- package/lib/zhin-agent/tool-catalog.js.map +0 -1
- package/lib/zhin-agent/tool-orchestration.d.ts +0 -9
- package/lib/zhin-agent/tool-orchestration.d.ts.map +0 -1
- package/lib/zhin-agent/tool-orchestration.js +0 -90
- package/lib/zhin-agent/tool-orchestration.js.map +0 -1
- package/lib/zhin-agent/tool-runtime.d.ts +0 -31
- package/lib/zhin-agent/tool-runtime.d.ts.map +0 -1
- package/lib/zhin-agent/tool-runtime.js +0 -61
- package/lib/zhin-agent/tool-runtime.js.map +0 -1
- package/lib/zhin-agent/tool-search-orchestrator.d.ts +0 -26
- package/lib/zhin-agent/tool-search-orchestrator.d.ts.map +0 -1
- package/lib/zhin-agent/tool-search-orchestrator.js +0 -107
- package/lib/zhin-agent/tool-search-orchestrator.js.map +0 -1
- package/lib/zhin-agent/turn-context.d.ts +0 -9
- package/lib/zhin-agent/turn-context.d.ts.map +0 -1
- package/lib/zhin-agent/turn-context.js +0 -12
- package/lib/zhin-agent/turn-context.js.map +0 -1
- package/lib/zhin-agent/turn-metrics.d.ts +0 -20
- package/lib/zhin-agent/turn-metrics.d.ts.map +0 -1
- package/lib/zhin-agent/turn-metrics.js +0 -28
- package/lib/zhin-agent/turn-metrics.js.map +0 -1
- package/lib/zhin-agent/turn-pipeline.d.ts +0 -12
- package/lib/zhin-agent/turn-pipeline.d.ts.map +0 -1
- package/lib/zhin-agent/turn-pipeline.js +0 -326
- package/lib/zhin-agent/turn-pipeline.js.map +0 -1
- package/lib/zhin-agent/turn-tracker.d.ts.map +0 -1
- package/lib/zhin-agent/turn-tracker.js.map +0 -1
- package/lib/zhin-agent/turn-user-message.d.ts +0 -11
- package/lib/zhin-agent/turn-user-message.d.ts.map +0 -1
- package/lib/zhin-agent/turn-user-message.js +0 -49
- package/lib/zhin-agent/turn-user-message.js.map +0 -1
- package/lib/zhin-agent/web-search-locale-attach.d.ts.map +0 -1
- package/lib/zhin-agent/web-search-locale-attach.js.map +0 -1
- package/lib/zhin-agent/workspace-prompt.d.ts.map +0 -1
- package/lib/zhin-agent/workspace-prompt.js.map +0 -1
- package/lib/zhin-agent/zhin-agent-private.d.ts +0 -90
- package/lib/zhin-agent/zhin-agent-private.d.ts.map +0 -1
- package/lib/zhin-agent/zhin-agent-private.js +0 -4
- package/lib/zhin-agent/zhin-agent-private.js.map +0 -1
- /package/lib/{zhin-agent → context}/model-resolver.d.ts +0 -0
- /package/lib/{zhin-agent → core}/text-sanitize.d.ts +0 -0
- /package/lib/{zhin-agent → core}/tool-calls-user-format.d.ts +0 -0
- /package/lib/{zhin-agent → internal}/phase-trace.js +0 -0
- /package/lib/{zhin-agent → internal}/prompt-trace.js +0 -0
- /package/lib/{zhin-agent → prompt}/prompt-builder.d.ts +0 -0
- /package/lib/{zhin-agent → prompt}/workspace-prompt.d.ts +0 -0
- /package/lib/{zhin-agent → prompt}/workspace-prompt.js +0 -0
- /package/lib/{zhin-agent → tool}/pre-exec.d.ts +0 -0
- /package/lib/{zhin-agent → tool}/pre-exec.js +0 -0
- /package/lib/{zhin-agent → tool}/web-search-locale-attach.d.ts +0 -0
- /package/lib/{zhin-agent → tool}/web-search-locale-attach.js +0 -0
- /package/lib/{zhin-agent → turn}/deferred-auto-continue.js +0 -0
- /package/lib/{zhin-agent → turn}/deferred-delivery.js +0 -0
- /package/lib/{zhin-agent → turn}/prompt-access.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/prompt-access.js +0 -0
- /package/lib/{zhin-agent → turn}/prompt-input.js +0 -0
- /package/lib/{zhin-agent → turn}/session-message-queue.js +0 -0
- /package/lib/{zhin-agent → turn}/task-continuation.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/task-continuation.js +0 -0
- /package/lib/{zhin-agent → turn}/turn-tracker.d.ts +0 -0
- /package/lib/{zhin-agent → turn}/turn-tracker.js +0 -0
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@ Zhin AI Agent 组合层:在 `@zhin.js/core` 的类型与 Provider 之上,提
|
|
|
7
7
|
## 功能特性
|
|
8
8
|
|
|
9
9
|
- 🤖 **agentLoop 统一路径**:ZhinAgent、Subagent、Deferred Worker、AIService 均经 `agentLoop`(legacy `Agent.run` 仅保留在 `@zhin.js/ai` 供单测)
|
|
10
|
-
- 📝
|
|
10
|
+
- 📝 **会话持久化**:`AgentSessionStore` + `ContextRepository` + `ImTranscriptStore`(ADR 0009)
|
|
11
11
|
- 🧠 **ZhinAgent**:与 Zhin 消息流集成的智能体(SOUL/TOOLS/AGENTS、工具收集、执行策略)
|
|
12
|
-
- 🔍 **模型自动发现**:`ModelRegistry` 调用 `listModels()
|
|
12
|
+
- 🔍 **模型自动发现**:`ModelRegistry` 调用 `listModels()`;结果写入 `provider.models` 并供 `getLlmTransportModel()` 校验
|
|
13
13
|
- 🔄 **模型自动降级**:首选模型失败时按 `resolveModelCandidates` 候选链 fallback(文本 / 多模态 / standalone 均走 agentLoop)
|
|
14
14
|
- 🛡️ **6 层 Bash 安全**:`ExecPolicy` 纵深防御(危险黑名单、环境变量剥离、wrapper 剥离、复合命令拆分、只读放行、交互式审批)
|
|
15
15
|
- 📂 **文件访问安全**:`FilePolicy` 路径检查、设备路径拦截、命令读写分类
|
|
@@ -27,6 +27,59 @@ Zhin AI Agent 组合层:在 `@zhin.js/core` 的类型与 Provider 之上,提
|
|
|
27
27
|
- 依赖 **@zhin.js/core**(IM 类型与消息链)与 **@zhin.js/ai**(`agentLoop`、Provider 抽象)
|
|
28
28
|
- **zhin.js 4.x** 主包为 optional peer;运行时通过 `zhin.js/agent` 子路径或本包 import;`bootstrapNode` 在检测到本包时调用 `initAgentModule()`
|
|
29
29
|
|
|
30
|
+
## 模块化架构(理想蓝图 8 模块)
|
|
31
|
+
|
|
32
|
+
迁移完成后,`src/` 按职责拆分为 8 个理想模块 + Orchestration + IM 组合层(单包,可选 subpath export):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
packages/im/agent/src/
|
|
36
|
+
core/ Agent Core — agentLoop 薄适配(ADR 0009)
|
|
37
|
+
tool/ Tool System — Source/Filter、deferred 解析、运行时
|
|
38
|
+
session/ Session System — IM/Agent 双 store、passive group、session-io
|
|
39
|
+
event/ Event System — Agent turn 域事件(不替代 Kernel RunEvent)
|
|
40
|
+
skill/ Skill System — SkillRegistry 统一出口
|
|
41
|
+
memory/ Memory System — Port → ContextRepository + compaction
|
|
42
|
+
subagent/ Subagent System — SubagentSystem + ImResultSink
|
|
43
|
+
context/ Context System — builder/injector 链、tail limit
|
|
44
|
+
prompt/ 系统提示词、assembly、workspace 模板
|
|
45
|
+
turn/ Turn pipeline、inbound 队列、auto-continue、metrics
|
|
46
|
+
config/ ZhinAgent 配置 SSOT、model harness
|
|
47
|
+
orchestrator/ Orchestration Kernel(ADR 0027 SSOT)
|
|
48
|
+
collaboration/ IM 入站/出站(阶段 4)
|
|
49
|
+
inbound-turn-pipeline.ts enrich → peerPolicy → plan → route → outbound
|
|
50
|
+
inbound-turn-enrich.ts 媒体/引用/subagent 通知
|
|
51
|
+
inbound-turn-route.ts Kernel 委派 / spawn / 本地 execute
|
|
52
|
+
inbound-turn-outbound-stage.ts 出站 batch + Kernel 投影
|
|
53
|
+
inbound-turn-endpoint.ts @ ID / aiAccess
|
|
54
|
+
zhin-agent/ ZhinAgent 门面类(单文件 index.ts)
|
|
55
|
+
init/ create-zhin-agent、composeZhinAgentRuntime、configure/dispose 生命周期
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**阶段 4 — `collaboration/` 入站编排子模块**
|
|
59
|
+
|
|
60
|
+
| 文件 | 职责 |
|
|
61
|
+
|------|------|
|
|
62
|
+
| `inbound-turn-pipeline.ts` | enrich → peerPolicy → buildTurnPlan → route → outbound 纯编排 |
|
|
63
|
+
| `inbound-turn-enrich.ts` | 媒体/引用/subagent 通知 enrich |
|
|
64
|
+
| `inbound-turn-route.ts` | Kernel 委派、spawn_task、本地 `executeInboundAgentTurn` |
|
|
65
|
+
| `inbound-turn-outbound-stage.ts` | 出站 batch 解析、IM 发送、Kernel 投影 |
|
|
66
|
+
| `inbound-turn-endpoint.ts` | @ ID / aiAccess 解析 |
|
|
67
|
+
|
|
68
|
+
**Agent Core**:`AgentCore.runText()` / `runVision()` 为 `AsyncGenerator<TurnEvent>` SSOT;`runTextTurn` 为 collector。组合层经 `composeZhinAgentRuntime` 注入 8 模块 + `createAgentCoreDepsForCompose`。
|
|
69
|
+
|
|
70
|
+
Port 边界见 [orchestrator/PORTS.md](./src/orchestrator/PORTS.md)。
|
|
71
|
+
|
|
72
|
+
可选 subpath(`package.json` `exports`):
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { AgentCore } from '@zhin.js/agent/core'
|
|
76
|
+
import { ToolSystem } from '@zhin.js/agent/tool'
|
|
77
|
+
import { SessionSystem } from '@zhin.js/agent/session'
|
|
78
|
+
// …/event、/skill、/memory、/subagent、/context、/prompt、/turn、/config
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
词汇与 Port 边界见 [CONTEXT.md](./CONTEXT.md)、[orchestrator/PORTS.md](./src/orchestrator/PORTS.md)。
|
|
82
|
+
|
|
30
83
|
## 安装
|
|
31
84
|
|
|
32
85
|
```bash
|
|
@@ -46,13 +99,12 @@ pnpm add @ai-sdk/openai # 示例:按厂商安装 provider SDK
|
|
|
46
99
|
import {
|
|
47
100
|
ZhinAgent,
|
|
48
101
|
AIService,
|
|
49
|
-
SessionManager,
|
|
50
102
|
registerAIHook,
|
|
51
103
|
} from 'zhin.js/agent'
|
|
52
104
|
|
|
53
105
|
// 使用 ctx.ai (AIService)
|
|
54
106
|
useContext('ai', async (ai) => {
|
|
55
|
-
const
|
|
107
|
+
const result = await ai.runAgent('你好', { provider: 'ollama' })
|
|
56
108
|
// ...
|
|
57
109
|
})
|
|
58
110
|
```
|
|
@@ -84,17 +136,17 @@ useContext('ai', async (ai) => {
|
|
|
84
136
|
| 初始化 | `initAgentModule` |
|
|
85
137
|
| Agent | `ServiceAgent`、`CreateServiceAgentOptions`(`AIService.createAgent`);legacy `Agent` / `createAgent` re-export 自 `@zhin.js/ai` |
|
|
86
138
|
| Model harness | `MODEL_HARNESS_DEFAULTS`, `resolveModelHarness`, `mergeModelHarnessValues` |
|
|
87
|
-
| 服务与会话 | `AIService
|
|
88
|
-
| ZhinAgent | `ZhinAgent`,以及 config / exec-policy / file-policy / tool
|
|
139
|
+
| 服务与会话 | `AIService`;会话/context 类型见 `@zhin.js/ai`(`ContextRepository`、`AgentSessionStore`、`ImTranscriptStore`) |
|
|
140
|
+
| ZhinAgent | `ZhinAgent`,以及 config / exec-policy / file-policy / `@zhin.js/agent/tool` / prompt / builtin-tools 等 |
|
|
89
141
|
| 安全策略 | `checkExecPolicy`, `applyExecPolicyToTools`, `isDangerousCommand`, `stripEnvVarPrefix`, `stripSafeWrappers`, `splitCompoundCommand`, `extractCommandName`, `ExecPolicyResult`, `checkFileAccess`, `classifyBashCommand`, `isBlockedDevicePath` |
|
|
90
142
|
| 提示词构建 | `buildRichSystemPrompt`, `buildEnhancedPersona`, `buildUserMessageWithHistory`, `buildContextHint` |
|
|
91
|
-
| 上下文与记忆 | `ContextRepository`, `AgentSessionStore`, `ImTranscriptStore
|
|
143
|
+
| 上下文与记忆 | `ContextRepository`, `AgentSessionStore`, `ImTranscriptStore`(`@zhin.js/ai`);`ContextManager`, `ConversationMemory`, `UserProfileStore` |
|
|
92
144
|
| 跟进与定时 | `FollowUpManager`, `PersistentCronEngine`, `createCronTools`, `setCronManager`, `getCronManager` |
|
|
93
145
|
| 压缩与 Bootstrap | `compactSession`, `estimateTokens`, `loadBootstrapFiles`, `loadSoulPersona`, `loadToolsGuide`, `loadAgentsMemory` |
|
|
94
146
|
| Hook | `registerAIHook`, `unregisterAIHook`, `triggerAIHook`, `createAIHookEvent` |
|
|
95
147
|
| IM 内置工具工厂 | `createBuiltinTools`、`BuiltinBaseTool`;具体工具见 `src/builtin/*` |
|
|
96
148
|
| 输出与检测 | `parseOutput`, `renderToPlainText`, `renderToSatori`, `detectTone` |
|
|
97
|
-
| 子代理 | `
|
|
149
|
+
| 子代理 | `SubagentSystem` |
|
|
98
150
|
| 编排 | `AgentOrchestrator`、`ToolRegistry`、`SkillRegistry`、`SubAgentRegistry`、`McpRegistry`、`HookRegistry` |
|
|
99
151
|
| MCP 客户端 | `McpClientManager`、`McpClientConnection`、`mcpToolToAgentTool`、`ensureMcpConnections`(见下方「MCP」) |
|
|
100
152
|
| 限流 | `RateLimiter` |
|
|
@@ -146,11 +198,31 @@ ai:
|
|
|
146
198
|
|
|
147
199
|
### 1. 主 Agent + 子 Agent(内置)
|
|
148
200
|
|
|
149
|
-
框架已提供 **
|
|
201
|
+
框架已提供 **SubagentSystem**:主 ZhinAgent 通过工具 `spawn_task` 把复杂/耗时任务派给**后台子 Agent** 异步执行。子 Agent 使用受限工具集;完成后**先交还主 Agent**(写入主会话 + auto-continue 续聊),用户可见回复由主 Agent 整理发出。
|
|
202
|
+
|
|
203
|
+
- 主对话不阻塞,用户可继续聊天(异步 `spawn_task`)。
|
|
204
|
+
- `spawn_task` 在每轮 `turn-pipeline` 注入(`createSpawnTaskTool`),并默认列入 `deferredTools.alwaysLoadedTools`。
|
|
205
|
+
- **`wait: true`** 时同步等待,结果经 tool result 回到当前主 Agent turn。
|
|
206
|
+
- 监听 `ai.subagent.finish` 可做 log / 监控;需旧式「子任务摘要直推 IM」时设 `ai.agent.subagentDirectImDelivery: true`。
|
|
207
|
+
|
|
208
|
+
**并发与并行(ADR 0030)**
|
|
209
|
+
|
|
210
|
+
| 配置 | 默认 | 说明 |
|
|
211
|
+
|------|------|------|
|
|
212
|
+
| `toolExecution` | `tiered` | 同轮 `spawn_task` + 只读工具并行;写/bash 顺序 |
|
|
213
|
+
| `maxParallelSubagents` | `5` | 并行子 agent 硬顶,超限拒绝 |
|
|
214
|
+
| `subagentAutoContinue` | `true` | 异步完成后唤醒主 Agent |
|
|
215
|
+
| `subagentDirectImDelivery` | `false` | 额外直发格式化摘要到 IM |
|
|
150
216
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
217
|
+
**类型权限**:`ai.agents.<name>.permission.task`(glob → allow/deny)控制主 Agent 可见的子 agent 预设。
|
|
218
|
+
|
|
219
|
+
关键路径:
|
|
220
|
+
|
|
221
|
+
- `src/subagent/` — `SubagentSystem`、`SubagentRuntime`、`onSubagentComplete`
|
|
222
|
+
- `src/builtin/spawn-task-tool.ts` — 工具定义与 `permission.task` 校验
|
|
223
|
+
- `src/turn/persist-subagent-context.ts` / `subagent-auto-continue.ts` — 结果落库与续聊
|
|
224
|
+
- `src/turn/turn-pipeline.ts` — 每轮注入 `spawn_task`
|
|
225
|
+
- `packages/im/ai/src/llm/tiered-tool-buckets.ts` — tiered 并行工具 SSOT
|
|
154
226
|
|
|
155
227
|
无需额外配置即可使用;若需放宽子 Agent 的工具范围,使用 `ai.agent.subagentTools` 显式追加白名单(不会自动继承主会话全部 skill/tool)。
|
|
156
228
|
|
|
@@ -211,7 +283,7 @@ useContext('ai', async (ai) => {
|
|
|
211
283
|
|
|
212
284
|
`AIService` 构造时:
|
|
213
285
|
|
|
214
|
-
1. 按 `ai.providers.<别名>` 实例化 Provider(须配置 `
|
|
286
|
+
1. 按 `ai.providers.<别名>` 实例化 Provider(须配置 `sdk`,如 `openai` 或 `openai-compatible`)。
|
|
215
287
|
2. `registerLlmApiFromProviders`:**未写 `models` 的 provider** 在 ApiRegistry 注册为空白名单,由后台 `ModelRegistry.discover()` 填充 `provider.models`;**写了 `models`** 则用 yaml 白名单。
|
|
216
288
|
3. `createZhinAgent` 启动时 `loadCache()` 先恢复上次发现结果,再异步刷新 `/v1/models`。
|
|
217
289
|
|
|
@@ -221,12 +293,12 @@ useContext('ai', async (ai) => {
|
|
|
221
293
|
ai:
|
|
222
294
|
providers:
|
|
223
295
|
openai-main:
|
|
224
|
-
|
|
296
|
+
sdk: openai-compatible
|
|
225
297
|
baseUrl: ${OPENAI_BASE_URL}
|
|
226
298
|
apiKey: ${OPENAI_API_KEY}
|
|
227
299
|
# models 省略 → 自动 GET /v1/models
|
|
228
300
|
cloudflare-flash:
|
|
229
|
-
|
|
301
|
+
sdk: openai-compatible
|
|
230
302
|
models: ["@cf/zai-org/glm-4.7-flash"] # 显式列表
|
|
231
303
|
agents:
|
|
232
304
|
zhin:
|
|
@@ -238,7 +310,7 @@ ai:
|
|
|
238
310
|
|
|
239
311
|
`AIService` 构造时:
|
|
240
312
|
|
|
241
|
-
1. 按 `ai.providers.<别名>` 实例化 Provider(须配置 `
|
|
313
|
+
1. 按 `ai.providers.<别名>` 实例化 Provider(须配置 `sdk`,如 `openai` 或 `openai-compatible`)。
|
|
242
314
|
2. `registerLlmApiFromProviders`:**未写 `models` 的 provider** 在 ApiRegistry 注册为空白名单,由后台 `ModelRegistry.discover()` 填充 `provider.models`;**写了 `models`** 则用 yaml 白名单。
|
|
243
315
|
3. `createZhinAgent` 启动时 `loadCache()` 先恢复上次发现结果,再异步刷新 `/v1/models`。
|
|
244
316
|
|
|
@@ -248,12 +320,12 @@ ai:
|
|
|
248
320
|
ai:
|
|
249
321
|
providers:
|
|
250
322
|
openai-main:
|
|
251
|
-
|
|
323
|
+
sdk: openai-compatible
|
|
252
324
|
baseUrl: ${OPENAI_BASE_URL}
|
|
253
325
|
apiKey: ${OPENAI_API_KEY}
|
|
254
326
|
# models 省略 → 自动 GET /v1/models
|
|
255
327
|
cloudflare-flash:
|
|
256
|
-
|
|
328
|
+
sdk: openai-compatible
|
|
257
329
|
models: ["@cf/zai-org/glm-4.7-flash"] # 显式列表
|
|
258
330
|
agents:
|
|
259
331
|
zhin:
|
|
@@ -267,7 +339,7 @@ ai:
|
|
|
267
339
|
|
|
268
340
|
**合并顺序**(约定优先,详见 [ADR 0007](../../docs/adr/0007-ai-agent-model-harness-yaml-overrides.md)):
|
|
269
341
|
|
|
270
|
-
1. TypeScript 默认表 `MODEL_HARNESS_DEFAULTS`([`src/
|
|
342
|
+
1. TypeScript 默认表 `MODEL_HARNESS_DEFAULTS`([`src/config/model-harness.ts`](./src/config/model-harness.ts) + [`model-harness-runtime.ts`](./src/config/model-harness-runtime.ts))
|
|
271
343
|
2. YAML `ai.agent.modelHarness.providerPatterns`(匹配当前 provider,支持 `*` 通配;按对象键插入顺序叠加)
|
|
272
344
|
3. YAML `ai.agent.modelHarness.models`(`model` 或 `provider:model` 精确键)
|
|
273
345
|
|
|
@@ -287,7 +359,7 @@ ai:
|
|
|
287
359
|
|
|
288
360
|
运行时由 `resolveModelHarness(providerName, modelName, config?.modelHarness)` 解析;包入口导出 `MODEL_HARNESS_DEFAULTS`、`resolveModelHarness`、`mergeModelHarnessValues` 与 `ModelHarnessConfig` 类型。未命中任何规则时回退 TS 默认行或空对象;当前仅消费 `maxIterations`,未知 YAML 字段会被忽略。
|
|
289
361
|
|
|
290
|
-
增补内置默认值:在 `model-harness.ts` 增加 `ModelHarnessRow` 并附测试;YAML 只做覆盖,不替代 TS 约定层。
|
|
362
|
+
增补内置默认值:在 `config/model-harness.ts` 增加 `ModelHarnessRow` 并附测试;YAML 只做覆盖,不替代 TS 约定层。
|
|
291
363
|
|
|
292
364
|
## IM 管理命令
|
|
293
365
|
|
|
@@ -307,44 +379,45 @@ zhin-package CLI:`zhin packages`(`basic/cli`)。详见 [ADR 0010](../../do
|
|
|
307
379
|
|
|
308
380
|
```
|
|
309
381
|
src/
|
|
310
|
-
├── index.ts #
|
|
382
|
+
├── index.ts # 包根导出:Orchestrator、ZhinAgent、init、builtin…
|
|
383
|
+
│
|
|
384
|
+
├── core/ # Agent Core — agentLoop 薄适配
|
|
385
|
+
├── tool/ # Tool System — 运行时工具收集
|
|
386
|
+
├── session/ # Session System — IM/Agent 双 store、session-io
|
|
387
|
+
├── event/ # Event System — turn 域事件 + session 事件
|
|
388
|
+
├── skill/ # Skill System
|
|
389
|
+
├── memory/ # Memory System
|
|
390
|
+
├── subagent/ # Subagent System + manager init
|
|
391
|
+
├── context/ # Context System — builder/injector、tail limit
|
|
392
|
+
├── prompt/ # 系统提示词、assembly、workspace 模板
|
|
393
|
+
├── turn/ # Turn pipeline、inbound 队列、auto-continue
|
|
394
|
+
├── config/ # ZhinAgent 配置 SSOT、model harness
|
|
311
395
|
│
|
|
312
|
-
├── orchestrator/ # ★
|
|
396
|
+
├── orchestrator/ # ★ 编排中枢(Kernel SSOT,ADR 0027)
|
|
313
397
|
│ ├── index.ts # AgentOrchestrator class
|
|
314
|
-
│ ├── types.ts # ResourceScope,
|
|
315
|
-
│ ├── resource-registry.ts
|
|
316
|
-
│ ├── tool-registry.ts
|
|
317
|
-
│ ├── skill-registry.ts
|
|
318
|
-
│ ├── subagent-registry.ts
|
|
319
|
-
│ ├── mcp-registry.ts
|
|
320
|
-
│ └── hook-registry.ts
|
|
398
|
+
│ ├── types.ts # ResourceScope, Skill, SubAgentDef, AIHook…
|
|
399
|
+
│ ├── resource-registry.ts
|
|
400
|
+
│ ├── tool-registry.ts
|
|
401
|
+
│ ├── skill-registry.ts
|
|
402
|
+
│ ├── subagent-registry.ts
|
|
403
|
+
│ ├── mcp-registry.ts
|
|
404
|
+
│ └── hook-registry.ts
|
|
321
405
|
│
|
|
322
|
-
├── mcp-client/ # MCP
|
|
406
|
+
├── mcp-client/ # MCP 客户端
|
|
323
407
|
│
|
|
324
408
|
├── init.ts # initAgentModule 入口
|
|
325
|
-
├── init/ #
|
|
326
|
-
│
|
|
327
|
-
├── service.ts # AIService(保留,对接 Orchestrator)
|
|
328
|
-
│
|
|
329
|
-
├── zhin-agent/ # 主对话 Agent
|
|
330
|
-
│ ├── index.ts # ZhinAgent(改造:从 Orchestrator 获取资源)
|
|
331
|
-
│ ├── config.ts
|
|
332
|
-
│ ├── prompt.ts
|
|
333
|
-
│ ├── tool-runtime.ts # 运行时工具收集与执行路径规划
|
|
334
|
-
│ └── builtin-tools.ts # chat_history(im_transcripts), user_profile, spawn_task
|
|
409
|
+
├── init/ # create-zhin-agent、compose/configure/dispose 生命周期
|
|
335
410
|
│
|
|
336
|
-
├──
|
|
337
|
-
│ ├── index.ts
|
|
338
|
-
│ ├── utils.ts
|
|
339
|
-
│ ├── tools.ts # *.tool.md 发现
|
|
340
|
-
│ ├── skills.ts # SKILL.md 发现
|
|
341
|
-
│ └── agents.ts # *.agent.md 发现
|
|
411
|
+
├── service.ts # AIService
|
|
342
412
|
│
|
|
343
|
-
├──
|
|
344
|
-
│
|
|
345
|
-
│ └── exec-policy.ts
|
|
413
|
+
├── zhin-agent/ # ZhinAgent 门面类(单文件)
|
|
414
|
+
│ └── index.ts
|
|
346
415
|
│
|
|
347
|
-
├──
|
|
416
|
+
├── internal/ # host 契约、asPrivate、turn-context、phase/prompt trace
|
|
417
|
+
├── collaboration/ # 多 Endpoint 入站/出站
|
|
418
|
+
├── discovery/ # 文件化资源发现(tools / skills / agents)
|
|
419
|
+
├── security/ # exec-policy、file-policy
|
|
420
|
+
├── builtin/ # IM 内置工具
|
|
348
421
|
├── builtin-tools.ts # createBuiltinTools() 聚合
|
|
349
422
|
│
|
|
350
423
|
├── defaults/ # ★ 各注册表的默认资源
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SendMessageRequest } from '@a2a-js/sdk';
|
|
2
|
+
export interface DelegationTaskPayload {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
acceptance_criteria?: string;
|
|
6
|
+
artifacts?: Array<{
|
|
7
|
+
name?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
mime?: string;
|
|
10
|
+
}>;
|
|
11
|
+
role?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildSendMessageRequest(payload: DelegationTaskPayload): SendMessageRequest;
|
|
14
|
+
//# sourceMappingURL=delegation-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-message.d.ts","sourceRoot":"","sources":["../../src/a2a/delegation-message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,kBAAkB,EAAQ,MAAM,aAAa,CAAC;AACvE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,kBAAkB,CA+B1F"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build A2A SendMessageRequest from orchestration task fields.
|
|
3
|
+
*/
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { Role } from '@a2a-js/sdk';
|
|
6
|
+
function textPart(text) {
|
|
7
|
+
return {
|
|
8
|
+
content: { $case: 'text', value: text },
|
|
9
|
+
metadata: undefined,
|
|
10
|
+
filename: '',
|
|
11
|
+
mediaType: 'text/plain',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function dataPart(data) {
|
|
15
|
+
return {
|
|
16
|
+
content: { $case: 'data', value: data },
|
|
17
|
+
metadata: undefined,
|
|
18
|
+
filename: '',
|
|
19
|
+
mediaType: 'application/json',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function buildSendMessageRequest(payload) {
|
|
23
|
+
const parts = [textPart(`# ${payload.title}\n\n${payload.description}`)];
|
|
24
|
+
if (payload.acceptance_criteria?.trim()) {
|
|
25
|
+
parts.push(textPart(`## Acceptance Criteria\n${payload.acceptance_criteria}`));
|
|
26
|
+
}
|
|
27
|
+
if (payload.artifacts?.length) {
|
|
28
|
+
parts.push(dataPart({ artifacts: payload.artifacts }));
|
|
29
|
+
}
|
|
30
|
+
const metadata = {};
|
|
31
|
+
if (payload.role?.trim())
|
|
32
|
+
metadata.skillId = payload.role.trim();
|
|
33
|
+
return {
|
|
34
|
+
tenant: '',
|
|
35
|
+
message: {
|
|
36
|
+
messageId: randomUUID(),
|
|
37
|
+
contextId: '',
|
|
38
|
+
taskId: '',
|
|
39
|
+
role: Role.ROLE_USER,
|
|
40
|
+
parts,
|
|
41
|
+
metadata,
|
|
42
|
+
extensions: [],
|
|
43
|
+
referenceTaskIds: [],
|
|
44
|
+
},
|
|
45
|
+
configuration: {
|
|
46
|
+
acceptedOutputModes: ['text/plain'],
|
|
47
|
+
returnImmediately: true,
|
|
48
|
+
taskPushNotificationConfig: undefined,
|
|
49
|
+
},
|
|
50
|
+
metadata: payload.role ? { skillId: payload.role } : {},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=delegation-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-message.js","sourceRoot":"","sources":["../../src/a2a/delegation-message.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAsC,IAAI,EAAE,MAAM,aAAa,CAAC;AASvE,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO;QACL,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;QACvC,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,YAAY;KACxB,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAa;IAC7B,OAAO;QACL,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;QACvC,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,kBAAkB;KAC9B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAA8B;IACpE,MAAM,KAAK,GAAW,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,KAAK,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACjF,IAAI,OAAO,CAAC,mBAAmB,EAAE,IAAI,EAAE,EAAE,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,2BAA2B,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAC7C,IAAI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE;QAAE,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAEjE,OAAO;QACL,MAAM,EAAE,EAAE;QACV,OAAO,EAAE;YACP,SAAS,EAAE,UAAU,EAAE;YACvB,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,IAAI,CAAC,SAAS;YACpB,KAAK;YACL,QAAQ;YACR,UAAU,EAAE,EAAE;YACd,gBAAgB,EAAE,EAAE;SACrB;QACD,aAAa,EAAE;YACb,mBAAmB,EAAE,CAAC,YAAY,CAAC;YACnC,iBAAiB,EAAE,IAAI;YACvB,0BAA0B,EAAE,SAAS;SACtC;QACD,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map A2A TaskState to remote_mesh poll status strings.
|
|
3
|
+
*/
|
|
4
|
+
import { type Task, TaskState } from '@a2a-js/sdk';
|
|
5
|
+
export type RemotePollStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
6
|
+
export declare function mapA2aTaskState(state: TaskState | string | undefined): RemotePollStatus;
|
|
7
|
+
export declare function extractTaskResultText(task: Task): string;
|
|
8
|
+
export declare function isTerminalA2aState(state: TaskState | string | undefined): boolean;
|
|
9
|
+
//# sourceMappingURL=task-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-state.d.ts","sourceRoot":"","sources":["../../src/a2a/task-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAO5F,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAkBvF;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAiBxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAGjF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map A2A TaskState to remote_mesh poll status strings.
|
|
3
|
+
*/
|
|
4
|
+
import { taskStateToJSON } from '@a2a-js/sdk';
|
|
5
|
+
function stateKey(state) {
|
|
6
|
+
if (state === undefined)
|
|
7
|
+
return '';
|
|
8
|
+
return taskStateToJSON(state);
|
|
9
|
+
}
|
|
10
|
+
export function mapA2aTaskState(state) {
|
|
11
|
+
const key = typeof state === 'string' ? state : stateKey(state);
|
|
12
|
+
switch (key) {
|
|
13
|
+
case 'TASK_STATE_COMPLETED':
|
|
14
|
+
return 'completed';
|
|
15
|
+
case 'TASK_STATE_FAILED':
|
|
16
|
+
return 'failed';
|
|
17
|
+
case 'TASK_STATE_CANCELED':
|
|
18
|
+
return 'cancelled';
|
|
19
|
+
case 'TASK_STATE_SUBMITTED':
|
|
20
|
+
return 'pending';
|
|
21
|
+
case 'TASK_STATE_WORKING':
|
|
22
|
+
case 'TASK_STATE_INPUT_REQUIRED':
|
|
23
|
+
case 'TASK_STATE_AUTH_REQUIRED':
|
|
24
|
+
return 'running';
|
|
25
|
+
default:
|
|
26
|
+
return 'running';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function extractTaskResultText(task) {
|
|
30
|
+
const statusMsg = task.status?.message;
|
|
31
|
+
if (statusMsg?.parts?.length) {
|
|
32
|
+
const text = statusMsg.parts
|
|
33
|
+
.map((p) => (p.content?.$case === 'text' ? p.content.value : ''))
|
|
34
|
+
.join('\n')
|
|
35
|
+
.trim();
|
|
36
|
+
if (text)
|
|
37
|
+
return text;
|
|
38
|
+
}
|
|
39
|
+
for (const artifact of task.artifacts ?? []) {
|
|
40
|
+
const text = artifact.parts
|
|
41
|
+
?.map((p) => (p.content?.$case === 'text' ? p.content.value : ''))
|
|
42
|
+
.join('\n')
|
|
43
|
+
.trim();
|
|
44
|
+
if (text)
|
|
45
|
+
return text;
|
|
46
|
+
}
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
export function isTerminalA2aState(state) {
|
|
50
|
+
const mapped = mapA2aTaskState(state);
|
|
51
|
+
return mapped === 'completed' || mapped === 'failed' || mapped === 'cancelled';
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=task-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-state.js","sourceRoot":"","sources":["../../src/a2a/task-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAwB,eAAe,EAAE,MAAM,aAAa,CAAC;AAGpE,SAAS,QAAQ,CAAC,KAA4B;IAC5C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqC;IACnE,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,sBAAsB;YACzB,OAAO,WAAW,CAAC;QACrB,KAAK,mBAAmB;YACtB,OAAO,QAAQ,CAAC;QAClB,KAAK,qBAAqB;YACxB,OAAO,WAAW,CAAC;QACrB,KAAK,sBAAsB;YACzB,OAAO,SAAS,CAAC;QACnB,KAAK,oBAAoB,CAAC;QAC1B,KAAK,2BAA2B,CAAC;QACjC,KAAK,0BAA0B;YAC7B,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;IACvC,IAAI,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK;aACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAChE,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CAAC;QACV,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;IACxB,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK;YACzB,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aACjE,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CAAC;QACV,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;IACxB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAqC;IACtE,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity Feedback — endpoint 适配器集成(复用 typing-indicator 底层适配器)
|
|
3
|
+
*/
|
|
4
|
+
import type { Adapter, Endpoint } from '@zhin.js/core';
|
|
5
|
+
import { type TypingIndicator, type TypingIndicatorOptions } from '../typing-indicator/index.js';
|
|
6
|
+
import { PLATFORM_FEATURES, buildTypingSendContent, type PlatformFeatures } from '../typing-indicator/adapter-integration.js';
|
|
7
|
+
import { ActivityFeedbackManager } from './manager.js';
|
|
8
|
+
import type { ActivityFeedbackPhase, ResolvedActivityFeedbackPhaseConfig } from './types.js';
|
|
9
|
+
export { PLATFORM_FEATURES, buildTypingSendContent, type PlatformFeatures };
|
|
10
|
+
type OutboundAdapter = Pick<Adapter, 'sendMessage'>;
|
|
11
|
+
export interface PlatformActivityFeedbackStartOptions {
|
|
12
|
+
messageId?: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
userId?: string;
|
|
15
|
+
groupId?: string;
|
|
16
|
+
sceneType: 'private' | 'group';
|
|
17
|
+
phase?: ActivityFeedbackPhase;
|
|
18
|
+
/** 由 service 插件策略层解析;adapter 不再自行 resolve */
|
|
19
|
+
phaseConfig: ResolvedActivityFeedbackPhaseConfig;
|
|
20
|
+
}
|
|
21
|
+
/** 平台自管 Activity Feedback IO(如 ICQQ 群临时私聊 parent) */
|
|
22
|
+
export interface PlatformActivityFeedbackManager {
|
|
23
|
+
start(options: PlatformActivityFeedbackStartOptions): Promise<unknown>;
|
|
24
|
+
stop(options: {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
userId?: string;
|
|
27
|
+
groupId?: string;
|
|
28
|
+
phase?: ActivityFeedbackPhase;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
getActiveIndicator?(phase: ActivityFeedbackPhase, options: TypingIndicatorOptions): TypingIndicator | undefined;
|
|
31
|
+
}
|
|
32
|
+
export type BotActivityFeedbackManager = ActivityFeedbackManager | PlatformActivityFeedbackManager;
|
|
33
|
+
export interface EndpointWithActivityFeedback extends Endpoint {
|
|
34
|
+
$activityFeedback?: BotActivityFeedbackManager;
|
|
35
|
+
$addReaction?(messageId: string, emoji: string, hint?: {
|
|
36
|
+
sceneType?: 'private' | 'group' | 'channel';
|
|
37
|
+
channelId?: string;
|
|
38
|
+
}): Promise<string | null>;
|
|
39
|
+
$removeReaction?(messageId: string, reactionId: string): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export declare class AdapterActivityFeedbackManager {
|
|
42
|
+
private managers;
|
|
43
|
+
enableForEndpoint(endpoint: EndpointWithActivityFeedback, platform: string, outbound?: OutboundAdapter): ActivityFeedbackManager;
|
|
44
|
+
getManager(platform: string, endpointId: string): ActivityFeedbackManager | undefined;
|
|
45
|
+
stopAll(platform: string, endpointId: string): Promise<void>;
|
|
46
|
+
clearAll(): void;
|
|
47
|
+
}
|
|
48
|
+
export declare function getAdapterActivityFeedbackManager(): AdapterActivityFeedbackManager;
|
|
49
|
+
export declare function initAdapterActivityFeedbackManager(): AdapterActivityFeedbackManager;
|
|
50
|
+
export declare function enableActivityFeedbackForBot(endpoint: EndpointWithActivityFeedback, platform: string, outbound?: OutboundAdapter): ActivityFeedbackManager;
|
|
51
|
+
export declare function isGenericActivityFeedbackManager(manager: BotActivityFeedbackManager): manager is ActivityFeedbackManager;
|
|
52
|
+
//# sourceMappingURL=adapter-integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-integration.d.ts","sourceRoot":"","sources":["../../src/activity-feedback/adapter-integration.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;AACpE,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAE5E,KAAK,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AA+CpD,MAAM,WAAW,oCAAoC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,6CAA6C;IAC7C,WAAW,EAAE,mCAAmC,CAAC;CAClD;AAED,qDAAqD;AACrD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,CAAC,OAAO,EAAE,oCAAoC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,qBAAqB,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,kBAAkB,CAAC,CACjB,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,sBAAsB,GAC9B,eAAe,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,GAAG,+BAA+B,CAAC;AAEnG,MAAM,WAAW,4BAA6B,SAAQ,QAAQ;IAC5D,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;IAC/C,YAAY,CAAC,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GACzE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1B,eAAe,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AAqDD,qBAAa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAA8C;IAE9D,iBAAiB,CACf,QAAQ,EAAE,4BAA4B,EACtC,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,eAAe,GACzB,uBAAuB;IAoB1B,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAI/E,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,QAAQ,IAAI,IAAI;CAGjB;AAID,wBAAgB,iCAAiC,IAAI,8BAA8B,CAKlF;AAED,wBAAgB,kCAAkC,IAAI,8BAA8B,CAGnF;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,4BAA4B,EACtC,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,eAAe,GACzB,uBAAuB,CAEzB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,0BAA0B,GAClC,OAAO,IAAI,uBAAuB,CAEpC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity Feedback — endpoint 适配器集成(复用 typing-indicator 底层适配器)
|
|
3
|
+
*/
|
|
4
|
+
import { ReactionTypingIndicatorAdapter, GenericTypingIndicatorAdapter, } from '../typing-indicator/index.js';
|
|
5
|
+
import { PLATFORM_FEATURES, buildTypingSendContent, } from '../typing-indicator/adapter-integration.js';
|
|
6
|
+
import { ActivityFeedbackManager } from './manager.js';
|
|
7
|
+
export { PLATFORM_FEATURES, buildTypingSendContent };
|
|
8
|
+
function resolveSendTarget(options) {
|
|
9
|
+
if ((options.sceneType === 'group' || options.sceneType === 'channel') && options.groupId) {
|
|
10
|
+
return { type: 'group', id: options.groupId };
|
|
11
|
+
}
|
|
12
|
+
if (options.sceneType === 'private') {
|
|
13
|
+
if (options.groupId) {
|
|
14
|
+
return { type: 'private', id: options.groupId };
|
|
15
|
+
}
|
|
16
|
+
if (options.userId) {
|
|
17
|
+
return { type: 'private', id: options.userId };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const parts = (options.sessionId ?? '').split(':').filter((p) => p.length > 0);
|
|
21
|
+
if (parts.length >= 3)
|
|
22
|
+
return { type: 'group', id: parts[1] };
|
|
23
|
+
if (parts.length >= 2)
|
|
24
|
+
return { type: 'private', id: parts[parts.length - 1] };
|
|
25
|
+
return { type: 'private', id: options.sessionId ?? '' };
|
|
26
|
+
}
|
|
27
|
+
function createOutboundSendMessage(endpoint, platform, outbound) {
|
|
28
|
+
return async (options, content) => {
|
|
29
|
+
try {
|
|
30
|
+
const segments = buildTypingSendContent(platform, options, content);
|
|
31
|
+
if (!segments)
|
|
32
|
+
return null;
|
|
33
|
+
const { type, id } = resolveSendTarget(options);
|
|
34
|
+
const sendOptions = {
|
|
35
|
+
type,
|
|
36
|
+
id,
|
|
37
|
+
context: platform,
|
|
38
|
+
endpoint: endpoint.$id,
|
|
39
|
+
content: segments,
|
|
40
|
+
};
|
|
41
|
+
if (outbound)
|
|
42
|
+
return await outbound.sendMessage(sendOptions);
|
|
43
|
+
console.error(`[${platform}] Activity feedback requires Adapter.sendMessage; endpoint ${endpoint.$id} has no outbound adapter`);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(`[${platform}] Failed to send activity feedback message:`, error);
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function registerPlatformAdapters(manager, endpoint, platform, features, outbound) {
|
|
53
|
+
const sendMessage = createOutboundSendMessage(endpoint, platform, outbound);
|
|
54
|
+
if (features.supportsReaction && endpoint.$addReaction && endpoint.$removeReaction) {
|
|
55
|
+
manager.registerAdapter(new ReactionTypingIndicatorAdapter(platform, async (messageId, emoji, options) => {
|
|
56
|
+
try {
|
|
57
|
+
return await endpoint.$addReaction(messageId, emoji, {
|
|
58
|
+
sceneType: options.sceneType,
|
|
59
|
+
channelId: options.groupId,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error(`[${platform}] Failed to add reaction:`, error);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}, async (messageId, reactionId) => {
|
|
67
|
+
try {
|
|
68
|
+
await endpoint.$removeReaction(messageId, reactionId);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.error(`[${platform}] Failed to remove reaction:`, error);
|
|
72
|
+
}
|
|
73
|
+
}, sendMessage, async (messageId) => { await endpoint.$recallMessage(messageId); }, async (messageId, content) => {
|
|
74
|
+
const editBot = endpoint;
|
|
75
|
+
if (typeof editBot.$editMessage === 'function')
|
|
76
|
+
await editBot.$editMessage(messageId, content);
|
|
77
|
+
else if (typeof editBot.$updateMessage === 'function')
|
|
78
|
+
await editBot.$updateMessage(messageId, content);
|
|
79
|
+
}));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
manager.registerAdapter(new GenericTypingIndicatorAdapter(platform, sendMessage, async (messageId) => { await endpoint.$recallMessage(messageId); }, async (messageId, content) => {
|
|
83
|
+
const editBot = endpoint;
|
|
84
|
+
if (typeof editBot.$editMessage === 'function')
|
|
85
|
+
await editBot.$editMessage(messageId, content);
|
|
86
|
+
else if (typeof editBot.$updateMessage === 'function')
|
|
87
|
+
await editBot.$updateMessage(messageId, content);
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
export class AdapterActivityFeedbackManager {
|
|
91
|
+
managers = new Map();
|
|
92
|
+
enableForEndpoint(endpoint, platform, outbound) {
|
|
93
|
+
const botKey = `${platform}:${endpoint.$id}`;
|
|
94
|
+
if (this.managers.has(botKey)) {
|
|
95
|
+
return this.managers.get(botKey);
|
|
96
|
+
}
|
|
97
|
+
const features = PLATFORM_FEATURES[platform] ?? {
|
|
98
|
+
platform,
|
|
99
|
+
supportsReaction: false,
|
|
100
|
+
supportsEdit: false,
|
|
101
|
+
supportsDelete: true,
|
|
102
|
+
supportsTyping: false,
|
|
103
|
+
defaultType: 'message',
|
|
104
|
+
};
|
|
105
|
+
const manager = new ActivityFeedbackManager();
|
|
106
|
+
registerPlatformAdapters(manager, endpoint, platform, features, outbound);
|
|
107
|
+
this.managers.set(botKey, manager);
|
|
108
|
+
endpoint.$activityFeedback = manager;
|
|
109
|
+
return manager;
|
|
110
|
+
}
|
|
111
|
+
getManager(platform, endpointId) {
|
|
112
|
+
return this.managers.get(`${platform}:${endpointId}`);
|
|
113
|
+
}
|
|
114
|
+
async stopAll(platform, endpointId) {
|
|
115
|
+
await this.managers.get(`${platform}:${endpointId}`)?.stopAll();
|
|
116
|
+
}
|
|
117
|
+
clearAll() {
|
|
118
|
+
this.managers.clear();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
let globalAdapterManager = null;
|
|
122
|
+
export function getAdapterActivityFeedbackManager() {
|
|
123
|
+
if (!globalAdapterManager) {
|
|
124
|
+
globalAdapterManager = new AdapterActivityFeedbackManager();
|
|
125
|
+
}
|
|
126
|
+
return globalAdapterManager;
|
|
127
|
+
}
|
|
128
|
+
export function initAdapterActivityFeedbackManager() {
|
|
129
|
+
globalAdapterManager = new AdapterActivityFeedbackManager();
|
|
130
|
+
return globalAdapterManager;
|
|
131
|
+
}
|
|
132
|
+
export function enableActivityFeedbackForBot(endpoint, platform, outbound) {
|
|
133
|
+
return getAdapterActivityFeedbackManager().enableForEndpoint(endpoint, platform, outbound);
|
|
134
|
+
}
|
|
135
|
+
export function isGenericActivityFeedbackManager(manager) {
|
|
136
|
+
return manager instanceof ActivityFeedbackManager;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=adapter-integration.js.map
|