@poolzin/pool-bot 2026.3.26 → 2026.3.28
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/dist/build-info.json +3 -3
- package/dist/utils.js +41 -0
- package/package.json +1 -1
- package/dist/acp/client.js +0 -333
- package/dist/acp/commands.js +0 -38
- package/dist/acp/event-mapper.js +0 -135
- package/dist/acp/meta.js +0 -36
- package/dist/acp/server.js +0 -133
- package/dist/acp/session-mapper.js +0 -65
- package/dist/acp/session.js +0 -68
- package/dist/acp/translator.js +0 -441
- package/dist/acp/types.js +0 -6
- package/dist/agents/agent-paths.js +0 -22
- package/dist/agents/agent-scope.js +0 -134
- package/dist/agents/announce-idempotency.js +0 -14
- package/dist/agents/anthropic-payload-log.js +0 -161
- package/dist/agents/api-key-rotation.js +0 -47
- package/dist/agents/apply-patch-update.js +0 -155
- package/dist/agents/apply-patch.js +0 -380
- package/dist/agents/auth-health.js +0 -165
- package/dist/agents/auth-profiles/constants.js +0 -20
- package/dist/agents/auth-profiles/display.js +0 -10
- package/dist/agents/auth-profiles/doctor.js +0 -31
- package/dist/agents/auth-profiles/external-cli-sync.js +0 -62
- package/dist/agents/auth-profiles/oauth.js +0 -302
- package/dist/agents/auth-profiles/order.js +0 -166
- package/dist/agents/auth-profiles/paths.js +0 -27
- package/dist/agents/auth-profiles/profiles.js +0 -72
- package/dist/agents/auth-profiles/repair.js +0 -120
- package/dist/agents/auth-profiles/session-override.js +0 -103
- package/dist/agents/auth-profiles/store.js +0 -323
- package/dist/agents/auth-profiles/usage.js +0 -260
- package/dist/agents/auth-profiles.js +0 -10
- package/dist/agents/bash-process-registry.js +0 -177
- package/dist/agents/bash-tools.exec-runtime.js +0 -415
- package/dist/agents/bash-tools.exec-types.js +0 -1
- package/dist/agents/bash-tools.exec.js +0 -813
- package/dist/agents/bash-tools.js +0 -2
- package/dist/agents/bash-tools.process.js +0 -575
- package/dist/agents/bash-tools.shared.js +0 -205
- package/dist/agents/bedrock-discovery.js +0 -159
- package/dist/agents/bootstrap-files.js +0 -28
- package/dist/agents/bootstrap-hooks.js +0 -19
- package/dist/agents/byteplus-models.js +0 -97
- package/dist/agents/cache-trace.js +0 -189
- package/dist/agents/channel-tools.js +0 -58
- package/dist/agents/chutes-oauth.js +0 -134
- package/dist/agents/cli-backends.js +0 -169
- package/dist/agents/cli-credentials.js +0 -360
- package/dist/agents/cli-runner/helpers.js +0 -328
- package/dist/agents/cli-runner/reliability.js +0 -61
- package/dist/agents/cli-runner.js +0 -316
- package/dist/agents/cli-session.js +0 -27
- package/dist/agents/cli-watchdog-defaults.js +0 -11
- package/dist/agents/cloudflare-ai-gateway.js +0 -31
- package/dist/agents/command-poll-backoff.js +0 -63
- package/dist/agents/compaction.js +0 -270
- package/dist/agents/content-blocks.js +0 -16
- package/dist/agents/context-window-guard.js +0 -40
- package/dist/agents/context.js +0 -34
- package/dist/agents/current-time.js +0 -16
- package/dist/agents/date-time.js +0 -158
- package/dist/agents/defaults.js +0 -6
- package/dist/agents/docs-path.js +0 -20
- package/dist/agents/doubao-models.js +0 -121
- package/dist/agents/failover-error.js +0 -264
- package/dist/agents/glob-pattern.js +0 -42
- package/dist/agents/huggingface-models.js +0 -168
- package/dist/agents/identity-avatar.js +0 -82
- package/dist/agents/identity-file.js +0 -80
- package/dist/agents/identity.js +0 -120
- package/dist/agents/image-sanitization.js +0 -9
- package/dist/agents/lanes.js +0 -2
- package/dist/agents/live-auth-keys.js +0 -168
- package/dist/agents/memory-search.js +0 -242
- package/dist/agents/minimax-vlm.js +0 -83
- package/dist/agents/model-alias-lines.js +0 -18
- package/dist/agents/model-auth-label.js +0 -61
- package/dist/agents/model-auth.js +0 -318
- package/dist/agents/model-catalog.js +0 -128
- package/dist/agents/model-compat.js +0 -17
- package/dist/agents/model-fallback.js +0 -339
- package/dist/agents/model-forward-compat.js +0 -224
- package/dist/agents/model-scan.js +0 -350
- package/dist/agents/model-selection.js +0 -410
- package/dist/agents/models-config.js +0 -111
- package/dist/agents/models-config.providers.js +0 -837
- package/dist/agents/ollama-stream.js +0 -415
- package/dist/agents/opencode-zen-models.js +0 -265
- package/dist/agents/pi-auth-json.js +0 -118
- package/dist/agents/pi-embedded-block-chunker.js +0 -284
- package/dist/agents/pi-embedded-helpers/bootstrap.js +0 -209
- package/dist/agents/pi-embedded-helpers/errors.js +0 -688
- package/dist/agents/pi-embedded-helpers/google.js +0 -12
- package/dist/agents/pi-embedded-helpers/images.js +0 -102
- package/dist/agents/pi-embedded-helpers/messaging-dedupe.js +0 -40
- package/dist/agents/pi-embedded-helpers/openai.js +0 -98
- package/dist/agents/pi-embedded-helpers/thinking.js +0 -37
- package/dist/agents/pi-embedded-helpers/turns.js +0 -95
- package/dist/agents/pi-embedded-helpers/types.js +0 -1
- package/dist/agents/pi-embedded-helpers.js +0 -9
- package/dist/agents/pi-embedded-messaging.js +0 -24
- package/dist/agents/pi-embedded-runner/abort.js +0 -16
- package/dist/agents/pi-embedded-runner/cache-ttl.js +0 -45
- package/dist/agents/pi-embedded-runner/compact.js +0 -623
- package/dist/agents/pi-embedded-runner/compaction-safety-timeout.js +0 -5
- package/dist/agents/pi-embedded-runner/extensions.js +0 -66
- package/dist/agents/pi-embedded-runner/extra-params.js +0 -261
- package/dist/agents/pi-embedded-runner/google.js +0 -404
- package/dist/agents/pi-embedded-runner/history.js +0 -79
- package/dist/agents/pi-embedded-runner/lanes.js +0 -11
- package/dist/agents/pi-embedded-runner/logger.js +0 -2
- package/dist/agents/pi-embedded-runner/model.js +0 -83
- package/dist/agents/pi-embedded-runner/run/attempt.js +0 -1127
- package/dist/agents/pi-embedded-runner/run/compaction-timeout.js +0 -27
- package/dist/agents/pi-embedded-runner/run/images.js +0 -370
- package/dist/agents/pi-embedded-runner/run/params.js +0 -1
- package/dist/agents/pi-embedded-runner/run/payloads.js +0 -212
- package/dist/agents/pi-embedded-runner/run/types.js +0 -1
- package/dist/agents/pi-embedded-runner/run.js +0 -915
- package/dist/agents/pi-embedded-runner/runs.js +0 -116
- package/dist/agents/pi-embedded-runner/sandbox-info.js +0 -22
- package/dist/agents/pi-embedded-runner/session-manager-cache.js +0 -59
- package/dist/agents/pi-embedded-runner/session-manager-init.js +0 -31
- package/dist/agents/pi-embedded-runner/system-prompt.js +0 -43
- package/dist/agents/pi-embedded-runner/thinking.js +0 -42
- package/dist/agents/pi-embedded-runner/tool-name-allowlist.js +0 -19
- package/dist/agents/pi-embedded-runner/tool-result-context-guard.js +0 -262
- package/dist/agents/pi-embedded-runner/tool-result-truncation.js +0 -330
- package/dist/agents/pi-embedded-runner/tool-split.js +0 -8
- package/dist/agents/pi-embedded-runner/types.js +0 -1
- package/dist/agents/pi-embedded-runner/utils.js +0 -22
- package/dist/agents/pi-embedded-runner/wait-for-idle-before-flush.js +0 -29
- package/dist/agents/pi-embedded-runner.js +0 -10
- package/dist/agents/pi-embedded-subscribe.handlers.compaction.js +0 -63
- package/dist/agents/pi-embedded-subscribe.handlers.js +0 -45
- package/dist/agents/pi-embedded-subscribe.handlers.lifecycle.js +0 -75
- package/dist/agents/pi-embedded-subscribe.handlers.messages.js +0 -230
- package/dist/agents/pi-embedded-subscribe.handlers.tools.js +0 -346
- package/dist/agents/pi-embedded-subscribe.handlers.types.js +0 -1
- package/dist/agents/pi-embedded-subscribe.js +0 -640
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +0 -28
- package/dist/agents/pi-embedded-subscribe.tools.js +0 -317
- package/dist/agents/pi-embedded-subscribe.types.js +0 -1
- package/dist/agents/pi-embedded-utils.js +0 -344
- package/dist/agents/pi-embedded.js +0 -1
- package/dist/agents/pi-extensions/compaction-safeguard-runtime.js +0 -4
- package/dist/agents/pi-extensions/compaction-safeguard.js +0 -294
- package/dist/agents/pi-extensions/context-pruning/extension.js +0 -32
- package/dist/agents/pi-extensions/context-pruning/pruner.js +0 -263
- package/dist/agents/pi-extensions/context-pruning/runtime.js +0 -21
- package/dist/agents/pi-extensions/context-pruning/settings.js +0 -71
- package/dist/agents/pi-extensions/context-pruning/tools.js +0 -44
- package/dist/agents/pi-extensions/context-pruning.js +0 -9
- package/dist/agents/pi-extensions/session-manager-runtime-registry.js +0 -23
- package/dist/agents/pi-model-discovery.js +0 -17
- package/dist/agents/pi-settings.js +0 -59
- package/dist/agents/pi-tool-definition-adapter.js +0 -167
- package/dist/agents/pi-tools.abort.js +0 -41
- package/dist/agents/pi-tools.before-tool-call.js +0 -208
- package/dist/agents/pi-tools.js +0 -376
- package/dist/agents/pi-tools.policy.js +0 -239
- package/dist/agents/pi-tools.read.js +0 -526
- package/dist/agents/pi-tools.schema.js +0 -174
- package/dist/agents/pi-tools.types.js +0 -1
- package/dist/agents/poolbot-tools.js +0 -168
- package/dist/agents/provider/integration.js +0 -136
- package/dist/agents/provider/rate-limits.js +0 -458
- package/dist/agents/provider/request-monitor.js +0 -449
- package/dist/agents/provider/token-pool.js +0 -541
- package/dist/agents/pty-dsr.js +0 -13
- package/dist/agents/pty-keys.js +0 -235
- package/dist/agents/sandbox/browser-bridges.js +0 -1
- package/dist/agents/sandbox/browser.js +0 -318
- package/dist/agents/sandbox/config-hash.js +0 -32
- package/dist/agents/sandbox/config.js +0 -133
- package/dist/agents/sandbox/constants.js +0 -47
- package/dist/agents/sandbox/context.js +0 -117
- package/dist/agents/sandbox/docker.js +0 -384
- package/dist/agents/sandbox/fs-bridge.js +0 -146
- package/dist/agents/sandbox/fs-paths.js +0 -205
- package/dist/agents/sandbox/hash.js +0 -4
- package/dist/agents/sandbox/manage.js +0 -91
- package/dist/agents/sandbox/novnc-auth.js +0 -62
- package/dist/agents/sandbox/prune.js +0 -87
- package/dist/agents/sandbox/registry.js +0 -121
- package/dist/agents/sandbox/runtime-status.js +0 -90
- package/dist/agents/sandbox/sanitize-env-vars.js +0 -82
- package/dist/agents/sandbox/shared.js +0 -42
- package/dist/agents/sandbox/tool-policy.js +0 -106
- package/dist/agents/sandbox/types.docker.js +0 -1
- package/dist/agents/sandbox/types.js +0 -1
- package/dist/agents/sandbox/validate-sandbox-security.js +0 -157
- package/dist/agents/sandbox/workspace.js +0 -39
- package/dist/agents/sandbox-paths.js +0 -148
- package/dist/agents/sandbox-tool-policy.js +0 -26
- package/dist/agents/sandbox.js +0 -7
- package/dist/agents/sanitize-for-prompt.js +0 -18
- package/dist/agents/schema/clean-for-gemini.js +0 -342
- package/dist/agents/schema/typebox.js +0 -22
- package/dist/agents/session-dirs.js +0 -20
- package/dist/agents/session-file-repair.js +0 -83
- package/dist/agents/session-slug.js +0 -139
- package/dist/agents/session-tool-result-guard-wrapper.js +0 -47
- package/dist/agents/session-tool-result-guard.js +0 -180
- package/dist/agents/session-transcript-repair.js +0 -279
- package/dist/agents/session-write-lock.js +0 -437
- package/dist/agents/shell-utils.js +0 -150
- package/dist/agents/skills/bundled-dir.js +0 -79
- package/dist/agents/skills/config.js +0 -142
- package/dist/agents/skills/env-overrides.js +0 -148
- package/dist/agents/skills/filter.js +0 -24
- package/dist/agents/skills/frontmatter.js +0 -81
- package/dist/agents/skills/plugin-skills.js +0 -62
- package/dist/agents/skills/refresh.js +0 -135
- package/dist/agents/skills/serialize.js +0 -13
- package/dist/agents/skills/types.js +0 -1
- package/dist/agents/skills/workspace.js +0 -580
- package/dist/agents/skills-install.js +0 -427
- package/dist/agents/skills-status.js +0 -183
- package/dist/agents/skills.js +0 -13
- package/dist/agents/stable-stringify.js +0 -12
- package/dist/agents/subagent-announce-queue.js +0 -173
- package/dist/agents/subagent-announce.js +0 -972
- package/dist/agents/subagent-depth.js +0 -137
- package/dist/agents/subagent-lifecycle-events.js +0 -19
- package/dist/agents/subagent-registry-cleanup.js +0 -31
- package/dist/agents/subagent-registry-completion.js +0 -68
- package/dist/agents/subagent-registry-queries.js +0 -117
- package/dist/agents/subagent-registry-state.js +0 -46
- package/dist/agents/subagent-registry.js +0 -767
- package/dist/agents/subagent-registry.store.js +0 -74
- package/dist/agents/subagent-registry.types.js +0 -1
- package/dist/agents/subagent-spawn.js +0 -433
- package/dist/agents/synthetic-models.js +0 -182
- package/dist/agents/system-prompt-params.js +0 -70
- package/dist/agents/system-prompt-report.js +0 -130
- package/dist/agents/system-prompt.js +0 -532
- package/dist/agents/timeout.js +0 -36
- package/dist/agents/together-models.js +0 -127
- package/dist/agents/tool-call-id.js +0 -216
- package/dist/agents/tool-display.js +0 -209
- package/dist/agents/tool-display.json +0 -308
- package/dist/agents/tool-images.js +0 -272
- package/dist/agents/tool-loop-detection.js +0 -466
- package/dist/agents/tool-mutation.js +0 -164
- package/dist/agents/tool-policy-pipeline.js +0 -69
- package/dist/agents/tool-policy.js +0 -254
- package/dist/agents/tool-summaries.js +0 -10
- package/dist/agents/tools/agent-step.js +0 -44
- package/dist/agents/tools/agents-list-tool.js +0 -66
- package/dist/agents/tools/browser-tool.js +0 -702
- package/dist/agents/tools/browser-tool.schema.js +0 -105
- package/dist/agents/tools/canvas-tool.js +0 -190
- package/dist/agents/tools/cron-tool.js +0 -410
- package/dist/agents/tools/deep-research-tool.js +0 -225
- package/dist/agents/tools/discord-actions-guild.js +0 -456
- package/dist/agents/tools/discord-actions-messaging.js +0 -383
- package/dist/agents/tools/discord-actions-moderation.js +0 -92
- package/dist/agents/tools/discord-actions.js +0 -61
- package/dist/agents/tools/gateway-tool.js +0 -216
- package/dist/agents/tools/gateway.js +0 -98
- package/dist/agents/tools/image-generate-tool.js +0 -235
- package/dist/agents/tools/image-tool.helpers.js +0 -55
- package/dist/agents/tools/image-tool.js +0 -485
- package/dist/agents/tools/memory-tool.js +0 -191
- package/dist/agents/tools/message-tool.js +0 -515
- package/dist/agents/tools/nodes-file-tool.js +0 -197
- package/dist/agents/tools/nodes-tool.js +0 -491
- package/dist/agents/tools/nodes-utils.js +0 -57
- package/dist/agents/tools/pdf-native-providers.js +0 -102
- package/dist/agents/tools/pdf-tool.helpers.js +0 -86
- package/dist/agents/tools/pdf-tool.js +0 -508
- package/dist/agents/tools/session-status-tool.js +0 -310
- package/dist/agents/tools/sessions-access.js +0 -178
- package/dist/agents/tools/sessions-announce-target.js +0 -43
- package/dist/agents/tools/sessions-helpers.js +0 -89
- package/dist/agents/tools/sessions-history-tool.js +0 -218
- package/dist/agents/tools/sessions-list-tool.js +0 -161
- package/dist/agents/tools/sessions-resolution.js +0 -206
- package/dist/agents/tools/sessions-send-helpers.js +0 -122
- package/dist/agents/tools/sessions-send-tool.a2a.js +0 -119
- package/dist/agents/tools/sessions-send-tool.js +0 -345
- package/dist/agents/tools/sessions-spawn-tool.js +0 -68
- package/dist/agents/tools/slack-actions.js +0 -243
- package/dist/agents/tools/subagents-tool.js +0 -617
- package/dist/agents/tools/telegram-actions.js +0 -305
- package/dist/agents/tools/tts-tool.js +0 -47
- package/dist/agents/tools/web-fetch-utils.js +0 -209
- package/dist/agents/tools/web-fetch.js +0 -581
- package/dist/agents/tools/web-search.js +0 -524
- package/dist/agents/tools/web-shared.js +0 -125
- package/dist/agents/tools/web-tools.js +0 -2
- package/dist/agents/tools/whatsapp-actions.js +0 -40
- package/dist/agents/tools/whatsapp-target-auth.js +0 -18
- package/dist/agents/transcript-policy.js +0 -97
- package/dist/agents/usage.js +0 -79
- package/dist/agents/venice-models.js +0 -350
- package/dist/agents/workspace-dir.js +0 -18
- package/dist/agents/workspace-dirs.js +0 -14
- package/dist/agents/workspace-run.js +0 -67
- package/dist/agents/workspace-templates.js +0 -44
- package/dist/agents/workspace.js +0 -480
- package/dist/auto-reply/auto-reply/reply/agent-runner-execution.js +0 -502
- package/dist/auto-reply/auto-reply/reply/agent-runner-helpers.js +0 -65
- package/dist/auto-reply/auto-reply/reply/agent-runner-memory.js +0 -160
- package/dist/auto-reply/auto-reply/reply/agent-runner-payloads.js +0 -85
- package/dist/auto-reply/auto-reply/reply/agent-runner-utils.js +0 -101
- package/dist/auto-reply/auto-reply/reply/bash-command.js +0 -338
- package/dist/auto-reply/auto-reply/reply/block-streaming.js +0 -91
- package/dist/auto-reply/auto-reply/reply/commands-approve.js +0 -88
- package/dist/auto-reply/auto-reply/reply/commands-bash.js +0 -26
- package/dist/auto-reply/auto-reply/reply/commands-compact.js +0 -107
- package/dist/auto-reply/auto-reply/reply/commands-config.js +0 -241
- package/dist/auto-reply/auto-reply/reply/commands-context-report.js +0 -295
- package/dist/auto-reply/auto-reply/reply/commands-context.js +0 -30
- package/dist/auto-reply/auto-reply/reply/commands-core.js +0 -151
- package/dist/auto-reply/auto-reply/reply/commands-export-session.js +0 -163
- package/dist/auto-reply/auto-reply/reply/commands-info.js +0 -184
- package/dist/auto-reply/auto-reply/reply/commands-models.js +0 -299
- package/dist/auto-reply/auto-reply/reply/commands-plugin.js +0 -35
- package/dist/auto-reply/auto-reply/reply/commands-ptt.js +0 -171
- package/dist/auto-reply/auto-reply/reply/commands-setunset-standard.js +0 -13
- package/dist/auto-reply/auto-reply/reply/commands-setunset.js +0 -73
- package/dist/auto-reply/auto-reply/reply/commands-slash-parse.js +0 -31
- package/dist/auto-reply/auto-reply/reply/commands-status.js +0 -178
- package/dist/auto-reply/auto-reply/reply/commands-subagents.js +0 -73
- package/dist/auto-reply/auto-reply/reply/commands-system-prompt.js +0 -117
- package/dist/auto-reply/auto-reply/reply/commands-tts.js +0 -231
- package/dist/auto-reply/auto-reply/reply/commands-types.js +0 -1
- package/dist/auto-reply/auto-reply/reply/directive-handling.impl.js +0 -380
- package/dist/auto-reply/auto-reply/reply/followup-runner.js +0 -227
- package/dist/auto-reply/auto-reply/reply/get-reply-directives-apply.js +0 -201
- package/dist/auto-reply/auto-reply/reply/get-reply-directives-utils.js +0 -54
- package/dist/auto-reply/auto-reply/reply/get-reply-directives.js +0 -332
- package/dist/auto-reply/auto-reply/reply/get-reply-inline-actions.js +0 -258
- package/dist/auto-reply/auto-reply/reply/get-reply-run.js +0 -297
- package/dist/auto-reply/auto-reply/reply/groups.js +0 -102
- package/dist/auto-reply/auto-reply/reply/mentions.js +0 -129
- package/dist/auto-reply/auto-reply/reply/reply-delivery.js +0 -92
- package/dist/auto-reply/auto-reply/reply/reply-directives.js +0 -30
- package/dist/auto-reply/auto-reply/reply/reply-dispatcher.js +0 -152
- package/dist/auto-reply/auto-reply/reply/reply-elevated.js +0 -166
- package/dist/auto-reply/auto-reply/reply/reply-inline.js +0 -28
- package/dist/auto-reply/auto-reply/reply/reply-payloads.js +0 -114
- package/dist/auto-reply/auto-reply/reply/reply-reference.js +0 -36
- package/dist/auto-reply/auto-reply/reply/reply-tags.js +0 -13
- package/dist/auto-reply/auto-reply/reply/reply-threading.js +0 -41
- package/dist/auto-reply/auto-reply/reply/session-updates.js +0 -233
- package/dist/auto-reply/auto-reply/reply/stage-sandbox-media.js +0 -146
- package/dist/auto-reply/chunk.js +0 -358
- package/dist/auto-reply/command-auth.js +0 -247
- package/dist/auto-reply/command-detection.js +0 -56
- package/dist/auto-reply/commands-args.js +0 -85
- package/dist/auto-reply/commands-registry.data.js +0 -699
- package/dist/auto-reply/commands-registry.js +0 -352
- package/dist/auto-reply/commands-registry.types.js +0 -1
- package/dist/auto-reply/dispatch.js +0 -59
- package/dist/auto-reply/envelope.js +0 -165
- package/dist/auto-reply/fallback-state.js +0 -114
- package/dist/auto-reply/group-activation.js +0 -27
- package/dist/auto-reply/heartbeat-reply-payload.js +0 -18
- package/dist/auto-reply/heartbeat.js +0 -120
- package/dist/auto-reply/inbound-debounce.js +0 -79
- package/dist/auto-reply/media-note.js +0 -72
- package/dist/auto-reply/model-runtime.js +0 -68
- package/dist/auto-reply/model.js +0 -28
- package/dist/auto-reply/reply/abort.js +0 -220
- package/dist/auto-reply/reply/agent-runner-execution.js +0 -502
- package/dist/auto-reply/reply/agent-runner-helpers.js +0 -65
- package/dist/auto-reply/reply/agent-runner-memory.js +0 -160
- package/dist/auto-reply/reply/agent-runner-payloads.js +0 -85
- package/dist/auto-reply/reply/agent-runner-utils.js +0 -101
- package/dist/auto-reply/reply/agent-runner.js +0 -505
- package/dist/auto-reply/reply/audio-tags.js +0 -1
- package/dist/auto-reply/reply/bash-command.js +0 -338
- package/dist/auto-reply/reply/block-reply-coalescer.js +0 -101
- package/dist/auto-reply/reply/block-reply-pipeline.js +0 -179
- package/dist/auto-reply/reply/block-streaming.js +0 -91
- package/dist/auto-reply/reply/body.js +0 -37
- package/dist/auto-reply/reply/command-gates.js +0 -25
- package/dist/auto-reply/reply/commands-allowlist.js +0 -609
- package/dist/auto-reply/reply/commands-approve.js +0 -88
- package/dist/auto-reply/reply/commands-bash.js +0 -26
- package/dist/auto-reply/reply/commands-compact.js +0 -107
- package/dist/auto-reply/reply/commands-config.js +0 -241
- package/dist/auto-reply/reply/commands-context-report.js +0 -295
- package/dist/auto-reply/reply/commands-context.js +0 -30
- package/dist/auto-reply/reply/commands-core.js +0 -151
- package/dist/auto-reply/reply/commands-export-session.js +0 -163
- package/dist/auto-reply/reply/commands-info.js +0 -184
- package/dist/auto-reply/reply/commands-models.js +0 -299
- package/dist/auto-reply/reply/commands-plugin.js +0 -35
- package/dist/auto-reply/reply/commands-ptt.js +0 -171
- package/dist/auto-reply/reply/commands-session.js +0 -466
- package/dist/auto-reply/reply/commands-setunset-standard.js +0 -13
- package/dist/auto-reply/reply/commands-setunset.js +0 -73
- package/dist/auto-reply/reply/commands-slash-parse.js +0 -31
- package/dist/auto-reply/reply/commands-status.js +0 -178
- package/dist/auto-reply/reply/commands-subagents/action-agents.js +0 -44
- package/dist/auto-reply/reply/commands-subagents/action-focus.js +0 -64
- package/dist/auto-reply/reply/commands-subagents/action-help.js +0 -4
- package/dist/auto-reply/reply/commands-subagents/action-info.js +0 -45
- package/dist/auto-reply/reply/commands-subagents/action-kill.js +0 -60
- package/dist/auto-reply/reply/commands-subagents/action-list.js +0 -44
- package/dist/auto-reply/reply/commands-subagents/action-log.js +0 -29
- package/dist/auto-reply/reply/commands-subagents/action-send.js +0 -119
- package/dist/auto-reply/reply/commands-subagents/action-spawn.js +0 -52
- package/dist/auto-reply/reply/commands-subagents/action-unfocus.js +0 -30
- package/dist/auto-reply/reply/commands-subagents/shared.js +0 -303
- package/dist/auto-reply/reply/commands-subagents.js +0 -73
- package/dist/auto-reply/reply/commands-system-prompt.js +0 -117
- package/dist/auto-reply/reply/commands-tts.js +0 -231
- package/dist/auto-reply/reply/commands-types.js +0 -1
- package/dist/auto-reply/reply/commands.js +0 -3
- package/dist/auto-reply/reply/config-commands.js +0 -58
- package/dist/auto-reply/reply/config-value.js +0 -40
- package/dist/auto-reply/reply/debug-commands.js +0 -58
- package/dist/auto-reply/reply/directive-handling.auth.js +0 -191
- package/dist/auto-reply/reply/directive-handling.fast-lane.js +0 -60
- package/dist/auto-reply/reply/directive-handling.impl.js +0 -380
- package/dist/auto-reply/reply/directive-handling.js +0 -5
- package/dist/auto-reply/reply/directive-handling.levels.js +0 -17
- package/dist/auto-reply/reply/directive-handling.model-picker.js +0 -70
- package/dist/auto-reply/reply/directive-handling.model.js +0 -279
- package/dist/auto-reply/reply/directive-handling.params.js +0 -1
- package/dist/auto-reply/reply/directive-handling.parse.js +0 -84
- package/dist/auto-reply/reply/directive-handling.persist.js +0 -169
- package/dist/auto-reply/reply/directive-handling.queue-validation.js +0 -48
- package/dist/auto-reply/reply/directive-handling.shared.js +0 -63
- package/dist/auto-reply/reply/directive-parsing.js +0 -36
- package/dist/auto-reply/reply/directives.js +0 -114
- package/dist/auto-reply/reply/dispatch-from-config.js +0 -424
- package/dist/auto-reply/reply/dispatcher-registry.js +0 -43
- package/dist/auto-reply/reply/elevated-unavailable.js +0 -20
- package/dist/auto-reply/reply/exec/directive.js +0 -183
- package/dist/auto-reply/reply/exec.js +0 -1
- package/dist/auto-reply/reply/followup-runner.js +0 -227
- package/dist/auto-reply/reply/get-reply-directives-apply.js +0 -201
- package/dist/auto-reply/reply/get-reply-directives-utils.js +0 -54
- package/dist/auto-reply/reply/get-reply-directives.js +0 -332
- package/dist/auto-reply/reply/get-reply-inline-actions.js +0 -258
- package/dist/auto-reply/reply/get-reply-run.js +0 -297
- package/dist/auto-reply/reply/get-reply.js +0 -299
- package/dist/auto-reply/reply/groups.js +0 -102
- package/dist/auto-reply/reply/history.js +0 -110
- package/dist/auto-reply/reply/inbound-context.js +0 -59
- package/dist/auto-reply/reply/inbound-dedupe.js +0 -39
- package/dist/auto-reply/reply/inbound-meta.js +0 -141
- package/dist/auto-reply/reply/inbound-sender-meta.js +0 -45
- package/dist/auto-reply/reply/inbound-text.js +0 -3
- package/dist/auto-reply/reply/line-directives.js +0 -294
- package/dist/auto-reply/reply/memory-flush.js +0 -66
- package/dist/auto-reply/reply/mentions.js +0 -129
- package/dist/auto-reply/reply/message-preprocess-hooks.js +0 -17
- package/dist/auto-reply/reply/model-selection.js +0 -439
- package/dist/auto-reply/reply/normalize-reply.js +0 -63
- package/dist/auto-reply/reply/post-compaction-audit.js +0 -96
- package/dist/auto-reply/reply/post-compaction-context.js +0 -98
- package/dist/auto-reply/reply/provider-dispatcher.js +0 -19
- package/dist/auto-reply/reply/queue/cleanup.js +0 -19
- package/dist/auto-reply/reply/queue/directive.js +0 -155
- package/dist/auto-reply/reply/queue/drain.js +0 -111
- package/dist/auto-reply/reply/queue/enqueue.js +0 -48
- package/dist/auto-reply/reply/queue/normalize.js +0 -30
- package/dist/auto-reply/reply/queue/settings.js +0 -52
- package/dist/auto-reply/reply/queue/state.js +0 -54
- package/dist/auto-reply/reply/queue/types.js +0 -1
- package/dist/auto-reply/reply/queue.js +0 -6
- package/dist/auto-reply/reply/reply-delivery.js +0 -92
- package/dist/auto-reply/reply/reply-directives.js +0 -30
- package/dist/auto-reply/reply/reply-dispatcher.js +0 -152
- package/dist/auto-reply/reply/reply-elevated.js +0 -166
- package/dist/auto-reply/reply/reply-inline.js +0 -28
- package/dist/auto-reply/reply/reply-payloads.js +0 -114
- package/dist/auto-reply/reply/reply-reference.js +0 -36
- package/dist/auto-reply/reply/reply-tags.js +0 -13
- package/dist/auto-reply/reply/reply-threading.js +0 -41
- package/dist/auto-reply/reply/response-prefix-template.js +0 -76
- package/dist/auto-reply/reply/route-reply.js +0 -115
- package/dist/auto-reply/reply/session-reset-model.js +0 -133
- package/dist/auto-reply/reply/session-reset-prompt.js +0 -1
- package/dist/auto-reply/reply/session-run-accounting.js +0 -33
- package/dist/auto-reply/reply/session-updates.js +0 -233
- package/dist/auto-reply/reply/session-usage.js +0 -79
- package/dist/auto-reply/reply/session.js +0 -400
- package/dist/auto-reply/reply/stage-sandbox-media.js +0 -146
- package/dist/auto-reply/reply/streaming-directives.js +0 -103
- package/dist/auto-reply/reply/strip-inbound-meta.js +0 -147
- package/dist/auto-reply/reply/subagents-utils.js +0 -78
- package/dist/auto-reply/reply/test-ctx.js +0 -15
- package/dist/auto-reply/reply/typing-mode.js +0 -91
- package/dist/auto-reply/reply/typing.js +0 -157
- package/dist/auto-reply/reply/untrusted-context.js +0 -15
- package/dist/auto-reply/reply.directive.directive-behavior.e2e-mocks.js +0 -12
- package/dist/auto-reply/reply.js +0 -5
- package/dist/auto-reply/send-policy.js +0 -37
- package/dist/auto-reply/skill-commands.js +0 -97
- package/dist/auto-reply/status.js +0 -638
- package/dist/auto-reply/templating.js +0 -44
- package/dist/auto-reply/thinking.js +0 -190
- package/dist/auto-reply/tokens.js +0 -31
- package/dist/auto-reply/tool-meta.js +0 -112
- package/dist/auto-reply/types.js +0 -1
- package/dist/browser/bridge-auth-registry.js +0 -26
- package/dist/browser/bridge-server.js +0 -74
- package/dist/browser/browser-profile-manager.js +0 -319
- package/dist/browser/cdp-proxy-bypass.js +0 -129
- package/dist/browser/cdp-timeouts.js +0 -41
- package/dist/browser/cdp.helpers.js +0 -143
- package/dist/browser/cdp.js +0 -313
- package/dist/browser/chrome-extension-validator.js +0 -406
- package/dist/browser/chrome-mcp-snapshot.js +0 -222
- package/dist/browser/chrome-mcp.js +0 -421
- package/dist/browser/chrome-mcp.snapshot.js +0 -133
- package/dist/browser/chrome.executables.js +0 -509
- package/dist/browser/chrome.js +0 -253
- package/dist/browser/chrome.profile-decoration.js +0 -147
- package/dist/browser/client-actions-core.js +0 -100
- package/dist/browser/client-actions-observe.js +0 -100
- package/dist/browser/client-actions-state.js +0 -169
- package/dist/browser/client-actions-types.js +0 -1
- package/dist/browser/client-actions-url.js +0 -10
- package/dist/browser/client-actions.js +0 -4
- package/dist/browser/client-fetch.js +0 -134
- package/dist/browser/client.js +0 -137
- package/dist/browser/config.js +0 -201
- package/dist/browser/constants.js +0 -8
- package/dist/browser/control-auth.js +0 -73
- package/dist/browser/control-service.js +0 -72
- package/dist/browser/csrf.js +0 -64
- package/dist/browser/errors.js +0 -67
- package/dist/browser/extension-relay-auth.js +0 -55
- package/dist/browser/extension-relay.js +0 -647
- package/dist/browser/form-fields.js +0 -22
- package/dist/browser/http-auth.js +0 -52
- package/dist/browser/navigation-guard.js +0 -39
- package/dist/browser/output-atomic.js +0 -44
- package/dist/browser/paths.js +0 -114
- package/dist/browser/profile-capabilities.js +0 -47
- package/dist/browser/profiles-service.js +0 -132
- package/dist/browser/profiles.js +0 -98
- package/dist/browser/proxy-files.js +0 -32
- package/dist/browser/pw-ai-module.js +0 -42
- package/dist/browser/pw-ai-state.js +0 -7
- package/dist/browser/pw-ai.js +0 -2
- package/dist/browser/pw-role-snapshot.js +0 -310
- package/dist/browser/pw-session.js +0 -603
- package/dist/browser/pw-tools-core.activity.js +0 -44
- package/dist/browser/pw-tools-core.downloads.js +0 -176
- package/dist/browser/pw-tools-core.interactions.js +0 -525
- package/dist/browser/pw-tools-core.js +0 -8
- package/dist/browser/pw-tools-core.responses.js +0 -83
- package/dist/browser/pw-tools-core.shared.js +0 -48
- package/dist/browser/pw-tools-core.snapshot.js +0 -142
- package/dist/browser/pw-tools-core.state.js +0 -153
- package/dist/browser/pw-tools-core.storage.js +0 -72
- package/dist/browser/pw-tools-core.trace.js +0 -25
- package/dist/browser/resolved-config-refresh.js +0 -42
- package/dist/browser/routes/agent.act.js +0 -518
- package/dist/browser/routes/agent.act.shared.js +0 -38
- package/dist/browser/routes/agent.debug.js +0 -133
- package/dist/browser/routes/agent.js +0 -10
- package/dist/browser/routes/agent.shared.js +0 -89
- package/dist/browser/routes/agent.snapshot.js +0 -275
- package/dist/browser/routes/agent.storage.js +0 -392
- package/dist/browser/routes/basic.js +0 -173
- package/dist/browser/routes/dispatcher.js +0 -86
- package/dist/browser/routes/index.js +0 -8
- package/dist/browser/routes/path-output.js +0 -1
- package/dist/browser/routes/tabs.js +0 -174
- package/dist/browser/routes/types.js +0 -1
- package/dist/browser/routes/utils.js +0 -57
- package/dist/browser/safe-filename.js +0 -25
- package/dist/browser/screenshot.js +0 -39
- package/dist/browser/server-context.chrome-test-harness.js +0 -20
- package/dist/browser/server-context.js +0 -540
- package/dist/browser/server-context.types.js +0 -1
- package/dist/browser/server-lifecycle.js +0 -37
- package/dist/browser/server-middleware.js +0 -31
- package/dist/browser/server.js +0 -103
- package/dist/browser/snapshot-roles.js +0 -60
- package/dist/browser/target-id.js +0 -16
- package/dist/browser/test-port.js +0 -16
- package/dist/browser/trash.js +0 -21
- package/dist/canvas-host/a2ui.js +0 -191
- package/dist/canvas-host/file-resolver.js +0 -43
- package/dist/canvas-host/server.js +0 -414
- package/dist/channel-web.js +0 -8
- package/dist/channels/account-summary.js +0 -19
- package/dist/channels/ack-reactions.js +0 -56
- package/dist/channels/allow-from.js +0 -26
- package/dist/channels/allowlist-match.js +0 -23
- package/dist/channels/allowlists/resolve-utils.js +0 -124
- package/dist/channels/channel-config.js +0 -138
- package/dist/channels/channels/directory-config.js +0 -185
- package/dist/channels/channels/discord/handle-action.guild-admin.js +0 -332
- package/dist/channels/channels/discord/handle-action.js +0 -165
- package/dist/channels/channels/discord.js +0 -413
- package/dist/channels/channels/dock.js +0 -436
- package/dist/channels/channels/index.js +0 -51
- package/dist/channels/channels/plugins/outbound/discord.js +0 -101
- package/dist/channels/channels/whatsapp.js +0 -17
- package/dist/channels/chat-type.js +0 -16
- package/dist/channels/command-gating.js +0 -24
- package/dist/channels/conversation-label.js +0 -48
- package/dist/channels/dock.js +0 -436
- package/dist/channels/draft-stream-controls.js +0 -89
- package/dist/channels/draft-stream-loop.js +0 -88
- package/dist/channels/location.js +0 -44
- package/dist/channels/logging.js +0 -13
- package/dist/channels/mention-gating.js +0 -26
- package/dist/channels/model-overrides.js +0 -82
- package/dist/channels/plugins/account-action-gate.js +0 -13
- package/dist/channels/plugins/account-helpers.js +0 -26
- package/dist/channels/plugins/actions/discord/handle-action.guild-admin.js +0 -332
- package/dist/channels/plugins/actions/discord/handle-action.js +0 -165
- package/dist/channels/plugins/actions/discord.js +0 -93
- package/dist/channels/plugins/actions/signal.js +0 -115
- package/dist/channels/plugins/actions/telegram.js +0 -173
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +0 -63
- package/dist/channels/plugins/allowlist-match.js +0 -1
- package/dist/channels/plugins/bluebubbles-actions.js +0 -16
- package/dist/channels/plugins/catalog.js +0 -223
- package/dist/channels/plugins/channel-config.js +0 -1
- package/dist/channels/plugins/config-helpers.js +0 -87
- package/dist/channels/plugins/config-schema.js +0 -8
- package/dist/channels/plugins/config-writes.js +0 -21
- package/dist/channels/plugins/directory-config.js +0 -185
- package/dist/channels/plugins/group-mentions.js +0 -324
- package/dist/channels/plugins/helpers.js +0 -12
- package/dist/channels/plugins/index.js +0 -51
- package/dist/channels/plugins/load.js +0 -22
- package/dist/channels/plugins/media-limits.js +0 -15
- package/dist/channels/plugins/message-action-names.js +0 -53
- package/dist/channels/plugins/message-actions.js +0 -64
- package/dist/channels/plugins/normalize/discord.js +0 -40
- package/dist/channels/plugins/normalize/imessage.js +0 -43
- package/dist/channels/plugins/normalize/signal.js +0 -65
- package/dist/channels/plugins/normalize/slack.js +0 -24
- package/dist/channels/plugins/normalize/telegram.js +0 -38
- package/dist/channels/plugins/normalize/whatsapp.js +0 -17
- package/dist/channels/plugins/onboarding/channel-access.js +0 -68
- package/dist/channels/plugins/onboarding/discord.js +0 -413
- package/dist/channels/plugins/onboarding/helpers.js +0 -15
- package/dist/channels/plugins/onboarding/imessage.js +0 -231
- package/dist/channels/plugins/onboarding/signal.js +0 -262
- package/dist/channels/plugins/onboarding/slack.js +0 -470
- package/dist/channels/plugins/onboarding/telegram.js +0 -289
- package/dist/channels/plugins/onboarding/whatsapp.js +0 -286
- package/dist/channels/plugins/onboarding-types.js +0 -1
- package/dist/channels/plugins/outbound/discord.js +0 -101
- package/dist/channels/plugins/outbound/imessage.js +0 -39
- package/dist/channels/plugins/outbound/load.js +0 -28
- package/dist/channels/plugins/outbound/signal.js +0 -36
- package/dist/channels/plugins/outbound/slack.js +0 -27
- package/dist/channels/plugins/outbound/telegram.js +0 -91
- package/dist/channels/plugins/outbound/whatsapp.js +0 -76
- package/dist/channels/plugins/pairing-message.js +0 -1
- package/dist/channels/plugins/pairing.js +0 -44
- package/dist/channels/plugins/setup-helpers.js +0 -94
- package/dist/channels/plugins/slack.actions.js +0 -158
- package/dist/channels/plugins/status-issues/bluebubbles.js +0 -76
- package/dist/channels/plugins/status-issues/discord.js +0 -115
- package/dist/channels/plugins/status-issues/shared.js +0 -23
- package/dist/channels/plugins/status-issues/telegram.js +0 -100
- package/dist/channels/plugins/status-issues/whatsapp.js +0 -52
- package/dist/channels/plugins/status.js +0 -26
- package/dist/channels/plugins/types.adapters.js +0 -1
- package/dist/channels/plugins/types.core.js +0 -1
- package/dist/channels/plugins/types.plugin.js +0 -1
- package/dist/channels/plugins/whatsapp-heartbeat.js +0 -56
- package/dist/channels/registry.js +0 -166
- package/dist/channels/reply-prefix.js +0 -28
- package/dist/channels/run-state-machine.js +0 -7
- package/dist/channels/sender-identity.js +0 -30
- package/dist/channels/sender-label.js +0 -45
- package/dist/channels/session.js +0 -28
- package/dist/channels/status-reactions.js +0 -297
- package/dist/channels/targets.js +0 -27
- package/dist/channels/telegram/allow-from.js +0 -10
- package/dist/channels/telegram/api.js +0 -18
- package/dist/channels/typing-lifecycle.js +0 -39
- package/dist/channels/typing.js +0 -17
- package/dist/channels/web/index.js +0 -2
- package/dist/cli/acp-cli.js +0 -63
- package/dist/cli/argv.js +0 -189
- package/dist/cli/banner.js +0 -116
- package/dist/cli/browser-cli-actions-input/register.element.js +0 -228
- package/dist/cli/browser-cli-actions-input/register.files-downloads.js +0 -157
- package/dist/cli/browser-cli-actions-input/register.form-wait-eval.js +0 -121
- package/dist/cli/browser-cli-actions-input/register.js +0 -10
- package/dist/cli/browser-cli-actions-input/register.navigation.js +0 -72
- package/dist/cli/browser-cli-actions-input/shared.js +0 -57
- package/dist/cli/browser-cli-actions-input.js +0 -1
- package/dist/cli/browser-cli-actions-observe.js +0 -90
- package/dist/cli/browser-cli-debug.js +0 -162
- package/dist/cli/browser-cli-examples.js +0 -33
- package/dist/cli/browser-cli-extension.js +0 -111
- package/dist/cli/browser-cli-inspect.js +0 -136
- package/dist/cli/browser-cli-manage.js +0 -401
- package/dist/cli/browser-cli-resize.js +0 -22
- package/dist/cli/browser-cli-shared.js +0 -42
- package/dist/cli/browser-cli-state.cookies-storage.js +0 -201
- package/dist/cli/browser-cli-state.js +0 -243
- package/dist/cli/browser-cli.js +0 -37
- package/dist/cli/channel-auth.js +0 -49
- package/dist/cli/channel-options.js +0 -29
- package/dist/cli/channels-cli.js +0 -208
- package/dist/cli/clawbot-cli.js +0 -5
- package/dist/cli/cli-name.js +0 -26
- package/dist/cli/cli-utils.js +0 -44
- package/dist/cli/command-format.js +0 -18
- package/dist/cli/command-options.js +0 -34
- package/dist/cli/completion-cli.js +0 -566
- package/dist/cli/config-cli.js +0 -427
- package/dist/cli/cron-cli/register.cron-add.js +0 -233
- package/dist/cli/cron-cli/register.cron-dashboard.js +0 -339
- package/dist/cli/cron-cli/register.cron-edit.js +0 -230
- package/dist/cli/cron-cli/register.cron-simple.js +0 -98
- package/dist/cli/cron-cli/register.js +0 -18
- package/dist/cli/cron-cli/shared.js +0 -199
- package/dist/cli/cron-cli.js +0 -1
- package/dist/cli/daemon-cli/install.js +0 -115
- package/dist/cli/daemon-cli/lifecycle-core.js +0 -270
- package/dist/cli/daemon-cli/lifecycle.js +0 -103
- package/dist/cli/daemon-cli/probe.js +0 -28
- package/dist/cli/daemon-cli/register-service-commands.js +0 -81
- package/dist/cli/daemon-cli/register.js +0 -69
- package/dist/cli/daemon-cli/response.js +0 -20
- package/dist/cli/daemon-cli/restart-health.js +0 -126
- package/dist/cli/daemon-cli/runners.js +0 -3
- package/dist/cli/daemon-cli/shared.js +0 -169
- package/dist/cli/daemon-cli/status.gather.js +0 -168
- package/dist/cli/daemon-cli/status.js +0 -19
- package/dist/cli/daemon-cli/status.print.js +0 -233
- package/dist/cli/daemon-cli/types.js +0 -1
- package/dist/cli/daemon-cli-compat.js +0 -80
- package/dist/cli/daemon-cli.js +0 -3
- package/dist/cli/deps.js +0 -33
- package/dist/cli/devices-cli.js +0 -194
- package/dist/cli/directory-cli.js +0 -227
- package/dist/cli/dns-cli.js +0 -211
- package/dist/cli/docs-cli.js +0 -17
- package/dist/cli/errors.js +0 -187
- package/dist/cli/exec-approvals-cli.js +0 -346
- package/dist/cli/gateway-cli/call.js +0 -25
- package/dist/cli/gateway-cli/dev.js +0 -99
- package/dist/cli/gateway-cli/discover.js +0 -88
- package/dist/cli/gateway-cli/register.js +0 -205
- package/dist/cli/gateway-cli/run-loop.js +0 -137
- package/dist/cli/gateway-cli/run.js +0 -308
- package/dist/cli/gateway-cli/shared.js +0 -101
- package/dist/cli/gateway-cli.js +0 -1
- package/dist/cli/gateway-rpc.js +0 -27
- package/dist/cli/help-format.js +0 -16
- package/dist/cli/hooks-cli.js +0 -709
- package/dist/cli/logs-cli.js +0 -222
- package/dist/cli/memory-cli.js +0 -640
- package/dist/cli/models-cli.js +0 -321
- package/dist/cli/node-cli/daemon.js +0 -482
- package/dist/cli/node-cli/register.js +0 -90
- package/dist/cli/node-cli.js +0 -1
- package/dist/cli/nodes-camera.js +0 -107
- package/dist/cli/nodes-canvas.js +0 -26
- package/dist/cli/nodes-cli/a2ui-jsonl.js +0 -81
- package/dist/cli/nodes-cli/cli-utils.js +0 -27
- package/dist/cli/nodes-cli/format.js +0 -35
- package/dist/cli/nodes-cli/pairing-render.js +0 -26
- package/dist/cli/nodes-cli/register.camera.js +0 -196
- package/dist/cli/nodes-cli/register.canvas.js +0 -215
- package/dist/cli/nodes-cli/register.invoke.js +0 -303
- package/dist/cli/nodes-cli/register.js +0 -24
- package/dist/cli/nodes-cli/register.location.js +0 -64
- package/dist/cli/nodes-cli/register.notify.js +0 -51
- package/dist/cli/nodes-cli/register.pairing.js +0 -99
- package/dist/cli/nodes-cli/register.push.js +0 -63
- package/dist/cli/nodes-cli/register.screen.js +0 -66
- package/dist/cli/nodes-cli/register.status.js +0 -328
- package/dist/cli/nodes-cli/rpc.js +0 -71
- package/dist/cli/nodes-cli/types.js +0 -1
- package/dist/cli/nodes-cli.js +0 -1
- package/dist/cli/nodes-media-utils.js +0 -26
- package/dist/cli/nodes-run.js +0 -19
- package/dist/cli/nodes-screen.js +0 -35
- package/dist/cli/outbound-send-deps.js +0 -4
- package/dist/cli/outbound-send-mapping.js +0 -11
- package/dist/cli/pairing-cli.js +0 -141
- package/dist/cli/parse-bytes.js +0 -37
- package/dist/cli/parse-duration.js +0 -28
- package/dist/cli/parse-timeout.js +0 -18
- package/dist/cli/plugin-registry.js +0 -24
- package/dist/cli/plugins-cli.js +0 -646
- package/dist/cli/ports.js +0 -102
- package/dist/cli/profile-utils.js +0 -17
- package/dist/cli/profile.js +0 -96
- package/dist/cli/program/action-reparse.js +0 -17
- package/dist/cli/program/build-program.js +0 -16
- package/dist/cli/program/command-registry.js +0 -326
- package/dist/cli/program/command-tree.js +0 -16
- package/dist/cli/program/config-guard.js +0 -67
- package/dist/cli/program/context.js +0 -11
- package/dist/cli/program/help.js +0 -99
- package/dist/cli/program/helpers.js +0 -26
- package/dist/cli/program/message/helpers.js +0 -46
- package/dist/cli/program/message/register.broadcast.js +0 -11
- package/dist/cli/program/message/register.discord-admin.js +0 -119
- package/dist/cli/program/message/register.emoji-sticker.js +0 -43
- package/dist/cli/program/message/register.permissions-search.js +0 -22
- package/dist/cli/program/message/register.pins.js +0 -23
- package/dist/cli/program/message/register.poll.js +0 -13
- package/dist/cli/program/message/register.reactions.js +0 -21
- package/dist/cli/program/message/register.read-edit-delete.js +0 -30
- package/dist/cli/program/message/register.send.js +0 -18
- package/dist/cli/program/message/register.thread.js +0 -35
- package/dist/cli/program/preaction.js +0 -52
- package/dist/cli/program/program-context.js +0 -8
- package/dist/cli/program/register.agent.js +0 -162
- package/dist/cli/program/register.configure.js +0 -17
- package/dist/cli/program/register.maintenance.js +0 -112
- package/dist/cli/program/register.message.js +0 -54
- package/dist/cli/program/register.onboard.js +0 -155
- package/dist/cli/program/register.setup.js +0 -41
- package/dist/cli/program/register.skills.js +0 -4
- package/dist/cli/program/register.status-health-sessions.js +0 -108
- package/dist/cli/program/register.subclis.js +0 -328
- package/dist/cli/program/routes.js +0 -233
- package/dist/cli/program.js +0 -2
- package/dist/cli/progress.js +0 -165
- package/dist/cli/prompt.js +0 -17
- package/dist/cli/qr-cli.js +0 -132
- package/dist/cli/requirements-test-fixtures.js +0 -17
- package/dist/cli/respawn-policy.js +0 -4
- package/dist/cli/route.js +0 -33
- package/dist/cli/run-main.js +0 -107
- package/dist/cli/sandbox-cli.js +0 -98
- package/dist/cli/security-cli.js +0 -332
- package/dist/cli/shared/parse-port.js +0 -18
- package/dist/cli/skills-cli.format.js +0 -241
- package/dist/cli/skills-cli.js +0 -341
- package/dist/cli/swarm-cli/register.js +0 -8
- package/dist/cli/swarm-cli/register.swarm-status.js +0 -488
- package/dist/cli/system-cli.js +0 -88
- package/dist/cli/tagline.js +0 -215
- package/dist/cli/telemetry-cli/register.js +0 -10
- package/dist/cli/telemetry-cli/register.telemetry-alerts.js +0 -176
- package/dist/cli/telemetry-cli/register.telemetry-metrics.js +0 -323
- package/dist/cli/telemetry-cli/register.telemetry-status.js +0 -179
- package/dist/cli/test-runtime-capture.js +0 -24
- package/dist/cli/tui-cli.js +0 -44
- package/dist/cli/update-cli/progress.js +0 -121
- package/dist/cli/update-cli/restart-helper.js +0 -129
- package/dist/cli/update-cli/shared.js +0 -209
- package/dist/cli/update-cli/status.js +0 -97
- package/dist/cli/update-cli/suppress-deprecations.js +0 -17
- package/dist/cli/update-cli/update-command.js +0 -587
- package/dist/cli/update-cli/wizard.js +0 -124
- package/dist/cli/update-cli.js +0 -124
- package/dist/cli/wait.js +0 -8
- package/dist/cli/webhooks-cli.js +0 -140
- package/dist/cli/windows-argv.js +0 -69
- package/dist/commands/agent/delivery.js +0 -140
- package/dist/commands/agent/run-context.js +0 -40
- package/dist/commands/agent/session-store.js +0 -56
- package/dist/commands/agent/session.js +0 -74
- package/dist/commands/agent/types.js +0 -1
- package/dist/commands/agent-binding.js +0 -123
- package/dist/commands/agent-via-gateway.js +0 -119
- package/dist/commands/agent.js +0 -536
- package/dist/commands/agents.bindings.js +0 -133
- package/dist/commands/agents.command-shared.js +0 -18
- package/dist/commands/agents.commands.add.js +0 -297
- package/dist/commands/agents.commands.delete.js +0 -75
- package/dist/commands/agents.commands.identity.js +0 -174
- package/dist/commands/agents.commands.list.js +0 -103
- package/dist/commands/agents.config.js +0 -143
- package/dist/commands/agents.js +0 -6
- package/dist/commands/agents.providers.js +0 -146
- package/dist/commands/auth-choice-legacy.js +0 -20
- package/dist/commands/auth-choice-options.js +0 -328
- package/dist/commands/auth-choice-prompt.js +0 -36
- package/dist/commands/auth-choice.api-key.js +0 -34
- package/dist/commands/auth-choice.apply-helpers.js +0 -8
- package/dist/commands/auth-choice.apply.anthropic.js +0 -85
- package/dist/commands/auth-choice.apply.api-providers.js +0 -895
- package/dist/commands/auth-choice.apply.byteplus.js +0 -55
- package/dist/commands/auth-choice.apply.copilot-proxy.js +0 -10
- package/dist/commands/auth-choice.apply.github-copilot.js +0 -47
- package/dist/commands/auth-choice.apply.google-antigravity.js +0 -10
- package/dist/commands/auth-choice.apply.google-gemini-cli.js +0 -10
- package/dist/commands/auth-choice.apply.huggingface.js +0 -130
- package/dist/commands/auth-choice.apply.js +0 -37
- package/dist/commands/auth-choice.apply.minimax.js +0 -120
- package/dist/commands/auth-choice.apply.oauth.js +0 -78
- package/dist/commands/auth-choice.apply.openai.js +0 -119
- package/dist/commands/auth-choice.apply.openrouter.js +0 -77
- package/dist/commands/auth-choice.apply.plugin-provider.js +0 -85
- package/dist/commands/auth-choice.apply.qwen-portal.js +0 -10
- package/dist/commands/auth-choice.apply.vllm.js +0 -92
- package/dist/commands/auth-choice.apply.volcengine.js +0 -55
- package/dist/commands/auth-choice.apply.xai.js +0 -63
- package/dist/commands/auth-choice.default-model.js +0 -12
- package/dist/commands/auth-choice.js +0 -3
- package/dist/commands/auth-choice.model-check.js +0 -61
- package/dist/commands/auth-choice.preferred-provider.js +0 -50
- package/dist/commands/auth-token.js +0 -32
- package/dist/commands/backup.js +0 -166
- package/dist/commands/channel-account.js +0 -190
- package/dist/commands/channels/add-mutators.js +0 -17
- package/dist/commands/channels/add.js +0 -198
- package/dist/commands/channels/capabilities.js +0 -439
- package/dist/commands/channels/list.js +0 -145
- package/dist/commands/channels/logs.js +0 -85
- package/dist/commands/channels/remove.js +0 -121
- package/dist/commands/channels/resolve.js +0 -107
- package/dist/commands/channels/shared.js +0 -31
- package/dist/commands/channels/status.js +0 -238
- package/dist/commands/channels.js +0 -7
- package/dist/commands/channels.mock-harness.js +0 -23
- package/dist/commands/chutes-oauth.js +0 -144
- package/dist/commands/cleanup-plan.js +0 -10
- package/dist/commands/cleanup-utils.js +0 -81
- package/dist/commands/config-validation.js +0 -15
- package/dist/commands/configure.channels.js +0 -52
- package/dist/commands/configure.commands.js +0 -22
- package/dist/commands/configure.daemon.js +0 -101
- package/dist/commands/configure.gateway-auth.js +0 -101
- package/dist/commands/configure.gateway.js +0 -201
- package/dist/commands/configure.js +0 -4
- package/dist/commands/configure.shared.js +0 -60
- package/dist/commands/configure.wizard.js +0 -485
- package/dist/commands/daemon-install-helpers.js +0 -51
- package/dist/commands/daemon-install-runtime-warning.js +0 -11
- package/dist/commands/daemon-runtime.js +0 -11
- package/dist/commands/dashboard.js +0 -52
- package/dist/commands/docs.js +0 -154
- package/dist/commands/doctor-auth.js +0 -236
- package/dist/commands/doctor-checks.js +0 -498
- package/dist/commands/doctor-completion.js +0 -112
- package/dist/commands/doctor-config-flow.js +0 -766
- package/dist/commands/doctor-format.js +0 -85
- package/dist/commands/doctor-gateway-daemon-flow.js +0 -207
- package/dist/commands/doctor-gateway-health.js +0 -43
- package/dist/commands/doctor-gateway-services.js +0 -237
- package/dist/commands/doctor-install.js +0 -27
- package/dist/commands/doctor-legacy-config.js +0 -323
- package/dist/commands/doctor-memory-search.js +0 -126
- package/dist/commands/doctor-platform-notes.js +0 -110
- package/dist/commands/doctor-prompter.js +0 -75
- package/dist/commands/doctor-sandbox.js +0 -207
- package/dist/commands/doctor-security.js +0 -141
- package/dist/commands/doctor-session-locks.js +0 -73
- package/dist/commands/doctor-state-integrity.js +0 -408
- package/dist/commands/doctor-state-migrations.js +0 -1
- package/dist/commands/doctor-ui.js +0 -119
- package/dist/commands/doctor-update.js +0 -68
- package/dist/commands/doctor-workspace-status.js +0 -56
- package/dist/commands/doctor-workspace.js +0 -69
- package/dist/commands/doctor.js +0 -264
- package/dist/commands/gateway-presence.js +0 -19
- package/dist/commands/gateway-status/helpers.js +0 -202
- package/dist/commands/gateway-status.js +0 -300
- package/dist/commands/google-gemini-model-default.js +0 -33
- package/dist/commands/health-format.js +0 -37
- package/dist/commands/health.js +0 -595
- package/dist/commands/message-format.js +0 -345
- package/dist/commands/message.js +0 -45
- package/dist/commands/model-allowlist.js +0 -29
- package/dist/commands/model-default.js +0 -35
- package/dist/commands/model-picker.js +0 -446
- package/dist/commands/models/aliases.js +0 -92
- package/dist/commands/models/auth-order.js +0 -95
- package/dist/commands/models/auth.js +0 -323
- package/dist/commands/models/fallbacks-shared.js +0 -102
- package/dist/commands/models/fallbacks.js +0 -126
- package/dist/commands/models/image-fallbacks.js +0 -126
- package/dist/commands/models/list.auth-overview.js +0 -93
- package/dist/commands/models/list.configured.js +0 -80
- package/dist/commands/models/list.errors.js +0 -14
- package/dist/commands/models/list.format.js +0 -41
- package/dist/commands/models/list.js +0 -2
- package/dist/commands/models/list.list-command.js +0 -112
- package/dist/commands/models/list.probe.js +0 -348
- package/dist/commands/models/list.registry.js +0 -173
- package/dist/commands/models/list.status-command.js +0 -441
- package/dist/commands/models/list.table.js +0 -58
- package/dist/commands/models/list.types.js +0 -1
- package/dist/commands/models/scan.js +0 -293
- package/dist/commands/models/set-image.js +0 -9
- package/dist/commands/models/set.js +0 -9
- package/dist/commands/models/shared.js +0 -161
- package/dist/commands/models.js +0 -10
- package/dist/commands/node-daemon-install-helpers.js +0 -37
- package/dist/commands/node-daemon-runtime.js +0 -6
- package/dist/commands/oauth-env.js +0 -16
- package/dist/commands/oauth-flow.js +0 -33
- package/dist/commands/onboard-auth.config-core.js +0 -981
- package/dist/commands/onboard-auth.config-gateways.js +0 -64
- package/dist/commands/onboard-auth.config-litellm.js +0 -45
- package/dist/commands/onboard-auth.config-minimax.js +0 -150
- package/dist/commands/onboard-auth.config-opencode.js +0 -24
- package/dist/commands/onboard-auth.config-shared.js +0 -116
- package/dist/commands/onboard-auth.credentials.js +0 -327
- package/dist/commands/onboard-auth.js +0 -7
- package/dist/commands/onboard-auth.models.js +0 -170
- package/dist/commands/onboard-channels.js +0 -527
- package/dist/commands/onboard-config.js +0 -16
- package/dist/commands/onboard-custom.js +0 -495
- package/dist/commands/onboard-helpers.js +0 -401
- package/dist/commands/onboard-hooks.js +0 -59
- package/dist/commands/onboard-interactive.js +0 -17
- package/dist/commands/onboard-non-interactive/api-keys.js +0 -61
- package/dist/commands/onboard-non-interactive/local/auth-choice-inference.js +0 -43
- package/dist/commands/onboard-non-interactive/local/auth-choice.js +0 -683
- package/dist/commands/onboard-non-interactive/local/daemon-install.js +0 -45
- package/dist/commands/onboard-non-interactive/local/gateway-config.js +0 -86
- package/dist/commands/onboard-non-interactive/local/output.js +0 -14
- package/dist/commands/onboard-non-interactive/local/skills-config.js +0 -21
- package/dist/commands/onboard-non-interactive/local/workspace.js +0 -7
- package/dist/commands/onboard-non-interactive/local.js +0 -105
- package/dist/commands/onboard-non-interactive/remote.js +0 -41
- package/dist/commands/onboard-non-interactive.js +0 -25
- package/dist/commands/onboard-non-interactive.test-helpers.js +0 -31
- package/dist/commands/onboard-provider-auth-flags.js +0 -150
- package/dist/commands/onboard-remote.js +0 -128
- package/dist/commands/onboard-skills.js +0 -171
- package/dist/commands/onboard-types.js +0 -1
- package/dist/commands/onboard.js +0 -60
- package/dist/commands/onboarding/__tests__/test-utils.js +0 -20
- package/dist/commands/onboarding/plugin-install.js +0 -162
- package/dist/commands/onboarding/registry.js +0 -13
- package/dist/commands/onboarding/types.js +0 -1
- package/dist/commands/openai-codex-model-default.js +0 -44
- package/dist/commands/openai-codex-oauth.js +0 -40
- package/dist/commands/openai-model-default.js +0 -41
- package/dist/commands/opencode-zen-model-default.js +0 -35
- package/dist/commands/provider-auth-helpers.js +0 -61
- package/dist/commands/reset.js +0 -134
- package/dist/commands/sandbox-display.js +0 -83
- package/dist/commands/sandbox-explain.js +0 -226
- package/dist/commands/sandbox-formatters.js +0 -31
- package/dist/commands/sandbox.js +0 -119
- package/dist/commands/security-owner-only.js +0 -86
- package/dist/commands/sessions-cleanup.js +0 -97
- package/dist/commands/sessions.js +0 -210
- package/dist/commands/sessions.test-helpers.js +0 -61
- package/dist/commands/setup.js +0 -60
- package/dist/commands/signal-install.js +0 -132
- package/dist/commands/skills-openclaw.command.js +0 -123
- package/dist/commands/status-all/agents.js +0 -62
- package/dist/commands/status-all/channels.js +0 -354
- package/dist/commands/status-all/diagnosis.js +0 -160
- package/dist/commands/status-all/format.js +0 -42
- package/dist/commands/status-all/gateway.js +0 -158
- package/dist/commands/status-all/report-lines.js +0 -135
- package/dist/commands/status-all.js +0 -411
- package/dist/commands/status.agent-local.js +0 -68
- package/dist/commands/status.command.js +0 -476
- package/dist/commands/status.daemon.js +0 -30
- package/dist/commands/status.format.js +0 -52
- package/dist/commands/status.gateway-probe.js +0 -22
- package/dist/commands/status.js +0 -2
- package/dist/commands/status.link-channel.js +0 -39
- package/dist/commands/status.scan.js +0 -141
- package/dist/commands/status.summary.js +0 -190
- package/dist/commands/status.types.js +0 -1
- package/dist/commands/status.update.js +0 -112
- package/dist/commands/systemd-linger.js +0 -83
- package/dist/commands/test-runtime-config-helpers.js +0 -21
- package/dist/commands/test-wizard-helpers.js +0 -68
- package/dist/commands/uninstall.js +0 -161
- package/dist/commands/vllm-setup.js +0 -66
- package/dist/commands/zai-endpoint-detect.js +0 -97
- package/dist/commands-subagents/action-agents.js +0 -44
- package/dist/commands-subagents/action-focus.js +0 -64
- package/dist/commands-subagents/action-help.js +0 -4
- package/dist/commands-subagents/action-info.js +0 -45
- package/dist/commands-subagents/action-kill.js +0 -60
- package/dist/commands-subagents/action-list.js +0 -44
- package/dist/commands-subagents/action-log.js +0 -29
- package/dist/commands-subagents/action-send.js +0 -119
- package/dist/commands-subagents/action-spawn.js +0 -52
- package/dist/commands-subagents/action-unfocus.js +0 -30
- package/dist/commands-subagents/shared.js +0 -303
- package/dist/compat/legacy-names.js +0 -9
- package/dist/config/agent-dirs.js +0 -79
- package/dist/config/agent-limits.js +0 -18
- package/dist/config/backup-rotation.js +0 -19
- package/dist/config/cache-utils.js +0 -22
- package/dist/config/channel-capabilities.js +0 -42
- package/dist/config/commands.js +0 -55
- package/dist/config/config-paths.js +0 -73
- package/dist/config/defaults.js +0 -408
- package/dist/config/discord-preview-streaming.js +0 -104
- package/dist/config/env-preserve.js +0 -122
- package/dist/config/env-substitution.js +0 -145
- package/dist/config/env-vars.js +0 -59
- package/dist/config/group-policy.js +0 -155
- package/dist/config/includes-scan.js +0 -78
- package/dist/config/includes.js +0 -214
- package/dist/config/io.js +0 -979
- package/dist/config/legacy-migrate.js +0 -13
- package/dist/config/legacy.js +0 -34
- package/dist/config/legacy.migrations.js +0 -8
- package/dist/config/legacy.migrations.part-1.js +0 -419
- package/dist/config/legacy.migrations.part-2.js +0 -343
- package/dist/config/legacy.migrations.part-3.js +0 -221
- package/dist/config/legacy.rules.js +0 -116
- package/dist/config/legacy.shared.js +0 -78
- package/dist/config/logging.js +0 -10
- package/dist/config/markdown-tables.js +0 -36
- package/dist/config/merge-config.js +0 -22
- package/dist/config/merge-patch.js +0 -72
- package/dist/config/normalize-paths.js +0 -54
- package/dist/config/paths.js +0 -241
- package/dist/config/plugin-auto-enable.js +0 -354
- package/dist/config/plugins-allowlist.js +0 -13
- package/dist/config/port-defaults.js +0 -30
- package/dist/config/prototype-keys.js +0 -4
- package/dist/config/redact-snapshot.js +0 -481
- package/dist/config/runtime-overrides.js +0 -50
- package/dist/config/schema.field-metadata.js +0 -590
- package/dist/config/schema.help.js +0 -294
- package/dist/config/schema.hints.js +0 -189
- package/dist/config/schema.irc.js +0 -20
- package/dist/config/schema.js +0 -281
- package/dist/config/schema.labels.js +0 -350
- package/dist/config/secrets-integration.js +0 -88
- package/dist/config/sessions/delivery-info.js +0 -47
- package/dist/config/sessions/group.js +0 -84
- package/dist/config/sessions/main-session.js +0 -48
- package/dist/config/sessions/metadata.js +0 -114
- package/dist/config/sessions/paths.js +0 -172
- package/dist/config/sessions/reset.js +0 -103
- package/dist/config/sessions/session-file.js +0 -33
- package/dist/config/sessions/session-key.js +0 -39
- package/dist/config/sessions/store.js +0 -734
- package/dist/config/sessions/transcript.js +0 -113
- package/dist/config/sessions/types.js +0 -25
- package/dist/config/sessions.js +0 -11
- package/dist/config/talk.js +0 -31
- package/dist/config/telegram-custom-commands.js +0 -71
- package/dist/config/types.agent-defaults.js +0 -1
- package/dist/config/types.agents.js +0 -1
- package/dist/config/types.approvals.js +0 -1
- package/dist/config/types.auth.js +0 -1
- package/dist/config/types.base.js +0 -1
- package/dist/config/types.browser.js +0 -1
- package/dist/config/types.channels.js +0 -1
- package/dist/config/types.cli.js +0 -1
- package/dist/config/types.cron.js +0 -1
- package/dist/config/types.discord.js +0 -1
- package/dist/config/types.gateway.js +0 -1
- package/dist/config/types.googlechat.js +0 -1
- package/dist/config/types.hooks.js +0 -1
- package/dist/config/types.imessage.js +0 -1
- package/dist/config/types.irc.js +0 -1
- package/dist/config/types.js +0 -31
- package/dist/config/types.memory.js +0 -1
- package/dist/config/types.messages.js +0 -1
- package/dist/config/types.models.js +0 -1
- package/dist/config/types.msteams.js +0 -1
- package/dist/config/types.node-host.js +0 -1
- package/dist/config/types.plugins.js +0 -1
- package/dist/config/types.poolbot.js +0 -1
- package/dist/config/types.queue.js +0 -1
- package/dist/config/types.sandbox.js +0 -1
- package/dist/config/types.secrets.js +0 -61
- package/dist/config/types.security.js +0 -33
- package/dist/config/types.signal.js +0 -1
- package/dist/config/types.skills.js +0 -1
- package/dist/config/types.slack.js +0 -1
- package/dist/config/types.telegram.js +0 -1
- package/dist/config/types.tools.js +0 -1
- package/dist/config/types.tts.js +0 -1
- package/dist/config/types.whatsapp.js +0 -1
- package/dist/config/validation.js +0 -352
- package/dist/config/version.js +0 -30
- package/dist/config/zod-schema.agent-defaults.js +0 -153
- package/dist/config/zod-schema.agent-model.js +0 -10
- package/dist/config/zod-schema.agent-runtime.js +0 -654
- package/dist/config/zod-schema.agents.js +0 -46
- package/dist/config/zod-schema.allowdeny.js +0 -35
- package/dist/config/zod-schema.approvals.js +0 -25
- package/dist/config/zod-schema.channels.js +0 -9
- package/dist/config/zod-schema.core.js +0 -453
- package/dist/config/zod-schema.hooks.js +0 -153
- package/dist/config/zod-schema.installs.js +0 -20
- package/dist/config/zod-schema.js +0 -689
- package/dist/config/zod-schema.providers-core.js +0 -993
- package/dist/config/zod-schema.providers-whatsapp.js +0 -126
- package/dist/config/zod-schema.providers.js +0 -34
- package/dist/config/zod-schema.security.js +0 -113
- package/dist/config/zod-schema.sensitive.js +0 -4
- package/dist/config/zod-schema.session.js +0 -169
- package/dist/context-engine/index.js +0 -33
- package/dist/context-engine/legacy.js +0 -179
- package/dist/context-engine/registry.js +0 -86
- package/dist/context-engine/summarizing.js +0 -290
- package/dist/context-engine/types.js +0 -7
- package/dist/cron/cron-filters.js +0 -150
- package/dist/cron/cron-improvements.js +0 -195
- package/dist/cron/delivery.js +0 -57
- package/dist/cron/heartbeat-policy.js +0 -26
- package/dist/cron/isolated-agent/delivery-target.js +0 -74
- package/dist/cron/isolated-agent/helpers.js +0 -66
- package/dist/cron/isolated-agent/run.js +0 -652
- package/dist/cron/isolated-agent/session.js +0 -29
- package/dist/cron/isolated-agent/skills-snapshot.js +0 -26
- package/dist/cron/isolated-agent/subagent-followup.js +0 -127
- package/dist/cron/isolated-agent.js +0 -1
- package/dist/cron/isolated-agent.mocks.js +0 -12
- package/dist/cron/isolated-agent.test-setup.js +0 -22
- package/dist/cron/legacy-delivery.js +0 -43
- package/dist/cron/normalize.js +0 -445
- package/dist/cron/parse.js +0 -29
- package/dist/cron/payload-migration.js +0 -29
- package/dist/cron/run-log.js +0 -112
- package/dist/cron/schedule.js +0 -70
- package/dist/cron/service/jobs.js +0 -557
- package/dist/cron/service/locked.js +0 -12
- package/dist/cron/service/normalize.js +0 -73
- package/dist/cron/service/ops.js +0 -188
- package/dist/cron/service/state.js +0 -12
- package/dist/cron/service/store.js +0 -415
- package/dist/cron/service/timer.js +0 -664
- package/dist/cron/service.js +0 -38
- package/dist/cron/session-reaper.js +0 -86
- package/dist/cron/stagger.js +0 -39
- package/dist/cron/store.js +0 -58
- package/dist/cron/types.js +0 -1
- package/dist/cron/validate-timestamp.js +0 -43
- package/dist/cron/webhook-url.js +0 -22
- package/dist/daemon/arg-split.js +0 -40
- package/dist/daemon/cmd-argv.js +0 -21
- package/dist/daemon/cmd-set.js +0 -58
- package/dist/daemon/constants.js +0 -75
- package/dist/daemon/diagnostics.js +0 -38
- package/dist/daemon/exec-file.js +0 -23
- package/dist/daemon/inspect.js +0 -353
- package/dist/daemon/launchd-plist.js +0 -68
- package/dist/daemon/launchd.js +0 -319
- package/dist/daemon/legacy.js +0 -44
- package/dist/daemon/node-service.js +0 -67
- package/dist/daemon/output.js +0 -6
- package/dist/daemon/paths.js +0 -35
- package/dist/daemon/program-args.js +0 -220
- package/dist/daemon/runtime-format.js +0 -31
- package/dist/daemon/runtime-parse.js +0 -17
- package/dist/daemon/runtime-paths.js +0 -130
- package/dist/daemon/schtasks-exec.js +0 -4
- package/dist/daemon/schtasks.js +0 -306
- package/dist/daemon/service-audit.js +0 -323
- package/dist/daemon/service-env.js +0 -148
- package/dist/daemon/service-runtime.js +0 -1
- package/dist/daemon/service-types.js +0 -1
- package/dist/daemon/service.js +0 -90
- package/dist/daemon/systemd-hints.js +0 -24
- package/dist/daemon/systemd-linger.js +0 -59
- package/dist/daemon/systemd-unit.js +0 -108
- package/dist/daemon/systemd.js +0 -321
- package/dist/discord/accounts.js +0 -55
- package/dist/discord/api.js +0 -99
- package/dist/discord/audit.js +0 -94
- package/dist/discord/chunk.js +0 -200
- package/dist/discord/client.js +0 -41
- package/dist/discord/components-registry.js +0 -57
- package/dist/discord/components.js +0 -816
- package/dist/discord/directory-live.js +0 -76
- package/dist/discord/draft-chunking.js +0 -22
- package/dist/discord/draft-stream.js +0 -124
- package/dist/discord/gateway-logging.js +0 -48
- package/dist/discord/guilds.js +0 -12
- package/dist/discord/monitor/agent-components.js +0 -1334
- package/dist/discord/monitor/allow-list.js +0 -333
- package/dist/discord/monitor/commands.js +0 -5
- package/dist/discord/monitor/exec-approvals.js +0 -601
- package/dist/discord/monitor/format.js +0 -27
- package/dist/discord/monitor/gateway-plugin.js +0 -49
- package/dist/discord/monitor/gateway-registry.js +0 -29
- package/dist/discord/monitor/listeners.js +0 -357
- package/dist/discord/monitor/message-handler.js +0 -115
- package/dist/discord/monitor/message-handler.preflight.js +0 -598
- package/dist/discord/monitor/message-handler.preflight.types.js +0 -1
- package/dist/discord/monitor/message-handler.process.js +0 -634
- package/dist/discord/monitor/message-utils.js +0 -389
- package/dist/discord/monitor/model-picker-preferences.js +0 -143
- package/dist/discord/monitor/model-picker.js +0 -651
- package/dist/discord/monitor/native-command.js +0 -1305
- package/dist/discord/monitor/presence-cache.js +0 -38
- package/dist/discord/monitor/presence.js +0 -30
- package/dist/discord/monitor/provider.allowlist.js +0 -223
- package/dist/discord/monitor/provider.js +0 -484
- package/dist/discord/monitor/provider.lifecycle.js +0 -100
- package/dist/discord/monitor/reply-context.js +0 -33
- package/dist/discord/monitor/reply-delivery.js +0 -196
- package/dist/discord/monitor/rest-fetch.js +0 -22
- package/dist/discord/monitor/sender-identity.js +0 -45
- package/dist/discord/monitor/system-events.js +0 -53
- package/dist/discord/monitor/thread-bindings.discord-api.js +0 -215
- package/dist/discord/monitor/thread-bindings.js +0 -4
- package/dist/discord/monitor/thread-bindings.lifecycle.js +0 -177
- package/dist/discord/monitor/thread-bindings.manager.js +0 -423
- package/dist/discord/monitor/thread-bindings.messages.js +0 -55
- package/dist/discord/monitor/thread-bindings.state.js +0 -358
- package/dist/discord/monitor/thread-bindings.types.js +0 -6
- package/dist/discord/monitor/threading.js +0 -294
- package/dist/discord/monitor/typing.js +0 -8
- package/dist/discord/monitor.gateway.js +0 -54
- package/dist/discord/monitor.js +0 -7
- package/dist/discord/pluralkit.js +0 -27
- package/dist/discord/probe.js +0 -124
- package/dist/discord/resolve-channels.js +0 -239
- package/dist/discord/resolve-users.js +0 -126
- package/dist/discord/send.channels.js +0 -89
- package/dist/discord/send.components.js +0 -115
- package/dist/discord/send.emojis-stickers.js +0 -48
- package/dist/discord/send.guild.js +0 -79
- package/dist/discord/send.js +0 -9
- package/dist/discord/send.messages.js +0 -91
- package/dist/discord/send.outbound.js +0 -343
- package/dist/discord/send.permissions.js +0 -169
- package/dist/discord/send.reactions.js +0 -75
- package/dist/discord/send.shared.js +0 -330
- package/dist/discord/send.types.js +0 -16
- package/dist/discord/targets.js +0 -126
- package/dist/discord/token.js +0 -34
- package/dist/discord/ui.js +0 -26
- package/dist/discord/voice/command.js +0 -263
- package/dist/discord/voice/manager.js +0 -531
- package/dist/discord/voice-message.js +0 -254
- package/dist/entry.js +0 -136
- package/dist/extensionAPI.js +0 -8
- package/dist/gateway/agent-event-assistant-text.js +0 -5
- package/dist/gateway/agent-prompt.js +0 -33
- package/dist/gateway/assistant-identity.js +0 -64
- package/dist/gateway/auth-rate-limit.js +0 -155
- package/dist/gateway/auth.js +0 -367
- package/dist/gateway/boot.js +0 -72
- package/dist/gateway/call.js +0 -295
- package/dist/gateway/canvas-capability.js +0 -75
- package/dist/gateway/channel-health-monitor.js +0 -121
- package/dist/gateway/chat-abort.js +0 -55
- package/dist/gateway/chat-attachments.js +0 -133
- package/dist/gateway/chat-sanitize.js +0 -103
- package/dist/gateway/client.js +0 -397
- package/dist/gateway/config-reload.js +0 -294
- package/dist/gateway/control-plane-audit.js +0 -28
- package/dist/gateway/control-plane-rate-limit.js +0 -53
- package/dist/gateway/control-ui-contract.js +0 -1
- package/dist/gateway/control-ui-csp.js +0 -15
- package/dist/gateway/control-ui-shared.js +0 -48
- package/dist/gateway/control-ui.js +0 -388
- package/dist/gateway/device-auth.js +0 -19
- package/dist/gateway/device-pairing-security.js +0 -197
- package/dist/gateway/event-deduplication.js +0 -167
- package/dist/gateway/events.js +0 -1
- package/dist/gateway/exec-approval-manager.js +0 -40
- package/dist/gateway/gateway-config-prompts.shared.js +0 -25
- package/dist/gateway/gateway-improvements.js +0 -294
- package/dist/gateway/hooks-mapping.js +0 -379
- package/dist/gateway/hooks.js +0 -287
- package/dist/gateway/http-auth-helpers.js +0 -19
- package/dist/gateway/http-common.js +0 -88
- package/dist/gateway/http-endpoint-helpers.js +0 -28
- package/dist/gateway/http-utils.js +0 -49
- package/dist/gateway/live-image-probe.js +0 -91
- package/dist/gateway/method-scopes.js +0 -177
- package/dist/gateway/net.js +0 -414
- package/dist/gateway/node-command-policy.js +0 -146
- package/dist/gateway/node-invoke-sanitize.js +0 -11
- package/dist/gateway/node-invoke-system-run-approval.js +0 -184
- package/dist/gateway/node-pending-work.js +0 -142
- package/dist/gateway/node-registry.js +0 -147
- package/dist/gateway/open-responses.schema.js +0 -285
- package/dist/gateway/openai-http.js +0 -328
- package/dist/gateway/openresponses-http.js +0 -704
- package/dist/gateway/origin-check.js +0 -39
- package/dist/gateway/probe-auth.js +0 -23
- package/dist/gateway/probe.js +0 -87
- package/dist/gateway/protocol/client-info.js +0 -55
- package/dist/gateway/protocol/index.js +0 -127
- package/dist/gateway/protocol/schema/agent.js +0 -91
- package/dist/gateway/protocol/schema/agents-models-skills.js +0 -117
- package/dist/gateway/protocol/schema/channels.js +0 -95
- package/dist/gateway/protocol/schema/config.js +0 -44
- package/dist/gateway/protocol/schema/cron.js +0 -188
- package/dist/gateway/protocol/schema/devices.js +0 -37
- package/dist/gateway/protocol/schema/error-codes.js +0 -15
- package/dist/gateway/protocol/schema/exec-approvals.js +0 -66
- package/dist/gateway/protocol/schema/frames.js +0 -101
- package/dist/gateway/protocol/schema/logs-chat.js +0 -53
- package/dist/gateway/protocol/schema/nodes.js +0 -72
- package/dist/gateway/protocol/schema/primitives.js +0 -10
- package/dist/gateway/protocol/schema/protocol-schemas.js +0 -136
- package/dist/gateway/protocol/schema/push.js +0 -18
- package/dist/gateway/protocol/schema/sessions.js +0 -91
- package/dist/gateway/protocol/schema/snapshot.js +0 -40
- package/dist/gateway/protocol/schema/swarm.js +0 -80
- package/dist/gateway/protocol/schema/types.js +0 -1
- package/dist/gateway/protocol/schema/wizard.js +0 -76
- package/dist/gateway/protocol/schema.js +0 -18
- package/dist/gateway/role-policy.js +0 -17
- package/dist/gateway/run-tracker.js +0 -253
- package/dist/gateway/server/__tests__/test-utils.js +0 -24
- package/dist/gateway/server/close-reason.js +0 -10
- package/dist/gateway/server/health-state.js +0 -69
- package/dist/gateway/server/hooks.js +0 -85
- package/dist/gateway/server/http-listen.js +0 -26
- package/dist/gateway/server/plugins-http.js +0 -45
- package/dist/gateway/server/presence-events.js +0 -12
- package/dist/gateway/server/tls.js +0 -4
- package/dist/gateway/server/ws-connection/auth-messages.js +0 -54
- package/dist/gateway/server/ws-connection/connect-policy.js +0 -37
- package/dist/gateway/server/ws-connection/message-handler.js +0 -792
- package/dist/gateway/server/ws-connection.js +0 -228
- package/dist/gateway/server/ws-types.js +0 -1
- package/dist/gateway/server-broadcast.js +0 -95
- package/dist/gateway/server-browser.js +0 -24
- package/dist/gateway/server-channels.js +0 -338
- package/dist/gateway/server-chat.js +0 -368
- package/dist/gateway/server-close.js +0 -103
- package/dist/gateway/server-constants.js +0 -34
- package/dist/gateway/server-cron.js +0 -372
- package/dist/gateway/server-discovery-runtime.js +0 -80
- package/dist/gateway/server-discovery.js +0 -62
- package/dist/gateway/server-health-probes.js +0 -55
- package/dist/gateway/server-http-health.js +0 -215
- package/dist/gateway/server-http.js +0 -526
- package/dist/gateway/server-lanes.js +0 -7
- package/dist/gateway/server-maintenance.js +0 -116
- package/dist/gateway/server-methods/agent-job.js +0 -197
- package/dist/gateway/server-methods/agent-timestamp.js +0 -60
- package/dist/gateway/server-methods/agent.js +0 -498
- package/dist/gateway/server-methods/agents.js +0 -333
- package/dist/gateway/server-methods/attachment-normalize.js +0 -16
- package/dist/gateway/server-methods/base-hash.js +0 -8
- package/dist/gateway/server-methods/browser.js +0 -204
- package/dist/gateway/server-methods/channels.js +0 -218
- package/dist/gateway/server-methods/chat.js +0 -855
- package/dist/gateway/server-methods/config.js +0 -310
- package/dist/gateway/server-methods/connect.js +0 -6
- package/dist/gateway/server-methods/cron.js +0 -109
- package/dist/gateway/server-methods/devices.js +0 -109
- package/dist/gateway/server-methods/exec-approval.js +0 -78
- package/dist/gateway/server-methods/exec-approvals.js +0 -141
- package/dist/gateway/server-methods/health.js +0 -29
- package/dist/gateway/server-methods/logs.js +0 -143
- package/dist/gateway/server-methods/models.js +0 -26
- package/dist/gateway/server-methods/nodes-pending.js +0 -96
- package/dist/gateway/server-methods/nodes.handlers.invoke-result.js +0 -55
- package/dist/gateway/server-methods/nodes.helpers.js +0 -44
- package/dist/gateway/server-methods/nodes.js +0 -624
- package/dist/gateway/server-methods/push.js +0 -53
- package/dist/gateway/server-methods/restart-request.js +0 -13
- package/dist/gateway/server-methods/send.js +0 -326
- package/dist/gateway/server-methods/sessions.js +0 -442
- package/dist/gateway/server-methods/skills.js +0 -137
- package/dist/gateway/server-methods/swarm.js +0 -58
- package/dist/gateway/server-methods/system.js +0 -120
- package/dist/gateway/server-methods/talk.js +0 -20
- package/dist/gateway/server-methods/telemetry.js +0 -71
- package/dist/gateway/server-methods/tts.js +0 -132
- package/dist/gateway/server-methods/types.js +0 -1
- package/dist/gateway/server-methods/update.js +0 -96
- package/dist/gateway/server-methods/usage.js +0 -693
- package/dist/gateway/server-methods/validation.js +0 -8
- package/dist/gateway/server-methods/voicewake.js +0 -30
- package/dist/gateway/server-methods/web.js +0 -73
- package/dist/gateway/server-methods/wizard.js +0 -100
- package/dist/gateway/server-methods-list.js +0 -128
- package/dist/gateway/server-methods.js +0 -220
- package/dist/gateway/server-mobile-nodes.js +0 -10
- package/dist/gateway/server-model-catalog.js +0 -11
- package/dist/gateway/server-node-events-types.js +0 -1
- package/dist/gateway/server-node-events.js +0 -445
- package/dist/gateway/server-node-subscriptions.js +0 -93
- package/dist/gateway/server-plugins.js +0 -36
- package/dist/gateway/server-reload-handlers.js +0 -111
- package/dist/gateway/server-restart-sentinel.js +0 -84
- package/dist/gateway/server-runtime-config.js +0 -92
- package/dist/gateway/server-runtime-state.js +0 -129
- package/dist/gateway/server-session-key.js +0 -20
- package/dist/gateway/server-shared.js +0 -1
- package/dist/gateway/server-startup-log.js +0 -27
- package/dist/gateway/server-startup-memory.js +0 -22
- package/dist/gateway/server-startup.js +0 -119
- package/dist/gateway/server-tailscale.js +0 -41
- package/dist/gateway/server-utils.js +0 -35
- package/dist/gateway/server-wizard-sessions.js +0 -19
- package/dist/gateway/server-ws-runtime.js +0 -21
- package/dist/gateway/server.agent.gateway-server-agent.mocks.js +0 -35
- package/dist/gateway/server.e2e-registry-helpers.js +0 -1
- package/dist/gateway/server.e2e-ws-harness.js +0 -20
- package/dist/gateway/server.impl.js +0 -615
- package/dist/gateway/server.js +0 -2
- package/dist/gateway/session-preview.test-helpers.js +0 -11
- package/dist/gateway/session-utils.fs.js +0 -580
- package/dist/gateway/session-utils.js +0 -698
- package/dist/gateway/session-utils.types.js +0 -1
- package/dist/gateway/sessions-patch.js +0 -326
- package/dist/gateway/sessions-resolve.js +0 -115
- package/dist/gateway/startup-auth.js +0 -126
- package/dist/gateway/test-helpers.agent-results.js +0 -15
- package/dist/gateway/test-helpers.e2e.js +0 -101
- package/dist/gateway/test-helpers.js +0 -2
- package/dist/gateway/test-helpers.mocks.js +0 -532
- package/dist/gateway/test-helpers.openai-mock.js +0 -170
- package/dist/gateway/test-helpers.server.js +0 -526
- package/dist/gateway/test-http-response.js +0 -12
- package/dist/gateway/test-openai-responses-model.js +0 -20
- package/dist/gateway/test-temp-config.js +0 -30
- package/dist/gateway/test-with-server.js +0 -32
- package/dist/gateway/tools-invoke-http.js +0 -244
- package/dist/gateway/websocket-preauth-security.js +0 -188
- package/dist/gateway/ws-log.js +0 -364
- package/dist/gateway/ws-logging.js +0 -8
- package/dist/globals.js +0 -41
- package/dist/hooks/bundled/boot-md/handler.js +0 -14
- package/dist/hooks/bundled/bootstrap-extra-files/handler.js +0 -48
- package/dist/hooks/bundled/command-logger/handler.js +0 -60
- package/dist/hooks/bundled/session-memory/handler.js +0 -278
- package/dist/hooks/bundled/soul-evil/handler.js +0 -36
- package/dist/hooks/bundled-dir.js +0 -42
- package/dist/hooks/config.js +0 -123
- package/dist/hooks/fire-and-forget.js +0 -6
- package/dist/hooks/frontmatter.js +0 -60
- package/dist/hooks/gmail-ops.js +0 -243
- package/dist/hooks/gmail-setup-utils.js +0 -310
- package/dist/hooks/gmail-watcher-lifecycle.js +0 -23
- package/dist/hooks/gmail-watcher.js +0 -196
- package/dist/hooks/gmail.js +0 -179
- package/dist/hooks/hooks-status.js +0 -135
- package/dist/hooks/hooks.js +0 -2
- package/dist/hooks/install.js +0 -338
- package/dist/hooks/installs.js +0 -24
- package/dist/hooks/internal-hooks.js +0 -201
- package/dist/hooks/llm-slug-generator.js +0 -73
- package/dist/hooks/loader.js +0 -110
- package/dist/hooks/message-hook-mappers.js +0 -179
- package/dist/hooks/module-loader.js +0 -28
- package/dist/hooks/plugin-hooks.js +0 -92
- package/dist/hooks/soul-evil.js +0 -186
- package/dist/hooks/types.js +0 -1
- package/dist/hooks/workspace.js +0 -237
- package/dist/imessage/accounts.js +0 -50
- package/dist/imessage/channel.js +0 -253
- package/dist/imessage/client.js +0 -174
- package/dist/imessage/constants.js +0 -2
- package/dist/imessage/index.js +0 -3
- package/dist/imessage/monitor/abort-handler.js +0 -23
- package/dist/imessage/monitor/deliver.js +0 -54
- package/dist/imessage/monitor/echo-cache.js +0 -70
- package/dist/imessage/monitor/inbound-processing.js +0 -347
- package/dist/imessage/monitor/loop-rate-limiter.js +0 -51
- package/dist/imessage/monitor/monitor-provider.js +0 -418
- package/dist/imessage/monitor/parse-notification.js +0 -64
- package/dist/imessage/monitor/reflection-guard.js +0 -50
- package/dist/imessage/monitor/runtime.js +0 -8
- package/dist/imessage/monitor/sanitize-outbound.js +0 -25
- package/dist/imessage/monitor/self-chat-cache.js +0 -75
- package/dist/imessage/monitor/types.js +0 -1
- package/dist/imessage/monitor.js +0 -1
- package/dist/imessage/probe.js +0 -68
- package/dist/imessage/runtime.js +0 -3
- package/dist/imessage/send.js +0 -147
- package/dist/imessage/target-parsing-helpers.js +0 -92
- package/dist/imessage/targets.js +0 -172
- package/dist/index.js +0 -49
- package/dist/infra/abort-pattern.js +0 -106
- package/dist/infra/abort-signal.js +0 -12
- package/dist/infra/agent-command-binding.js +0 -144
- package/dist/infra/agent-events.js +0 -57
- package/dist/infra/archive-path.js +0 -49
- package/dist/infra/archive.js +0 -422
- package/dist/infra/backoff.js +0 -19
- package/dist/infra/backup.js +0 -328
- package/dist/infra/binaries.js +0 -9
- package/dist/infra/bonjour-ciao.js +0 -10
- package/dist/infra/bonjour-discovery.js +0 -506
- package/dist/infra/bonjour-errors.js +0 -7
- package/dist/infra/bonjour.js +0 -209
- package/dist/infra/boundary-file-read.js +0 -118
- package/dist/infra/boundary-path.js +0 -594
- package/dist/infra/brew.js +0 -55
- package/dist/infra/canvas-host-url.js +0 -52
- package/dist/infra/channel-account-context.js +0 -173
- package/dist/infra/channel-activity.js +0 -32
- package/dist/infra/channel-summary.js +0 -183
- package/dist/infra/channels-status-issues.js +0 -15
- package/dist/infra/clipboard.js +0 -24
- package/dist/infra/control-ui-assets.js +0 -228
- package/dist/infra/dedupe.js +0 -47
- package/dist/infra/detect-package-manager.js +0 -26
- package/dist/infra/device-auth-store.js +0 -97
- package/dist/infra/device-identity.js +0 -149
- package/dist/infra/device-pairing.js +0 -461
- package/dist/infra/diagnostic-events.js +0 -28
- package/dist/infra/diagnostic-flags.js +0 -67
- package/dist/infra/dotenv.js +0 -15
- package/dist/infra/env-file.js +0 -43
- package/dist/infra/env.js +0 -39
- package/dist/infra/errors.js +0 -87
- package/dist/infra/exec-approval-forwarder.js +0 -212
- package/dist/infra/exec-approval-reply.js +0 -7
- package/dist/infra/exec-approvals-allowlist.js +0 -335
- package/dist/infra/exec-approvals-analysis.js +0 -828
- package/dist/infra/exec-approvals-security.js +0 -217
- package/dist/infra/exec-approvals.js +0 -365
- package/dist/infra/exec-host.js +0 -75
- package/dist/infra/exec-safe-bin-policy.js +0 -277
- package/dist/infra/exec-safe-bin-trust.js +0 -64
- package/dist/infra/exec-safety.js +0 -31
- package/dist/infra/fetch.js +0 -58
- package/dist/infra/file-identity.js +0 -12
- package/dist/infra/file-lock.js +0 -1
- package/dist/infra/fixed-window-rate-limit.js +0 -33
- package/dist/infra/format-duration.js +0 -20
- package/dist/infra/format-time/format-datetime.js +0 -79
- package/dist/infra/format-time/format-duration.js +0 -81
- package/dist/infra/format-time/format-relative.js +0 -80
- package/dist/infra/fs-safe.js +0 -473
- package/dist/infra/gateway-lock.js +0 -206
- package/dist/infra/gemini-auth.js +0 -39
- package/dist/infra/git-commit.js +0 -106
- package/dist/infra/git-root.js +0 -61
- package/dist/infra/hardlink-guards.js +0 -30
- package/dist/infra/heartbeat-active-hours.js +0 -85
- package/dist/infra/heartbeat-events-filter.js +0 -50
- package/dist/infra/heartbeat-events.js +0 -34
- package/dist/infra/heartbeat-reason.js +0 -40
- package/dist/infra/heartbeat-runner.js +0 -947
- package/dist/infra/heartbeat-runner.test-utils.js +0 -39
- package/dist/infra/heartbeat-visibility.js +0 -45
- package/dist/infra/heartbeat-wake.js +0 -216
- package/dist/infra/home-dir.js +0 -54
- package/dist/infra/host-env-security-policy.json +0 -19
- package/dist/infra/host-env-security.js +0 -66
- package/dist/infra/http-body.js +0 -265
- package/dist/infra/install-package-dir.js +0 -50
- package/dist/infra/install-safe-path.js +0 -49
- package/dist/infra/install-source-utils.js +0 -131
- package/dist/infra/is-main.js +0 -33
- package/dist/infra/json-file.js +0 -21
- package/dist/infra/json-files.js +0 -49
- package/dist/infra/json-utf8-bytes.js +0 -8
- package/dist/infra/jsonl-socket.js +0 -52
- package/dist/infra/machine-name.js +0 -43
- package/dist/infra/map-size.js +0 -14
- package/dist/infra/net/fetch-guard.js +0 -217
- package/dist/infra/net/hostname.js +0 -7
- package/dist/infra/net/proxy-env.js +0 -17
- package/dist/infra/net/ssrf.js +0 -277
- package/dist/infra/node-pairing.js +0 -173
- package/dist/infra/node-shell.js +0 -9
- package/dist/infra/npm-integrity.js +0 -45
- package/dist/infra/npm-pack-install.js +0 -40
- package/dist/infra/npm-registry-spec.js +0 -39
- package/dist/infra/os-summary.js +0 -23
- package/dist/infra/outbound/abort.js +0 -14
- package/dist/infra/outbound/agent-delivery.js +0 -86
- package/dist/infra/outbound/bound-delivery-router.js +0 -88
- package/dist/infra/outbound/channel-adapters.js +0 -29
- package/dist/infra/outbound/channel-selection.js +0 -68
- package/dist/infra/outbound/channel-target.js +0 -28
- package/dist/infra/outbound/deliver.js +0 -419
- package/dist/infra/outbound/delivery-queue.js +0 -214
- package/dist/infra/outbound/directory-cache.js +0 -44
- package/dist/infra/outbound/envelope.js +0 -20
- package/dist/infra/outbound/format.js +0 -72
- package/dist/infra/outbound/identity.js +0 -23
- package/dist/infra/outbound/message-action-params.js +0 -307
- package/dist/infra/outbound/message-action-runner.js +0 -610
- package/dist/infra/outbound/message-action-spec.js +0 -90
- package/dist/infra/outbound/message.js +0 -212
- package/dist/infra/outbound/outbound-policy.js +0 -149
- package/dist/infra/outbound/outbound-send-service.js +0 -110
- package/dist/infra/outbound/outbound-session.js +0 -852
- package/dist/infra/outbound/payloads.js +0 -85
- package/dist/infra/outbound/session-binding-service.js +0 -123
- package/dist/infra/outbound/target-errors.js +0 -23
- package/dist/infra/outbound/target-normalization.js +0 -27
- package/dist/infra/outbound/target-resolver.js +0 -348
- package/dist/infra/outbound/targets.js +0 -213
- package/dist/infra/outbound/tool-payload.js +0 -21
- package/dist/infra/package-json.js +0 -23
- package/dist/infra/pairing-files.js +0 -29
- package/dist/infra/pairing-token.js +0 -9
- package/dist/infra/path-alias-guards.js +0 -21
- package/dist/infra/path-env.js +0 -94
- package/dist/infra/path-guards.js +0 -37
- package/dist/infra/path-prepend.js +0 -51
- package/dist/infra/path-safety.js +0 -16
- package/dist/infra/plain-object.js +0 -9
- package/dist/infra/poolbot-root.js +0 -109
- package/dist/infra/ports-format.js +0 -53
- package/dist/infra/ports-inspect.js +0 -240
- package/dist/infra/ports-lsof.js +0 -33
- package/dist/infra/ports-probe.js +0 -19
- package/dist/infra/ports-types.js +0 -1
- package/dist/infra/ports.js +0 -78
- package/dist/infra/process-respawn.js +0 -49
- package/dist/infra/prototype-keys.js +0 -4
- package/dist/infra/provider-usage.auth.js +0 -188
- package/dist/infra/provider-usage.fetch.antigravity.js +0 -212
- package/dist/infra/provider-usage.fetch.claude.js +0 -129
- package/dist/infra/provider-usage.fetch.codex.js +0 -54
- package/dist/infra/provider-usage.fetch.copilot.js +0 -42
- package/dist/infra/provider-usage.fetch.gemini.js +0 -60
- package/dist/infra/provider-usage.fetch.js +0 -7
- package/dist/infra/provider-usage.fetch.minimax.js +0 -332
- package/dist/infra/provider-usage.fetch.shared.js +0 -39
- package/dist/infra/provider-usage.fetch.zai.js +0 -63
- package/dist/infra/provider-usage.format.js +0 -96
- package/dist/infra/provider-usage.js +0 -3
- package/dist/infra/provider-usage.load.js +0 -59
- package/dist/infra/provider-usage.shared.js +0 -51
- package/dist/infra/provider-usage.types.js +0 -1
- package/dist/infra/push-apns.js +0 -365
- package/dist/infra/restart-sentinel.js +0 -80
- package/dist/infra/restart-stale-pids.js +0 -254
- package/dist/infra/restart.js +0 -375
- package/dist/infra/retry-policy.js +0 -73
- package/dist/infra/retry.js +0 -185
- package/dist/infra/runtime-guard.js +0 -60
- package/dist/infra/runtime-status.js +0 -16
- package/dist/infra/safe-open-sync.js +0 -71
- package/dist/infra/scp-host.js +0 -54
- package/dist/infra/secure-random.js +0 -7
- package/dist/infra/security/command-analyzer.js +0 -257
- package/dist/infra/session-cleanup.js +0 -143
- package/dist/infra/session-cost-usage.js +0 -828
- package/dist/infra/session-cost-usage.types.js +0 -1
- package/dist/infra/session-maintenance-warning.js +0 -91
- package/dist/infra/shell-env.js +0 -190
- package/dist/infra/shell-security.js +0 -201
- package/dist/infra/skills-remote.js +0 -293
- package/dist/infra/ssh-config.js +0 -89
- package/dist/infra/ssh-tunnel.js +0 -166
- package/dist/infra/state-migrations.fs.js +0 -49
- package/dist/infra/state-migrations.js +0 -770
- package/dist/infra/system-events.js +0 -89
- package/dist/infra/system-presence.js +0 -227
- package/dist/infra/system-run-command.js +0 -123
- package/dist/infra/tailnet.js +0 -46
- package/dist/infra/tailscale.js +0 -368
- package/dist/infra/tls/fingerprint.js +0 -5
- package/dist/infra/tls/gateway.js +0 -119
- package/dist/infra/tmp-openclaw-dir.js +0 -84
- package/dist/infra/tmp-poolbot-dir.js +0 -81
- package/dist/infra/transport-ready.js +0 -38
- package/dist/infra/unhandled-rejections.js +0 -116
- package/dist/infra/update-channels.js +0 -81
- package/dist/infra/update-check.js +0 -293
- package/dist/infra/update-global.js +0 -120
- package/dist/infra/update-runner.js +0 -686
- package/dist/infra/update-startup.js +0 -163
- package/dist/infra/voicewake.js +0 -74
- package/dist/infra/warning-filter.js +0 -65
- package/dist/infra/warnings.js +0 -25
- package/dist/infra/widearea-dns.js +0 -152
- package/dist/infra/ws.js +0 -13
- package/dist/infra/wsl.js +0 -61
- package/dist/line/accounts.js +0 -128
- package/dist/line/actions.js +0 -45
- package/dist/line/auto-reply-delivery.js +0 -102
- package/dist/line/bot-access.js +0 -26
- package/dist/line/bot-handlers.js +0 -260
- package/dist/line/bot-message-context.js +0 -346
- package/dist/line/bot.js +0 -48
- package/dist/line/channel-access-token.js +0 -9
- package/dist/line/config-schema.js +0 -47
- package/dist/line/download.js +0 -95
- package/dist/line/flex-templates/basic-cards.js +0 -332
- package/dist/line/flex-templates/common.js +0 -18
- package/dist/line/flex-templates/media-control-cards.js +0 -453
- package/dist/line/flex-templates/message.js +0 -10
- package/dist/line/flex-templates/schedule-cards.js +0 -399
- package/dist/line/flex-templates/types.js +0 -1
- package/dist/line/flex-templates.js +0 -1264
- package/dist/line/http-registry.js +0 -27
- package/dist/line/index.js +0 -19
- package/dist/line/markdown-to-line.js +0 -346
- package/dist/line/monitor.js +0 -266
- package/dist/line/probe.js +0 -37
- package/dist/line/reply-chunks.js +0 -53
- package/dist/line/rich-menu.js +0 -320
- package/dist/line/send.js +0 -451
- package/dist/line/signature.js +0 -11
- package/dist/line/template-messages.js +0 -258
- package/dist/line/types.js +0 -1
- package/dist/line/webhook-node.js +0 -100
- package/dist/line/webhook-utils.js +0 -11
- package/dist/line/webhook.js +0 -71
- package/dist/link-understanding/apply.js +0 -22
- package/dist/link-understanding/defaults.js +0 -2
- package/dist/link-understanding/detect.js +0 -57
- package/dist/link-understanding/format.js +0 -10
- package/dist/link-understanding/index.js +0 -4
- package/dist/link-understanding/runner.js +0 -99
- package/dist/logger.js +0 -53
- package/dist/logging/config.js +0 -19
- package/dist/logging/console.js +0 -237
- package/dist/logging/diagnostic-session-state.js +0 -73
- package/dist/logging/diagnostic.js +0 -258
- package/dist/logging/levels.js +0 -26
- package/dist/logging/logger.js +0 -185
- package/dist/logging/parse-log-line.js +0 -52
- package/dist/logging/redact-identifier.js +0 -12
- package/dist/logging/redact.js +0 -115
- package/dist/logging/state.js +0 -12
- package/dist/logging/subsystem.js +0 -271
- package/dist/logging/timestamps.js +0 -14
- package/dist/logging.js +0 -5
- package/dist/macos/gateway-daemon.js +0 -183
- package/dist/macos/relay-smoke.js +0 -33
- package/dist/macos/relay.js +0 -61
- package/dist/markdown/code-spans.js +0 -67
- package/dist/markdown/fences.js +0 -57
- package/dist/markdown/frontmatter.js +0 -124
- package/dist/markdown/ir.js +0 -761
- package/dist/markdown/render.js +0 -113
- package/dist/markdown/tables.js +0 -35
- package/dist/markdown/whatsapp.js +0 -62
- package/dist/media/audio-tags.js +0 -14
- package/dist/media/audio.js +0 -15
- package/dist/media/base64.js +0 -34
- package/dist/media/constants.js +0 -42
- package/dist/media/fetch.js +0 -145
- package/dist/media/ffmpeg-limits.js +0 -4
- package/dist/media/host.js +0 -43
- package/dist/media/image-ops.js +0 -394
- package/dist/media/inbound-path-policy.js +0 -107
- package/dist/media/input-files.js +0 -296
- package/dist/media/local-roots.js +0 -33
- package/dist/media/mime.js +0 -151
- package/dist/media/outbound-attachment.js +0 -10
- package/dist/media/parse.js +0 -175
- package/dist/media/png-encode.js +0 -74
- package/dist/media/read-response-with-limit.js +0 -64
- package/dist/media/server.js +0 -88
- package/dist/media/sniff-mime-from-base64.js +0 -19
- package/dist/media/store.js +0 -238
- package/dist/media/temp-files.js +0 -12
- package/dist/media-understanding/apply.js +0 -481
- package/dist/media-understanding/attachments.js +0 -331
- package/dist/media-understanding/audio-preflight.js +0 -67
- package/dist/media-understanding/concurrency.js +0 -14
- package/dist/media-understanding/defaults.js +0 -46
- package/dist/media-understanding/errors.js +0 -11
- package/dist/media-understanding/format.js +0 -56
- package/dist/media-understanding/fs.js +0 -13
- package/dist/media-understanding/index.js +0 -3
- package/dist/media-understanding/output-extract.js +0 -26
- package/dist/media-understanding/providers/anthropic/index.js +0 -6
- package/dist/media-understanding/providers/audio.test-helpers.js +0 -34
- package/dist/media-understanding/providers/deepgram/audio.js +0 -55
- package/dist/media-understanding/providers/deepgram/index.js +0 -6
- package/dist/media-understanding/providers/google/audio.js +0 -71
- package/dist/media-understanding/providers/google/index.js +0 -10
- package/dist/media-understanding/providers/google/inline-data.js +0 -64
- package/dist/media-understanding/providers/google/video.js +0 -71
- package/dist/media-understanding/providers/groq/index.js +0 -10
- package/dist/media-understanding/providers/image.js +0 -59
- package/dist/media-understanding/providers/index.js +0 -48
- package/dist/media-understanding/providers/minimax/index.js +0 -6
- package/dist/media-understanding/providers/openai/audio.js +0 -54
- package/dist/media-understanding/providers/openai/index.js +0 -8
- package/dist/media-understanding/providers/shared.js +0 -41
- package/dist/media-understanding/providers/zai/index.js +0 -6
- package/dist/media-understanding/resolve.js +0 -113
- package/dist/media-understanding/runner.entries.js +0 -476
- package/dist/media-understanding/runner.js +0 -649
- package/dist/media-understanding/scope.js +0 -41
- package/dist/media-understanding/types.js +0 -1
- package/dist/media-understanding/video.js +0 -8
- package/dist/memory/backend-config.js +0 -246
- package/dist/memory/batch-error-utils.js +0 -11
- package/dist/memory/batch-gemini.js +0 -320
- package/dist/memory/batch-http.js +0 -27
- package/dist/memory/batch-openai.js +0 -290
- package/dist/memory/batch-output.js +0 -29
- package/dist/memory/batch-runner.js +0 -22
- package/dist/memory/batch-upload.js +0 -23
- package/dist/memory/batch-utils.js +0 -26
- package/dist/memory/batch-voyage.js +0 -277
- package/dist/memory/embedding-chunk-limits.js +0 -25
- package/dist/memory/embedding-input-limits.js +0 -56
- package/dist/memory/embedding-model-limits.js +0 -24
- package/dist/memory/embeddings-debug.js +0 -11
- package/dist/memory/embeddings-gemini.js +0 -144
- package/dist/memory/embeddings-ollama.js +0 -111
- package/dist/memory/embeddings-openai.js +0 -65
- package/dist/memory/embeddings-remote-client.js +0 -22
- package/dist/memory/embeddings-remote-fetch.js +0 -15
- package/dist/memory/embeddings-voyage.js +0 -75
- package/dist/memory/embeddings.js +0 -251
- package/dist/memory/fs-utils.js +0 -23
- package/dist/memory/headers-fingerprint.js +0 -16
- package/dist/memory/hybrid.js +0 -80
- package/dist/memory/index.js +0 -1
- package/dist/memory/internal.js +0 -272
- package/dist/memory/manager-cache-key.js +0 -45
- package/dist/memory/manager-embedding-ops.js +0 -595
- package/dist/memory/manager-search.js +0 -101
- package/dist/memory/manager-sync-ops.js +0 -963
- package/dist/memory/manager.js +0 -1975
- package/dist/memory/memory-improvements.js +0 -239
- package/dist/memory/memory-schema.js +0 -76
- package/dist/memory/mmr.js +0 -164
- package/dist/memory/node-llama.js +0 -3
- package/dist/memory/openai-batch.js +0 -2
- package/dist/memory/post-json.js +0 -23
- package/dist/memory/provider-key.js +0 -23
- package/dist/memory/qmd-manager.js +0 -1669
- package/dist/memory/qmd-query-parser.js +0 -107
- package/dist/memory/qmd-scope.js +0 -93
- package/dist/memory/query-expansion.js +0 -495
- package/dist/memory/remote-http.js +0 -33
- package/dist/memory/search-manager.js +0 -183
- package/dist/memory/session-files.js +0 -104
- package/dist/memory/sqlite-vec.js +0 -19
- package/dist/memory/sqlite.js +0 -7
- package/dist/memory/status-format.js +0 -28
- package/dist/memory/sync-index.js +0 -21
- package/dist/memory/sync-memory-files.js +0 -69
- package/dist/memory/sync-progress.js +0 -22
- package/dist/memory/sync-session-files.js +0 -95
- package/dist/memory/sync-stale.js +0 -30
- package/dist/memory/temporal-decay.js +0 -119
- package/dist/memory/test-embeddings-mock.js +0 -16
- package/dist/memory/test-manager-helpers.js +0 -14
- package/dist/memory/test-manager.js +0 -8
- package/dist/memory/test-runtime-mocks.js +0 -11
- package/dist/memory/types.js +0 -1
- package/dist/node-host/config.js +0 -53
- package/dist/node-host/invoke-browser.js +0 -177
- package/dist/node-host/invoke-system-run.js +0 -281
- package/dist/node-host/invoke.js +0 -403
- package/dist/node-host/runner.js +0 -1034
- package/dist/node-host/with-timeout.js +0 -27
- package/dist/pairing/pairing-challenge.js +0 -15
- package/dist/pairing/pairing-labels.js +0 -4
- package/dist/pairing/pairing-messages.js +0 -14
- package/dist/pairing/pairing-store.js +0 -438
- package/dist/pairing/setup-code.js +0 -285
- package/dist/plugin-sdk/account-id.d.ts +0 -1
- package/dist/plugin-sdk/agent-media-payload.d.ts +0 -12
- package/dist/plugin-sdk/allow-from.d.ts +0 -27
- package/dist/plugin-sdk/command-auth.d.ts +0 -25
- package/dist/plugin-sdk/config-paths.d.ts +0 -6
- package/dist/plugin-sdk/file-lock.d.ts +0 -16
- package/dist/plugin-sdk/index.d.ts +0 -428
- package/dist/plugin-sdk/json-store.d.ts +0 -5
- package/dist/plugin-sdk/keyed-async-queue.d.ts +0 -12
- package/dist/plugin-sdk/onboarding.d.ts +0 -11
- package/dist/plugin-sdk/provider-auth-result.d.ts +0 -14
- package/dist/plugin-sdk/slack-message-actions.d.ts +0 -11
- package/dist/plugin-sdk/status-helpers.d.ts +0 -25
- package/dist/plugin-sdk/temp-path.d.ts +0 -12
- package/dist/plugin-sdk/text-chunking.d.ts +0 -1
- package/dist/plugin-sdk/tool-send.d.ts +0 -4
- package/dist/plugin-sdk/webhook-path.d.ts +0 -6
- package/dist/plugin-sdk/webhook-targets.d.ts +0 -23
- package/dist/plugin-sdk/windows-spawn.d.ts +0 -39
- package/dist/plugin-sdk-internal/accounts.js +0 -6
- package/dist/plugin-sdk-internal/discord.js +0 -23
- package/dist/plugin-sdk-internal/imessage.js +0 -13
- package/dist/plugin-sdk-internal/setup.js +0 -9
- package/dist/plugin-sdk-internal/signal.js +0 -13
- package/dist/plugin-sdk-internal/slack.js +0 -22
- package/dist/plugin-sdk-internal/telegram.js +0 -32
- package/dist/plugin-sdk-internal/whatsapp.js +0 -29
- package/dist/plugins/bundled-dir.js +0 -39
- package/dist/plugins/cli.js +0 -49
- package/dist/plugins/commands.js +0 -232
- package/dist/plugins/config-schema.js +0 -23
- package/dist/plugins/config-state.js +0 -180
- package/dist/plugins/discovery.js +0 -468
- package/dist/plugins/enable.js +0 -36
- package/dist/plugins/hook-runner-global.js +0 -73
- package/dist/plugins/hooks.js +0 -454
- package/dist/plugins/hooks.test-helpers.js +0 -21
- package/dist/plugins/http-path.js +0 -10
- package/dist/plugins/http-registry.js +0 -31
- package/dist/plugins/install.js +0 -374
- package/dist/plugins/installs.js +0 -21
- package/dist/plugins/loader.js +0 -548
- package/dist/plugins/logger.js +0 -8
- package/dist/plugins/manifest-registry.js +0 -140
- package/dist/plugins/manifest.js +0 -84
- package/dist/plugins/path-safety.js +0 -34
- package/dist/plugins/providers.js +0 -16
- package/dist/plugins/registry.js +0 -315
- package/dist/plugins/runtime/index.js +0 -355
- package/dist/plugins/runtime/native-deps.js +0 -16
- package/dist/plugins/runtime/types.js +0 -1
- package/dist/plugins/runtime.js +0 -28
- package/dist/plugins/schema-validator.js +0 -28
- package/dist/plugins/services.js +0 -55
- package/dist/plugins/slots.js +0 -68
- package/dist/plugins/source-display.js +0 -51
- package/dist/plugins/status.js +0 -27
- package/dist/plugins/tools.js +0 -98
- package/dist/plugins/uninstall.js +0 -171
- package/dist/plugins/update.js +0 -390
- package/dist/polls.js +0 -52
- package/dist/process/child-process-bridge.js +0 -34
- package/dist/process/command-queue.js +0 -226
- package/dist/process/exec.js +0 -116
- package/dist/process/kill-tree.js +0 -98
- package/dist/process/lanes.js +0 -1
- package/dist/process/restart-recovery.js +0 -16
- package/dist/process/spawn-utils.js +0 -102
- package/dist/process/supervisor/adapters/child.js +0 -143
- package/dist/process/supervisor/adapters/env.js +0 -13
- package/dist/process/supervisor/adapters/pty.js +0 -148
- package/dist/process/supervisor/index.js +0 -10
- package/dist/process/supervisor/registry.js +0 -117
- package/dist/process/supervisor/supervisor.js +0 -244
- package/dist/process/supervisor/types.js +0 -1
- package/dist/providers/github-copilot-auth.js +0 -101
- package/dist/providers/github-copilot-models.js +0 -66
- package/dist/providers/github-copilot-token.js +0 -57
- package/dist/providers/google-shared.test-helpers.js +0 -75
- package/dist/providers/qwen-portal-oauth.js +0 -46
- package/dist/routing/account-id.js +0 -30
- package/dist/routing/bindings.js +0 -87
- package/dist/routing/resolve-route.js +0 -282
- package/dist/runtime.js +0 -43
- package/dist/secrets/index.js +0 -28
- package/dist/secrets/resolver.js +0 -185
- package/dist/secrets/runtime.js +0 -142
- package/dist/secrets/types.js +0 -11
- package/dist/security/audit-channel.js +0 -499
- package/dist/security/audit-extra.async.js +0 -927
- package/dist/security/audit-extra.js +0 -12
- package/dist/security/audit-extra.sync.js +0 -891
- package/dist/security/audit-findings.js +0 -165
- package/dist/security/audit-fs.js +0 -151
- package/dist/security/audit-tool-policy.js +0 -1
- package/dist/security/audit.js +0 -172
- package/dist/security/capability-guards.js +0 -89
- package/dist/security/capability-manager.js +0 -76
- package/dist/security/capability.js +0 -147
- package/dist/security/channel-metadata.js +0 -34
- package/dist/security/dangerous-tools.js +0 -114
- package/dist/security/dm-policy-shared.js +0 -68
- package/dist/security/external-content.js +0 -307
- package/dist/security/fix.js +0 -366
- package/dist/security/index.js +0 -7
- package/dist/security/middleware.js +0 -105
- package/dist/security/prototype-pollution.js +0 -141
- package/dist/security/scan-paths.js +0 -32
- package/dist/security/secret-equal.js +0 -8
- package/dist/security/skill-scanner.js +0 -330
- package/dist/security/types.js +0 -12
- package/dist/security/webhook-security.js +0 -253
- package/dist/security/windows-acl.js +0 -177
- package/dist/sessions/input-provenance.js +0 -55
- package/dist/sessions/level-overrides.js +0 -24
- package/dist/sessions/model-overrides.js +0 -57
- package/dist/sessions/send-policy.js +0 -69
- package/dist/sessions/session-costs.js +0 -228
- package/dist/sessions/session-key-utils.js +0 -83
- package/dist/sessions/session-label.js +0 -16
- package/dist/sessions/transcript-events.js +0 -16
- package/dist/shared/chat-content.js +0 -31
- package/dist/shared/chat-envelope.js +0 -45
- package/dist/shared/config-eval.js +0 -117
- package/dist/shared/device-auth.js +0 -16
- package/dist/shared/entry-metadata.js +0 -9
- package/dist/shared/entry-status.js +0 -31
- package/dist/shared/frontmatter.js +0 -98
- package/dist/shared/model-param-b.js +0 -19
- package/dist/shared/net/ip-test-fixtures.js +0 -1
- package/dist/shared/net/ip.js +0 -354
- package/dist/shared/net/ipv4.js +0 -14
- package/dist/shared/node-list-parse.js +0 -13
- package/dist/shared/node-list-types.js +0 -1
- package/dist/shared/node-match.js +0 -60
- package/dist/shared/operator-scope-compat.js +0 -42
- package/dist/shared/param-key.js +0 -16
- package/dist/shared/poll-params.js +0 -58
- package/dist/shared/polls.js +0 -55
- package/dist/shared/requirements.js +0 -128
- package/dist/shared/string-normalization.js +0 -15
- package/dist/shared/subagents-format.js +0 -84
- package/dist/shared/text/reasoning-tags.js +0 -93
- package/dist/shared/text-chunking.js +0 -29
- package/dist/shared/usage-aggregates.js +0 -28
- package/dist/signal/accounts.js +0 -46
- package/dist/signal/channel.js +0 -264
- package/dist/signal/client.js +0 -141
- package/dist/signal/daemon.js +0 -69
- package/dist/signal/format.js +0 -165
- package/dist/signal/identity.js +0 -95
- package/dist/signal/index.js +0 -5
- package/dist/signal/monitor/access-policy.js +0 -60
- package/dist/signal/monitor/event-handler.js +0 -605
- package/dist/signal/monitor/event-handler.types.js +0 -1
- package/dist/signal/monitor/mentions.js +0 -45
- package/dist/signal/monitor.js +0 -269
- package/dist/signal/probe.js +0 -46
- package/dist/signal/reaction-level.js +0 -53
- package/dist/signal/rpc-context.js +0 -19
- package/dist/signal/runtime.js +0 -3
- package/dist/signal/send-reactions.js +0 -155
- package/dist/signal/send.js +0 -184
- package/dist/signal/sse-reconnect.js +0 -56
- package/dist/skills/commands.js +0 -333
- package/dist/skills/index.js +0 -164
- package/dist/skills/loader.js +0 -282
- package/dist/skills/openclaw-skill-loader.js +0 -191
- package/dist/skills/parser.js +0 -446
- package/dist/skills/registry.js +0 -394
- package/dist/skills/security.js +0 -312
- package/dist/skills/types.js +0 -21
- package/dist/slack/account-inspect.js +0 -135
- package/dist/slack/account-surface-fields.js +0 -1
- package/dist/slack/accounts.js +0 -71
- package/dist/slack/actions.js +0 -164
- package/dist/slack/blocks-fallback.js +0 -76
- package/dist/slack/blocks.test-helpers.js +0 -31
- package/dist/slack/channel-migration.js +0 -53
- package/dist/slack/channel.js +0 -394
- package/dist/slack/client.js +0 -17
- package/dist/slack/directory-live.js +0 -122
- package/dist/slack/draft-stream.js +0 -106
- package/dist/slack/format.js +0 -111
- package/dist/slack/http/index.js +0 -1
- package/dist/slack/http/registry.js +0 -27
- package/dist/slack/index.js +0 -6
- package/dist/slack/interactive-replies.js +0 -28
- package/dist/slack/message-actions.js +0 -51
- package/dist/slack/modal-metadata.js +0 -32
- package/dist/slack/monitor/allow-list.js +0 -57
- package/dist/slack/monitor/auth.js +0 -17
- package/dist/slack/monitor/channel-config.js +0 -79
- package/dist/slack/monitor/channel-type.js +0 -31
- package/dist/slack/monitor/commands.js +0 -28
- package/dist/slack/monitor/context.js +0 -243
- package/dist/slack/monitor/dm-auth.js +0 -49
- package/dist/slack/monitor/events/channels.js +0 -116
- package/dist/slack/monitor/events/interactions.js +0 -462
- package/dist/slack/monitor/events/interactions.modal.js +0 -137
- package/dist/slack/monitor/events/members.js +0 -74
- package/dist/slack/monitor/events/message-subtype-handlers.js +0 -68
- package/dist/slack/monitor/events/messages.js +0 -111
- package/dist/slack/monitor/events/pins.js +0 -76
- package/dist/slack/monitor/events/reactions.js +0 -54
- package/dist/slack/monitor/events/system-event-context.js +0 -29
- package/dist/slack/monitor/events/system-event-test-harness.js +0 -41
- package/dist/slack/monitor/events.js +0 -15
- package/dist/slack/monitor/external-arg-menu-store.js +0 -46
- package/dist/slack/monitor/media.js +0 -372
- package/dist/slack/monitor/message-handler/dispatch.js +0 -438
- package/dist/slack/monitor/message-handler/prepare-content.js +0 -69
- package/dist/slack/monitor/message-handler/prepare-thread-context.js +0 -91
- package/dist/slack/monitor/message-handler/prepare.js +0 -560
- package/dist/slack/monitor/message-handler/prepare.test-helpers.js +0 -55
- package/dist/slack/monitor/message-handler/types.js +0 -1
- package/dist/slack/monitor/message-handler.js +0 -87
- package/dist/slack/monitor/mrkdwn.js +0 -8
- package/dist/slack/monitor/policy.js +0 -10
- package/dist/slack/monitor/provider.js +0 -326
- package/dist/slack/monitor/reconnect-policy.js +0 -78
- package/dist/slack/monitor/replies.js +0 -115
- package/dist/slack/monitor/room-context.js +0 -17
- package/dist/slack/monitor/slash-commands.runtime.js +0 -1
- package/dist/slack/monitor/slash-dispatch.runtime.js +0 -9
- package/dist/slack/monitor/slash-skill-commands.runtime.js +0 -1
- package/dist/slack/monitor/slash.js +0 -726
- package/dist/slack/monitor/thread-resolution.js +0 -102
- package/dist/slack/monitor/types.js +0 -1
- package/dist/slack/monitor.js +0 -4
- package/dist/slack/monitor.test-helpers.js +0 -119
- package/dist/slack/probe.js +0 -47
- package/dist/slack/resolve-allowlist-common.js +0 -36
- package/dist/slack/resolve-channels.js +0 -93
- package/dist/slack/resolve-users.js +0 -133
- package/dist/slack/runtime.js +0 -3
- package/dist/slack/scopes.js +0 -87
- package/dist/slack/send.js +0 -222
- package/dist/slack/sent-thread-cache.js +0 -61
- package/dist/slack/slack-improvements.js +0 -225
- package/dist/slack/stream-mode.js +0 -51
- package/dist/slack/streaming.js +0 -79
- package/dist/slack/targets.js +0 -48
- package/dist/slack/threading-tool-context.js +0 -18
- package/dist/slack/threading.js +0 -26
- package/dist/slack/token.js +0 -10
- package/dist/slack/truncate.js +0 -10
- package/dist/slack/types.js +0 -1
- package/dist/swarm/service.js +0 -247
- package/dist/tailscale/detect.js +0 -145
- package/dist/telegram/account-inspect.js +0 -175
- package/dist/telegram/accounts.js +0 -130
- package/dist/telegram/allow-from.js +0 -10
- package/dist/telegram/allowed-updates.js +0 -11
- package/dist/telegram/api-fetch.js +0 -18
- package/dist/telegram/api-logging.js +0 -24
- package/dist/telegram/approval-buttons.js +0 -30
- package/dist/telegram/audit-membership-runtime.js +0 -61
- package/dist/telegram/audit.js +0 -116
- package/dist/telegram/bot/delivery.js +0 -474
- package/dist/telegram/bot/delivery.replies.js +0 -508
- package/dist/telegram/bot/delivery.resolve-media.js +0 -227
- package/dist/telegram/bot/delivery.send.js +0 -132
- package/dist/telegram/bot/helpers.js +0 -396
- package/dist/telegram/bot/reply-threading.js +0 -46
- package/dist/telegram/bot/types.js +0 -1
- package/dist/telegram/bot-access.js +0 -58
- package/dist/telegram/bot-handlers.js +0 -952
- package/dist/telegram/bot-message-context.body.js +0 -186
- package/dist/telegram/bot-message-context.js +0 -621
- package/dist/telegram/bot-message-context.session.js +0 -207
- package/dist/telegram/bot-message-context.types.js +0 -1
- package/dist/telegram/bot-message-dispatch.js +0 -682
- package/dist/telegram/bot-message.js +0 -41
- package/dist/telegram/bot-native-command-menu.js +0 -66
- package/dist/telegram/bot-native-commands.js +0 -529
- package/dist/telegram/bot-native-commands.test-helpers.js +0 -117
- package/dist/telegram/bot-updates.js +0 -25
- package/dist/telegram/bot.js +0 -292
- package/dist/telegram/bot.media.e2e-harness.js +0 -81
- package/dist/telegram/bot.media.test-utils.js +0 -81
- package/dist/telegram/button-types.js +0 -1
- package/dist/telegram/caption.js +0 -11
- package/dist/telegram/channel-actions.js +0 -225
- package/dist/telegram/channel.js +0 -515
- package/dist/telegram/conversation-route.js +0 -107
- package/dist/telegram/delivery.js +0 -2
- package/dist/telegram/delivery.replies.js +0 -508
- package/dist/telegram/dm-access.js +0 -86
- package/dist/telegram/download.js +0 -34
- package/dist/telegram/draft-chunking.js +0 -22
- package/dist/telegram/draft-stream.js +0 -146
- package/dist/telegram/draft-stream.test-helpers.js +0 -62
- package/dist/telegram/exec-approvals-handler.js +0 -281
- package/dist/telegram/exec-approvals.js +0 -62
- package/dist/telegram/fetch.js +0 -35
- package/dist/telegram/format.js +0 -210
- package/dist/telegram/forum-service-message.js +0 -22
- package/dist/telegram/group-access.js +0 -65
- package/dist/telegram/group-config-helpers.js +0 -10
- package/dist/telegram/group-migration.js +0 -53
- package/dist/telegram/index.js +0 -4
- package/dist/telegram/inline-buttons.js +0 -45
- package/dist/telegram/lane-delivery-state.js +0 -19
- package/dist/telegram/lane-delivery-text-deliverer.js +0 -357
- package/dist/telegram/lane-delivery.js +0 -2
- package/dist/telegram/model-buttons.js +0 -163
- package/dist/telegram/monitor.js +0 -179
- package/dist/telegram/network-config.js +0 -39
- package/dist/telegram/network-errors.js +0 -103
- package/dist/telegram/normalize.js +0 -37
- package/dist/telegram/onboarding.js +0 -192
- package/dist/telegram/outbound-adapter.js +0 -100
- package/dist/telegram/outbound-params.js +0 -21
- package/dist/telegram/pairing-store.js +0 -77
- package/dist/telegram/polling-session.js +0 -275
- package/dist/telegram/probe.js +0 -70
- package/dist/telegram/proxy.js +0 -10
- package/dist/telegram/reaction-level.js +0 -46
- package/dist/telegram/reasoning-lane-coordinator.js +0 -128
- package/dist/telegram/runtime.js +0 -3
- package/dist/telegram/send.js +0 -769
- package/dist/telegram/sendchataction-401-backoff.js +0 -71
- package/dist/telegram/sent-message-cache.js +0 -52
- package/dist/telegram/sequential-key.js +0 -46
- package/dist/telegram/status-issues.js +0 -105
- package/dist/telegram/status-reaction-variants.js +0 -208
- package/dist/telegram/sticker-cache.js +0 -204
- package/dist/telegram/target-writeback.js +0 -165
- package/dist/telegram/targets.js +0 -65
- package/dist/telegram/telegram-improvements.js +0 -220
- package/dist/telegram/thread-bindings.js +0 -560
- package/dist/telegram/token.js +0 -58
- package/dist/telegram/update-offset-store.js +0 -76
- package/dist/telegram/voice.js +0 -23
- package/dist/telegram/webhook-set.js +0 -28
- package/dist/telegram/webhook.js +0 -95
- package/dist/telemetry/alert-engine.js +0 -258
- package/dist/telemetry/cron-instrumentation.js +0 -49
- package/dist/telemetry/gateway-instrumentation.js +0 -80
- package/dist/telemetry/instrumentation.js +0 -66
- package/dist/telemetry/service.js +0 -345
- package/dist/terminal/ansi.js +0 -11
- package/dist/terminal/health-style.js +0 -36
- package/dist/terminal/links.js +0 -17
- package/dist/terminal/note.js +0 -79
- package/dist/terminal/palette.js +0 -14
- package/dist/terminal/progress-line.js +0 -18
- package/dist/terminal/prompt-select-styled.js +0 -9
- package/dist/terminal/prompt-style.js +0 -4
- package/dist/terminal/restore.js +0 -48
- package/dist/terminal/stream-writer.js +0 -49
- package/dist/terminal/table.js +0 -327
- package/dist/terminal/theme.js +0 -22
- package/dist/test-helpers/ssrf.js +0 -13
- package/dist/test-helpers/state-dir-env.js +0 -24
- package/dist/test-helpers/workspace.js +0 -11
- package/dist/test-utils/channel-plugins.js +0 -82
- package/dist/test-utils/command-runner.js +0 -6
- package/dist/test-utils/env.js +0 -72
- package/dist/test-utils/exec-assertions.js +0 -12
- package/dist/test-utils/fetch-mock.js +0 -5
- package/dist/test-utils/imessage-test-plugin.js +0 -54
- package/dist/test-utils/index.js +0 -219
- package/dist/test-utils/internal-hook-event-payload.js +0 -10
- package/dist/test-utils/mock-http-response.js +0 -17
- package/dist/test-utils/model-auth-mock.js +0 -12
- package/dist/test-utils/ports.js +0 -73
- package/dist/test-utils/provider-usage-fetch.js +0 -14
- package/dist/test-utils/temp-home.js +0 -33
- package/dist/test-utils/vitest-mock-fn.js +0 -1
- package/dist/tts/tts-core.js +0 -550
- package/dist/tts/tts.js +0 -683
- package/dist/tui/commands.js +0 -134
- package/dist/tui/components/assistant-message.js +0 -20
- package/dist/tui/components/chat-log.js +0 -128
- package/dist/tui/components/custom-editor.js +0 -61
- package/dist/tui/components/filterable-select-list.js +0 -105
- package/dist/tui/components/fuzzy-filter.js +0 -113
- package/dist/tui/components/hyperlink-markdown.js +0 -32
- package/dist/tui/components/searchable-select-list.js +0 -247
- package/dist/tui/components/selectors.js +0 -16
- package/dist/tui/components/tool-execution.js +0 -109
- package/dist/tui/components/user-message.js +0 -21
- package/dist/tui/gateway-chat.js +0 -148
- package/dist/tui/index.js +0 -611
- package/dist/tui/theme/syntax-theme.js +0 -49
- package/dist/tui/theme/theme-detection.js +0 -226
- package/dist/tui/theme/theme.js +0 -117
- package/dist/tui/tui-command-handlers.js +0 -455
- package/dist/tui/tui-event-handlers.js +0 -250
- package/dist/tui/tui-formatters.js +0 -159
- package/dist/tui/tui-local-shell.js +0 -109
- package/dist/tui/tui-overlays.js +0 -13
- package/dist/tui/tui-session-actions.js +0 -317
- package/dist/tui/tui-status-summary.js +0 -74
- package/dist/tui/tui-stream-assembler.js +0 -54
- package/dist/tui/tui-types.js +0 -1
- package/dist/tui/tui-waiting.js +0 -34
- package/dist/tui/tui.js +0 -750
- package/dist/tui/utils/ctrl-c-handler.js +0 -67
- package/dist/tui/utils/osc8-hyperlinks.js +0 -208
- package/dist/tui/utils/safe-stop.js +0 -180
- package/dist/tui/utils/session-key-utils.js +0 -81
- package/dist/tui/utils/text-sanitization.js +0 -284
- package/dist/ui-plugins/ui-plugins-improvements.js +0 -191
- package/dist/utils/account-id.js +0 -4
- package/dist/utils/boolean.js +0 -27
- package/dist/utils/chunk-items.js +0 -10
- package/dist/utils/delivery-context.js +0 -84
- package/dist/utils/directive-tags.js +0 -65
- package/dist/utils/fetch-timeout.js +0 -31
- package/dist/utils/lru-cache.js +0 -116
- package/dist/utils/mask-api-key.js +0 -10
- package/dist/utils/message-channel.js +0 -84
- package/dist/utils/normalize-secret-input.js +0 -19
- package/dist/utils/performance.js +0 -199
- package/dist/utils/provider-utils.js +0 -28
- package/dist/utils/queue-helpers.js +0 -150
- package/dist/utils/reaction-level.js +0 -52
- package/dist/utils/retry.js +0 -240
- package/dist/utils/run-with-concurrency.js +0 -39
- package/dist/utils/safe-json.js +0 -22
- package/dist/utils/shell-argv.js +0 -61
- package/dist/utils/time-format.js +0 -19
- package/dist/utils/transcript-tools.js +0 -58
- package/dist/utils/usage-format.js +0 -46
- package/dist/utils/with-timeout.js +0 -14
- package/dist/version.js +0 -69
- package/dist/web/accounts.js +0 -122
- package/dist/web/active-listener.js +0 -37
- package/dist/web/auth-store.js +0 -168
- package/dist/web/auto-reply/constants.js +0 -1
- package/dist/web/auto-reply/deliver-reply.js +0 -144
- package/dist/web/auto-reply/heartbeat-runner.js +0 -264
- package/dist/web/auto-reply/loggers.js +0 -5
- package/dist/web/auto-reply/mentions.js +0 -84
- package/dist/web/auto-reply/monitor/ack-reaction.js +0 -47
- package/dist/web/auto-reply/monitor/broadcast.js +0 -68
- package/dist/web/auto-reply/monitor/commands.js +0 -21
- package/dist/web/auto-reply/monitor/echo.js +0 -36
- package/dist/web/auto-reply/monitor/group-activation.js +0 -37
- package/dist/web/auto-reply/monitor/group-gating.js +0 -98
- package/dist/web/auto-reply/monitor/group-members.js +0 -60
- package/dist/web/auto-reply/monitor/last-route.js +0 -38
- package/dist/web/auto-reply/monitor/message-line.js +0 -35
- package/dist/web/auto-reply/monitor/on-message.js +0 -131
- package/dist/web/auto-reply/monitor/peer.js +0 -10
- package/dist/web/auto-reply/monitor/process-message.js +0 -337
- package/dist/web/auto-reply/monitor.js +0 -355
- package/dist/web/auto-reply/session-snapshot.js +0 -40
- package/dist/web/auto-reply/types.js +0 -1
- package/dist/web/auto-reply/util.js +0 -47
- package/dist/web/auto-reply.impl.js +0 -5
- package/dist/web/auto-reply.js +0 -1
- package/dist/web/inbound/access-control.js +0 -150
- package/dist/web/inbound/dedupe.js +0 -13
- package/dist/web/inbound/extract.js +0 -254
- package/dist/web/inbound/media.js +0 -61
- package/dist/web/inbound/monitor.js +0 -349
- package/dist/web/inbound/send-api.js +0 -91
- package/dist/web/inbound/types.js +0 -1
- package/dist/web/inbound.js +0 -3
- package/dist/web/login-qr.js +0 -233
- package/dist/web/login.js +0 -68
- package/dist/web/media.js +0 -344
- package/dist/web/outbound.js +0 -139
- package/dist/web/qr-image.js +0 -35
- package/dist/web/reconnect.js +0 -36
- package/dist/web/session.js +0 -224
- package/dist/web/vcard.js +0 -63
- package/dist/wizard/clack-prompter.js +0 -108
- package/dist/wizard/onboarding.completion.js +0 -74
- package/dist/wizard/onboarding.finalize.js +0 -354
- package/dist/wizard/onboarding.gateway-config.js +0 -188
- package/dist/wizard/onboarding.js +0 -376
- package/dist/wizard/onboarding.types.js +0 -1
- package/dist/wizard/session.js +0 -201
|
@@ -1,1305 +0,0 @@
|
|
|
1
|
-
import { Button, ChannelType, Command, Container, Row, StringSelectMenu, TextDisplay, } from "@buape/carbon";
|
|
2
|
-
import { ApplicationCommandOptionType, ButtonStyle } from "discord-api-types/v10";
|
|
3
|
-
import { resolveHumanDelayConfig } from "../../agents/identity.js";
|
|
4
|
-
import { resolveChunkMode, resolveTextChunkLimit } from "../../auto-reply/chunk.js";
|
|
5
|
-
import { buildCommandTextFromArgs, findCommandByNativeName, listChatCommands, parseCommandArgs, resolveCommandArgChoices, resolveCommandArgMenu, serializeCommandArgs, } from "../../auto-reply/commands-registry.js";
|
|
6
|
-
import { finalizeInboundContext } from "../../auto-reply/reply/inbound-context.js";
|
|
7
|
-
import { resolveStoredModelOverride } from "../../auto-reply/reply/model-selection.js";
|
|
8
|
-
import { dispatchReplyWithDispatcher } from "../../auto-reply/reply/provider-dispatcher.js";
|
|
9
|
-
import { resolveCommandAuthorizedFromAuthorizers } from "../../channels/command-gating.js";
|
|
10
|
-
import { createReplyPrefixOptions } from "../../channels/reply-prefix.js";
|
|
11
|
-
import { loadSessionStore, resolveStorePath } from "../../config/sessions.js";
|
|
12
|
-
import { logVerbose } from "../../globals.js";
|
|
13
|
-
import { createSubsystemLogger } from "../../logging/subsystem.js";
|
|
14
|
-
import { getAgentScopedMediaLocalRoots } from "../../media/local-roots.js";
|
|
15
|
-
import { buildPairingReply } from "../../pairing/pairing-messages.js";
|
|
16
|
-
import { readChannelAllowFromStore, upsertChannelPairingRequest, } from "../../pairing/pairing-store.js";
|
|
17
|
-
import { resolveAgentRoute } from "../../routing/resolve-route.js";
|
|
18
|
-
import { resolveAgentIdFromSessionKey } from "../../routing/session-key.js";
|
|
19
|
-
import { buildUntrustedChannelMetadata } from "../../security/channel-metadata.js";
|
|
20
|
-
import { chunkItems } from "../../utils/chunk-items.js";
|
|
21
|
-
import { withTimeout } from "../../utils/with-timeout.js";
|
|
22
|
-
import { loadWebMedia } from "../../web/media.js";
|
|
23
|
-
import { chunkDiscordTextWithMode } from "../chunk.js";
|
|
24
|
-
import { allowListMatches, isDiscordGroupAllowedByPolicy, normalizeDiscordAllowList, normalizeDiscordSlug, resolveDiscordChannelConfigWithFallback, resolveDiscordGuildEntry, resolveDiscordMemberAccessState, resolveDiscordOwnerAllowFrom, } from "./allow-list.js";
|
|
25
|
-
import { resolveDiscordChannelInfo } from "./message-utils.js";
|
|
26
|
-
import { readDiscordModelPickerRecentModels, recordDiscordModelPickerRecentModel, } from "./model-picker-preferences.js";
|
|
27
|
-
import { DISCORD_MODEL_PICKER_CUSTOM_ID_KEY, loadDiscordModelPickerData, parseDiscordModelPickerData, renderDiscordModelPickerModelsView, renderDiscordModelPickerProvidersView, renderDiscordModelPickerRecentsView, toDiscordModelPickerMessagePayload, } from "./model-picker.js";
|
|
28
|
-
import { resolveDiscordSenderIdentity } from "./sender-identity.js";
|
|
29
|
-
import { resolveDiscordThreadParentInfo } from "./threading.js";
|
|
30
|
-
const log = createSubsystemLogger("discord/native-command");
|
|
31
|
-
function buildDiscordCommandOptions(params) {
|
|
32
|
-
const { command, cfg } = params;
|
|
33
|
-
const args = command.args;
|
|
34
|
-
if (!args || args.length === 0) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
return args.map((arg) => {
|
|
38
|
-
const required = arg.required ?? false;
|
|
39
|
-
if (arg.type === "number") {
|
|
40
|
-
return {
|
|
41
|
-
name: arg.name,
|
|
42
|
-
description: arg.description,
|
|
43
|
-
type: ApplicationCommandOptionType.Number,
|
|
44
|
-
required,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
if (arg.type === "boolean") {
|
|
48
|
-
return {
|
|
49
|
-
name: arg.name,
|
|
50
|
-
description: arg.description,
|
|
51
|
-
type: ApplicationCommandOptionType.Boolean,
|
|
52
|
-
required,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const resolvedChoices = resolveCommandArgChoices({ command, arg, cfg });
|
|
56
|
-
const shouldAutocomplete = resolvedChoices.length > 0 &&
|
|
57
|
-
(typeof arg.choices === "function" || resolvedChoices.length > 25);
|
|
58
|
-
const autocomplete = shouldAutocomplete
|
|
59
|
-
? async (interaction) => {
|
|
60
|
-
const focused = interaction.options.getFocused();
|
|
61
|
-
const focusValue = typeof focused?.value === "string" ? focused.value.trim().toLowerCase() : "";
|
|
62
|
-
const choices = resolveCommandArgChoices({ command, arg, cfg });
|
|
63
|
-
const filtered = focusValue
|
|
64
|
-
? choices.filter((choice) => choice.label.toLowerCase().includes(focusValue))
|
|
65
|
-
: choices;
|
|
66
|
-
await interaction.respond(filtered.slice(0, 25).map((choice) => ({ name: choice.label, value: choice.value })));
|
|
67
|
-
}
|
|
68
|
-
: undefined;
|
|
69
|
-
const choices = resolvedChoices.length > 0 && !autocomplete
|
|
70
|
-
? resolvedChoices
|
|
71
|
-
.slice(0, 25)
|
|
72
|
-
.map((choice) => ({ name: choice.label, value: choice.value }))
|
|
73
|
-
: undefined;
|
|
74
|
-
return {
|
|
75
|
-
name: arg.name,
|
|
76
|
-
description: arg.description,
|
|
77
|
-
type: ApplicationCommandOptionType.String,
|
|
78
|
-
required,
|
|
79
|
-
choices,
|
|
80
|
-
autocomplete,
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function readDiscordCommandArgs(interaction, definitions) {
|
|
85
|
-
if (!definitions || definitions.length === 0) {
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
const values = {};
|
|
89
|
-
for (const definition of definitions) {
|
|
90
|
-
let value;
|
|
91
|
-
if (definition.type === "number") {
|
|
92
|
-
value = interaction.options.getNumber(definition.name) ?? null;
|
|
93
|
-
}
|
|
94
|
-
else if (definition.type === "boolean") {
|
|
95
|
-
value = interaction.options.getBoolean(definition.name) ?? null;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
value = interaction.options.getString(definition.name) ?? null;
|
|
99
|
-
}
|
|
100
|
-
if (value != null) {
|
|
101
|
-
values[definition.name] = value;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return Object.keys(values).length > 0 ? { values } : undefined;
|
|
105
|
-
}
|
|
106
|
-
const DISCORD_COMMAND_ARG_CUSTOM_ID_KEY = "cmdarg";
|
|
107
|
-
function createCommandArgsWithValue(params) {
|
|
108
|
-
const values = { [params.argName]: params.value };
|
|
109
|
-
return { values };
|
|
110
|
-
}
|
|
111
|
-
function encodeDiscordCommandArgValue(value) {
|
|
112
|
-
return encodeURIComponent(value);
|
|
113
|
-
}
|
|
114
|
-
function decodeDiscordCommandArgValue(value) {
|
|
115
|
-
try {
|
|
116
|
-
return decodeURIComponent(value);
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
return value;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function isDiscordUnknownInteraction(error) {
|
|
123
|
-
if (!error || typeof error !== "object") {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
const err = error;
|
|
127
|
-
if (err.discordCode === 10062 || err.rawBody?.code === 10062) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
if (err.status === 404 && /Unknown interaction/i.test(err.message ?? "")) {
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
if (/Unknown interaction/i.test(err.rawBody?.message ?? "")) {
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
async function safeDiscordInteractionCall(label, fn) {
|
|
139
|
-
try {
|
|
140
|
-
return await fn();
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
if (isDiscordUnknownInteraction(error)) {
|
|
144
|
-
logVerbose(`discord: ${label} skipped (interaction expired)`);
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
throw error;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function buildDiscordCommandArgCustomId(params) {
|
|
151
|
-
return [
|
|
152
|
-
`${DISCORD_COMMAND_ARG_CUSTOM_ID_KEY}:command=${encodeDiscordCommandArgValue(params.command)}`,
|
|
153
|
-
`arg=${encodeDiscordCommandArgValue(params.arg)}`,
|
|
154
|
-
`value=${encodeDiscordCommandArgValue(params.value)}`,
|
|
155
|
-
`user=${encodeDiscordCommandArgValue(params.userId)}`,
|
|
156
|
-
].join(";");
|
|
157
|
-
}
|
|
158
|
-
function parseDiscordCommandArgData(data) {
|
|
159
|
-
if (!data || typeof data !== "object") {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
const coerce = (value) => typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
163
|
-
const rawCommand = coerce(data.command);
|
|
164
|
-
const rawArg = coerce(data.arg);
|
|
165
|
-
const rawValue = coerce(data.value);
|
|
166
|
-
const rawUser = coerce(data.user);
|
|
167
|
-
if (!rawCommand || !rawArg || !rawValue || !rawUser) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
return {
|
|
171
|
-
command: decodeDiscordCommandArgValue(rawCommand),
|
|
172
|
-
arg: decodeDiscordCommandArgValue(rawArg),
|
|
173
|
-
value: decodeDiscordCommandArgValue(rawValue),
|
|
174
|
-
userId: decodeDiscordCommandArgValue(rawUser),
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
function resolveDiscordModelPickerCommandContext(command) {
|
|
178
|
-
const normalized = (command.nativeName ?? command.key).trim().toLowerCase();
|
|
179
|
-
if (normalized === "model" || normalized === "models") {
|
|
180
|
-
return normalized;
|
|
181
|
-
}
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
function resolveCommandArgStringValue(args, key) {
|
|
185
|
-
const value = args?.values?.[key];
|
|
186
|
-
if (typeof value !== "string") {
|
|
187
|
-
return "";
|
|
188
|
-
}
|
|
189
|
-
return value.trim();
|
|
190
|
-
}
|
|
191
|
-
function shouldOpenDiscordModelPickerFromCommand(params) {
|
|
192
|
-
const context = resolveDiscordModelPickerCommandContext(params.command);
|
|
193
|
-
if (!context) {
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
const serializedArgs = serializeCommandArgs(params.command, params.commandArgs)?.trim() ?? "";
|
|
197
|
-
if (context === "model") {
|
|
198
|
-
const modelValue = resolveCommandArgStringValue(params.commandArgs, "model");
|
|
199
|
-
return !modelValue && !serializedArgs ? context : null;
|
|
200
|
-
}
|
|
201
|
-
return serializedArgs ? null : context;
|
|
202
|
-
}
|
|
203
|
-
function buildDiscordModelPickerCurrentModel(defaultProvider, defaultModel) {
|
|
204
|
-
return `${defaultProvider}/${defaultModel}`;
|
|
205
|
-
}
|
|
206
|
-
function buildDiscordModelPickerAllowedModelRefs(data) {
|
|
207
|
-
const out = new Set();
|
|
208
|
-
for (const provider of data.providers) {
|
|
209
|
-
const models = data.byProvider.get(provider);
|
|
210
|
-
if (!models) {
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
for (const model of models) {
|
|
214
|
-
out.add(`${provider}/${model}`);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return out;
|
|
218
|
-
}
|
|
219
|
-
function resolveDiscordModelPickerPreferenceScope(params) {
|
|
220
|
-
return {
|
|
221
|
-
accountId: params.accountId,
|
|
222
|
-
guildId: params.interaction.guild?.id ?? undefined,
|
|
223
|
-
userId: params.userId,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function buildDiscordModelPickerNoticePayload(message) {
|
|
227
|
-
return {
|
|
228
|
-
components: [new Container([new TextDisplay(message)])],
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
async function resolveDiscordModelPickerRoute(params) {
|
|
232
|
-
const { interaction, cfg, accountId } = params;
|
|
233
|
-
const channel = interaction.channel;
|
|
234
|
-
const channelType = channel?.type;
|
|
235
|
-
const isDirectMessage = channelType === ChannelType.DM;
|
|
236
|
-
const isGroupDm = channelType === ChannelType.GroupDM;
|
|
237
|
-
const isThreadChannel = channelType === ChannelType.PublicThread ||
|
|
238
|
-
channelType === ChannelType.PrivateThread ||
|
|
239
|
-
channelType === ChannelType.AnnouncementThread;
|
|
240
|
-
const rawChannelId = channel?.id ?? "unknown";
|
|
241
|
-
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
|
|
242
|
-
? interaction.rawData.member.roles.map((roleId) => String(roleId))
|
|
243
|
-
: [];
|
|
244
|
-
let threadParentId;
|
|
245
|
-
if (interaction.guild && channel && isThreadChannel && rawChannelId) {
|
|
246
|
-
const channelInfo = await resolveDiscordChannelInfo(interaction.client, rawChannelId);
|
|
247
|
-
const parentInfo = await resolveDiscordThreadParentInfo({
|
|
248
|
-
client: interaction.client,
|
|
249
|
-
threadChannel: {
|
|
250
|
-
id: rawChannelId,
|
|
251
|
-
name: "name" in channel ? channel.name : undefined,
|
|
252
|
-
parentId: "parentId" in channel ? (channel.parentId ?? undefined) : undefined,
|
|
253
|
-
parent: undefined,
|
|
254
|
-
},
|
|
255
|
-
channelInfo,
|
|
256
|
-
});
|
|
257
|
-
threadParentId = parentInfo.id;
|
|
258
|
-
}
|
|
259
|
-
const route = resolveAgentRoute({
|
|
260
|
-
cfg,
|
|
261
|
-
channel: "discord",
|
|
262
|
-
accountId,
|
|
263
|
-
guildId: interaction.guild?.id ?? undefined,
|
|
264
|
-
memberRoleIds,
|
|
265
|
-
peer: {
|
|
266
|
-
kind: isDirectMessage ? "direct" : isGroupDm ? "group" : "channel",
|
|
267
|
-
id: isDirectMessage ? (interaction.user?.id ?? rawChannelId) : rawChannelId,
|
|
268
|
-
},
|
|
269
|
-
parentPeer: threadParentId ? { kind: "channel", id: threadParentId } : undefined,
|
|
270
|
-
});
|
|
271
|
-
const threadBinding = isThreadChannel
|
|
272
|
-
? params.threadBindings.getByThreadId(rawChannelId)
|
|
273
|
-
: undefined;
|
|
274
|
-
const boundSessionKey = threadBinding?.targetSessionKey?.trim();
|
|
275
|
-
const boundAgentId = boundSessionKey ? resolveAgentIdFromSessionKey(boundSessionKey) : undefined;
|
|
276
|
-
return boundSessionKey
|
|
277
|
-
? {
|
|
278
|
-
...route,
|
|
279
|
-
sessionKey: boundSessionKey,
|
|
280
|
-
agentId: boundAgentId ?? route.agentId,
|
|
281
|
-
}
|
|
282
|
-
: route;
|
|
283
|
-
}
|
|
284
|
-
function resolveDiscordModelPickerCurrentModel(params) {
|
|
285
|
-
const fallback = buildDiscordModelPickerCurrentModel(params.data.resolvedDefault.provider, params.data.resolvedDefault.model);
|
|
286
|
-
try {
|
|
287
|
-
const storePath = resolveStorePath(params.cfg.session?.store, {
|
|
288
|
-
agentId: params.route.agentId,
|
|
289
|
-
});
|
|
290
|
-
const sessionStore = loadSessionStore(storePath, { skipCache: true });
|
|
291
|
-
const sessionEntry = sessionStore[params.route.sessionKey];
|
|
292
|
-
const override = resolveStoredModelOverride({
|
|
293
|
-
sessionEntry,
|
|
294
|
-
sessionStore,
|
|
295
|
-
sessionKey: params.route.sessionKey,
|
|
296
|
-
});
|
|
297
|
-
if (!override?.model) {
|
|
298
|
-
return fallback;
|
|
299
|
-
}
|
|
300
|
-
const provider = (override.provider || params.data.resolvedDefault.provider).trim();
|
|
301
|
-
if (!provider) {
|
|
302
|
-
return fallback;
|
|
303
|
-
}
|
|
304
|
-
return `${provider}/${override.model}`;
|
|
305
|
-
}
|
|
306
|
-
catch {
|
|
307
|
-
return fallback;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
async function replyWithDiscordModelPickerProviders(params) {
|
|
311
|
-
const data = await loadDiscordModelPickerData(params.cfg);
|
|
312
|
-
const route = await resolveDiscordModelPickerRoute({
|
|
313
|
-
interaction: params.interaction,
|
|
314
|
-
cfg: params.cfg,
|
|
315
|
-
accountId: params.accountId,
|
|
316
|
-
threadBindings: params.threadBindings,
|
|
317
|
-
});
|
|
318
|
-
const currentModel = resolveDiscordModelPickerCurrentModel({
|
|
319
|
-
cfg: params.cfg,
|
|
320
|
-
route,
|
|
321
|
-
data,
|
|
322
|
-
});
|
|
323
|
-
const quickModels = await readDiscordModelPickerRecentModels({
|
|
324
|
-
scope: resolveDiscordModelPickerPreferenceScope({
|
|
325
|
-
interaction: params.interaction,
|
|
326
|
-
accountId: params.accountId,
|
|
327
|
-
userId: params.userId,
|
|
328
|
-
}),
|
|
329
|
-
allowedModelRefs: buildDiscordModelPickerAllowedModelRefs(data),
|
|
330
|
-
limit: 5,
|
|
331
|
-
});
|
|
332
|
-
const rendered = renderDiscordModelPickerModelsView({
|
|
333
|
-
command: params.command,
|
|
334
|
-
userId: params.userId,
|
|
335
|
-
data,
|
|
336
|
-
provider: splitDiscordModelRef(currentModel ?? "")?.provider ?? data.resolvedDefault.provider,
|
|
337
|
-
page: 1,
|
|
338
|
-
providerPage: 1,
|
|
339
|
-
currentModel,
|
|
340
|
-
quickModels,
|
|
341
|
-
});
|
|
342
|
-
const payload = {
|
|
343
|
-
...toDiscordModelPickerMessagePayload(rendered),
|
|
344
|
-
ephemeral: true,
|
|
345
|
-
};
|
|
346
|
-
await safeDiscordInteractionCall("model picker reply", async () => {
|
|
347
|
-
if (params.preferFollowUp) {
|
|
348
|
-
await params.interaction.followUp(payload);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
await params.interaction.reply(payload);
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
function resolveModelPickerSelectionValue(interaction) {
|
|
355
|
-
const rawValues = interaction.values;
|
|
356
|
-
if (!Array.isArray(rawValues) || rawValues.length === 0) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
const first = rawValues[0];
|
|
360
|
-
if (typeof first !== "string") {
|
|
361
|
-
return null;
|
|
362
|
-
}
|
|
363
|
-
const trimmed = first.trim();
|
|
364
|
-
return trimmed || null;
|
|
365
|
-
}
|
|
366
|
-
function buildDiscordModelPickerSelectionCommand(params) {
|
|
367
|
-
const commandDefinition = findCommandByNativeName("model", "discord") ??
|
|
368
|
-
listChatCommands().find((entry) => entry.key === "model");
|
|
369
|
-
if (!commandDefinition) {
|
|
370
|
-
return null;
|
|
371
|
-
}
|
|
372
|
-
const commandArgs = {
|
|
373
|
-
values: {
|
|
374
|
-
model: params.modelRef,
|
|
375
|
-
},
|
|
376
|
-
raw: params.modelRef,
|
|
377
|
-
};
|
|
378
|
-
return {
|
|
379
|
-
command: commandDefinition,
|
|
380
|
-
args: commandArgs,
|
|
381
|
-
prompt: buildCommandTextFromArgs(commandDefinition, commandArgs),
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
function listDiscordModelPickerProviderModels(data, provider) {
|
|
385
|
-
const modelSet = data.byProvider.get(provider);
|
|
386
|
-
if (!modelSet) {
|
|
387
|
-
return [];
|
|
388
|
-
}
|
|
389
|
-
return [...modelSet].toSorted();
|
|
390
|
-
}
|
|
391
|
-
function resolveDiscordModelPickerModelIndex(params) {
|
|
392
|
-
const models = listDiscordModelPickerProviderModels(params.data, params.provider);
|
|
393
|
-
if (!models.length) {
|
|
394
|
-
return null;
|
|
395
|
-
}
|
|
396
|
-
const index = models.indexOf(params.model);
|
|
397
|
-
if (index < 0) {
|
|
398
|
-
return null;
|
|
399
|
-
}
|
|
400
|
-
return index + 1;
|
|
401
|
-
}
|
|
402
|
-
function resolveDiscordModelPickerModelByIndex(params) {
|
|
403
|
-
if (!params.modelIndex || params.modelIndex < 1) {
|
|
404
|
-
return null;
|
|
405
|
-
}
|
|
406
|
-
const models = listDiscordModelPickerProviderModels(params.data, params.provider);
|
|
407
|
-
if (!models.length) {
|
|
408
|
-
return null;
|
|
409
|
-
}
|
|
410
|
-
return models[params.modelIndex - 1] ?? null;
|
|
411
|
-
}
|
|
412
|
-
function splitDiscordModelRef(modelRef) {
|
|
413
|
-
const trimmed = modelRef.trim();
|
|
414
|
-
const slashIndex = trimmed.indexOf("/");
|
|
415
|
-
if (slashIndex <= 0 || slashIndex >= trimmed.length - 1) {
|
|
416
|
-
return null;
|
|
417
|
-
}
|
|
418
|
-
const provider = trimmed.slice(0, slashIndex).trim();
|
|
419
|
-
const model = trimmed.slice(slashIndex + 1).trim();
|
|
420
|
-
if (!provider || !model) {
|
|
421
|
-
return null;
|
|
422
|
-
}
|
|
423
|
-
return { provider, model };
|
|
424
|
-
}
|
|
425
|
-
async function handleDiscordModelPickerInteraction(interaction, data, ctx) {
|
|
426
|
-
const parsed = parseDiscordModelPickerData(data);
|
|
427
|
-
if (!parsed) {
|
|
428
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("Sorry, that model picker interaction is no longer available.")));
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
if (interaction.user?.id && interaction.user.id !== parsed.userId) {
|
|
432
|
-
await safeDiscordInteractionCall("model picker ack", () => interaction.acknowledge());
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
const pickerData = await loadDiscordModelPickerData(ctx.cfg);
|
|
436
|
-
const route = await resolveDiscordModelPickerRoute({
|
|
437
|
-
interaction,
|
|
438
|
-
cfg: ctx.cfg,
|
|
439
|
-
accountId: ctx.accountId,
|
|
440
|
-
threadBindings: ctx.threadBindings,
|
|
441
|
-
});
|
|
442
|
-
const currentModelRef = resolveDiscordModelPickerCurrentModel({
|
|
443
|
-
cfg: ctx.cfg,
|
|
444
|
-
route,
|
|
445
|
-
data: pickerData,
|
|
446
|
-
});
|
|
447
|
-
const allowedModelRefs = buildDiscordModelPickerAllowedModelRefs(pickerData);
|
|
448
|
-
const preferenceScope = resolveDiscordModelPickerPreferenceScope({
|
|
449
|
-
interaction,
|
|
450
|
-
accountId: ctx.accountId,
|
|
451
|
-
userId: parsed.userId,
|
|
452
|
-
});
|
|
453
|
-
const quickModels = await readDiscordModelPickerRecentModels({
|
|
454
|
-
scope: preferenceScope,
|
|
455
|
-
allowedModelRefs,
|
|
456
|
-
limit: 5,
|
|
457
|
-
});
|
|
458
|
-
if (parsed.action === "recents") {
|
|
459
|
-
const rendered = renderDiscordModelPickerRecentsView({
|
|
460
|
-
command: parsed.command,
|
|
461
|
-
userId: parsed.userId,
|
|
462
|
-
data: pickerData,
|
|
463
|
-
quickModels,
|
|
464
|
-
currentModel: currentModelRef,
|
|
465
|
-
provider: parsed.provider,
|
|
466
|
-
page: parsed.page,
|
|
467
|
-
providerPage: parsed.providerPage,
|
|
468
|
-
});
|
|
469
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(toDiscordModelPickerMessagePayload(rendered)));
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
if (parsed.action === "back" && parsed.view === "providers") {
|
|
473
|
-
const rendered = renderDiscordModelPickerProvidersView({
|
|
474
|
-
command: parsed.command,
|
|
475
|
-
userId: parsed.userId,
|
|
476
|
-
data: pickerData,
|
|
477
|
-
page: parsed.page,
|
|
478
|
-
currentModel: currentModelRef,
|
|
479
|
-
});
|
|
480
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(toDiscordModelPickerMessagePayload(rendered)));
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
if (parsed.action === "back" && parsed.view === "models") {
|
|
484
|
-
const provider = parsed.provider ??
|
|
485
|
-
splitDiscordModelRef(currentModelRef ?? "")?.provider ??
|
|
486
|
-
pickerData.resolvedDefault.provider;
|
|
487
|
-
const rendered = renderDiscordModelPickerModelsView({
|
|
488
|
-
command: parsed.command,
|
|
489
|
-
userId: parsed.userId,
|
|
490
|
-
data: pickerData,
|
|
491
|
-
provider,
|
|
492
|
-
page: parsed.page ?? 1,
|
|
493
|
-
providerPage: parsed.providerPage ?? 1,
|
|
494
|
-
currentModel: currentModelRef,
|
|
495
|
-
quickModels,
|
|
496
|
-
});
|
|
497
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(toDiscordModelPickerMessagePayload(rendered)));
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
if (parsed.action === "provider") {
|
|
501
|
-
const selectedProvider = resolveModelPickerSelectionValue(interaction) ?? parsed.provider;
|
|
502
|
-
if (!selectedProvider || !pickerData.byProvider.has(selectedProvider)) {
|
|
503
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("Sorry, that provider isn't available anymore.")));
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
const rendered = renderDiscordModelPickerModelsView({
|
|
507
|
-
command: parsed.command,
|
|
508
|
-
userId: parsed.userId,
|
|
509
|
-
data: pickerData,
|
|
510
|
-
provider: selectedProvider,
|
|
511
|
-
page: 1,
|
|
512
|
-
providerPage: parsed.providerPage ?? parsed.page,
|
|
513
|
-
currentModel: currentModelRef,
|
|
514
|
-
quickModels,
|
|
515
|
-
});
|
|
516
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(toDiscordModelPickerMessagePayload(rendered)));
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
if (parsed.action === "model") {
|
|
520
|
-
const selectedModel = resolveModelPickerSelectionValue(interaction);
|
|
521
|
-
const provider = parsed.provider;
|
|
522
|
-
if (!provider || !selectedModel) {
|
|
523
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("Sorry, I couldn't read that model selection.")));
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
const modelIndex = resolveDiscordModelPickerModelIndex({
|
|
527
|
-
data: pickerData,
|
|
528
|
-
provider,
|
|
529
|
-
model: selectedModel,
|
|
530
|
-
});
|
|
531
|
-
if (!modelIndex) {
|
|
532
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("Sorry, that model isn't available anymore.")));
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
const modelRef = `${provider}/${selectedModel}`;
|
|
536
|
-
const rendered = renderDiscordModelPickerModelsView({
|
|
537
|
-
command: parsed.command,
|
|
538
|
-
userId: parsed.userId,
|
|
539
|
-
data: pickerData,
|
|
540
|
-
provider,
|
|
541
|
-
page: parsed.page,
|
|
542
|
-
providerPage: parsed.providerPage ?? 1,
|
|
543
|
-
currentModel: currentModelRef,
|
|
544
|
-
pendingModel: modelRef,
|
|
545
|
-
pendingModelIndex: modelIndex,
|
|
546
|
-
quickModels,
|
|
547
|
-
});
|
|
548
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(toDiscordModelPickerMessagePayload(rendered)));
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
if (parsed.action === "submit" || parsed.action === "reset" || parsed.action === "quick") {
|
|
552
|
-
let modelRef = null;
|
|
553
|
-
if (parsed.action === "reset") {
|
|
554
|
-
modelRef = `${pickerData.resolvedDefault.provider}/${pickerData.resolvedDefault.model}`;
|
|
555
|
-
}
|
|
556
|
-
else if (parsed.action === "quick") {
|
|
557
|
-
const slot = parsed.recentSlot ?? 0;
|
|
558
|
-
modelRef = slot >= 1 ? (quickModels[slot - 1] ?? null) : null;
|
|
559
|
-
}
|
|
560
|
-
else if (parsed.view === "recents") {
|
|
561
|
-
const defaultModelRef = `${pickerData.resolvedDefault.provider}/${pickerData.resolvedDefault.model}`;
|
|
562
|
-
const dedupedRecents = quickModels.filter((ref) => ref !== defaultModelRef);
|
|
563
|
-
const slot = parsed.recentSlot ?? 0;
|
|
564
|
-
if (slot === 1) {
|
|
565
|
-
modelRef = defaultModelRef;
|
|
566
|
-
}
|
|
567
|
-
else if (slot >= 2) {
|
|
568
|
-
modelRef = dedupedRecents[slot - 2] ?? null;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
const provider = parsed.provider;
|
|
573
|
-
const selectedModel = resolveDiscordModelPickerModelByIndex({
|
|
574
|
-
data: pickerData,
|
|
575
|
-
provider: provider ?? "",
|
|
576
|
-
modelIndex: parsed.modelIndex,
|
|
577
|
-
});
|
|
578
|
-
modelRef = provider && selectedModel ? `${provider}/${selectedModel}` : null;
|
|
579
|
-
}
|
|
580
|
-
const parsedModelRef = modelRef ? splitDiscordModelRef(modelRef) : null;
|
|
581
|
-
if (!parsedModelRef ||
|
|
582
|
-
!pickerData.byProvider.get(parsedModelRef.provider)?.has(parsedModelRef.model)) {
|
|
583
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("That selection expired. Please choose a model again.")));
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
const resolvedModelRef = `${parsedModelRef.provider}/${parsedModelRef.model}`;
|
|
587
|
-
const selectionCommand = buildDiscordModelPickerSelectionCommand({
|
|
588
|
-
modelRef: resolvedModelRef,
|
|
589
|
-
});
|
|
590
|
-
if (!selectionCommand) {
|
|
591
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload("Sorry, /model is unavailable right now.")));
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
const updateResult = await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload(`Applying model change to ${resolvedModelRef}...`)));
|
|
595
|
-
if (updateResult === null) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
try {
|
|
599
|
-
await withTimeout(dispatchDiscordCommandInteraction({
|
|
600
|
-
interaction,
|
|
601
|
-
prompt: selectionCommand.prompt,
|
|
602
|
-
command: selectionCommand.command,
|
|
603
|
-
commandArgs: selectionCommand.args,
|
|
604
|
-
cfg: ctx.cfg,
|
|
605
|
-
discordConfig: ctx.discordConfig,
|
|
606
|
-
accountId: ctx.accountId,
|
|
607
|
-
sessionPrefix: ctx.sessionPrefix,
|
|
608
|
-
preferFollowUp: true,
|
|
609
|
-
threadBindings: ctx.threadBindings,
|
|
610
|
-
suppressReplies: true,
|
|
611
|
-
}), 12000);
|
|
612
|
-
}
|
|
613
|
-
catch (error) {
|
|
614
|
-
if (error instanceof Error && error.message === "timeout") {
|
|
615
|
-
await safeDiscordInteractionCall("model picker follow-up", () => interaction.followUp({
|
|
616
|
-
...buildDiscordModelPickerNoticePayload(`⏳ Model change to ${resolvedModelRef} is still processing. Check /status in a few seconds.`),
|
|
617
|
-
ephemeral: true,
|
|
618
|
-
}));
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
await safeDiscordInteractionCall("model picker follow-up", () => interaction.followUp({
|
|
622
|
-
...buildDiscordModelPickerNoticePayload(`❌ Failed to apply ${resolvedModelRef}. Try /model ${resolvedModelRef} directly.`),
|
|
623
|
-
ephemeral: true,
|
|
624
|
-
}));
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
const effectiveModelRef = resolveDiscordModelPickerCurrentModel({
|
|
628
|
-
cfg: ctx.cfg,
|
|
629
|
-
route,
|
|
630
|
-
data: pickerData,
|
|
631
|
-
});
|
|
632
|
-
const persisted = effectiveModelRef === resolvedModelRef;
|
|
633
|
-
if (!persisted) {
|
|
634
|
-
logVerbose(`discord: model picker override mismatch — expected ${resolvedModelRef} but read ${effectiveModelRef} from session key ${route.sessionKey}`);
|
|
635
|
-
}
|
|
636
|
-
if (persisted) {
|
|
637
|
-
await recordDiscordModelPickerRecentModel({
|
|
638
|
-
scope: preferenceScope,
|
|
639
|
-
modelRef: resolvedModelRef,
|
|
640
|
-
limit: 5,
|
|
641
|
-
}).catch(() => undefined);
|
|
642
|
-
}
|
|
643
|
-
await safeDiscordInteractionCall("model picker follow-up", () => interaction.followUp({
|
|
644
|
-
...buildDiscordModelPickerNoticePayload(persisted
|
|
645
|
-
? `✅ Model set to ${resolvedModelRef}.`
|
|
646
|
-
: `⚠️ Tried to set ${resolvedModelRef}, but current model is ${effectiveModelRef}.`),
|
|
647
|
-
ephemeral: true,
|
|
648
|
-
}));
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
if (parsed.action === "cancel") {
|
|
652
|
-
const displayModel = currentModelRef ?? "default";
|
|
653
|
-
await safeDiscordInteractionCall("model picker update", () => interaction.update(buildDiscordModelPickerNoticePayload(`ℹ️ Model kept as ${displayModel}.`)));
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
async function handleDiscordCommandArgInteraction(interaction, data, ctx) {
|
|
658
|
-
const parsed = parseDiscordCommandArgData(data);
|
|
659
|
-
if (!parsed) {
|
|
660
|
-
await safeDiscordInteractionCall("command arg update", () => interaction.update({
|
|
661
|
-
content: "Sorry, that selection is no longer available.",
|
|
662
|
-
components: [],
|
|
663
|
-
}));
|
|
664
|
-
return;
|
|
665
|
-
}
|
|
666
|
-
if (interaction.user?.id && interaction.user.id !== parsed.userId) {
|
|
667
|
-
await safeDiscordInteractionCall("command arg ack", () => interaction.acknowledge());
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
const commandDefinition = findCommandByNativeName(parsed.command, "discord") ??
|
|
671
|
-
listChatCommands().find((entry) => entry.key === parsed.command);
|
|
672
|
-
if (!commandDefinition) {
|
|
673
|
-
await safeDiscordInteractionCall("command arg update", () => interaction.update({
|
|
674
|
-
content: "Sorry, that command is no longer available.",
|
|
675
|
-
components: [],
|
|
676
|
-
}));
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
const argUpdateResult = await safeDiscordInteractionCall("command arg update", () => interaction.update({
|
|
680
|
-
content: `✅ Selected ${parsed.value}.`,
|
|
681
|
-
components: [],
|
|
682
|
-
}));
|
|
683
|
-
if (argUpdateResult === null) {
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
const commandArgs = createCommandArgsWithValue({
|
|
687
|
-
argName: parsed.arg,
|
|
688
|
-
value: parsed.value,
|
|
689
|
-
});
|
|
690
|
-
const commandArgsWithRaw = {
|
|
691
|
-
...commandArgs,
|
|
692
|
-
raw: serializeCommandArgs(commandDefinition, commandArgs),
|
|
693
|
-
};
|
|
694
|
-
const prompt = buildCommandTextFromArgs(commandDefinition, commandArgsWithRaw);
|
|
695
|
-
await dispatchDiscordCommandInteraction({
|
|
696
|
-
interaction,
|
|
697
|
-
prompt,
|
|
698
|
-
command: commandDefinition,
|
|
699
|
-
commandArgs: commandArgsWithRaw,
|
|
700
|
-
cfg: ctx.cfg,
|
|
701
|
-
discordConfig: ctx.discordConfig,
|
|
702
|
-
accountId: ctx.accountId,
|
|
703
|
-
sessionPrefix: ctx.sessionPrefix,
|
|
704
|
-
preferFollowUp: true,
|
|
705
|
-
threadBindings: ctx.threadBindings,
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
class DiscordCommandArgButton extends Button {
|
|
709
|
-
label;
|
|
710
|
-
customId;
|
|
711
|
-
style = ButtonStyle.Secondary;
|
|
712
|
-
cfg;
|
|
713
|
-
discordConfig;
|
|
714
|
-
accountId;
|
|
715
|
-
sessionPrefix;
|
|
716
|
-
threadBindings;
|
|
717
|
-
constructor(params) {
|
|
718
|
-
super();
|
|
719
|
-
this.label = params.label;
|
|
720
|
-
this.customId = params.customId;
|
|
721
|
-
this.cfg = params.cfg;
|
|
722
|
-
this.discordConfig = params.discordConfig;
|
|
723
|
-
this.accountId = params.accountId;
|
|
724
|
-
this.sessionPrefix = params.sessionPrefix;
|
|
725
|
-
this.threadBindings = params.threadBindings;
|
|
726
|
-
}
|
|
727
|
-
async run(interaction, data) {
|
|
728
|
-
await handleDiscordCommandArgInteraction(interaction, data, {
|
|
729
|
-
cfg: this.cfg,
|
|
730
|
-
discordConfig: this.discordConfig,
|
|
731
|
-
accountId: this.accountId,
|
|
732
|
-
sessionPrefix: this.sessionPrefix,
|
|
733
|
-
threadBindings: this.threadBindings,
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
class DiscordCommandArgFallbackButton extends Button {
|
|
738
|
-
label = "cmdarg";
|
|
739
|
-
customId = "cmdarg:seed=1";
|
|
740
|
-
ctx;
|
|
741
|
-
constructor(ctx) {
|
|
742
|
-
super();
|
|
743
|
-
this.ctx = ctx;
|
|
744
|
-
}
|
|
745
|
-
async run(interaction, data) {
|
|
746
|
-
await handleDiscordCommandArgInteraction(interaction, data, this.ctx);
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
export function createDiscordCommandArgFallbackButton(params) {
|
|
750
|
-
return new DiscordCommandArgFallbackButton(params);
|
|
751
|
-
}
|
|
752
|
-
class DiscordModelPickerFallbackButton extends Button {
|
|
753
|
-
label = DISCORD_MODEL_PICKER_CUSTOM_ID_KEY;
|
|
754
|
-
customId = `${DISCORD_MODEL_PICKER_CUSTOM_ID_KEY}:seed=btn`;
|
|
755
|
-
ctx;
|
|
756
|
-
constructor(ctx) {
|
|
757
|
-
super();
|
|
758
|
-
this.ctx = ctx;
|
|
759
|
-
}
|
|
760
|
-
async run(interaction, data) {
|
|
761
|
-
await handleDiscordModelPickerInteraction(interaction, data, this.ctx);
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
class DiscordModelPickerFallbackSelect extends StringSelectMenu {
|
|
765
|
-
customId = `${DISCORD_MODEL_PICKER_CUSTOM_ID_KEY}:seed=sel`;
|
|
766
|
-
options = [];
|
|
767
|
-
ctx;
|
|
768
|
-
constructor(ctx) {
|
|
769
|
-
super();
|
|
770
|
-
this.ctx = ctx;
|
|
771
|
-
}
|
|
772
|
-
async run(interaction, data) {
|
|
773
|
-
await handleDiscordModelPickerInteraction(interaction, data, this.ctx);
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
export function createDiscordModelPickerFallbackButton(params) {
|
|
777
|
-
return new DiscordModelPickerFallbackButton(params);
|
|
778
|
-
}
|
|
779
|
-
export function createDiscordModelPickerFallbackSelect(params) {
|
|
780
|
-
return new DiscordModelPickerFallbackSelect(params);
|
|
781
|
-
}
|
|
782
|
-
function buildDiscordCommandArgMenu(params) {
|
|
783
|
-
const { command, menu, interaction } = params;
|
|
784
|
-
const commandLabel = command.nativeName ?? command.key;
|
|
785
|
-
const userId = interaction.user?.id ?? "";
|
|
786
|
-
const rows = chunkItems(menu.choices, 4).map((choices) => {
|
|
787
|
-
const buttons = choices.map((choice) => new DiscordCommandArgButton({
|
|
788
|
-
label: choice.label,
|
|
789
|
-
customId: buildDiscordCommandArgCustomId({
|
|
790
|
-
command: commandLabel,
|
|
791
|
-
arg: menu.arg.name,
|
|
792
|
-
value: choice.value,
|
|
793
|
-
userId,
|
|
794
|
-
}),
|
|
795
|
-
cfg: params.cfg,
|
|
796
|
-
discordConfig: params.discordConfig,
|
|
797
|
-
accountId: params.accountId,
|
|
798
|
-
sessionPrefix: params.sessionPrefix,
|
|
799
|
-
threadBindings: params.threadBindings,
|
|
800
|
-
}));
|
|
801
|
-
return new Row(buttons);
|
|
802
|
-
});
|
|
803
|
-
const content = menu.title ?? `Choose ${menu.arg.description || menu.arg.name} for /${commandLabel}.`;
|
|
804
|
-
return { content, components: rows };
|
|
805
|
-
}
|
|
806
|
-
export function createDiscordNativeCommand(params) {
|
|
807
|
-
const { command, cfg, discordConfig, accountId, sessionPrefix, ephemeralDefault, threadBindings, } = params;
|
|
808
|
-
const commandDefinition = findCommandByNativeName(command.name, "discord") ??
|
|
809
|
-
{
|
|
810
|
-
key: command.name,
|
|
811
|
-
nativeName: command.name,
|
|
812
|
-
description: command.description,
|
|
813
|
-
textAliases: [],
|
|
814
|
-
acceptsArgs: command.acceptsArgs,
|
|
815
|
-
args: command.args,
|
|
816
|
-
argsParsing: "none",
|
|
817
|
-
scope: "native",
|
|
818
|
-
};
|
|
819
|
-
const argDefinitions = commandDefinition.args ?? command.args;
|
|
820
|
-
const commandOptions = buildDiscordCommandOptions({
|
|
821
|
-
command: commandDefinition,
|
|
822
|
-
cfg,
|
|
823
|
-
});
|
|
824
|
-
const options = commandOptions
|
|
825
|
-
? commandOptions
|
|
826
|
-
: command.acceptsArgs
|
|
827
|
-
? [
|
|
828
|
-
{
|
|
829
|
-
name: "input",
|
|
830
|
-
description: "Command input",
|
|
831
|
-
type: ApplicationCommandOptionType.String,
|
|
832
|
-
required: false,
|
|
833
|
-
},
|
|
834
|
-
]
|
|
835
|
-
: undefined;
|
|
836
|
-
return new (class extends Command {
|
|
837
|
-
name = command.name;
|
|
838
|
-
description = command.description;
|
|
839
|
-
defer = true;
|
|
840
|
-
ephemeral = ephemeralDefault;
|
|
841
|
-
options = options;
|
|
842
|
-
async run(interaction) {
|
|
843
|
-
const commandArgs = argDefinitions?.length
|
|
844
|
-
? readDiscordCommandArgs(interaction, argDefinitions)
|
|
845
|
-
: command.acceptsArgs
|
|
846
|
-
? parseCommandArgs(commandDefinition, interaction.options.getString("input") ?? "")
|
|
847
|
-
: undefined;
|
|
848
|
-
const commandArgsWithRaw = commandArgs
|
|
849
|
-
? {
|
|
850
|
-
...commandArgs,
|
|
851
|
-
raw: serializeCommandArgs(commandDefinition, commandArgs) ?? commandArgs.raw,
|
|
852
|
-
}
|
|
853
|
-
: undefined;
|
|
854
|
-
const prompt = buildCommandTextFromArgs(commandDefinition, commandArgsWithRaw);
|
|
855
|
-
await dispatchDiscordCommandInteraction({
|
|
856
|
-
interaction,
|
|
857
|
-
prompt,
|
|
858
|
-
command: commandDefinition,
|
|
859
|
-
commandArgs: commandArgsWithRaw,
|
|
860
|
-
cfg,
|
|
861
|
-
discordConfig,
|
|
862
|
-
accountId,
|
|
863
|
-
sessionPrefix,
|
|
864
|
-
preferFollowUp: false,
|
|
865
|
-
threadBindings,
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
})();
|
|
869
|
-
}
|
|
870
|
-
async function dispatchDiscordCommandInteraction(params) {
|
|
871
|
-
const { interaction, prompt, command, commandArgs, cfg, discordConfig, accountId, sessionPrefix, preferFollowUp, threadBindings, suppressReplies, } = params;
|
|
872
|
-
const respond = async (content, options) => {
|
|
873
|
-
const payload = {
|
|
874
|
-
content,
|
|
875
|
-
...(options?.ephemeral !== undefined ? { ephemeral: options.ephemeral } : {}),
|
|
876
|
-
};
|
|
877
|
-
await safeDiscordInteractionCall("interaction reply", async () => {
|
|
878
|
-
if (preferFollowUp) {
|
|
879
|
-
await interaction.followUp(payload);
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
await interaction.reply(payload);
|
|
883
|
-
});
|
|
884
|
-
};
|
|
885
|
-
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
886
|
-
const user = interaction.user;
|
|
887
|
-
if (!user) {
|
|
888
|
-
return;
|
|
889
|
-
}
|
|
890
|
-
const sender = resolveDiscordSenderIdentity({ author: user, pluralkitInfo: null });
|
|
891
|
-
const channel = interaction.channel;
|
|
892
|
-
const channelType = channel?.type;
|
|
893
|
-
const isDirectMessage = channelType === ChannelType.DM;
|
|
894
|
-
const isGroupDm = channelType === ChannelType.GroupDM;
|
|
895
|
-
const isThreadChannel = channelType === ChannelType.PublicThread ||
|
|
896
|
-
channelType === ChannelType.PrivateThread ||
|
|
897
|
-
channelType === ChannelType.AnnouncementThread;
|
|
898
|
-
const channelName = channel && "name" in channel ? channel.name : undefined;
|
|
899
|
-
const channelSlug = channelName ? normalizeDiscordSlug(channelName) : "";
|
|
900
|
-
const rawChannelId = channel?.id ?? "";
|
|
901
|
-
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
|
|
902
|
-
? interaction.rawData.member.roles.map((roleId) => String(roleId))
|
|
903
|
-
: [];
|
|
904
|
-
const ownerAllowList = normalizeDiscordAllowList(discordConfig?.allowFrom ?? discordConfig?.dm?.allowFrom ?? [], ["discord:", "user:", "pk:"]);
|
|
905
|
-
const ownerOk = ownerAllowList && user
|
|
906
|
-
? allowListMatches(ownerAllowList, {
|
|
907
|
-
id: sender.id,
|
|
908
|
-
name: sender.name,
|
|
909
|
-
tag: sender.tag,
|
|
910
|
-
})
|
|
911
|
-
: false;
|
|
912
|
-
const guildInfo = resolveDiscordGuildEntry({
|
|
913
|
-
guild: interaction.guild ?? undefined,
|
|
914
|
-
guildEntries: discordConfig?.guilds,
|
|
915
|
-
});
|
|
916
|
-
let threadParentId;
|
|
917
|
-
let threadParentName;
|
|
918
|
-
let threadParentSlug = "";
|
|
919
|
-
if (interaction.guild && channel && isThreadChannel && rawChannelId) {
|
|
920
|
-
// Threads inherit parent channel config unless explicitly overridden.
|
|
921
|
-
const channelInfo = await resolveDiscordChannelInfo(interaction.client, rawChannelId);
|
|
922
|
-
const parentInfo = await resolveDiscordThreadParentInfo({
|
|
923
|
-
client: interaction.client,
|
|
924
|
-
threadChannel: {
|
|
925
|
-
id: rawChannelId,
|
|
926
|
-
name: channelName,
|
|
927
|
-
parentId: "parentId" in channel ? (channel.parentId ?? undefined) : undefined,
|
|
928
|
-
parent: undefined,
|
|
929
|
-
},
|
|
930
|
-
channelInfo,
|
|
931
|
-
});
|
|
932
|
-
threadParentId = parentInfo.id;
|
|
933
|
-
threadParentName = parentInfo.name;
|
|
934
|
-
threadParentSlug = threadParentName ? normalizeDiscordSlug(threadParentName) : "";
|
|
935
|
-
}
|
|
936
|
-
const channelConfig = interaction.guild
|
|
937
|
-
? resolveDiscordChannelConfigWithFallback({
|
|
938
|
-
guildInfo,
|
|
939
|
-
channelId: rawChannelId,
|
|
940
|
-
channelName,
|
|
941
|
-
channelSlug,
|
|
942
|
-
parentId: threadParentId,
|
|
943
|
-
parentName: threadParentName,
|
|
944
|
-
parentSlug: threadParentSlug,
|
|
945
|
-
scope: isThreadChannel ? "thread" : "channel",
|
|
946
|
-
})
|
|
947
|
-
: null;
|
|
948
|
-
if (channelConfig?.enabled === false) {
|
|
949
|
-
await respond("This channel is disabled.");
|
|
950
|
-
return;
|
|
951
|
-
}
|
|
952
|
-
if (interaction.guild && channelConfig?.allowed === false) {
|
|
953
|
-
await respond("This channel is not allowed.");
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (useAccessGroups && interaction.guild) {
|
|
957
|
-
const channelAllowlistConfigured = Boolean(guildInfo?.channels) && Object.keys(guildInfo?.channels ?? {}).length > 0;
|
|
958
|
-
const channelAllowed = channelConfig?.allowed !== false;
|
|
959
|
-
const allowByPolicy = isDiscordGroupAllowedByPolicy({
|
|
960
|
-
groupPolicy: discordConfig?.groupPolicy ?? "open",
|
|
961
|
-
guildAllowlisted: Boolean(guildInfo),
|
|
962
|
-
channelAllowlistConfigured,
|
|
963
|
-
channelAllowed,
|
|
964
|
-
});
|
|
965
|
-
if (!allowByPolicy) {
|
|
966
|
-
await respond("This channel is not allowed.");
|
|
967
|
-
return;
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
const dmEnabled = discordConfig?.dm?.enabled ?? true;
|
|
971
|
-
const dmPolicy = discordConfig?.dmPolicy ?? discordConfig?.dm?.policy ?? "pairing";
|
|
972
|
-
let commandAuthorized = true;
|
|
973
|
-
if (isDirectMessage) {
|
|
974
|
-
if (!dmEnabled || dmPolicy === "disabled") {
|
|
975
|
-
await respond("Discord DMs are disabled.");
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
if (dmPolicy !== "open") {
|
|
979
|
-
const storeAllowFrom = dmPolicy === "allowlist" ? [] : await readChannelAllowFromStore("discord").catch(() => []);
|
|
980
|
-
const effectiveAllowFrom = [
|
|
981
|
-
...(discordConfig?.allowFrom ?? discordConfig?.dm?.allowFrom ?? []),
|
|
982
|
-
...storeAllowFrom,
|
|
983
|
-
];
|
|
984
|
-
const allowList = normalizeDiscordAllowList(effectiveAllowFrom, ["discord:", "user:", "pk:"]);
|
|
985
|
-
const permitted = allowList
|
|
986
|
-
? allowListMatches(allowList, {
|
|
987
|
-
id: sender.id,
|
|
988
|
-
name: sender.name,
|
|
989
|
-
tag: sender.tag,
|
|
990
|
-
})
|
|
991
|
-
: false;
|
|
992
|
-
if (!permitted) {
|
|
993
|
-
commandAuthorized = false;
|
|
994
|
-
if (dmPolicy === "pairing") {
|
|
995
|
-
const { code, created } = await upsertChannelPairingRequest({
|
|
996
|
-
channel: "discord",
|
|
997
|
-
id: user.id,
|
|
998
|
-
meta: {
|
|
999
|
-
tag: sender.tag,
|
|
1000
|
-
name: sender.name,
|
|
1001
|
-
},
|
|
1002
|
-
});
|
|
1003
|
-
if (created) {
|
|
1004
|
-
await respond(buildPairingReply({
|
|
1005
|
-
channel: "discord",
|
|
1006
|
-
idLine: `Your Discord user id: ${user.id}`,
|
|
1007
|
-
code,
|
|
1008
|
-
}), { ephemeral: true });
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
else {
|
|
1012
|
-
await respond("You are not authorized to use this command.", { ephemeral: true });
|
|
1013
|
-
}
|
|
1014
|
-
return;
|
|
1015
|
-
}
|
|
1016
|
-
commandAuthorized = true;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
if (!isDirectMessage) {
|
|
1020
|
-
const { hasAccessRestrictions, memberAllowed } = resolveDiscordMemberAccessState({
|
|
1021
|
-
channelConfig,
|
|
1022
|
-
guildInfo,
|
|
1023
|
-
memberRoleIds,
|
|
1024
|
-
sender,
|
|
1025
|
-
});
|
|
1026
|
-
const authorizers = useAccessGroups
|
|
1027
|
-
? [
|
|
1028
|
-
{ configured: ownerAllowList != null, allowed: ownerOk },
|
|
1029
|
-
{ configured: hasAccessRestrictions, allowed: memberAllowed },
|
|
1030
|
-
]
|
|
1031
|
-
: [{ configured: hasAccessRestrictions, allowed: memberAllowed }];
|
|
1032
|
-
commandAuthorized = resolveCommandAuthorizedFromAuthorizers({
|
|
1033
|
-
useAccessGroups,
|
|
1034
|
-
authorizers,
|
|
1035
|
-
modeWhenAccessGroupsOff: "configured",
|
|
1036
|
-
});
|
|
1037
|
-
if (!commandAuthorized) {
|
|
1038
|
-
await respond("You are not authorized to use this command.", { ephemeral: true });
|
|
1039
|
-
return;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
if (isGroupDm && discordConfig?.dm?.groupEnabled === false) {
|
|
1043
|
-
await respond("Discord group DMs are disabled.");
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
const menu = resolveCommandArgMenu({
|
|
1047
|
-
command,
|
|
1048
|
-
args: commandArgs,
|
|
1049
|
-
cfg,
|
|
1050
|
-
});
|
|
1051
|
-
if (menu) {
|
|
1052
|
-
const menuPayload = buildDiscordCommandArgMenu({
|
|
1053
|
-
command,
|
|
1054
|
-
menu,
|
|
1055
|
-
interaction: interaction,
|
|
1056
|
-
cfg,
|
|
1057
|
-
discordConfig,
|
|
1058
|
-
accountId,
|
|
1059
|
-
sessionPrefix,
|
|
1060
|
-
threadBindings,
|
|
1061
|
-
});
|
|
1062
|
-
if (preferFollowUp) {
|
|
1063
|
-
await safeDiscordInteractionCall("interaction follow-up", () => interaction.followUp({
|
|
1064
|
-
content: menuPayload.content,
|
|
1065
|
-
components: menuPayload.components,
|
|
1066
|
-
ephemeral: true,
|
|
1067
|
-
}));
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
await safeDiscordInteractionCall("interaction reply", () => interaction.reply({
|
|
1071
|
-
content: menuPayload.content,
|
|
1072
|
-
components: menuPayload.components,
|
|
1073
|
-
ephemeral: true,
|
|
1074
|
-
}));
|
|
1075
|
-
return;
|
|
1076
|
-
}
|
|
1077
|
-
const pickerCommandContext = shouldOpenDiscordModelPickerFromCommand({
|
|
1078
|
-
command,
|
|
1079
|
-
commandArgs,
|
|
1080
|
-
});
|
|
1081
|
-
if (pickerCommandContext) {
|
|
1082
|
-
await replyWithDiscordModelPickerProviders({
|
|
1083
|
-
interaction,
|
|
1084
|
-
cfg,
|
|
1085
|
-
command: pickerCommandContext,
|
|
1086
|
-
userId: user.id,
|
|
1087
|
-
accountId,
|
|
1088
|
-
threadBindings,
|
|
1089
|
-
preferFollowUp,
|
|
1090
|
-
});
|
|
1091
|
-
return;
|
|
1092
|
-
}
|
|
1093
|
-
const isGuild = Boolean(interaction.guild);
|
|
1094
|
-
const channelId = rawChannelId || "unknown";
|
|
1095
|
-
const interactionId = interaction.rawData.id;
|
|
1096
|
-
const route = resolveAgentRoute({
|
|
1097
|
-
cfg,
|
|
1098
|
-
channel: "discord",
|
|
1099
|
-
accountId,
|
|
1100
|
-
guildId: interaction.guild?.id ?? undefined,
|
|
1101
|
-
memberRoleIds,
|
|
1102
|
-
peer: {
|
|
1103
|
-
kind: isDirectMessage ? "direct" : isGroupDm ? "group" : "channel",
|
|
1104
|
-
id: isDirectMessage ? user.id : channelId,
|
|
1105
|
-
},
|
|
1106
|
-
parentPeer: threadParentId ? { kind: "channel", id: threadParentId } : undefined,
|
|
1107
|
-
});
|
|
1108
|
-
const threadBinding = isThreadChannel ? threadBindings.getByThreadId(rawChannelId) : undefined;
|
|
1109
|
-
const boundSessionKey = threadBinding?.targetSessionKey?.trim();
|
|
1110
|
-
const boundAgentId = boundSessionKey ? resolveAgentIdFromSessionKey(boundSessionKey) : undefined;
|
|
1111
|
-
const effectiveRoute = boundSessionKey
|
|
1112
|
-
? {
|
|
1113
|
-
...route,
|
|
1114
|
-
sessionKey: boundSessionKey,
|
|
1115
|
-
agentId: boundAgentId ?? route.agentId,
|
|
1116
|
-
}
|
|
1117
|
-
: route;
|
|
1118
|
-
const conversationLabel = isDirectMessage ? (user.globalName ?? user.username) : channelId;
|
|
1119
|
-
const ownerAllowFrom = resolveDiscordOwnerAllowFrom({
|
|
1120
|
-
channelConfig,
|
|
1121
|
-
guildInfo,
|
|
1122
|
-
sender: { id: sender.id, name: sender.name, tag: sender.tag },
|
|
1123
|
-
});
|
|
1124
|
-
const ctxPayload = finalizeInboundContext({
|
|
1125
|
-
Body: prompt,
|
|
1126
|
-
BodyForAgent: prompt,
|
|
1127
|
-
RawBody: prompt,
|
|
1128
|
-
CommandBody: prompt,
|
|
1129
|
-
CommandArgs: commandArgs,
|
|
1130
|
-
From: isDirectMessage
|
|
1131
|
-
? `discord:${user.id}`
|
|
1132
|
-
: isGroupDm
|
|
1133
|
-
? `discord:group:${channelId}`
|
|
1134
|
-
: `discord:channel:${channelId}`,
|
|
1135
|
-
To: `slash:${user.id}`,
|
|
1136
|
-
SessionKey: boundSessionKey ?? `agent:${effectiveRoute.agentId}:${sessionPrefix}:${user.id}`,
|
|
1137
|
-
CommandTargetSessionKey: boundSessionKey ?? effectiveRoute.sessionKey,
|
|
1138
|
-
AccountId: effectiveRoute.accountId,
|
|
1139
|
-
ChatType: isDirectMessage ? "direct" : isGroupDm ? "group" : "channel",
|
|
1140
|
-
ConversationLabel: conversationLabel,
|
|
1141
|
-
GroupSubject: isGuild ? interaction.guild?.name : undefined,
|
|
1142
|
-
GroupSystemPrompt: isGuild
|
|
1143
|
-
? (() => {
|
|
1144
|
-
const systemPromptParts = [channelConfig?.systemPrompt?.trim() || null].filter((entry) => Boolean(entry));
|
|
1145
|
-
return systemPromptParts.length > 0 ? systemPromptParts.join("\n\n") : undefined;
|
|
1146
|
-
})()
|
|
1147
|
-
: undefined,
|
|
1148
|
-
UntrustedContext: isGuild
|
|
1149
|
-
? (() => {
|
|
1150
|
-
const channelTopic = channel && "topic" in channel ? (channel.topic ?? undefined) : undefined;
|
|
1151
|
-
const untrustedChannelMetadata = buildUntrustedChannelMetadata({
|
|
1152
|
-
source: "discord",
|
|
1153
|
-
label: "Discord channel topic",
|
|
1154
|
-
entries: [channelTopic],
|
|
1155
|
-
});
|
|
1156
|
-
return untrustedChannelMetadata ? [untrustedChannelMetadata] : undefined;
|
|
1157
|
-
})()
|
|
1158
|
-
: undefined,
|
|
1159
|
-
OwnerAllowFrom: ownerAllowFrom,
|
|
1160
|
-
SenderName: user.globalName ?? user.username,
|
|
1161
|
-
SenderId: user.id,
|
|
1162
|
-
SenderUsername: user.username,
|
|
1163
|
-
SenderTag: sender.tag,
|
|
1164
|
-
Provider: "discord",
|
|
1165
|
-
Surface: "discord",
|
|
1166
|
-
WasMentioned: true,
|
|
1167
|
-
MessageSid: interactionId,
|
|
1168
|
-
MessageThreadId: isThreadChannel ? channelId : undefined,
|
|
1169
|
-
Timestamp: Date.now(),
|
|
1170
|
-
CommandAuthorized: commandAuthorized,
|
|
1171
|
-
CommandSource: "native",
|
|
1172
|
-
// Native slash contexts use To=slash:<user> for interaction routing.
|
|
1173
|
-
// For follow-up delivery (for example subagent completion announces),
|
|
1174
|
-
// preserve the real Discord target separately.
|
|
1175
|
-
OriginatingChannel: "discord",
|
|
1176
|
-
OriginatingTo: isDirectMessage ? `user:${user.id}` : `channel:${channelId}`,
|
|
1177
|
-
});
|
|
1178
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
1179
|
-
cfg,
|
|
1180
|
-
agentId: effectiveRoute.agentId,
|
|
1181
|
-
channel: "discord",
|
|
1182
|
-
accountId: effectiveRoute.accountId,
|
|
1183
|
-
});
|
|
1184
|
-
const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, effectiveRoute.agentId);
|
|
1185
|
-
let didReply = false;
|
|
1186
|
-
await dispatchReplyWithDispatcher({
|
|
1187
|
-
ctx: ctxPayload,
|
|
1188
|
-
cfg,
|
|
1189
|
-
dispatcherOptions: {
|
|
1190
|
-
...prefixOptions,
|
|
1191
|
-
humanDelay: resolveHumanDelayConfig(cfg, effectiveRoute.agentId),
|
|
1192
|
-
deliver: async (payload) => {
|
|
1193
|
-
if (suppressReplies) {
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
try {
|
|
1197
|
-
await deliverDiscordInteractionReply({
|
|
1198
|
-
interaction,
|
|
1199
|
-
payload,
|
|
1200
|
-
mediaLocalRoots,
|
|
1201
|
-
textLimit: resolveTextChunkLimit(cfg, "discord", accountId, {
|
|
1202
|
-
fallbackLimit: 2000,
|
|
1203
|
-
}),
|
|
1204
|
-
maxLinesPerMessage: discordConfig?.maxLinesPerMessage,
|
|
1205
|
-
preferFollowUp: preferFollowUp || didReply,
|
|
1206
|
-
chunkMode: resolveChunkMode(cfg, "discord", accountId),
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
catch (error) {
|
|
1210
|
-
if (isDiscordUnknownInteraction(error)) {
|
|
1211
|
-
logVerbose("discord: interaction reply skipped (interaction expired)");
|
|
1212
|
-
return;
|
|
1213
|
-
}
|
|
1214
|
-
throw error;
|
|
1215
|
-
}
|
|
1216
|
-
didReply = true;
|
|
1217
|
-
},
|
|
1218
|
-
onError: (err, info) => {
|
|
1219
|
-
const message = err instanceof Error ? (err.stack ?? err.message) : String(err);
|
|
1220
|
-
log.error(`discord slash ${info.kind} reply failed: ${message}`);
|
|
1221
|
-
},
|
|
1222
|
-
},
|
|
1223
|
-
replyOptions: {
|
|
1224
|
-
skillFilter: channelConfig?.skills,
|
|
1225
|
-
disableBlockStreaming: typeof discordConfig?.blockStreaming === "boolean"
|
|
1226
|
-
? !discordConfig.blockStreaming
|
|
1227
|
-
: undefined,
|
|
1228
|
-
onModelSelected,
|
|
1229
|
-
},
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
async function deliverDiscordInteractionReply(params) {
|
|
1233
|
-
const { interaction, payload, textLimit, maxLinesPerMessage, preferFollowUp, chunkMode } = params;
|
|
1234
|
-
const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
|
|
1235
|
-
const text = payload.text ?? "";
|
|
1236
|
-
let hasReplied = false;
|
|
1237
|
-
const sendMessage = async (content, files) => {
|
|
1238
|
-
const payload = files && files.length > 0
|
|
1239
|
-
? {
|
|
1240
|
-
content,
|
|
1241
|
-
files: files.map((file) => {
|
|
1242
|
-
if (file.data instanceof Blob) {
|
|
1243
|
-
return { name: file.name, data: file.data };
|
|
1244
|
-
}
|
|
1245
|
-
const arrayBuffer = Uint8Array.from(file.data).buffer;
|
|
1246
|
-
return { name: file.name, data: new Blob([arrayBuffer]) };
|
|
1247
|
-
}),
|
|
1248
|
-
}
|
|
1249
|
-
: { content };
|
|
1250
|
-
await safeDiscordInteractionCall("interaction send", async () => {
|
|
1251
|
-
if (!preferFollowUp && !hasReplied) {
|
|
1252
|
-
await interaction.reply(payload);
|
|
1253
|
-
hasReplied = true;
|
|
1254
|
-
return;
|
|
1255
|
-
}
|
|
1256
|
-
await interaction.followUp(payload);
|
|
1257
|
-
hasReplied = true;
|
|
1258
|
-
});
|
|
1259
|
-
};
|
|
1260
|
-
if (mediaList.length > 0) {
|
|
1261
|
-
const media = await Promise.all(mediaList.map(async (url) => {
|
|
1262
|
-
const loaded = await loadWebMedia(url, {
|
|
1263
|
-
localRoots: params.mediaLocalRoots,
|
|
1264
|
-
});
|
|
1265
|
-
return {
|
|
1266
|
-
name: loaded.fileName ?? "upload",
|
|
1267
|
-
data: loaded.buffer,
|
|
1268
|
-
};
|
|
1269
|
-
}));
|
|
1270
|
-
const chunks = chunkDiscordTextWithMode(text, {
|
|
1271
|
-
maxChars: textLimit,
|
|
1272
|
-
maxLines: maxLinesPerMessage,
|
|
1273
|
-
chunkMode,
|
|
1274
|
-
});
|
|
1275
|
-
if (!chunks.length && text) {
|
|
1276
|
-
chunks.push(text);
|
|
1277
|
-
}
|
|
1278
|
-
const caption = chunks[0] ?? "";
|
|
1279
|
-
await sendMessage(caption, media);
|
|
1280
|
-
for (const chunk of chunks.slice(1)) {
|
|
1281
|
-
if (!chunk.trim()) {
|
|
1282
|
-
continue;
|
|
1283
|
-
}
|
|
1284
|
-
await interaction.followUp({ content: chunk });
|
|
1285
|
-
}
|
|
1286
|
-
return;
|
|
1287
|
-
}
|
|
1288
|
-
if (!text.trim()) {
|
|
1289
|
-
return;
|
|
1290
|
-
}
|
|
1291
|
-
const chunks = chunkDiscordTextWithMode(text, {
|
|
1292
|
-
maxChars: textLimit,
|
|
1293
|
-
maxLines: maxLinesPerMessage,
|
|
1294
|
-
chunkMode,
|
|
1295
|
-
});
|
|
1296
|
-
if (!chunks.length && text) {
|
|
1297
|
-
chunks.push(text);
|
|
1298
|
-
}
|
|
1299
|
-
for (const chunk of chunks) {
|
|
1300
|
-
if (!chunk.trim()) {
|
|
1301
|
-
continue;
|
|
1302
|
-
}
|
|
1303
|
-
await sendMessage(chunk);
|
|
1304
|
-
}
|
|
1305
|
-
}
|