@tencent-ai/agent-sdk 0.3.263-dev.90f0e98.202609190050 → 0.3.263
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/cli/dist/codebuddy-headless.js +1 -1
- package/cli/dist/codebuddy-lite-wb.mjs +1 -1
- package/cli/dist-server/codebuddy.js +1 -1
- package/cli/dist-server/types/node/references/index.d.ts +2 -0
- package/cli/dist-server/types/node/settings/settings-controller.d.ts +23 -0
- package/cli/dist-server/types/node/settings/settings-validate-middleware.d.ts +9 -0
- package/cli/dist-server/types/node/utils/compress-path.source.d.ts +59 -0
- package/cli/package.json +2 -3
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +2 -2
- package/cli/product.selfhosted.json +2 -2
- package/package.json +2 -3
- package/cli/dist-server/types/node/a2a/a2a-artifact-download-service.d.ts +0 -51
- package/cli/dist-server/types/node/a2a/a2a-context-store.d.ts +0 -100
- package/cli/dist-server/types/node/a2a/a2a-remote-cancel.d.ts +0 -111
- package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
- package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
- package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
- package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
- package/cli/dist-server/types/node/agent/agent-config-cli-fields.d.ts +0 -57
- package/cli/dist-server/types/node/agent/agent-controller.d.ts +0 -127
- package/cli/dist-server/types/node/agent/agent-display.d.ts +0 -77
- package/cli/dist-server/types/node/agent/agent-runtime-adapter.d.ts +0 -69
- package/cli/dist-server/types/node/agent/custom-agent-identity.d.ts +0 -54
- package/cli/dist-server/types/node/agent/custom-agent-manager.d.ts +0 -43
- package/cli/dist-server/types/node/agent/custom-agent-path-registry.d.ts +0 -19
- package/cli/dist-server/types/node/agent/insights-data-agent-run-interceptor.d.ts +0 -67
- package/cli/dist-server/types/node/agent/interceptor-name-registry.d.ts +0 -4
- package/cli/dist-server/types/node/agent/interceptors/channel-event-interceptor.d.ts +0 -44
- package/cli/dist-server/types/node/agent/interceptors/command-interceptors.d.ts +0 -71
- package/cli/dist-server/types/node/agent/interceptors/deep-research-pending-interceptor.d.ts +0 -30
- package/cli/dist-server/types/node/agent/interceptors/env-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/agent/interceptors/file-interceptors.d.ts +0 -38
- package/cli/dist-server/types/node/agent/interceptors/image-interceptors.d.ts +0 -47
- package/cli/dist-server/types/node/agent/interceptors/index.d.ts +0 -15
- package/cli/dist-server/types/node/agent/interceptors/initial-prompt-interceptor.d.ts +0 -29
- package/cli/dist-server/types/node/agent/interceptors/model-interceptors.d.ts +0 -43
- package/cli/dist-server/types/node/agent/interceptors/sandbox-interceptor.d.ts +0 -68
- package/cli/dist-server/types/node/agent/interceptors/sensitive-user-input-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/agent/interceptors/system-reminder-interceptor.d.ts +0 -76
- package/cli/dist-server/types/node/agent/interceptors/team-resume-intent-interceptor.d.ts +0 -31
- package/cli/dist-server/types/node/agent/interceptors/telemetry-interceptors.d.ts +0 -43
- package/cli/dist-server/types/node/agent/interceptors/ultracode-effort-reminder-interceptor.d.ts +0 -21
- package/cli/dist-server/types/node/agent/interceptors/ultracode-keyword-interceptor.d.ts +0 -34
- package/cli/dist-server/types/node/agent/main-agent-acp-handler.d.ts +0 -203
- package/cli/dist-server/types/node/agent/main-agent-policy.d.ts +0 -33
- package/cli/dist-server/types/node/agent/memory-context-interceptor.d.ts +0 -84
- package/cli/dist-server/types/node/agent/stream-json-init-interceptor.d.ts +0 -9
- package/cli/dist-server/types/node/agent/subagent-limits.d.ts +0 -75
- package/cli/dist-server/types/node/agent/team-context-interceptor.d.ts +0 -42
- package/cli/dist-server/types/node/agent/team-resume-intent.d.ts +0 -20
- package/cli/dist-server/types/node/agent/teammate-failure-interceptor.d.ts +0 -67
- package/cli/dist-server/types/node/agent-home/agent-home-acp-forward.d.ts +0 -11
- package/cli/dist-server/types/node/agent-home/agent-home-agent-create.d.ts +0 -31
- package/cli/dist-server/types/node/agent-home/agent-home-audit.d.ts +0 -54
- package/cli/dist-server/types/node/agent-home/agent-home-channel-context.d.ts +0 -44
- package/cli/dist-server/types/node/agent-home/agent-home-channel-create.d.ts +0 -73
- package/cli/dist-server/types/node/agent-home/agent-home-channel-events.d.ts +0 -8
- package/cli/dist-server/types/node/agent-home/agent-home-channel-lookup.d.ts +0 -30
- package/cli/dist-server/types/node/agent-home/agent-home-channel-speech.d.ts +0 -72
- package/cli/dist-server/types/node/agent-home/agent-home-channel-task-events.d.ts +0 -45
- package/cli/dist-server/types/node/agent-home/agent-home-channel-task-order.d.ts +0 -25
- package/cli/dist-server/types/node/agent-home/agent-home-channel-tasks.d.ts +0 -156
- package/cli/dist-server/types/node/agent-home/agent-home-channel-wake-guard.d.ts +0 -35
- package/cli/dist-server/types/node/agent-home/agent-home-channel-wake.d.ts +0 -102
- package/cli/dist-server/types/node/agent-home/agent-home-colleague-job.d.ts +0 -37
- package/cli/dist-server/types/node/agent-home/agent-home-colleague-memory.d.ts +0 -52
- package/cli/dist-server/types/node/agent-home/agent-home-deliver.d.ts +0 -76
- package/cli/dist-server/types/node/agent-home/agent-home-directory-lock.d.ts +0 -22
- package/cli/dist-server/types/node/agent-home/agent-home-errors.d.ts +0 -17
- package/cli/dist-server/types/node/agent-home/agent-home-inbox.d.ts +0 -101
- package/cli/dist-server/types/node/agent-home/agent-home-main-session.d.ts +0 -33
- package/cli/dist-server/types/node/agent-home/agent-home-recipients.d.ts +0 -38
- package/cli/dist-server/types/node/agent-home/agent-home-room-context-interceptor.d.ts +0 -30
- package/cli/dist-server/types/node/agent-home/agent-home-runtime-arm-state.d.ts +0 -14
- package/cli/dist-server/types/node/agent-home/agent-home-runtime.d.ts +0 -87
- package/cli/dist-server/types/node/agent-home/agent-home-settings.d.ts +0 -39
- package/cli/dist-server/types/node/agent-home/agent-home-tool-gate.d.ts +0 -53
- package/cli/dist-server/types/node/agent-home/channel-wake-service.d.ts +0 -69
- package/cli/dist-server/types/node/agent-task/categorize-failure.d.ts +0 -65
- package/cli/dist-server/types/node/agent-team/shutdown-coordinator.d.ts +0 -98
- package/cli/dist-server/types/node/agent-team/team-runtime-adopter.d.ts +0 -13
- package/cli/dist-server/types/node/agent-team/team-runtime-manifest.d.ts +0 -66
- package/cli/dist-server/types/node/agent-team/team-runtime-status.d.ts +0 -34
- package/cli/dist-server/types/node/agent-view/agent-view-actions.d.ts +0 -205
- package/cli/dist-server/types/node/agent-view/job-reclaim-gate.d.ts +0 -13
- package/cli/dist-server/types/node/ask/index.d.ts +0 -3
- package/cli/dist-server/types/node/bash-sandbox/index.d.ts +0 -4
- package/cli/dist-server/types/node/code-ratio/cli-git-commit-watcher.d.ts +0 -159
- package/cli/dist-server/types/node/code-ratio/cli-svn-commit-watcher.d.ts +0 -111
- package/cli/dist-server/types/node/code-ratio/code-ratio-reporting-service.d.ts +0 -90
- package/cli/dist-server/types/node/code-ratio/fs-file-reader.d.ts +0 -26
- package/cli/dist-server/types/node/code-ratio/index.d.ts +0 -5
- package/cli/dist-server/types/node/code-ratio/repo-discovery.d.ts +0 -32
- package/cli/dist-server/types/node/code-ratio/vcs-repo-resolver.d.ts +0 -51
- package/cli/dist-server/types/node/control-signal/stdout-writer.d.ts +0 -99
- package/cli/dist-server/types/node/elicitation/elicitation-service.d.ts +0 -100
- package/cli/dist-server/types/node/hooks/admin-trusted.d.ts +0 -41
- package/cli/dist-server/types/node/http/api-galileo-metrics.d.ts +0 -19
- package/cli/dist-server/types/node/http/classify-network-error.d.ts +0 -21
- package/cli/dist-server/types/node/http/custom-header-http-interceptor.d.ts +0 -14
- package/cli/dist-server/types/node/http/fetch-proxy.d.ts +0 -22
- package/cli/dist-server/types/node/http/http-proxy-interceptor.d.ts +0 -74
- package/cli/dist-server/types/node/http/index.d.ts +0 -6
- package/cli/dist-server/types/node/http/workbuddy-config-dir.d.ts +0 -17
- package/cli/dist-server/types/node/lsp/index.d.ts +0 -6
- package/cli/dist-server/types/node/lsp/lsp-client.d.ts +0 -104
- package/cli/dist-server/types/node/lsp/lsp-exit-registry.d.ts +0 -16
- package/cli/dist-server/types/node/lsp/lsp-manager.d.ts +0 -91
- package/cli/dist-server/types/node/lsp/lsp-protocol.d.ts +0 -245
- package/cli/dist-server/types/node/model/effort-capabilities.d.ts +0 -64
- package/cli/dist-server/types/node/model/passthrough-header-policy.d.ts +0 -25
- package/cli/dist-server/types/node/multitask/completion-bus.d.ts +0 -36
- package/cli/dist-server/types/node/multitask/coordinator-acp-bridge.d.ts +0 -41
- package/cli/dist-server/types/node/multitask/coordinator-interceptor.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/coordinator-tool-policy.d.ts +0 -18
- package/cli/dist-server/types/node/multitask/delegation-planner.d.ts +0 -6
- package/cli/dist-server/types/node/multitask/entry-guard.d.ts +0 -12
- package/cli/dist-server/types/node/multitask/host-api.d.ts +0 -63
- package/cli/dist-server/types/node/multitask/inspect-self-tool.d.ts +0 -18
- package/cli/dist-server/types/node/multitask/multitask-log.d.ts +0 -2
- package/cli/dist-server/types/node/multitask/multitask-metrics.d.ts +0 -2
- package/cli/dist-server/types/node/multitask/planner-runtime.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/sandbox-reveal.d.ts +0 -35
- package/cli/dist-server/types/node/multitask/self-model.d.ts +0 -7
- package/cli/dist-server/types/node/multitask/slash-entry.d.ts +0 -14
- package/cli/dist-server/types/node/multitask/spawn-detached.d.ts +0 -9
- package/cli/dist-server/types/node/multitask/subagent-alias.d.ts +0 -5
- package/cli/dist-server/types/node/multitask/surface-reminder.d.ts +0 -5
- package/cli/dist-server/types/node/multitask/types.d.ts +0 -123
- package/cli/dist-server/types/node/multitask/wakeup-gate.d.ts +0 -21
- package/cli/dist-server/types/node/navigation/index.d.ts +0 -2
- package/cli/dist-server/types/node/runtime/add-dir-middleware.d.ts +0 -13
- package/cli/dist-server/types/node/runtime/external-uri-opener.d.ts +0 -8
- package/cli/dist-server/types/node/runtime/file-local-storage.d.ts +0 -17
- package/cli/dist-server/types/node/runtime/workspace-folder-manager.d.ts +0 -45
- package/cli/dist-server/types/node/runtime/workspace.d.ts +0 -5
- package/cli/dist-server/types/node/sandbox-cli/network-block-records.d.ts +0 -18
- package/cli/dist-server/types/node/shortcut/shortcut-protocol.d.ts +0 -41
- package/cli/dist-server/types/node/stats/index.d.ts +0 -5
- package/cli/dist-server/types/node/tools/a2a-cancel-task-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/a2a-get-agent-card-tool.d.ts +0 -59
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +0 -316
- package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +0 -46
- package/cli/dist-server/types/node/tools/a2a-send-message-tool.d.ts +0 -138
- package/cli/dist-server/types/node/tools/a2a-tool-guards.d.ts +0 -48
- package/cli/dist-server/types/node/tools/agent-tool.d.ts +0 -154
- package/cli/dist-server/types/node/tools/artifact-common.d.ts +0 -80
- package/cli/dist-server/types/node/tools/artifact-control-tool.d.ts +0 -103
- package/cli/dist-server/types/node/tools/artifact-tool.d.ts +0 -109
- package/cli/dist-server/types/node/tools/ask-user-for-structured-input-tool.d.ts +0 -127
- package/cli/dist-server/types/node/tools/ask-user-question-tool.d.ts +0 -237
- package/cli/dist-server/types/node/tools/ask-user-question-validation.d.ts +0 -22
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -21
- package/cli/dist-server/types/node/tools/auto-mode/index.d.ts +0 -15
- package/cli/dist-server/types/node/tools/background-output-files.d.ts +0 -39
- package/cli/dist-server/types/node/tools/background-output-tail-poller.d.ts +0 -60
- package/cli/dist-server/types/node/tools/bash-output-tool.d.ts +0 -34
- package/cli/dist-server/types/node/tools/bash-sandbox-approval-requester.d.ts +0 -48
- package/cli/dist-server/types/node/tools/bash-security-windows.d.ts +0 -34
- package/cli/dist-server/types/node/tools/bash-tool.d.ts +0 -204
- package/cli/dist-server/types/node/tools/channel-tasks-tool.d.ts +0 -174
- package/cli/dist-server/types/node/tools/computer-use-capabilities.d.ts +0 -23
- package/cli/dist-server/types/node/tools/computer-use-executor.d.ts +0 -130
- package/cli/dist-server/types/node/tools/computer-use-tool.d.ts +0 -86
- package/cli/dist-server/types/node/tools/create-channel-tool.d.ts +0 -82
- package/cli/dist-server/types/node/tools/create-colleague-tool.d.ts +0 -64
- package/cli/dist-server/types/node/tools/create-mode-write-guard.d.ts +0 -3
- package/cli/dist-server/types/node/tools/cron-create-tool.d.ts +0 -41
- package/cli/dist-server/types/node/tools/cron-delete-tool.d.ts +0 -28
- package/cli/dist-server/types/node/tools/cron-list-tool.d.ts +0 -27
- package/cli/dist-server/types/node/tools/defer-execute-tool.d.ts +0 -260
- package/cli/dist-server/types/node/tools/delegate-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/edit-tool.d.ts +0 -78
- package/cli/dist-server/types/node/tools/enter-planmode-tool.d.ts +0 -29
- package/cli/dist-server/types/node/tools/enter-worktree-tool.d.ts +0 -59
- package/cli/dist-server/types/node/tools/exit-planmode-tool.d.ts +0 -86
- package/cli/dist-server/types/node/tools/file-action-report-utils.d.ts +0 -35
- package/cli/dist-server/types/node/tools/glob-tool.d.ts +0 -102
- package/cli/dist-server/types/node/tools/grep-tool.d.ts +0 -141
- package/cli/dist-server/types/node/tools/image-edit-tool.d.ts +0 -94
- package/cli/dist-server/types/node/tools/image-gen-tool.d.ts +0 -107
- package/cli/dist-server/types/node/tools/kill-shell-tool.d.ts +0 -27
- package/cli/dist-server/types/node/tools/leave-worktree-tool.d.ts +0 -54
- package/cli/dist-server/types/node/tools/list-colleagues-tool.d.ts +0 -35
- package/cli/dist-server/types/node/tools/list-mcp-resources-tool.d.ts +0 -58
- package/cli/dist-server/types/node/tools/lsp-tool.d.ts +0 -68
- package/cli/dist-server/types/node/tools/main-agent-meta-tools.d.ts +0 -107
- package/cli/dist-server/types/node/tools/malicious-block-guidance.d.ts +0 -11
- package/cli/dist-server/types/node/tools/memory-tool.d.ts +0 -33
- package/cli/dist-server/types/node/tools/message-colleague-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/monitor-tool.d.ts +0 -216
- package/cli/dist-server/types/node/tools/monitor-ws-network-policy.d.ts +0 -64
- package/cli/dist-server/types/node/tools/monitor-ws-source.d.ts +0 -72
- package/cli/dist-server/types/node/tools/multi-edit-tool.d.ts +0 -104
- package/cli/dist-server/types/node/tools/notebook-edit-tool.d.ts +0 -75
- package/cli/dist-server/types/node/tools/notebook-read-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/notebook-write-tool.d.ts +0 -7
- package/cli/dist-server/types/node/tools/powershell-clm-types.d.ts +0 -30
- package/cli/dist-server/types/node/tools/powershell-command-semantics.d.ts +0 -23
- package/cli/dist-server/types/node/tools/powershell-dangerous-cmdlets.d.ts +0 -72
- package/cli/dist-server/types/node/tools/powershell-destructive-warning.d.ts +0 -12
- package/cli/dist-server/types/node/tools/powershell-detection.d.ts +0 -51
- package/cli/dist-server/types/node/tools/powershell-git-safety.d.ts +0 -60
- package/cli/dist-server/types/node/tools/powershell-pty-utils.d.ts +0 -13
- package/cli/dist-server/types/node/tools/powershell-security.d.ts +0 -93
- package/cli/dist-server/types/node/tools/powershell-tool.d.ts +0 -174
- package/cli/dist-server/types/node/tools/product-interaction-tools.d.ts +0 -23
- package/cli/dist-server/types/node/tools/push-notification-tool.d.ts +0 -55
- package/cli/dist-server/types/node/tools/read-mcp-resource-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/read-state-guard.d.ts +0 -22
- package/cli/dist-server/types/node/tools/read-tool.d.ts +0 -71
- package/cli/dist-server/types/node/tools/repl/index.d.ts +0 -10
- package/cli/dist-server/types/node/tools/repl/repl-bridge-broker.d.ts +0 -109
- package/cli/dist-server/types/node/tools/repl/repl-bridge-host.d.ts +0 -29
- package/cli/dist-server/types/node/tools/repl/repl-catalog-protocol.d.ts +0 -136
- package/cli/dist-server/types/node/tools/repl/repl-catalog-render.d.ts +0 -56
- package/cli/dist-server/types/node/tools/repl/repl-catalog-source.d.ts +0 -117
- package/cli/dist-server/types/node/tools/repl/repl-import-rewrite.d.ts +0 -17
- package/cli/dist-server/types/node/tools/repl/repl-nested-interaction.d.ts +0 -32
- package/cli/dist-server/types/node/tools/repl/repl-sandbox-result.d.ts +0 -111
- package/cli/dist-server/types/node/tools/repl/repl-tool.d.ts +0 -128
- package/cli/dist-server/types/node/tools/repl/repl-worker-manager.d.ts +0 -95
- package/cli/dist-server/types/node/tools/repl/repl-worker-source.d.ts +0 -16
- package/cli/dist-server/types/node/tools/repl/repl-worker-source.generated.d.ts +0 -2
- package/cli/dist-server/types/node/tools/report-findings-tool.d.ts +0 -97
- package/cli/dist-server/types/node/tools/running-background-tasks.d.ts +0 -26
- package/cli/dist-server/types/node/tools/sandbox-approval-helpers.d.ts +0 -19
- package/cli/dist-server/types/node/tools/sandbox-intercept-message.d.ts +0 -22
- package/cli/dist-server/types/node/tools/sandbox-network-intercept-message.d.ts +0 -25
- package/cli/dist-server/types/node/tools/sandbox-permission-file-tool.d.ts +0 -14
- package/cli/dist-server/types/node/tools/sandbox-program-blacklist-message.d.ts +0 -9
- package/cli/dist-server/types/node/tools/send-message-tool.d.ts +0 -116
- package/cli/dist-server/types/node/tools/send-user-message-attachments.d.ts +0 -22
- package/cli/dist-server/types/node/tools/send-user-message-tool.d.ts +0 -60
- package/cli/dist-server/types/node/tools/shell-stream-pusher.d.ts +0 -25
- package/cli/dist-server/types/node/tools/skill-manage-tool.d.ts +0 -77
- package/cli/dist-server/types/node/tools/skill-tool.d.ts +0 -129
- package/cli/dist-server/types/node/tools/slash-command-tool.d.ts +0 -45
- package/cli/dist-server/types/node/tools/speak-in-channel-tool.d.ts +0 -178
- package/cli/dist-server/types/node/tools/structured-output-tool.d.ts +0 -43
- package/cli/dist-server/types/node/tools/task-create-tool.d.ts +0 -72
- package/cli/dist-server/types/node/tools/task-get-tool.d.ts +0 -31
- package/cli/dist-server/types/node/tools/task-list-tool.d.ts +0 -21
- package/cli/dist-server/types/node/tools/task-output-tool.d.ts +0 -127
- package/cli/dist-server/types/node/tools/task-stop-tool.d.ts +0 -61
- package/cli/dist-server/types/node/tools/task-update-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/team-delete-tool.d.ts +0 -38
- package/cli/dist-server/types/node/tools/todo-write-tool.d.ts +0 -117
- package/cli/dist-server/types/node/tools/tool-permission-strategy.d.ts +0 -83
- package/cli/dist-server/types/node/tools/tool-search-tool.d.ts +0 -113
- package/cli/dist-server/types/node/tools/video-gen-tool.d.ts +0 -82
- package/cli/dist-server/types/node/tools/wait-for-mcp-servers-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/web-fetch-tool.d.ts +0 -164
- package/cli/dist-server/types/node/tools/web-search-tool.d.ts +0 -79
- package/cli/dist-server/types/node/tools/webfetch-resource-kind.d.ts +0 -25
- package/cli/dist-server/types/node/tools/wechat-reply-tool.d.ts +0 -43
- package/cli/dist-server/types/node/tools/wecom-reply-tool.d.ts +0 -65
- package/cli/dist-server/types/node/tools/workflow-tool.d.ts +0 -100
- package/cli/dist-server/types/node/tools/write-tool.d.ts +0 -74
- package/cli/dist-server/types/node/utils/stdio-persistence.d.ts +0 -39
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 同事(Agent Home colleague job)的记忆落点与共享层。
|
|
3
|
-
*
|
|
4
|
-
* ## 为什么分区
|
|
5
|
-
*
|
|
6
|
-
* 对齐上游 sand-memory 的 shard per assistant:上游把记忆按 agent 分目录,注释里
|
|
7
|
-
* 写明了意图——"one shard folder per assistant so every file has a single writer"。
|
|
8
|
-
*
|
|
9
|
-
* 我们原来的记忆目录只按 cwd 分(`projects/{projectId}/memory/`):同一个仓库下的
|
|
10
|
-
* 主 Agent、同事、子代理共用同一个 `MEMORY.md`。而提取是"对话结束 fire-and-forget
|
|
11
|
-
* 起一个 run 去写文件",几个同事同时写就是后写覆盖先写,也分不清是谁学到的。
|
|
12
|
-
*
|
|
13
|
-
* ## 写私有、读共享
|
|
14
|
-
*
|
|
15
|
-
* 对齐上游 own > project > user 的三层优先级:
|
|
16
|
-
* - 写:`projects/{projectId}/memory/agents/{agentId}/`(私有,单写者)
|
|
17
|
-
* - 读:自己的分区 + 项目(cwd)记忆 + 全局记忆(后两者只读,靠提示里的路径去
|
|
18
|
-
* Read / Grep;共享层保持单写者,不因为"读得到"就变成谁都能写)
|
|
19
|
-
*
|
|
20
|
-
* ## 门闸
|
|
21
|
-
*
|
|
22
|
-
* `isAgentHomeExclusiveToolSurface`(表面 ∧ 非子会话,含 WorkBuddy 宿主硬排除)
|
|
23
|
-
* 之上再加一条:**有 jobId 且该 job 能在 agent-home 目录里解析成同事**——普通 TUI
|
|
24
|
-
* 里的子代理也有 jobId,靠这条排除。任一不成立返回 undefined = 调用方走原路径。
|
|
25
|
-
*/
|
|
26
|
-
export interface ColleagueMemoryScope {
|
|
27
|
-
/** 私有分区:写这里。 */
|
|
28
|
-
memoryDir: string;
|
|
29
|
-
/** 项目(cwd)记忆:同事可读不可写。 */
|
|
30
|
-
projectDir: string;
|
|
31
|
-
/** 全局记忆(跨项目的本机共享层):同事可读不可写。 */
|
|
32
|
-
globalDir: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 解析当前会话是不是"该分区的同事"。不是就返回 undefined。
|
|
36
|
-
* 纯解析:不建目录(要写提示前先调 ensureColleagueMemoryDir)。
|
|
37
|
-
*/
|
|
38
|
-
export declare function resolveColleagueMemoryScope(input: {
|
|
39
|
-
session?: unknown;
|
|
40
|
-
agent?: unknown;
|
|
41
|
-
}): Promise<ColleagueMemoryScope | undefined>;
|
|
42
|
-
/**
|
|
43
|
-
* 记忆提示写着 "This directory already exists — write to it directly",所以注入提示
|
|
44
|
-
* 前把私有分区建出来(幂等)。建不出来不拦:Write 工具自己会补父目录。
|
|
45
|
-
*/
|
|
46
|
-
export declare function ensureColleagueMemoryDir(scope: ColleagueMemoryScope): void;
|
|
47
|
-
/**
|
|
48
|
-
* 同事记忆的提示补充(挂到 buildMemoryPrompt 的 extraGuidelines)。
|
|
49
|
-
*
|
|
50
|
-
* 只对同事生效:主 Agent / TUI / WorkBuddy 的提示文本一个字节都不改。
|
|
51
|
-
*/
|
|
52
|
-
export declare function colleagueMemoryGuidelines(scope: ColleagueMemoryScope): string[];
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 活人:写进 job inbox,让已经在跑的 JobInboxConsumer 取走。
|
|
3
|
-
* 死人:enqueueReply 再 respawn / 叫醒票。不在 resume 期强行 run()。
|
|
4
|
-
* 信封不能当 --resume 位置参数。
|
|
5
|
-
*/
|
|
6
|
-
import { type IDaemonProcessManager } from '@genie/cbc-daemon';
|
|
7
|
-
import { type IJobStore } from '../agent-view/agent-view-protocol';
|
|
8
|
-
/**
|
|
9
|
-
* 同事 job 的进程还活着吗。判活只有一份实现(目录锁 / 协调者租约 / 这里共用):
|
|
10
|
-
* `kill(0,0)` / `kill(-1,0)` 在 Unix 上不是「这个同事还活着」。
|
|
11
|
-
*/
|
|
12
|
-
export declare function isColleagueJobPidAlive(pid: number | undefined): boolean;
|
|
13
|
-
export declare function respawnColleagueJob(store: IJobStore, jobId: string, processManager?: IDaemonProcessManager, options?: {
|
|
14
|
-
resumeStopped?: boolean;
|
|
15
|
-
}): Promise<boolean>;
|
|
16
|
-
/**
|
|
17
|
-
* 记下"这件活在哪个主会话里被起(或被叫起来)":同事回投主 Agent 时按它寻址,
|
|
18
|
-
* 信就落在那个会话的上下文里,而不是"谁先 tick 谁拿"。
|
|
19
|
-
*
|
|
20
|
-
* 解析不出会话(后台 tick / 没有当前会话)就不写 —— 信会按活跃会话启发式投,不丢。
|
|
21
|
-
* 已经记过就保持不动(见下面的"只写一次")。
|
|
22
|
-
*/
|
|
23
|
-
export declare function noteColleagueJobOrigin(store: IJobStore, jobId: string, homeDir: string): Promise<void>;
|
|
24
|
-
/** 这个同事 job 的回投地址(没记过 / 读不到 = undefined)。 */
|
|
25
|
-
export declare function readColleagueJobOrigin(jobId: string | undefined): Promise<string | undefined>;
|
|
26
|
-
/**
|
|
27
|
-
* 投递结果:
|
|
28
|
-
* - `delivered`:信已经进了活着的收件箱(对方进程会自己消费),或本次重拉成功;
|
|
29
|
-
* - `deferred`:信写进了收件箱,但对方进程不在、本次也没拉起来 —— 只留了唤醒票等
|
|
30
|
-
* broker 拉起。**不等于送达**(现场误判过一次:任务指派后审计全是 delivered,
|
|
31
|
-
* 实际被指派人从未被拉起,见 #118277)。
|
|
32
|
-
* - `skipped-*`:一个字节都没写(原因会进审计)。
|
|
33
|
-
*/
|
|
34
|
-
export type ColleagueDelivery = 'delivered' | 'deferred' | 'skipped-user-stopped' | 'skipped-dead' | 'skipped-flood';
|
|
35
|
-
export declare function deliverToColleagueJob(input: {
|
|
36
|
-
store: IJobStore;
|
|
37
|
-
jobId: string;
|
|
38
|
-
text: string;
|
|
39
|
-
homeDir: string;
|
|
40
|
-
canRespawn: boolean;
|
|
41
|
-
respawn?: (jobId: string) => Promise<boolean>;
|
|
42
|
-
/** 用户显式点名时允许把"用户终止过"的同事重新拉起;自动唤醒不允许。 */
|
|
43
|
-
resumeStopped?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* true = 对方进程不在就**不投递**(不写信、不 respawn、不留票)。
|
|
46
|
-
* 成员之间 @ 用这个:信留在频道 transcript 里(事实源),等它下次被叫起来自己读;
|
|
47
|
-
* 只有用户发言才值得把一个死人拉起来。
|
|
48
|
-
*/
|
|
49
|
-
skipIfDead?: boolean;
|
|
50
|
-
}): Promise<ColleagueDelivery>;
|
|
51
|
-
/**
|
|
52
|
-
* 入队预算(进程内滑动窗口):同一个 job 在 10 分钟内最多收这么多条频道/同事信封。
|
|
53
|
-
*
|
|
54
|
-
* 超了**丢掉这条"提示"**——不丢信息:频道 transcript 才是事实源,对方下次被叫起来自己会读。
|
|
55
|
-
* 用户消息不走这条路径,永远不会被丢;进程内计数是"兜底",不是精确配额(多进程各自计数)。
|
|
56
|
-
*/
|
|
57
|
-
export declare const MAX_ENVELOPES_PER_JOB = 20;
|
|
58
|
-
export declare const ENVELOPE_WINDOW_MS: number;
|
|
59
|
-
/** 单测用:清空窗口计数(模块级状态,跨用例会互相污染)。 */
|
|
60
|
-
export declare function resetEnvelopeBudgetForTests(): void;
|
|
61
|
-
/** 单测用:窗口表当前键数(钉住"键不会只增不减",见 ENVELOPE_WINDOW_MAX_JOBS)。 */
|
|
62
|
-
export declare function __envelopeWindowKeyCountForTests(): number;
|
|
63
|
-
/**
|
|
64
|
-
* 投递到主 Agent(委托侧):**只落盘**,不做注入。
|
|
65
|
-
*
|
|
66
|
-
* 主会话活在 serve 进程里、由 agent-home-main-inbox-consumer 在它 idle 时取走;
|
|
67
|
-
* 窗口关着 / 进程重启都不丢——这正是它必须落盘、不能进内存队列的原因。
|
|
68
|
-
* 用信封装(和同事那条一样),主会话收到的是 action=incoming 的回执,不是用户打字。
|
|
69
|
-
*/
|
|
70
|
-
export declare function deliverToMainAgent(input: {
|
|
71
|
-
homeDir: string;
|
|
72
|
-
text: string;
|
|
73
|
-
fromAgentId?: string;
|
|
74
|
-
/** 收件会话 = 这件活在哪个主会话里被起(见 noteColleagueJobOrigin);缺省走启发式投。 */
|
|
75
|
-
targetSessionId?: string;
|
|
76
|
-
}): Promise<'delivered'>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* directory.json 跨进程锁。控制器 withLock 和 SpeakInChannel 共用。
|
|
3
|
-
* 进程内排队 + mkdir 锁目录。
|
|
4
|
-
*
|
|
5
|
-
* 约定:
|
|
6
|
-
* - 没拿到锁不要在 finally 里 rm 别人的锁目录。
|
|
7
|
-
* - 过期只在持有者 pid 已死时拆;不靠 mtime 抢活锁。
|
|
8
|
-
* - mkdir 成功但 pid 文件还没写 / 还是空的:等,不要当无主拆。
|
|
9
|
-
* - 可重入只限当前异步上下文(AsyncLocalStorage),并发 withLock 必须排队。
|
|
10
|
-
* - 释放时只删自己 pid 的锁。
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* 抢不到目录锁(预算内没等到)。**抛这个错时什么都没写**,所以调用方可以放心重试:
|
|
14
|
-
* HTTP 层映射成 503 + Retry-After,前端只对这一类失败自动重试。
|
|
15
|
-
*/
|
|
16
|
-
export declare class AgentHomeDirectoryBusyError extends Error {
|
|
17
|
-
readonly lockDir: string;
|
|
18
|
-
constructor(lockDir: string);
|
|
19
|
-
}
|
|
20
|
-
/** 进程还活着吗(给锁与协调者租约共用;kill(0) 的坑见 deliver 侧注释)。 */
|
|
21
|
-
export declare function pidLooksLive(pid: number): boolean;
|
|
22
|
-
export declare function withAgentHomeDirectoryLock<T>(homeDir: string, task: () => Promise<T>): Promise<T>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 的错误码单一映射表(建人/建频道 + 频道任务板,两张表一份形状)。
|
|
3
|
-
*
|
|
4
|
-
* 加/改一个错误只动本文件:domain 抛 code,工具层取 llmMessage,HTTP controller 取
|
|
5
|
-
* httpStatus/httpMessage。别在三处各写一遍——这里连"表驱动构造器"也只有一份。
|
|
6
|
-
*/
|
|
7
|
-
export type AgentHomeCreateErrorCode = 'DIRECTORY_UNAVAILABLE' | 'INVALID_ACTOR' | 'INVALID_INPUT' | 'ENGINE_NOT_ALLOWED' | 'QUOTA_AGENTS' | 'QUOTA_CHANNELS' | 'DEPTH_EXCEEDED' | 'CHANNEL_MEMBERS' | 'MEMBER_NOT_FOUND' | 'ALREADY_MEMBER' | 'MEMBER_NOT_ALLOWED' | 'MAIN_AGENT_NOT_MEMBER' | 'LEAD_NOT_MEMBER' | 'PERMISSION_MODE_NOT_ALLOWED';
|
|
8
|
-
export type ChannelTaskErrorCode = 'CHANNEL_NOT_FOUND' | 'CHANNEL_NEED_ID' | 'DIRECTORY_UNAVAILABLE' | 'INVALID_ACTOR' | 'INVALID_TASK' | 'TASK_NOT_FOUND' | 'TASK_CLAIM_CONFLICT' | 'TASK_DONE' | 'TASK_FORBIDDEN' | 'TASK_DUPLICATE' | 'BOARD_FULL' | 'BOARD_WRITE_FAILED' | 'LEAD_ONLY' | 'MEMBER_NOT_FOUND';
|
|
9
|
-
/** 两张表共用的行形状:[码, http 状态, http 文案(英文,给调用方), llm 文案(英文,给模型,要可执行)]。 */
|
|
10
|
-
export interface AgentHomeErrorSpec<C extends string = string> {
|
|
11
|
-
code: C;
|
|
12
|
-
httpStatus: number;
|
|
13
|
-
httpMessage: string;
|
|
14
|
-
llmMessage: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function agentHomeCreateError(code: AgentHomeCreateErrorCode): AgentHomeErrorSpec<AgentHomeCreateErrorCode>;
|
|
17
|
-
export declare function channelTaskError(code: ChannelTaskErrorCode): AgentHomeErrorSpec<ChannelTaskErrorCode>;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 落盘式收件箱:**同事 job 收件箱**(`jobs/<id>/colleague-inbox/`)+
|
|
3
|
-
* **唤醒票目录**(`agent-home/wake/`)+ 目录监听。
|
|
4
|
-
*
|
|
5
|
-
* 除了同事侧,这里还有**主 Agent 收件箱**(`agent-home/inbox/`):主 Agent 虽然不进频道
|
|
6
|
-
* 成员表(委托侧定位见 agent-home-membership),但它是**委托人**——同事可以用
|
|
7
|
-
* `MessageColleague` 回报它、一批派单全部完成时 lead 也会回报它,所以这条边是活的
|
|
8
|
-
* (入队 `enqueueMainAgentMail`,由 agent-home-main-inbox-consumer 在主会话空闲时投递)。
|
|
9
|
-
* 别再照着旧注释以为可以整条删掉。
|
|
10
|
-
*/
|
|
11
|
-
export declare function agentHomeWakeDir(homeDir: string): string;
|
|
12
|
-
export declare function colleagueInboxDir(jobDir: string): string;
|
|
13
|
-
export declare function enqueueColleagueInbox(jobDir: string, text: string): Promise<void>;
|
|
14
|
-
export declare function drainColleagueInbox(jobDir: string): Promise<Array<{
|
|
15
|
-
text: string;
|
|
16
|
-
}>>;
|
|
17
|
-
export declare function enqueueColleagueWake(homeDir: string, jobId: string): Promise<void>;
|
|
18
|
-
/** 先看票再叫醒,成功后再删。失败把文件留在盘上。 */
|
|
19
|
-
export declare function peekColleagueWake(homeDir: string): Promise<Array<{
|
|
20
|
-
jobId: string;
|
|
21
|
-
path: string;
|
|
22
|
-
}>>;
|
|
23
|
-
export declare function removeWakeTicket(path: string): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* 主 Agent 收件箱(委托侧):同事的回报/私信先落这里,主会话 idle 时由
|
|
26
|
-
* agent-home-main-inbox-consumer 取走。落盘 = 窗口关着、进程重启都不丢;
|
|
27
|
-
* 投递成功再删(与唤醒票同一条纪律)。
|
|
28
|
-
*/
|
|
29
|
-
export declare function agentHomeMainMailboxDir(homeDir: string): string;
|
|
30
|
-
export declare function enqueueMainAgentMail(homeDir: string, mail: {
|
|
31
|
-
text: string;
|
|
32
|
-
fromAgentId?: string;
|
|
33
|
-
targetSessionId?: string;
|
|
34
|
-
}): Promise<void>;
|
|
35
|
-
/** 先看信再投递,成功后再删。失败把文件留在盘上,下一 tick 重试。 */
|
|
36
|
-
export declare function peekMainAgentMail(homeDir: string): Promise<Array<{
|
|
37
|
-
text: string;
|
|
38
|
-
fromAgentId?: string;
|
|
39
|
-
targetSessionId?: string;
|
|
40
|
-
path: string;
|
|
41
|
-
}>>;
|
|
42
|
-
export declare function removeMainAgentMail(path: string): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* 已认领(取出处理中)目录:`agent-home/inbox/.processing/`。
|
|
45
|
-
* 与同事收件箱同一套两阶段纪律:认领是 rename,确认(ack = removeMainAgentMail)才真删。
|
|
46
|
-
*/
|
|
47
|
-
export declare function agentHomeMainMailboxProcessingDir(homeDir: string): string;
|
|
48
|
-
/**
|
|
49
|
-
* 认领租约(兜底)。正常路径走不到它:
|
|
50
|
-
* - 认领者崩溃 → pid 已死 → **下一个 kick 立刻回收**;
|
|
51
|
-
* - 认领者活着(哪怕正在跑一个很长的回合)→ 不抢,否则多窗口会重复投递。
|
|
52
|
-
* 只有 pid 被复用 / 进程僵死(活着但永不 ack)才会等到这里,属极端兜底。
|
|
53
|
-
*/
|
|
54
|
-
export declare const MAIN_MAIL_CLAIM_LEASE_MS: number;
|
|
55
|
-
/** 派发失败后的重投退避:落 `.retry/`(**不在被 watch 的队列里**),到点由下一轮 claim 提升回队列。 */
|
|
56
|
-
export declare const MAIN_MAIL_RETRY_BACKOFF_MS = 5000;
|
|
57
|
-
/** 重投队列(退避期):`agent-home/inbox/.retry/`。刻意不在 inbox 根下——那是被 fs.watch 盯着的目录。 */
|
|
58
|
-
export declare function agentHomeMainMailboxRetryDir(homeDir: string): string;
|
|
59
|
-
/**
|
|
60
|
-
* 派发失败(或暂时拿不到 agent)的信:进重投队列等退避。**不能直接放回 inbox**——
|
|
61
|
-
* 那是一次写盘,本进程的 fs.watch 立刻被叫醒 → 下一轮又派发又失败,实测 2 秒能打 40 次 run()。
|
|
62
|
-
*/
|
|
63
|
-
export declare function deferMainAgentMail(homeDir: string, path: string): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* 认领主 Agent 邮箱(两阶段的第一阶段):`inbox/*.json` rename 进 `inbox/.processing/<认领标记>`,
|
|
66
|
-
* 并**回收无主残留**(上一轮认领后没确认、且认领者已死或超租约的信),一起返回。
|
|
67
|
-
* 崩溃残留不丢(at-least-once,重复由 message_id 去重吸收)。
|
|
68
|
-
*
|
|
69
|
-
* rename 是原子操作:**多窗口共享同一个 HOME 时,同一封信只会被一个进程认领**——
|
|
70
|
-
* 原先 peek 不改盘,两个进程能各自看到同一封并各投一遍。正在被活进程投递的信这一轮不回收。
|
|
71
|
-
*
|
|
72
|
-
* 解析不出 `text` 的文件(坏 JSON / 缺字段)不返回也不动它:与 peek 的跳过语义一致,
|
|
73
|
-
* 它留在 .processing 里等人工排查,不会被当成待投递的信反复取。
|
|
74
|
-
*/
|
|
75
|
-
export declare function claimMainAgentMail(homeDir: string): Promise<Array<{
|
|
76
|
-
text: string;
|
|
77
|
-
fromAgentId?: string;
|
|
78
|
-
targetSessionId?: string;
|
|
79
|
-
path: string;
|
|
80
|
-
}>>;
|
|
81
|
-
/** 跳过目录:判等不可靠(旧格式无 message_id)且已在历史里的信放这儿——不删、也不再进队列。 */
|
|
82
|
-
export declare function agentHomeMainMailboxSkippedDir(homeDir: string): string;
|
|
83
|
-
/**
|
|
84
|
-
* 旧格式(无 message_id)的信已在历史里:不再投,但判等会回落到「同发信人 + 同正文」,
|
|
85
|
-
* 删了可能丢真信,所以**留盘**——但必须离开待取队列。
|
|
86
|
-
*
|
|
87
|
-
* 为什么不能像以前那样放回 inbox:那是一次写盘,本进程的 fs.watch 立刻被叫醒 →
|
|
88
|
-
* 下一轮又认领又放回,实测 2 秒 40 轮、每轮还写一条审计,永远不收敛。
|
|
89
|
-
*/
|
|
90
|
-
export declare function skipMainAgentMail(homeDir: string, path: string): Promise<void>;
|
|
91
|
-
/** 隔离目录:认不出来的信放这儿(不删——用户可见的回报不能静默丢)。 */
|
|
92
|
-
export declare function agentHomeMainMailboxQuarantineDir(homeDir: string): string;
|
|
93
|
-
/**
|
|
94
|
-
* 认不出的信移进隔离目录:**不丢**,但离开主队列(否则每个 tick 都重试、把队列堵死)。
|
|
95
|
-
* 出队的原因是解析失败/格式过旧,调用方要落一条审计说明。
|
|
96
|
-
*/
|
|
97
|
-
export declare function quarantineMainAgentMail(homeDir: string, path: string): Promise<void>;
|
|
98
|
-
/** 信落到目录就叫醒(同事收件箱 / 唤醒票目录 / 主 Agent 邮箱共用)。事件去抖 25ms,避免一次落盘叫醒多次。 */
|
|
99
|
-
export declare function watchInboxDirectory(dir: string, onEvent: () => void): {
|
|
100
|
-
dispose(): void;
|
|
101
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 主邮箱旁的「活跃主会话」指针:`agent-home/main-session.json`。
|
|
3
|
-
*
|
|
4
|
-
* 多进程共享同一个 HOME(几个 TUI / Web UI serve / 同事 job 的宿主)时,主邮箱只有一份、
|
|
5
|
-
* 信里也没有目标会话(同事根本不知道你有几个会话)。于是用这个指针回答"该投给谁":
|
|
6
|
-
* **最近有用户发言的那个会话**。指针由各进程在 drain 时单调推进(`at` 更大才写),
|
|
7
|
-
* 读失败 / 缺失 = 没有活跃会话(不拦投递)。
|
|
8
|
-
*
|
|
9
|
-
* 注意:这个文件刻意**不在** `agent-home/inbox/` 里 —— 那个目录被 fs.watch 盯着,
|
|
10
|
-
* 且扫描时会把根下所有 `*.json` 当信取走。
|
|
11
|
-
*/
|
|
12
|
-
export interface ActiveMainSession {
|
|
13
|
-
sessionId: string;
|
|
14
|
-
/** 该会话最后一条用户发言的时间(ms)。 */
|
|
15
|
-
at: number;
|
|
16
|
-
}
|
|
17
|
-
/** 未来时间戳的容忍窗口(时钟偏移);超出即视为坏数据。 */
|
|
18
|
-
export declare const FUTURE_SKEW_MS: number;
|
|
19
|
-
export declare function agentHomeMainSessionPath(homeDir: string): string;
|
|
20
|
-
export declare function readActiveMainSession(homeDir: string): Promise<ActiveMainSession | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* 解析"发起这件事的会话"(信的收件地址):
|
|
23
|
-
* - 优先**当前会话** —— 调用发生在某个会话的上下文里(主 Agent 在会话 A 里给同事派活、
|
|
24
|
-
* 在会话 A 的任务板上建任务),要的就是 A;
|
|
25
|
-
* - 回落**活跃会话指针**(后台 tick 触发的唤醒,进程里没有"当前在跑的会话");
|
|
26
|
-
* - 都没有 = 没地址,信按启发式投(见 agent-home-main-mail-gate.ts)。
|
|
27
|
-
*/
|
|
28
|
-
export declare function resolveOriginSessionId(homeDir: string): Promise<string | undefined>;
|
|
29
|
-
/**
|
|
30
|
-
* 记活跃会话。只在 `at` 前进时写盘(两个进程并发时后写者赢,但 `at` 单调不回退)。
|
|
31
|
-
* 返回是否真的写了(测试与排查用)。
|
|
32
|
-
*/
|
|
33
|
-
export declare function noteActiveMainSession(homeDir: string, input: ActiveMainSession): Promise<boolean>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 统一收件人解析:一个 ref(**id**)→ 投递目标。
|
|
3
|
-
*
|
|
4
|
-
* 对齐上游 `SendToAgent({ target_id })` 的语义:**目标是"某个 agent",不是"某个房间成员"**,
|
|
5
|
-
* 而且参数就是 id(上游文档原话:"Use an id from your teammates list … — not a name")。
|
|
6
|
-
* 我们 1:1 只有两类落点:
|
|
7
|
-
* - `colleague`:常驻同事 → 他的 job 收件箱(进程不在就拉起);
|
|
8
|
-
* - `main`:主 Agent = 委托侧的工作现场 → 主会话邮箱(idle 时注入)。
|
|
9
|
-
* 频道(上游的 group 目标)走 SpeakInChannel,不在这里。
|
|
10
|
-
*
|
|
11
|
-
* 显示名不是地址:名字只用于正文里的 @ 点名(撞名时同名的人全部叫上,见 agent-home-mentions)。
|
|
12
|
-
* 极简引擎的人不能当收件人,判据是「能不能进频道」(canJoinAgentHomeChannel:
|
|
13
|
-
* 极简在房间里说不了话)——不是"它没有 job":极简照样有 job,只是不参与房间编排。
|
|
14
|
-
*/
|
|
15
|
-
import { type AgentHomeDirectoryFile, type AgentHomeProfile } from './agent-home-directory';
|
|
16
|
-
export type HomeMessageTarget = {
|
|
17
|
-
kind: 'colleague';
|
|
18
|
-
id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
/** 主对话(还没有 = 他还没开过口,投递即拉起)。 */
|
|
21
|
-
jobId?: string;
|
|
22
|
-
} | {
|
|
23
|
-
kind: 'main';
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
};
|
|
27
|
-
export type HomeMessageTargetLookup = {
|
|
28
|
-
status: 'found';
|
|
29
|
-
target: HomeMessageTarget;
|
|
30
|
-
} | {
|
|
31
|
-
status: 'missing';
|
|
32
|
-
} | {
|
|
33
|
-
status: 'ineligible';
|
|
34
|
-
agent: AgentHomeProfile;
|
|
35
|
-
};
|
|
36
|
-
/** 全部可投递的人(主 Agent + 能进频道的同事),供"你能联系谁"的提示用。 */
|
|
37
|
-
export declare function listHomeMessageTargets(directory: AgentHomeDirectoryFile): HomeMessageTarget[];
|
|
38
|
-
export declare function resolveHomeMessageTarget(directory: AgentHomeDirectoryFile, ref: string): HomeMessageTargetLookup;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** 用户消息上附隐藏房间花名册(system-reminder)。 */
|
|
2
|
-
import { AgentRunInterceptor, AgentRunRequest } from '../../vendor/cbc-core/node/index.js';
|
|
3
|
-
import { SettingsManager } from '../settings/settings-protocol';
|
|
4
|
-
export declare class AgentHomeRoomContextInterceptor implements AgentRunInterceptor {
|
|
5
|
-
priority: number;
|
|
6
|
-
protected readonly settingsManager?: SettingsManager;
|
|
7
|
-
intercept(request: AgentRunRequest): Promise<void>;
|
|
8
|
-
/** 信封带了 mention_ids 且没有自己:这封是点别人的,不要回。 */
|
|
9
|
-
private channelMailIsForSomeoneElse;
|
|
10
|
-
private lastUserMessageText;
|
|
11
|
-
private attachRoomRoster;
|
|
12
|
-
private lastUserMessageHasReminder;
|
|
13
|
-
/**
|
|
14
|
-
* 频道叫醒:只教 SpeakInChannel,不挂房间花名册(否则模型会去 MessageColleague)。
|
|
15
|
-
* 入站是 function_call_result 时挂不上 last user,所以在回执后补一条 isMeta reminder。
|
|
16
|
-
*/
|
|
17
|
-
private attachChannelReminder;
|
|
18
|
-
/**
|
|
19
|
-
* 看板注入:lead 拿完整快照、成员拿一行概览(详略由 copy 层决定)。
|
|
20
|
-
* 挂进同一条 reminder,避免 inputHasChannelReminder 去重导致二次注入失效。
|
|
21
|
-
*/
|
|
22
|
-
private boardBrief;
|
|
23
|
-
private inputHasChannelReminder;
|
|
24
|
-
private incomingFromReceipt;
|
|
25
|
-
/**
|
|
26
|
-
* History 拦截器已经把 request.input 换成了 session.history 的同一引用。
|
|
27
|
-
* 提醒必须写在副本上,否则会改脏落盘历史,回放时同一封信再画一张卡片。
|
|
28
|
-
*/
|
|
29
|
-
private detachLastUserMessage;
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 运行时 arm 标志(**叶子模块,不 import 任何东西**)。
|
|
3
|
-
*
|
|
4
|
-
* 为什么要单独一个文件:`isAgentHomeRuntimeArmed()` 要被 **同步**判据用
|
|
5
|
-
* (`isAgentHomeJobBlockingAgentTeams` / `agentHomeToolSearchVisibility`),
|
|
6
|
-
* 而那些判据住在 agent-home-runtime / agent-home-tool-gate;arm 逻辑又要 import 它们
|
|
7
|
-
* 的 `isAgentHomeFeatureEnabled`。把标志抽成叶子,两边都只依赖它,避免 import 成环。
|
|
8
|
-
*/
|
|
9
|
-
/** 运行时是否已 arm(同步可读)。 */
|
|
10
|
-
export declare function isAgentHomeRuntimeArmed(): boolean;
|
|
11
|
-
/** 置位(返回是否是本次置上的:false = 之前已 arm,幂等)。 */
|
|
12
|
-
export declare function markAgentHomeRuntimeArmed(): boolean;
|
|
13
|
-
/** 测试用:复位。 */
|
|
14
|
-
export declare function __resetAgentHomeRuntimeArmedForTests(): void;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 专属表面。WorkBuddy / Zed `--acp` 不在这里。
|
|
3
|
-
*
|
|
4
|
-
* 允许:
|
|
5
|
-
* - 同事 job worker(CODEBUDDY_JOB_ID)
|
|
6
|
-
* - PWA ACP(session.options.webUiAcp,客户端名 codebuddy-web-ui)
|
|
7
|
-
* - `--serve` 宿主自己的非 ACP 会话(host-detection = web-ui)
|
|
8
|
-
*
|
|
9
|
-
* 不允许:任何 `acp && !webUiAcp`(WorkBuddy / Zed 连 --serve 也不行)、
|
|
10
|
-
* WorkBuddy Desktop、纯 TUI/CLI。即使 ~/.codebuddy/agent-home
|
|
11
|
-
* 里已有房间/频道,也不能把 MessageColleague / SpeakInChannel 露出去。
|
|
12
|
-
*/
|
|
13
|
-
interface SessionLike {
|
|
14
|
-
options?: {
|
|
15
|
-
acp?: boolean;
|
|
16
|
-
webUiAcp?: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* isEnabled 有的走 `{ runContext: { context } }`,有的直接塞 RunContext。
|
|
21
|
-
* 自治工具的闸门(agent-home-tool-gate)也用它取会话,勿另写一份。
|
|
22
|
-
*/
|
|
23
|
-
export declare function sessionFromToolEnabledArgs(args?: unknown): SessionLike | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* env 总闸。HTTP 目录在 env 未设时还看 settings;
|
|
26
|
-
* 工具 / interceptor / inbox / wake 走 isAgentHomeSurface(env ∧ 表面)。
|
|
27
|
-
*/
|
|
28
|
-
export declare function isAgentHomeFeatureEnabled(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 同事 job 是 Agent Home 频道/1:1,不是 Agent Teams。
|
|
31
|
-
* TeamCreate / SendMessage 留着,模型会拿来「演示 @」,和频道 @ 不是一回事。
|
|
32
|
-
*/
|
|
33
|
-
export declare function isAgentHomeJobBlockingAgentTeams(): boolean;
|
|
34
|
-
/** isEnabled 没挡住时(旧会话还握着工具)execute 也要拒,并指向 SpeakInChannel。 */
|
|
35
|
-
export declare function agentHomeAgentTeamsBlockedMessage(): string;
|
|
36
|
-
/** 功能开着,并且当前是 Agent Home 表面。 */
|
|
37
|
-
export declare function isAgentHomeSurface(hint?: unknown): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 进程身份(job id / HOST=web-ui)或会话身份(webUiAcp)。
|
|
40
|
-
* 非 PWA ACP:`acp && !webUiAcp` 关,即使连的是 --serve。
|
|
41
|
-
* `webUiAcp === true` 算 PWA(prompt 每轮重盖 stamp)。
|
|
42
|
-
* 无 hint 的进程级消费者只看 job / --serve host,不会套用会话级 veto。
|
|
43
|
-
*
|
|
44
|
-
* **WorkBuddy 硬排除**(按宿主,不看会话选项):原先只靠 `session.options.acp`,
|
|
45
|
-
* 而 WB 的 headless/print 入口未必盖 acp,那时只要进程里有 job id 就会被判成
|
|
46
|
-
* "Agent Home 表面"——实测(2026-09-14 抓请求体)WB 宿主 + 同事 job 会拿到
|
|
47
|
-
* CreateChannel/CreateColleague。产品口径是"WB 看不到自治工具",所以这里按宿主
|
|
48
|
-
* 一刀切;IDE(vscode-acp) 各入口都盖 acp,交给上面那条即可。
|
|
49
|
-
*/
|
|
50
|
-
export declare function isAgentHomeExclusiveRuntime(hint?: unknown): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* 宿主是否可能是 Agent Home 的 Web 面(进程级):显式 `CODEBUDDY_HOST=web-ui`,
|
|
53
|
-
* 或**没有**显式宿主信号时 argv 回退到 `--serve`(CBC Web UI 的真实形态:它不设该 env)。
|
|
54
|
-
*
|
|
55
|
-
* 为什么不能裸判 `getHostName() === 'web-ui'`:`detectHost()` 对**未识别**的显式宿主值
|
|
56
|
-
* 会继续扫 argv —— 而 WB 的进程恰好都带 `--serve`,一次宿主信号改名/丢失
|
|
57
|
-
* (如 sidecar 的 hostId 落回 'workbuddy-server')就会静默落进"放行档",
|
|
58
|
-
* 工具面 / 生命周期 / 收件箱投递 / HTTP 面一起打开(2026-09-14 漏口同型)。
|
|
59
|
-
* 对未知显式宿主一律按"不是 Web UI"处理:判错方向只能是更严,不能更宽。
|
|
60
|
-
*
|
|
61
|
-
* ⚠️ 只给**工具面**用(要求 --serve 指纹没错:TUI 主对话不该拿自治工具)。
|
|
62
|
-
* HTTP 面别用它——TUI 进程也内嵌 Web UI,见 isAgentHomeHttpHostAllowed。
|
|
63
|
-
*/
|
|
64
|
-
export declare function isAgentHomeWebUiHost(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* **主 Agent 邮箱消费者**的进程闸:比自治工具面(isAgentHomeSurface)宽一档。
|
|
67
|
-
*
|
|
68
|
-
* 工具面只对 Web UI PWA / 同事 job / `--serve` 宿主开放;但「同事回报主 Agent」这条边
|
|
69
|
-
* 在**任何合法宿主**都该通 —— 实测用户在 TUI(host=cli)里对话时消费者压根没起,
|
|
70
|
-
* 同事的完成报告永远躺在 `agent-home/inbox/`(最久 8 小时)。
|
|
71
|
-
*
|
|
72
|
-
* 仍硬排除:WorkBuddy 宿主、未知显式宿主、IDE 的 ACP 会话(vscode-acp)。
|
|
73
|
-
*/
|
|
74
|
-
export declare function isAgentHomeMainInboxHost(): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* HTTP 面(`/api/v1/agent-home/*`)的宿主判据:只按**明确的非 Web UI 宿主**拒绝。
|
|
77
|
-
*
|
|
78
|
-
* 为什么不能复用 `isAgentHomeWebUiHost()`(要求 --serve 指纹):**TUI 进程也在内嵌服务
|
|
79
|
-
* Web UI**(banner 里的 http://127.0.0.1:<port> 就是它,argv 无 --serve、host='cli'),
|
|
80
|
-
* 要求指纹会把这类用户的频道/看板一起静默关掉(2026-08-16 实发回归)。
|
|
81
|
-
* 拒绝面收窄为:WorkBuddy 宿主(workbuddy-desktop)与未知显式宿主(workbuddy-server 等)——
|
|
82
|
-
* 其余的 host(未设置 / web-ui / cli)都由 gateway 鉴权 + settings 开关各自兜底。
|
|
83
|
-
*/
|
|
84
|
-
export declare function isAgentHomeHttpHostAllowed(): boolean;
|
|
85
|
-
/** 工具 execute:不在表面上时的拒绝文案。在表面上返回 undefined。 */
|
|
86
|
-
export declare function agentHomeToolUnavailableMessage(hint: unknown, product: 'channel' | 'room'): string | undefined;
|
|
87
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 的用户开关。**Web UI 设置里只有一个**:`codebuddy.agentHome.orchestration`
|
|
3
|
-
* (「Agent 团队(Agent Home)」组的「允许智能体自主组队」)。
|
|
4
|
-
*
|
|
5
|
-
* 绑定的分工(新增链路时按这个选,别再各处自己判):
|
|
6
|
-
*
|
|
7
|
-
* - **行为链路**走 `isAgentHomeOrchestrationEnabled`:自治工具(建人/建频道/任务板/
|
|
8
|
-
* 发言/私信)、频道提醒注入、唤醒投递与轮次看门狗。关掉 = 同事不再被叫、不再注入。
|
|
9
|
-
* - **表面读路径**走 `isAgentHomeSurfaceEnabled`:Web UI 自己的目录/频道/看板 API。
|
|
10
|
-
* 关掉只是 Web 回落 Job 列表,不动已存在的房间数据。
|
|
11
|
-
* - **例外:同事记忆的目录布局**只看"这是不是一个同事 job"(`agent-home-colleague-memory`)。
|
|
12
|
-
* 开关不该改变数据落点——关一下就把同事的记忆目录指回共享目录,多同事又会互相覆盖。
|
|
13
|
-
*
|
|
14
|
-
* 优先级:env 硬覆盖 > settings > env 总闸。读失败不拦(总闸有 env 兜底)。
|
|
15
|
-
*
|
|
16
|
-
* **默认关**(2026-09):settings 里没开过 = 整块不出现。用户第一次在智能体面板的
|
|
17
|
-
* 「开启 Agent 团队」入口(或设置页开关)打开后才生效。这也是防"宿主判据漏网"的
|
|
18
|
-
* 第二道锁——WorkBuddy 等宿主即使判据失效,默认关也兜住。
|
|
19
|
-
*/
|
|
20
|
-
import type { SettingsManager } from '../settings/settings-protocol';
|
|
21
|
-
export interface AgentHomeCodebuddySettings {
|
|
22
|
-
agentHome?: {
|
|
23
|
-
enabled?: boolean;
|
|
24
|
-
orchestration?: boolean;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export type AgentHomeSettingsSource = Pick<SettingsManager, 'get'>;
|
|
28
|
-
export declare function readAgentHomeCodebuddySettings(settingsManager?: AgentHomeSettingsSource): Promise<AgentHomeCodebuddySettings | undefined>;
|
|
29
|
-
/**
|
|
30
|
-
* Agent Home 整个表面(目录 / 频道 / 同事)是否可用。**纯开关判据:只看 env 总闸 + settings,
|
|
31
|
-
* 不含宿主闸**——HTTP 面必须经 `isAgentHomeHttpEnabled`(它另外要求 Web UI 宿主),
|
|
32
|
-
* 别直接拿这个函数当"HTTP 能不能开"的判据。
|
|
33
|
-
*/
|
|
34
|
-
export declare function isAgentHomeSurfaceEnabled(settingsManager?: AgentHomeSettingsSource): Promise<boolean>;
|
|
35
|
-
/**
|
|
36
|
-
* Agent Home 自治机器总闸(Web UI 那个开关):工具、频道提醒、唤醒与看门狗都走它。
|
|
37
|
-
* 表面读路径(Web UI 目录/频道 API)用 `isAgentHomeSurfaceEnabled`。
|
|
38
|
-
*/
|
|
39
|
-
export declare function isAgentHomeOrchestrationEnabled(settingsManager?: AgentHomeSettingsSource): Promise<boolean>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Home 自治工具(CreateColleague / CreateChannel / ChannelTasks)专属闸门。
|
|
3
|
-
*
|
|
4
|
-
* 在 `isAgentHomeSurface`(只对同事 job / PWA ACP / --serve web-ui 开放)之上,
|
|
5
|
-
* 再排除三类「不是主对话」的会话,避免子代理、团队成员、内部生成器 agent
|
|
6
|
-
* 拿到建人 / 建频道 / 改任务板的能力:
|
|
7
|
-
*
|
|
8
|
-
* - 子代理:`SessionUtils.isSubAgent`(storeId 与 id 不同)或 `meta.parentSessionId`
|
|
9
|
-
* - 团队:`meta.isTeamLead` / `meta.isTeamMember`(SessionUtils.isTeamSession)
|
|
10
|
-
* - 生成器:`INTERNAL_GENERATOR_AGENTS`(compact / summary 等旁路 LLM 调用)
|
|
11
|
-
*
|
|
12
|
-
* 与 `agent-home-membership.ts` 不同,本模块允许依赖会话与 agent 协议——
|
|
13
|
-
* 它只服务 Node 侧工具,web-ui 不要 import。
|
|
14
|
-
*/
|
|
15
|
-
import { type AgentHomeSettingsSource } from './agent-home-settings';
|
|
16
|
-
/** 子代理 / 团队成员 / 内部生成器:看得见主对话之外的工具面,自治工具必须挡住。 */
|
|
17
|
-
export declare function isAgentHomeSubSession(args?: unknown): boolean;
|
|
18
|
-
/** 自治工具的唯一表面判据:Agent Home 表面 ∧ 非子会话。 */
|
|
19
|
-
export declare function isAgentHomeExclusiveToolSurface(args?: unknown): boolean;
|
|
20
|
-
/** 工具 execute:不在自治表面上时的拒绝文案。在表面上返回 undefined。 */
|
|
21
|
-
export declare function agentHomeExclusiveToolUnavailableMessage(args: unknown): string | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* 自治工具的完整开关:表面 ∧ 非子会话 ∧ Web UI 设置里的开关。
|
|
24
|
-
* 工具 isEnabled 直接 await 本函数;execute 里 `!enabled` 时用下面的文案硬拒。
|
|
25
|
-
*/
|
|
26
|
-
export declare function isAgentHomeOrchestrationToolEnabled(args: unknown, settingsManager?: AgentHomeSettingsSource): Promise<boolean>;
|
|
27
|
-
/** 表面成立、只是被设置/总闸关掉时的拒绝文案(能力中立:建人建频道、发言、私信都用它)。 */
|
|
28
|
-
export declare function agentHomeOrchestrationDisabledMessage(): string;
|
|
29
|
-
/**
|
|
30
|
-
* 房间类工具(SpeakInChannel / MessageColleague)的统一闸门:拒绝时给文案,放行给 undefined。
|
|
31
|
-
* 顺序固定:先产品级不可用(不在表面 / 子会话),再设置级关掉。isEnabled 与 execute 共用,
|
|
32
|
-
* 免得两个地方的判据与文案各写一份。
|
|
33
|
-
*/
|
|
34
|
-
export declare function agentHomeRoomToolRefusal(args: unknown, settingsManager: AgentHomeSettingsSource | undefined, product: 'channel' | 'room'): Promise<string | undefined>;
|
|
35
|
-
/**
|
|
36
|
-
* 自治工具 `shouldShowInToolSearch` 的统一口径;房间类工具用 `hasLocal` 追加自己的
|
|
37
|
-
* "有频道 / 有房间"前提(它的 isEnabled 已经改写成了异步,同步回调读不到设置)。
|
|
38
|
-
*
|
|
39
|
-
* 为什么是"近似":deferred 可见性回调只接受同步返回,且**拿不到 session**
|
|
40
|
-
* (`ToolManager.indexDeferredTool` 存的是不带参数的 bound 函数,
|
|
41
|
-
* `buildDeferredToolEnabledCheck` 也是拿 `runContext: undefined` 调 isEnabled)。
|
|
42
|
-
* 于是只能退回进程级信号:功能总闸 + 有没有 jobId + 宿主是不是 web-ui。
|
|
43
|
-
*
|
|
44
|
-
* 实测现状:这几个工具**不在** `product.tools` 的 `deferLoading` 列表里 →
|
|
45
|
-
* `indexDeferredToolsFromProductConfig` 不会索引它们 → 本回调当前不会被调用。
|
|
46
|
-
* 保留它是为了将来若被标成 deferred 时有正确口径:真正的门槛始终是带 session 的
|
|
47
|
-
* `isEnabled` / `execute`(`isAgentHomeExclusiveToolSurface`),这里给宽了也只是
|
|
48
|
-
* 多一条提示,不会多一份能力。
|
|
49
|
-
*
|
|
50
|
-
* 注意别把它当成"Cli 会话可见"的开关:普通 TUI(host=cli、无 job)在这里是 false,
|
|
51
|
-
* 而它在 REPL 沙箱里同样调不动——两边一致。
|
|
52
|
-
*/
|
|
53
|
-
export declare function agentHomeToolSearchVisibility(hasLocal?: () => boolean): boolean;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 频道唤醒编排服务:依赖(JobStore / Daemon)在这里解析一次,工具不再各自 ContainerUtil.get。
|
|
3
|
-
* 只做「落盘之后叫醒」,永远在目录锁外调用;单测直接 new + 赋字段即可。
|
|
4
|
-
*/
|
|
5
|
-
import { type IDaemonProcessManager } from '@genie/cbc-daemon';
|
|
6
|
-
import { Logger } from '@genie/telemetry';
|
|
7
|
-
import { type IJobStore } from '../agent-view/agent-view-protocol';
|
|
8
|
-
import { SettingsManager } from '../settings/settings-protocol';
|
|
9
|
-
import { type ChannelWakeSkipReason } from './agent-home-channel-wake';
|
|
10
|
-
import { type AgentHomeChannel, type AgentHomeChannelMessage, type AgentHomeDirectoryFile } from './agent-home-directory';
|
|
11
|
-
export interface ChannelWakeDeps {
|
|
12
|
-
store?: IJobStore;
|
|
13
|
-
processManager?: IDaemonProcessManager;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* 叫醒审计的两个回调(单一实现):工具路径(ChannelWakeService)与 HTTP 路径
|
|
17
|
-
* (local-agent-home-controller 的用户发言)共用,字段/文案不会各写一份。
|
|
18
|
-
* 投递成功的语义是「信已经进了对方的 job 收件箱」,不代表对方已经开始处理。
|
|
19
|
-
*/
|
|
20
|
-
export declare function channelWakeAudit(input: {
|
|
21
|
-
homeDir: string;
|
|
22
|
-
channelId: string;
|
|
23
|
-
actorAgentId?: string;
|
|
24
|
-
messageId?: string;
|
|
25
|
-
log?: (message: string) => void;
|
|
26
|
-
}): {
|
|
27
|
-
onSkip: (agentId: string, reason: ChannelWakeSkipReason) => void;
|
|
28
|
-
onDelivered: (agentId: string) => void;
|
|
29
|
-
};
|
|
30
|
-
export declare class ChannelWakeService {
|
|
31
|
-
protected readonly injectedStore?: IJobStore;
|
|
32
|
-
protected readonly injectedProcessManager?: IDaemonProcessManager;
|
|
33
|
-
protected readonly settingsManager?: SettingsManager;
|
|
34
|
-
protected readonly logger?: Logger;
|
|
35
|
-
/** 注入优先;缺注入时退回容器(真实运行;单测没有容器也不会炸)。 */
|
|
36
|
-
resolveDeps(): ChannelWakeDeps;
|
|
37
|
-
/**
|
|
38
|
-
* 发言落盘后的叫醒出口。返回 false = 拿不到 JobStore(只记日志,不影响发言结果)。
|
|
39
|
-
* job worker 进程里 canRespawn 强制 false,只写信 + wake 票,避免双 fork。
|
|
40
|
-
*/
|
|
41
|
-
wakeAfterSpeech(input: {
|
|
42
|
-
homeDir: string;
|
|
43
|
-
directory: AgentHomeDirectoryFile;
|
|
44
|
-
channel: AgentHomeChannel;
|
|
45
|
-
message: AgentHomeChannelMessage;
|
|
46
|
-
/** speech 侧结果:没有推进轮次就别重复叫人。 */
|
|
47
|
-
advancedTurn?: boolean;
|
|
48
|
-
onSkip?: (agentId: string, reason: ChannelWakeSkipReason) => void;
|
|
49
|
-
}): Promise<boolean>;
|
|
50
|
-
/** 叫醒审计(onSkip / onDelivered 回调),供各路径在投递结果上落审计行。 */
|
|
51
|
-
private audit;
|
|
52
|
-
/** 自治总闸(Web UI 那个开关)关掉就不投递:票与轮次留在原地,开关打开后自然继续。 */
|
|
53
|
-
private wakeAllowed;
|
|
54
|
-
/** 任务事件等非发言路径的定向叫醒。返回 false = 开关关着或拿不到 JobStore。 */
|
|
55
|
-
wakeMembers(input: {
|
|
56
|
-
homeDir: string;
|
|
57
|
-
directory: AgentHomeDirectoryFile;
|
|
58
|
-
channel: AgentHomeChannel;
|
|
59
|
-
text: string;
|
|
60
|
-
from?: string;
|
|
61
|
-
mentionNames?: string[];
|
|
62
|
-
messageId?: string;
|
|
63
|
-
onlyAgentIds?: readonly string[];
|
|
64
|
-
excludeAgentId?: string;
|
|
65
|
-
onSkip?: (agentId: string, reason: ChannelWakeSkipReason) => void;
|
|
66
|
-
}): Promise<boolean>;
|
|
67
|
-
/** 招人起 job 用的 logDir;工具拿不到容器时退化为默认。 */
|
|
68
|
-
logDir(): string;
|
|
69
|
-
}
|