@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,111 +0,0 @@
|
|
|
1
|
-
import { Application, ApplicationLifecycle } from '@celljs/core';
|
|
2
|
-
import { ProductManager } from '@genie/product';
|
|
3
|
-
import { type ICwdService } from '@genie/cbc-worktree';
|
|
4
|
-
/**
|
|
5
|
-
* CLI 端的 svn commit 监听 + 上报。
|
|
6
|
-
*
|
|
7
|
-
* 设计要点:
|
|
8
|
-
*
|
|
9
|
-
* - **多仓**:从 `process.cwd()` 出发发现「全部」svn 工作副本——
|
|
10
|
-
* 既兼容「直接打开工作副本(或其子目录)」(沿父链向上找 `.svn`),
|
|
11
|
-
* 也兼容「打开一个父目录、其下挂多个独立工作副本」(向下有限层扫描)。
|
|
12
|
-
* 每个工作副本各自 `fs.watch(.svn/wc.db)`、各自维护 lastRevision、各自上报。
|
|
13
|
-
* - 监听 `.svn/wc.db`:svn commit/update 都会动这个文件。
|
|
14
|
-
* - lastRevision 持久化到 `~/.codebuddy/code-ratio/cli-svn-watcher-lastRev-<hash>`,
|
|
15
|
-
* 按 repoRoot 区分,CLI 重启后补差量、避免重复上报。
|
|
16
|
-
* - 用户身份过滤交给 `getLikelyCurrentSvnUserCandidates` / `isLikelyCurrentUser`,
|
|
17
|
-
* 按各仓库 URL 分别匹配 auth realm,「未知身份不放行」避免 svn update 误报。
|
|
18
|
-
* - feature gate 不在 watcher 里判:`reporter.observeCommit()` 已做检查。
|
|
19
|
-
*/
|
|
20
|
-
export declare class CliSvnCommitWatcher implements ApplicationLifecycle<Application> {
|
|
21
|
-
protected readonly productManager?: ProductManager;
|
|
22
|
-
protected readonly cwdService?: ICwdService;
|
|
23
|
-
private logger?;
|
|
24
|
-
private readonly repos;
|
|
25
|
-
/** feature gate 是否已判定 enabled 并触发过挂载,保证只挂一次(幂等)。 */
|
|
26
|
-
private gateResolved;
|
|
27
|
-
/** 等待 late-enable 的配置订阅(未启用时挂,enabled 后退订)。 */
|
|
28
|
-
private gateSubscription?;
|
|
29
|
-
/** cwd 变更订阅(首轮种子值 attach、之后变更重绑)。 */
|
|
30
|
-
private cwdChangeSubscription?;
|
|
31
|
-
/** 标记是否已完成首轮 attach,区分种子值与后续 cwd 变更。 */
|
|
32
|
-
private attachedOnce;
|
|
33
|
-
initialize(): void;
|
|
34
|
-
/**
|
|
35
|
-
* 入库率 feature gate + late-enable 订阅(对齐 git watcher / plugin-core)。
|
|
36
|
-
*
|
|
37
|
-
* 未启用入库率能力时**完全不做** svn 工作副本发现扫描 / watcher / 轮询定时器,
|
|
38
|
-
* 避免预热池默认开启后对错误继承的 home 目录做大量无意义扫描。
|
|
39
|
-
* ProductManager 未注册(headless / 单测)时保守退回:直接走 cwd 订阅。
|
|
40
|
-
*/
|
|
41
|
-
private mountWhenEnabled;
|
|
42
|
-
/**
|
|
43
|
-
* 订阅 cwd 变更,把 attach 绑到最新 cwd(对齐 ConfigWatchService)。
|
|
44
|
-
* 首轮种子值 attach、之后 cwd 变更先 dispose 旧 watcher 再按新 cwd 重新 attach。
|
|
45
|
-
* CwdService 未注册(单测)时退回:直接 attach 一次。
|
|
46
|
-
*/
|
|
47
|
-
private subscribeCwd;
|
|
48
|
-
/**
|
|
49
|
-
* 是否仍处于预热(prewarm)待机态:argv 含 `--prewarm` 且 PrewarmServer 状态
|
|
50
|
-
* 为 `idle`(尚未收到 activate)。详见 git watcher 同名方法的说明。
|
|
51
|
-
*
|
|
52
|
-
* 待机时跳过首轮 attach,等 activate 后 dispatcher 的 cwd 广播(状态已转为
|
|
53
|
-
* activating)再绑定,避免对错误继承的 home 做工作副本发现扫描。
|
|
54
|
-
*/
|
|
55
|
-
private isPrewarmStandby;
|
|
56
|
-
flushOnExit(): Promise<void>;
|
|
57
|
-
notifyExternalSvnCommit(): Promise<void>;
|
|
58
|
-
dispose(): void;
|
|
59
|
-
/**
|
|
60
|
-
* 关闭并清空所有工作副本 watcher/timer,但**不**退订 gate/cwd。
|
|
61
|
-
* 供 cwd 变更重绑复用(先 disposeWatchers 再 attachAll),dispose() 也调用它。
|
|
62
|
-
*/
|
|
63
|
-
private disposeWatchers;
|
|
64
|
-
private attachAll;
|
|
65
|
-
private attachRepo;
|
|
66
|
-
private scheduleScan;
|
|
67
|
-
private checkAndReport;
|
|
68
|
-
}
|
|
69
|
-
export interface SvnDiscoveryDeps {
|
|
70
|
-
/** 沿父链向上找工作副本根;默认用 `findSvnWorkingCopyRoot`。 */
|
|
71
|
-
findUpRoot?: (startPath: string) => string | undefined;
|
|
72
|
-
/** 判断某目录是否是 svn 工作副本根;默认用 `isSvnWorkingCopy`。 */
|
|
73
|
-
isWorkingCopy?: (dir: string) => boolean;
|
|
74
|
-
/** 列出某目录下的直接「子目录绝对路径」;默认走 fs.readdirSync。 */
|
|
75
|
-
listSubdirectories?: (dir: string) => string[];
|
|
76
|
-
/** 向下扫描最大深度。 */
|
|
77
|
-
maxDepth?: number;
|
|
78
|
-
/** 发现的工作副本数量上限。 */
|
|
79
|
-
maxRepos?: number;
|
|
80
|
-
/** 诊断回调:把扫描过程打到日志。 */
|
|
81
|
-
onTrace?: (msg: string) => void;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 从 `cwd` 发现需要监听的全部 svn 工作副本根:
|
|
85
|
-
*
|
|
86
|
-
* 1. 先沿父链向上找:若 `cwd` 本身或其某个祖先是工作副本,则视为「打开了工作
|
|
87
|
-
* 副本(或其子目录)」,直接返回该唯一根(其下子目录都属于同一个 wc)。
|
|
88
|
-
* 2. 否则向下有限层扫描子目录,把每个含 `.svn` 的目录当成独立工作副本根,
|
|
89
|
-
* 命中后剪枝不再深入(兼容 svn 1.7+「整棵 wc 只有顶层一个 .svn」的布局,
|
|
90
|
-
* 也避免把 1.6 时代每级目录的 .svn 误判成多个仓库)。
|
|
91
|
-
*
|
|
92
|
-
* 纯函数 + 依赖注入,便于单测,不直接耦合真实 fs。
|
|
93
|
-
*/
|
|
94
|
-
export declare function discoverSvnWorkingCopies(cwd: string, deps?: SvnDiscoveryDeps): string[];
|
|
95
|
-
interface SvnUserCandidateOptions {
|
|
96
|
-
env?: NodeJS.ProcessEnv;
|
|
97
|
-
repoUrls?: Array<string | undefined>;
|
|
98
|
-
authCacheDirs?: string[];
|
|
99
|
-
readDir?: (dirPath: string) => string[];
|
|
100
|
-
readFile?: (filePath: string) => string;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* 计算当前 SVN 用户候选集。不再与操作系统登录用户绑定:
|
|
104
|
-
* - 显式环境变量 `SVN_USER` / `SVN_USERNAME`;
|
|
105
|
-
* - SVN auth cache(`~/.subversion/auth/svn.simple/*` 或 Windows `%APPDATA%`),
|
|
106
|
-
* 按当前仓库 URL 匹配 realm 后取 username。
|
|
107
|
-
* 读不到任何身份时返回空数组,调用方据此「未知身份不放行」,避免 svn update 误报。
|
|
108
|
-
*/
|
|
109
|
-
export declare function getLikelyCurrentSvnUserCandidates(options?: SvnUserCandidateOptions): string[];
|
|
110
|
-
export declare function isLikelyCurrentUser(author: string | undefined, currentUserCandidates?: string[]): boolean;
|
|
111
|
-
export {};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
2
|
-
import { CodeRatioReporter } from '@genie/code-ratio';
|
|
3
|
-
import { CodeRatioRepoResolver } from './vcs-repo-resolver';
|
|
4
|
-
/**
|
|
5
|
-
* Service token for the CLI-side code-ratio reporting helper.
|
|
6
|
-
*
|
|
7
|
-
* Editor tools depend on this token instead of the raw `CodeRatioReporter`
|
|
8
|
-
* so they don't need to know how to resolve VCS context, map ChangeType
|
|
9
|
-
* values or swallow reporter errors. All of that lives here.
|
|
10
|
-
*/
|
|
11
|
-
export declare const CodeRatioReportingService: unique symbol;
|
|
12
|
-
/**
|
|
13
|
-
* Minimal, CLI-friendly parameters for the edit tools' code-ratio
|
|
14
|
-
* reporting hook. Tools already have these values on hand after
|
|
15
|
-
* successfully applying an edit, so building the input is a one-liner.
|
|
16
|
-
*/
|
|
17
|
-
export interface EditChangeReport {
|
|
18
|
-
/** Absolute path of the file that was just written / edited. */
|
|
19
|
-
absoluteFilePath: string;
|
|
20
|
-
/** File content before the edit (empty string for new files). */
|
|
21
|
-
originalContent: string;
|
|
22
|
-
/** File content after the edit. */
|
|
23
|
-
newContent: string;
|
|
24
|
-
/** Whether this edit created a new file (drives ChangeType). */
|
|
25
|
-
isNewFile: boolean;
|
|
26
|
-
/** Tool name (e.g. `Write`, `Edit`, `MultiEdit`, `NotebookEdit`). */
|
|
27
|
-
toolName?: string;
|
|
28
|
-
/** Tool call identifier, if available from the agent runtime. */
|
|
29
|
-
toolCallId?: string;
|
|
30
|
-
/** Session context, used to derive conversationId / modelId / traceId. */
|
|
31
|
-
session?: Session;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* CLI-side code-ratio reporting helper.
|
|
35
|
-
*
|
|
36
|
-
* Contract: calling `reportEditChange` never throws, never blocks the
|
|
37
|
-
* edit flow and never affects the tool's return value. Any failure
|
|
38
|
-
* (missing reporter, non-git workspace, VCS metadata incomplete, etc.)
|
|
39
|
-
* is logged at debug level and silently dropped.
|
|
40
|
-
*/
|
|
41
|
-
export interface CodeRatioReportingService {
|
|
42
|
-
/**
|
|
43
|
-
* Report an AI-authored file change (Write / Edit / MultiEdit /
|
|
44
|
-
* NotebookEdit / NotebookWrite). Safe to call unconditionally after a
|
|
45
|
-
* successful file write.
|
|
46
|
-
*/
|
|
47
|
-
reportEditChange(report: EditChangeReport): void;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Default implementation. The reporter and resolver are looked up
|
|
51
|
-
* through the cell container rather than enforced through strict DI,
|
|
52
|
-
* because `@genie/code-ratio` is an optional peer dependency: builds
|
|
53
|
-
* that don't bundle it (or tests that don't register it) must still
|
|
54
|
-
* be able to instantiate the editor tools.
|
|
55
|
-
*
|
|
56
|
-
* Constructor arguments exist purely for unit tests; production code
|
|
57
|
-
* relies on the cell container resolution below.
|
|
58
|
-
*/
|
|
59
|
-
export declare class CodeRatioReportingServiceImpl implements CodeRatioReportingService {
|
|
60
|
-
protected readonly repoResolver?: CodeRatioRepoResolver;
|
|
61
|
-
private logger?;
|
|
62
|
-
private reporterProvider;
|
|
63
|
-
/**
|
|
64
|
-
* NOTE: must remain parameter-less.
|
|
65
|
-
*
|
|
66
|
-
* 早期版本曾把 unit-test overrides 通过构造函数对象参数注入,触发了一个
|
|
67
|
-
* 隐蔽的 cell/inversify bug:`@Component` 装饰会让 TS emit
|
|
68
|
-
* `design:paramtypes` 元数据,把 `overrides?: { ... }` 的对象类型擦成
|
|
69
|
-
* `Object`;cell 容器实例化时会按 paramtypes 在容器里查找 `Object` 的
|
|
70
|
-
* 绑定,由于不存在,统一抛出
|
|
71
|
-
* "No matching bindings found for serviceIdentifier: Object"
|
|
72
|
-
* 该错误从 ApplicationLifecycle 一路冒泡,导致整个 CLI 启动失败。
|
|
73
|
-
*
|
|
74
|
-
* 修复:constructor 改为无参,单测改用 {@link configureForTesting}
|
|
75
|
-
* 注入测试桩,从而**完全不让 paramtypes 元数据被生成**。
|
|
76
|
-
*/
|
|
77
|
-
constructor();
|
|
78
|
-
/**
|
|
79
|
-
* Test-only seam. Production code must not call this.
|
|
80
|
-
*
|
|
81
|
-
* 不通过 constructor 注入是为了避免 cell 装饰器生成 `design:paramtypes`
|
|
82
|
-
* 元数据,把测试用的 overrides 对象类型当成 IoC 依赖(详见 constructor
|
|
83
|
-
* 注释里的 bug 历史)。
|
|
84
|
-
*/
|
|
85
|
-
configureForTesting(overrides: {
|
|
86
|
-
repoResolver?: CodeRatioRepoResolver;
|
|
87
|
-
reporterProvider?: () => CodeRatioReporter | undefined;
|
|
88
|
-
}): void;
|
|
89
|
-
reportEditChange(report: EditChangeReport): void;
|
|
90
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CodeRatioFileReader } from '@genie/code-ratio';
|
|
2
|
-
/**
|
|
3
|
-
* CLI-side implementation of CodeRatioFileReader.
|
|
4
|
-
*
|
|
5
|
-
* The five editor tools (write / edit / multi-edit / notebook-edit /
|
|
6
|
-
* notebook-write) already have `originalContent` in hand when they call
|
|
7
|
-
* into the reporter, so this reader is a defensive fallback: the
|
|
8
|
-
* reporter itself will invoke it only when the caller omits `oldContent`.
|
|
9
|
-
*
|
|
10
|
-
* Input is a POSIX, repo-relative path (per the protocol). We resolve it
|
|
11
|
-
* against the current repo root (provided by CodeRatioRepoResolver) and
|
|
12
|
-
* read through `FileUtils.readFileWithEncodingDetection`, which reuses
|
|
13
|
-
* the same encoding detection that the edit tools use for writing, so
|
|
14
|
-
* the old/new content pair stays byte-comparable for diffing.
|
|
15
|
-
*
|
|
16
|
-
* Failure policy: any error (missing resolver, path outside the repo,
|
|
17
|
-
* file does not exist, permission denied, encoding failure, ...) is
|
|
18
|
-
* swallowed and `undefined` is returned. The reporter then treats it as
|
|
19
|
-
* `invalid-input` and skips the upload, never breaking the tool flow.
|
|
20
|
-
*/
|
|
21
|
-
export declare class FsFileReader implements CodeRatioFileReader {
|
|
22
|
-
private logger?;
|
|
23
|
-
constructor();
|
|
24
|
-
readFile(filePath: string): Promise<string | undefined>;
|
|
25
|
-
private resolveAbsolute;
|
|
26
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 入库率端侧 watcher 的「多仓发现」共享逻辑(git / svn 通用)。
|
|
3
|
-
*
|
|
4
|
-
* 同时覆盖两类打开方式:
|
|
5
|
-
* 1. 直接打开仓库(或其子目录):沿父链向上找到唯一仓库根,返回该根。
|
|
6
|
-
* 2. 打开一个父目录、其下挂多个独立仓库:向下有限层扫描子目录,
|
|
7
|
-
* 把每个仓库根收集出来,命中后剪枝不再深入。
|
|
8
|
-
*
|
|
9
|
-
* 纯函数 + 依赖注入,便于单测,不直接耦合真实 fs / 具体 VCS 判定。
|
|
10
|
-
*/
|
|
11
|
-
/** 向下扫描发现多仓时的最大深度。深度 1~2 即可覆盖常见场景,3 兼容 `group/project` 再套一层。 */
|
|
12
|
-
export declare const DEFAULT_REPO_SCAN_MAX_DEPTH = 3;
|
|
13
|
-
/** 向下扫描发现的仓库数量上限,避免在超大目录树里无限扫描。 */
|
|
14
|
-
export declare const DEFAULT_MAX_VCS_REPOS = 50;
|
|
15
|
-
/** 向下扫描时跳过的噪音目录,避免进 node_modules / 构建产物等大目录。 */
|
|
16
|
-
export declare const REPO_SCAN_SKIP_DIR_NAMES: Set<string>;
|
|
17
|
-
export interface VcsRootDiscoveryDeps {
|
|
18
|
-
/** 沿父链向上找仓库根。返回 undefined 表示 cwd 及其祖先都不是仓库。 */
|
|
19
|
-
findUpRoot?: (startPath: string) => string | undefined;
|
|
20
|
-
/** 判断某目录是否是仓库根。 */
|
|
21
|
-
isRoot?: (dir: string) => boolean;
|
|
22
|
-
/** 列出某目录下的直接「子目录绝对路径」。 */
|
|
23
|
-
listSubdirectories?: (dir: string) => string[];
|
|
24
|
-
/** 向下扫描最大深度。 */
|
|
25
|
-
maxDepth?: number;
|
|
26
|
-
/** 发现的仓库数量上限。 */
|
|
27
|
-
maxRepos?: number;
|
|
28
|
-
/** 可选的诊断回调:用于把扫描过程打到日志,便于线上定位「为什么没发现仓库」。 */
|
|
29
|
-
onTrace?: (msg: string) => void;
|
|
30
|
-
}
|
|
31
|
-
export declare function discoverVcsRoots(cwd: string, deps?: VcsRootDiscoveryDeps): string[];
|
|
32
|
-
export declare function defaultListSubdirectories(dir: string): string[];
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { CodeRatioRepoContext, CodeRatioRepoResolver } from '@genie/code-ratio';
|
|
2
|
-
export { CodeRatioRepoContext, CodeRatioRepoResolver, toPosixRelative } from '@genie/code-ratio';
|
|
3
|
-
export interface VcsRoot {
|
|
4
|
-
repoRoot: string;
|
|
5
|
-
vcsType: NonNullable<CodeRatioRepoContext['vcsType']>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* CLI-native implementation of CodeRatioRepoResolver.
|
|
9
|
-
*
|
|
10
|
-
* Unlike agent-craft which can lean on the vscode git extension via
|
|
11
|
-
* VCSManager, the CLI only has filesystem access. We walk up from the
|
|
12
|
-
* given absolute file path to locate the nearest `.git` directory and
|
|
13
|
-
* read remote/branch info through GitInfoExtractor (already used by the
|
|
14
|
-
* existing VCSEventProcessor, so behavior stays consistent).
|
|
15
|
-
*
|
|
16
|
-
* Results are cached per repo root with a 5-minute TTL, matching the
|
|
17
|
-
* cache strategy of VCSEventProcessor.
|
|
18
|
-
*/
|
|
19
|
-
export declare class CwdRepoResolver implements CodeRatioRepoResolver {
|
|
20
|
-
private readonly cache;
|
|
21
|
-
private logger?;
|
|
22
|
-
constructor();
|
|
23
|
-
resolve(absoluteFilePath: string): CodeRatioRepoContext | undefined;
|
|
24
|
-
getCurrentRepoRoot(): string | undefined;
|
|
25
|
-
private getRepoEntry;
|
|
26
|
-
private readGitRepoEntry;
|
|
27
|
-
private readSvnRepoEntry;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Walk upwards from `startPath` looking for the nearest VCS working copy.
|
|
31
|
-
*
|
|
32
|
-
* SVN is checked alongside Git at every directory level instead of falling
|
|
33
|
-
* back after Git lookup. This matters when an SVN working copy lives inside a
|
|
34
|
-
* Git-managed parent directory: codeDiff must use `vcsType=svn` for files in
|
|
35
|
-
* that working copy rather than inheriting the outer Git repository.
|
|
36
|
-
*
|
|
37
|
-
* Exported for unit testing.
|
|
38
|
-
*/
|
|
39
|
-
export declare function findVcsRoot(startPath: string): VcsRoot | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Git-only compatibility helper retained for existing tests/callers.
|
|
42
|
-
*/
|
|
43
|
-
export declare function findRepoRoot(startPath: string): string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Strip credentials from a git remote URL. Mirrors the logic used by
|
|
46
|
-
* VCSEventProcessor so that both paths produce identical `repoUrl`
|
|
47
|
-
* values downstream.
|
|
48
|
-
*
|
|
49
|
-
* Exported for unit testing.
|
|
50
|
-
*/
|
|
51
|
-
export declare function clearSensitiveData(gitUrl: string): string;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { type StdioChannel } from '../utils/stdio-persistence';
|
|
2
|
-
export declare const StdoutWriter: unique symbol;
|
|
3
|
-
export interface StdoutWriter {
|
|
4
|
-
/** Serialize `data` as one JSON line. Never throws. */
|
|
5
|
-
write(data: unknown): void;
|
|
6
|
-
/** Enqueue a pre-serialized single line (trailing newline appended if missing). Never throws. */
|
|
7
|
-
writeLine(line: string): void;
|
|
8
|
-
/** Resolves once every enqueued line has been handed to the fd (or dropped on error). */
|
|
9
|
-
flush(): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Wait for the queue to drain with a STALL bound rather than an absolute one:
|
|
12
|
-
* as long as the consumer keeps accepting writes (progress), keep waiting —
|
|
13
|
-
* a slow-but-alive consumer is never cut off. Give up only after
|
|
14
|
-
* `stallTimeoutMs` of ZERO progress (consumer provably stuck/gone).
|
|
15
|
-
* Never rejects.
|
|
16
|
-
*/
|
|
17
|
-
flushOrStall(stallTimeoutMs: number): Promise<{
|
|
18
|
-
complete: boolean;
|
|
19
|
-
remainingBytes: number;
|
|
20
|
-
}>;
|
|
21
|
-
/** Number of lines dropped because the physical write failed. */
|
|
22
|
-
readonly failedWrites: number;
|
|
23
|
-
/**
|
|
24
|
-
* Attach(or 替换)stdio 持久化通道;未 attach 时 tap 是 no-op。
|
|
25
|
-
* 由 stream-json 模式的驱动逻辑在拿到 sessionId 后调用;调用前累积的
|
|
26
|
-
* 消息通过 attach 时可选传入的 `backlog` 一次性回放到通道。
|
|
27
|
-
*
|
|
28
|
-
* 传 null 显式清除。
|
|
29
|
-
*/
|
|
30
|
-
attachPersistChannel(channel: StdioChannel | null, backlog?: unknown[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* 打开 pre-attach 输出缓冲。开启后 `writeLine` 会把每条消息同时压进内部
|
|
33
|
-
* 缓冲区(cap 4096),直到 `attachPersistChannel` 时统一回放到通道并清空。
|
|
34
|
-
* 未 arm 时不缓冲,热路径零额外开销。
|
|
35
|
-
*
|
|
36
|
-
* 由 stream-json 驱动逻辑在 executeStreamMode 入口调用,因为此时 sessionId
|
|
37
|
-
* 尚未拿到但 stdout 已经会发出 initialize control_response / system init
|
|
38
|
-
* 等消息 —— 不预缓冲这些消息就永远无法落盘。
|
|
39
|
-
*/
|
|
40
|
-
armPersistPrebuffer(): void;
|
|
41
|
-
/**
|
|
42
|
-
* CLI 退出前 flush 已 attach 的持久化通道。未 attach 时立即 resolve。
|
|
43
|
-
* 永不 reject —— 落盘失败在 append 阶段已被静默计数。
|
|
44
|
-
*/
|
|
45
|
-
flushPersistChannel(): Promise<void>;
|
|
46
|
-
}
|
|
47
|
-
export declare class StdoutWriterImpl implements StdoutWriter {
|
|
48
|
-
private queue;
|
|
49
|
-
private queuedBytes;
|
|
50
|
-
private inFlightBytes;
|
|
51
|
-
private pumping;
|
|
52
|
-
private idleWaiters;
|
|
53
|
-
/** Invoked after each physical write settles — the stall detector's progress signal. */
|
|
54
|
-
private progressListeners;
|
|
55
|
-
private _failedWrites;
|
|
56
|
-
private loggedFailures;
|
|
57
|
-
/**
|
|
58
|
-
* stdio 持久化通道。由 stream-json 驱动逻辑在拿到 sessionId 后 attach。
|
|
59
|
-
* 未 attach 时 `tapPersist` 是 no-op,热路径无额外开销。
|
|
60
|
-
*/
|
|
61
|
-
private persistChannel;
|
|
62
|
-
/**
|
|
63
|
-
* attach 之前所有 stdout 消息的 pre-attach 缓冲。sessionId 在首个 HTTP
|
|
64
|
-
* response 之后才知道;response 到手时 CLI 通常已经 stdout 推过 initialize
|
|
65
|
-
* control_response / system init / status / file-history-snapshot / 甚至
|
|
66
|
-
* error result 等消息 —— 不缓冲就永远拿不到这些"session 生成前"的 stdout。
|
|
67
|
-
* cap 防内存爆炸;启用 stdio 持久化时才积累(`_persistArmed` 门控)。
|
|
68
|
-
*/
|
|
69
|
-
private outputPrebuffer;
|
|
70
|
-
private _persistArmed;
|
|
71
|
-
private static readonly PREBUFFER_CAP;
|
|
72
|
-
get failedWrites(): number;
|
|
73
|
-
attachPersistChannel(channel: StdioChannel | null, backlog?: unknown[]): void;
|
|
74
|
-
armPersistPrebuffer(): void;
|
|
75
|
-
flushPersistChannel(): Promise<void>;
|
|
76
|
-
private tapPersist;
|
|
77
|
-
private appendChunkToChannel;
|
|
78
|
-
write(data: unknown): void;
|
|
79
|
-
writeLine(line: string): void;
|
|
80
|
-
flush(): Promise<void>;
|
|
81
|
-
flushOrStall(stallTimeoutMs: number): Promise<{
|
|
82
|
-
complete: boolean;
|
|
83
|
-
remainingBytes: number;
|
|
84
|
-
}>;
|
|
85
|
-
private kickPump;
|
|
86
|
-
private pump;
|
|
87
|
-
/**
|
|
88
|
-
* One physical write. Resolves when the runtime reports the chunk as
|
|
89
|
-
* handled (callback fired) — success or failure alike; failures are
|
|
90
|
-
* counted and logged, never thrown.
|
|
91
|
-
*/
|
|
92
|
-
private writeChunk;
|
|
93
|
-
/**
|
|
94
|
-
* Log to the file logger only — stdout itself is the failing component,
|
|
95
|
-
* so no console fallback. Throttled: the first failure and then every
|
|
96
|
-
* 100th, to avoid log storms while keeping the signal.
|
|
97
|
-
*/
|
|
98
|
-
private reportFailure;
|
|
99
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { type CreateElicitationResponse } from '@genie/agent-client-protocol';
|
|
2
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
3
|
-
import { Logger } from '@genie/telemetry';
|
|
4
|
-
import { AcpAgent } from '../acp/acp-protocol';
|
|
5
|
-
import { SdkElicitationClient, SdkHooksManager } from '../control-signal/control-signal-protocol';
|
|
6
|
-
/**
|
|
7
|
-
* QR / 表单类交互远超单次交互点击时间尺度;与 AskService 的 10 分钟一致。
|
|
8
|
-
* 调用方可通过 `elicit(options.timeoutMs)` 覆盖。
|
|
9
|
-
*/
|
|
10
|
-
export declare const ELICITATION_DEFAULT_TIMEOUT_MS: number;
|
|
11
|
-
/** Prevent an untrusted client response from adding unbounded text to model context. */
|
|
12
|
-
export declare const ELICITATION_RESPONSE_REASON_MAX_LENGTH = 2000;
|
|
13
|
-
/**
|
|
14
|
-
* elicitation 通道目标。两条等价通道,协议形状一致(参数命名对齐 ACP):
|
|
15
|
-
* - acp:ACP 会话,经 `elicitation/create` + `elicitation/complete`;
|
|
16
|
-
* - sdk:stream-json(agent-sdk-js),经 control-signal `elicitation_create`
|
|
17
|
-
* 请求 + `elicitation` 频道通知。
|
|
18
|
-
*/
|
|
19
|
-
export type ElicitationTarget = {
|
|
20
|
-
kind: 'acp';
|
|
21
|
-
agent: AcpAgent;
|
|
22
|
-
acpSessionId: string;
|
|
23
|
-
} | {
|
|
24
|
-
kind: 'sdk';
|
|
25
|
-
acpSessionId: string;
|
|
26
|
-
};
|
|
27
|
-
export interface ElicitationRequestPayload {
|
|
28
|
-
/**
|
|
29
|
-
* 顶部提示语(客户端渲染在表单上方)。ACP 官方位置。
|
|
30
|
-
*/
|
|
31
|
-
message?: string;
|
|
32
|
-
/**
|
|
33
|
-
* 收集的结构化答复的受限 JSON Schema。与 MCP elicitation 保持一致。
|
|
34
|
-
* 传空 `{ type: 'object', properties: {} }` 表示"不收集内容,只等
|
|
35
|
-
* accept/decline/cancel"(同 payment 卡片的用法)。
|
|
36
|
-
*/
|
|
37
|
-
requestedSchema: Record<string, unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* 可选:本次调用触发该 elicitation 的工具调用 id。写进 ACP 官方
|
|
40
|
-
* `SessionScope.toolCallId`,用于挂靠到具体的 tool_call 卡片。
|
|
41
|
-
*/
|
|
42
|
-
toolCallId?: string;
|
|
43
|
-
/**
|
|
44
|
-
* 可选:SDK ≥0.25 提供的 elicitation id,跨越 create/complete 关联同一
|
|
45
|
-
* 张卡片。省略时由本 service 生成一个 `elic_<ts>_<rand>` id。
|
|
46
|
-
*/
|
|
47
|
-
elicitationId?: string;
|
|
48
|
-
/**
|
|
49
|
-
* 可选:附加 `_meta` 字段。会与本 service 生成的 `_meta['codebuddy.ai']`
|
|
50
|
-
* 合并(浅合并到 `codebuddy.ai` 子键下)。
|
|
51
|
-
*/
|
|
52
|
-
metaCodebuddyAi?: Record<string, unknown>;
|
|
53
|
-
}
|
|
54
|
-
export interface ElicitOptions {
|
|
55
|
-
/** 覆盖默认 10 分钟超时。传 0 / 非有限值走默认。 */
|
|
56
|
-
timeoutMs?: number;
|
|
57
|
-
/** 外部 abort 信号;触发时按 cancel 语义收敛并 dismiss 卡片。 */
|
|
58
|
-
signal?: AbortSignal;
|
|
59
|
-
}
|
|
60
|
-
export declare const ElicitationService: unique symbol;
|
|
61
|
-
export interface ElicitationService {
|
|
62
|
-
/**
|
|
63
|
-
* 根据 session 解析可用的 elicitation 通道。返回 undefined 表示当前
|
|
64
|
-
* 会话不满足派发条件(无 ACP 连接 / 未声明 capability / 非 stream-json /
|
|
65
|
-
* 非 form 模式),调用方应回退到 LLM-mediated 或直接失败。
|
|
66
|
-
*/
|
|
67
|
-
resolveTarget(session: Session): ElicitationTarget | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* 下发 elicitation 并等待用户响应。永不 throw(包括超时/abort/传输错误),
|
|
70
|
-
* 按 ACP 官方扁平形状返回 `{ action, content?, _meta? }`;abort/timeout/
|
|
71
|
-
* 传输错误统一 map 成 `{ action: 'cancel' }`,且会尽力发一次
|
|
72
|
-
* `elicitation/complete` 让客户端把卡片翻掉。
|
|
73
|
-
*/
|
|
74
|
-
elicit(target: ElicitationTarget, payload: ElicitationRequestPayload, options?: ElicitOptions): Promise<CreateElicitationResponse>;
|
|
75
|
-
/**
|
|
76
|
-
* 从响应里提取 `action` 标签;非法形状(老客户端 catch-all 回的 question
|
|
77
|
-
* 形状)返回 undefined,调用方按 cancel 处理。
|
|
78
|
-
*/
|
|
79
|
-
responseAction(response: CreateElicitationResponse | undefined): 'accept' | 'decline' | 'cancel' | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* 读取 CodeBuddy 扩展槽中的通用原因。只接受非空字符串,不解释或映射内容;
|
|
82
|
-
* 超长值会在安全上限处截断,避免宿主回包无限放大模型上下文。
|
|
83
|
-
*/
|
|
84
|
-
responseReason(response: CreateElicitationResponse | undefined): string | undefined;
|
|
85
|
-
}
|
|
86
|
-
export declare class ElicitationServiceImpl implements ElicitationService {
|
|
87
|
-
protected readonly sdkHooksManager: SdkHooksManager;
|
|
88
|
-
protected readonly sdkElicitationClient?: SdkElicitationClient;
|
|
89
|
-
protected readonly logger: Logger;
|
|
90
|
-
private idCounter;
|
|
91
|
-
resolveTarget(session: Session): ElicitationTarget | undefined;
|
|
92
|
-
responseAction(response: CreateElicitationResponse | undefined): 'accept' | 'decline' | 'cancel' | undefined;
|
|
93
|
-
responseReason(response: CreateElicitationResponse | undefined): string | undefined;
|
|
94
|
-
elicit(target: ElicitationTarget, payload: ElicitationRequestPayload, options?: ElicitOptions): Promise<CreateElicitationResponse>;
|
|
95
|
-
/**
|
|
96
|
-
* Best-effort 关掉客户端仍在显示的 elicitation 卡片(超时 / abort /
|
|
97
|
-
* 传输错误后)。同 payment 侧的语义,只是不带业务终态载荷。
|
|
98
|
-
*/
|
|
99
|
-
private dismiss;
|
|
100
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admin-trusted source gate for frontmatter hooks.
|
|
3
|
-
*
|
|
4
|
-
* Aligns with Claude Code's `isSourceAdminTrusted` in `runAgent.ts:566`:
|
|
5
|
-
* frontmatter hooks declared on user-local `.codebuddy/agents/*.md` or
|
|
6
|
-
* `.codebuddy/skills/SKILL.md` can silently spawn shell commands. We gate
|
|
7
|
-
* their registration so users must opt-in via the
|
|
8
|
-
* `allowUntrustedFrontmatterHooks` setting, unless the source is already
|
|
9
|
-
* admin-trusted (product built-in agents/skills).
|
|
10
|
-
*/
|
|
11
|
-
import { Agent as ProductAgent, Skill } from '@genie/product';
|
|
12
|
-
/**
|
|
13
|
-
* An agent is admin-trusted when it's NOT tagged as a custom agent —
|
|
14
|
-
* i.e. product-bundled agents shipped inside cbc itself.
|
|
15
|
-
*
|
|
16
|
-
* Custom agents include:
|
|
17
|
-
* - `.codebuddy/agents/*.md` (user/project local)
|
|
18
|
-
* - plugin marketplace agents
|
|
19
|
-
*
|
|
20
|
-
* Both of these default to "untrusted" for frontmatter hooks; enable via
|
|
21
|
-
* the `allowUntrustedFrontmatterHooks` setting.
|
|
22
|
-
*/
|
|
23
|
-
export declare function isAgentAdminTrusted(agent: ProductAgent | undefined): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* A skill is admin-trusted only when it's bundled inside cbc itself
|
|
26
|
-
* (future: product.skills). Currently all discovered skills come from
|
|
27
|
-
* `skill-loader.ts` which unconditionally assigns `source: 'plugin'` —
|
|
28
|
-
* so today this function effectively returns `false` for every skill
|
|
29
|
-
* we see at runtime, forcing the `allowUntrustedFrontmatterHooks` gate.
|
|
30
|
-
*
|
|
31
|
-
* Called by `skill-tool.ts` when the fork path carries SKILL.md
|
|
32
|
-
* `hooks:` frontmatter into the subagent lifecycle.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isSkillAdminTrusted(skill: Skill | undefined): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Resolve whether frontmatter hooks from a given source should be registered.
|
|
37
|
-
*
|
|
38
|
-
* @param isAdminTrusted Whether the source (agent/skill) is admin-trusted
|
|
39
|
-
* @param allowUntrusted Settings flag `allowUntrustedFrontmatterHooks`
|
|
40
|
-
*/
|
|
41
|
-
export declare function shouldRegisterFrontmatterHooks(isAdminTrusted: boolean, allowUntrusted: boolean | undefined): boolean;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat HTTP 伽利略指标。口径与 daemon `net-galileo-metrics.ts` 对齐:
|
|
3
|
-
* wb.api.request + outcome / net_class → 成功率、P95、弱网成功率。
|
|
4
|
-
*
|
|
5
|
-
* agent-cli 不依赖 workbuddy-server,此处保持同名常量和分类规则。
|
|
6
|
-
*/
|
|
7
|
-
export declare const WB_API_REQUEST_METRIC = "wb.api.request";
|
|
8
|
-
export declare const WEAK_NET_DURATION_MS = 2000;
|
|
9
|
-
export declare const CHAT_API_METRIC_STARTED_AT = "__wbApiMetricStartedAt";
|
|
10
|
-
interface DurationReporter {
|
|
11
|
-
recordDuration(metric: string, durationMs: number, dimensions?: Record<string, string>): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function reportChatApiRequestToGalileo(reporter: DurationReporter | undefined, input: {
|
|
14
|
-
method?: string;
|
|
15
|
-
status?: number;
|
|
16
|
-
startedAt?: number;
|
|
17
|
-
error?: unknown;
|
|
18
|
-
}): void;
|
|
19
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI 侧网络失败原因分类器。
|
|
3
|
-
*
|
|
4
|
-
* 与 daemon 侧 `@genie/workbuddy-server` 的 `net/classify-network-error.ts` 保持
|
|
5
|
-
* 同一套判定口径(代理 / PAC / CA / DNS / 超时 / 重置 / 拒绝),但因 agent-cli 是
|
|
6
|
-
* 独立发布、不依赖 workbuddy-server,这里单独维护一份纯函数实现。改动分类规则时
|
|
7
|
-
* 两处需同步。
|
|
8
|
-
*
|
|
9
|
-
* 目的:让 CLI 的网络失败日志能一眼区分「代理连不上 / PAC 出问题 / CA 证书校验
|
|
10
|
-
* 失败」,而不是笼统一句 `fetch failed`。
|
|
11
|
-
*/
|
|
12
|
-
export type CliNetworkErrorCategory = 'ca' | 'pac' | 'proxy' | 'dns' | 'timeout' | 'reset' | 'refused' | 'unknown';
|
|
13
|
-
export interface CliNetworkErrorClassification {
|
|
14
|
-
category: CliNetworkErrorCategory;
|
|
15
|
-
code?: string;
|
|
16
|
-
detail: string;
|
|
17
|
-
chain: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function classifyCliNetworkError(error: unknown): CliNetworkErrorClassification;
|
|
20
|
-
/** 产出一行可直接落日志的 CLI 网络错误分类字符串。 */
|
|
21
|
-
export declare function formatCliNetworkErrorForLog(error: unknown): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Application, ApplicationLifecycle } from '@celljs/core';
|
|
2
|
-
import { RestOperations } from '@celljs/http';
|
|
3
|
-
import { ProductManager } from '@genie/product';
|
|
4
|
-
import { CustomHeadersProvider } from './custom-headers-provider';
|
|
5
|
-
/**
|
|
6
|
-
* 把 CODEBUDDY_CUSTOM_HEADERS 注入到打向平台 endpoint 的 RestOperations 请求。
|
|
7
|
-
* 覆盖 imagegen / videogen 以及其它走 axios 单例的平台接口。
|
|
8
|
-
*/
|
|
9
|
-
export declare class CustomHeaderHttpInterceptor implements ApplicationLifecycle<Application> {
|
|
10
|
-
protected readonly restOperations: RestOperations;
|
|
11
|
-
protected readonly productManager: ProductManager;
|
|
12
|
-
protected readonly customHeadersProvider: CustomHeadersProvider;
|
|
13
|
-
initialize(): void;
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Application, ApplicationLifecycle } from '@celljs/core';
|
|
2
|
-
import { Logger } from '@genie/telemetry';
|
|
3
|
-
/**
|
|
4
|
-
* CLI 侧 fetch 代理补丁。
|
|
5
|
-
*
|
|
6
|
-
* 使用 ProxyResolver 按优先级链自治解析代理,
|
|
7
|
-
* 失败时清除 OS 缓存并直连重试。
|
|
8
|
-
*/
|
|
9
|
-
export declare class FetchProxy implements ApplicationLifecycle<Application> {
|
|
10
|
-
protected readonly logger: Logger;
|
|
11
|
-
private originFetch;
|
|
12
|
-
/**
|
|
13
|
-
* settingsPath 显式注入,确保 WORKBUDDY_CONFIG_DIR 被尊重
|
|
14
|
-
* (见 ProxyResolver class JSDoc 顶部 invariant)。
|
|
15
|
-
*
|
|
16
|
-
* #57186:daemon 注入 `WORKBUDDY_PAC_RPC_*` env 时自动启用 L0 PAC 反查;env
|
|
17
|
-
* 缺失时退化为 L1-L4 自治链。
|
|
18
|
-
*/
|
|
19
|
-
private proxyResolver;
|
|
20
|
-
initialize(): Promise<void>;
|
|
21
|
-
onStop(): Promise<void>;
|
|
22
|
-
}
|