@weavecode/weave 0.1.0 → 0.1.1
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/node_modules/@weavecode/cli/dist/cli.js +4 -4
- package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/dashboard.d.ts +0 -2
- package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -1
- package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +5 -3
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +44 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +6 -4
- package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +4 -4
- package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
- package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
- package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
- package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/helpers-gen.d.ts +4 -0
- package/node_modules/@weavecode/cli/dist/init/helpers-gen.js +1 -20
- package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/mcp-gen.d.ts +3 -20
- package/node_modules/@weavecode/cli/dist/init/mcp-gen.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
- package/node_modules/@weavecode/cli/dist/init/settings-gen.d.ts +3 -30
- package/node_modules/@weavecode/cli/dist/init/settings-gen.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
- package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
- package/node_modules/@weavecode/cli/dist/parser.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
- package/node_modules/@weavecode/cli/package.json +5 -5
- package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
- package/node_modules/@weavecode/core/dist/harness.d.ts +45 -2
- package/node_modules/@weavecode/core/dist/harness.js +1 -1
- package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/core/dist/index.js +1 -1
- package/node_modules/@weavecode/core/dist/platform.js +1 -1
- package/node_modules/@weavecode/core/dist/terminal.d.ts +28 -4
- package/node_modules/@weavecode/core/dist/terminal.js +1 -1
- package/node_modules/@weavecode/core/dist/types.d.ts +188 -11
- package/node_modules/@weavecode/core/dist/types.js +1 -1
- package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
- package/node_modules/@weavecode/core/dist/utils/logger.js +1 -1
- package/node_modules/@weavecode/core/package.json +1 -1
- package/node_modules/@weavecode/harness/dist/claude/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/capture.d.ts +11 -1
- package/node_modules/@weavecode/harness/dist/claude/capture.js +5 -5
- package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/event-source.d.ts +1 -1
- package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/helpers-gen.d.ts +5 -0
- package/node_modules/@weavecode/harness/dist/claude/helpers-gen.js +20 -0
- package/node_modules/@weavecode/harness/dist/claude/index.d.ts +5 -1
- package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/mcp-gen.d.ts +22 -0
- package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/messaging.d.ts +11 -2
- package/node_modules/@weavecode/harness/dist/claude/messaging.js +4 -1
- package/node_modules/@weavecode/harness/dist/claude/model-aliases.d.ts +25 -0
- package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
- package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
- package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -1
- package/node_modules/@weavecode/harness/dist/claude/settings-gen.d.ts +32 -0
- package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/transcript.d.ts +16 -0
- package/node_modules/@weavecode/harness/dist/claude/transcript.js +4 -2
- package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/messaging.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/toml.js +9 -9
- package/node_modules/@weavecode/harness/dist/driver.d.ts +58 -1
- package/node_modules/@weavecode/harness/dist/driver.js +1 -1
- package/node_modules/@weavecode/harness/dist/index.d.ts +1 -0
- package/node_modules/@weavecode/harness/dist/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/init/generated.d.ts +37 -0
- package/node_modules/@weavecode/harness/dist/init/generated.js +2 -0
- package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
- package/node_modules/@weavecode/harness/dist/registry-wiring.d.ts +3 -1
- package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
- package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
- package/node_modules/@weavecode/harness/package.json +2 -2
- package/node_modules/@weavecode/server/dist/daemon/ai-config.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/ai-context.js +6 -6
- package/node_modules/@weavecode/server/dist/daemon/ai-routes.js +4 -4
- package/node_modules/@weavecode/server/dist/daemon/api-log.d.ts +48 -0
- package/node_modules/@weavecode/server/dist/daemon/api-log.js +3 -0
- package/node_modules/@weavecode/server/dist/daemon/auth-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/auto-start.js +6 -6
- package/node_modules/@weavecode/server/dist/daemon/capture-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/claude-liveness.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/data-bus.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.d.ts +6 -1
- package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/http.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener.d.ts +102 -19
- package/node_modules/@weavecode/server/dist/daemon/opener.js +97 -7
- package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.d.ts +4 -3
- package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/server.d.ts +8 -0
- package/node_modules/@weavecode/server/dist/daemon/server.js +6 -6
- package/node_modules/@weavecode/server/dist/daemon/session-probe.d.ts +59 -2
- package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +10 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/state.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/static.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/terminal-topology-refresher.d.ts +4 -1
- package/node_modules/@weavecode/server/dist/daemon/tls.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/toolkit-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/db/db.js +20 -2
- package/node_modules/@weavecode/server/dist/db/paths.d.ts +4 -0
- package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/answer-keys.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/bus.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
- package/node_modules/@weavecode/server/dist/hooks/handlers/webhook.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/headless-runner.js +2 -2
- package/node_modules/@weavecode/server/dist/hooks/inbox-socket.d.ts +17 -4
- package/node_modules/@weavecode/server/dist/hooks/inbox-socket.js +2 -1
- package/node_modules/@weavecode/server/dist/hooks/inbox-worker.d.ts +20 -6
- package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
- package/node_modules/@weavecode/server/dist/hooks/match.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/message-deliverer.d.ts +171 -13
- package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +3 -2
- package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
- package/node_modules/@weavecode/server/dist/hooks/plugin-installer.js +3 -3
- package/node_modules/@weavecode/server/dist/hooks/plugin-loader.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/plugin-project-state.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/prompt-flusher.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/promptbox.d.ts +13 -0
- package/node_modules/@weavecode/server/dist/hooks/promptbox.js +8 -8
- package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
- package/node_modules/@weavecode/server/dist/hooks/question-tracker.d.ts +6 -4
- package/node_modules/@weavecode/server/dist/hooks/question-tracker.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/registry.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/resume-runner.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/sequence-engine.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/session-purge.d.ts +4 -0
- package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/session-sweeper.d.ts +5 -8
- package/node_modules/@weavecode/server/dist/hooks/session-sweeper.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/toolkit.d.ts +8 -0
- package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
- package/node_modules/@weavecode/server/dist/hooks/watch-engine.d.ts +7 -0
- package/node_modules/@weavecode/server/dist/hooks/watch-engine.js +1 -1
- package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/install/apply-update.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
- package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
- package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
- package/node_modules/@weavecode/server/dist/install/file-assets.js +1 -1
- package/node_modules/@weavecode/server/dist/install/fingerprint.d.ts +5 -1
- package/node_modules/@weavecode/server/dist/install/fingerprint.js +1 -1
- package/node_modules/@weavecode/server/dist/install/git-classify.d.ts +30 -0
- package/node_modules/@weavecode/server/dist/install/git-classify.js +1 -0
- package/node_modules/@weavecode/server/dist/install/global-config.js +2 -2
- package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
- package/node_modules/@weavecode/server/dist/install/init-files.d.ts +46 -0
- package/node_modules/@weavecode/server/dist/install/init-files.js +2 -0
- package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
- package/node_modules/@weavecode/server/dist/install/installer.js +3 -3
- package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
- package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
- package/node_modules/@weavecode/server/dist/install/plugin-install.js +1 -1
- package/node_modules/@weavecode/server/dist/install/plugin-rows.js +1 -1
- package/node_modules/@weavecode/server/dist/install/plugin-templates.js +1 -1
- package/node_modules/@weavecode/server/dist/install/project-config.d.ts +0 -2
- package/node_modules/@weavecode/server/dist/install/project-config.js +2 -2
- package/node_modules/@weavecode/server/dist/install/reader.js +1 -1
- package/node_modules/@weavecode/server/dist/install/scan-cache.js +1 -1
- package/node_modules/@weavecode/server/dist/install/scanner.js +1 -1
- package/node_modules/@weavecode/server/dist/install/settings-mcp.js +2 -2
- package/node_modules/@weavecode/server/dist/install/updates.d.ts +17 -5
- package/node_modules/@weavecode/server/dist/install/updates.js +1 -1
- package/node_modules/@weavecode/server/dist/market/builtin.js +1 -1
- package/node_modules/@weavecode/server/dist/market/identity.js +1 -1
- package/node_modules/@weavecode/server/dist/market/import.js +2 -2
- package/node_modules/@weavecode/server/dist/market/refresh.js +1 -1
- package/node_modules/@weavecode/server/dist/market/resolve.js +1 -1
- package/node_modules/@weavecode/server/dist/market/updates.js +1 -1
- package/node_modules/@weavecode/server/dist/registry.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/hook-dispatches.js +5 -5
- package/node_modules/@weavecode/server/dist/repositories/hook-events.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/hook-rules.js +4 -4
- package/node_modules/@weavecode/server/dist/repositories/libraries.js +1 -1
- package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
- package/node_modules/@weavecode/server/dist/repositories/projects.d.ts +7 -0
- package/node_modules/@weavecode/server/dist/repositories/projects.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/push-subscriptions.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/session-watches.js +4 -4
- package/node_modules/@weavecode/server/dist/repositories/sessions.d.ts +17 -4
- package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/uploads.d.ts +66 -0
- package/node_modules/@weavecode/server/dist/repositories/uploads.js +7 -0
- package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
- package/node_modules/@weavecode/server/dist/statusline/generator.js +81 -40
- package/node_modules/@weavecode/server/dist/statusline/manager.d.ts +2 -0
- package/node_modules/@weavecode/server/dist/statusline/manager.js +4 -4
- package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
- package/node_modules/@weavecode/server/dist/watch/cache.js +1 -1
- package/node_modules/@weavecode/server/dist/watch/classifier.js +1 -1
- package/node_modules/@weavecode/server/dist/watch/plugin-mods.js +1 -1
- package/node_modules/@weavecode/server/dist/watch/sync-scheduler.d.ts +8 -4
- package/node_modules/@weavecode/server/dist/watch/sync-scheduler.js +1 -1
- package/node_modules/@weavecode/server/dist/watch/watch-service.js +1 -1
- package/node_modules/@weavecode/server/package.json +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/index-D5WFh77i.css +11 -0
- package/node_modules/@weavecode/server/web/dist/assets/index-DJibaGnJ.js +585 -0
- package/node_modules/@weavecode/server/web/dist/index.html +14 -2
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-plugin-creator/skills/weave-plugin-creator/SKILL.md +2 -2
- package/node_modules/@weavecode/templates/package.json +2 -2
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/package.json +20 -17
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/README.md +50 -32
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.d.ts +86 -40
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.es.js +860 -353
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.js +860 -353
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/package.json +20 -17
- package/package.json +6 -6
- package/node_modules/@weavecode/server/web/dist/assets/index-BOzaRlQE.js +0 -560
- package/node_modules/@weavecode/server/web/dist/assets/index-ChX8G8cT.css +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHmac as l}from"node:crypto";const u=5e3,d=4096;export async function runWebhook(
|
|
1
|
+
import{createHmac as l}from"node:crypto";const u=5e3,d=4096;export async function runWebhook(s,i,c=fetch){const e=s.handler;if(e.type!=="webhook")return{ok:!1,status:"failed",error:`rule ${s.id} is not a webhook handler`};let r;try{r=new URL(e.url)}catch{return{ok:!1,status:"failed",error:`invalid url: ${e.url}`}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,status:"failed",error:`unsupported protocol: ${r.protocol}`};const a=JSON.stringify(i),n={"content-type":"application/json","user-agent":"weave-daemon",...e.headers??{}};e.secret&&(n["x-weave-signature"]=`sha256=${l("sha256",e.secret).update(a).digest("hex")}`);try{const t=await c(r,{method:"POST",headers:n,body:a,signal:AbortSignal.timeout(u)}),o=(await t.text()).slice(0,d);return t.ok?{ok:!0,status:"succeeded",output:o||`HTTP ${t.status}`}:{ok:!1,status:"failed",error:`HTTP ${t.status}`,output:o}}catch(t){const o=t instanceof Error&&(t.name==="TimeoutError"||t.name==="AbortError");return{ok:!1,status:o?"timeout":"failed",error:o?`webhook timed out after ${u}ms`:String(t)}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{spawn as k}from"node:child_process";const
|
|
2
|
-
${g}`:c})})}settle(t,s,
|
|
1
|
+
import{spawn as k}from"node:child_process";const A=3e5,T=32*1024,_=2e3;export class HeadlessRunner{spawnImpl;killImpl;active=new Set;livePids=new Map;constructor(t={}){this.spawnImpl=t.spawnImpl??k,this.killImpl=t.killImpl??defaultKill}isBusy(t){return this.active.has(t)}killAll(){let t=0;for(const s of this.livePids.values())try{this.killImpl(s),t++}catch{}return this.livePids.clear(),t}run(t){if(this.active.has(t.sessionId))return!1;this.active.add(t.sessionId);const s={settled:!1};try{this.watch(t,s)}catch(l){this.settle(t,s,{status:"failed",output:null,error:y(l)})}return!0}watch(t,s){const l=t.timeoutMs??A,a=t.spec.promptStdin===!0,p=t.spec.args(t.sessionId,a?"":t.prompt),u=a&&process.platform==="win32"&&!/[\s"\\/]/.test(t.bin),E=(t.detached??!0)&&!u,m={cwd:t.cwd,detached:E,windowsHide:!0,shell:u,stdio:[a?"pipe":"ignore","pipe","pipe"],env:(()=>{const e={...process.env,WEAVE_HOOK_DISPATCH:"1"};return delete e.CLAUDE_CODE_CHILD_SESSION,e})()},r=u?this.spawnImpl([t.bin,...p].join(" "),[],m):this.spawnImpl(t.bin,p,m);if(r.pid!==void 0&&this.livePids.set(t.sessionId,r.pid),a){r.stdin?.on("error",()=>{});try{r.stdin?.write(t.prompt),r.stdin?.end()}catch{}}const I=[],h=[];let w=0,S=0;const v=(e,n,o)=>{if(n>=T)return n;const c=T-n;return e.push(o.length>c?o.subarray(0,c):o),n+Math.min(o.length,c)},f=()=>Buffer.concat([...I,...h]).toString("utf8"),M=()=>{const e=Buffer.concat(h).toString("utf8");return e.length>_?e.slice(-_):e};r.stdout?.on("data",e=>{w=v(I,w,e)}),r.stderr?.on("data",e=>{S=v(h,S,e)});const d=l>0?setTimeout(()=>{if(r.pid!==void 0)try{this.killImpl(r.pid)}catch{}this.settle(t,s,{status:"timeout",output:f(),error:`Timeout after ${l}ms`})},l):null;r.on("error",e=>{d!==null&&clearTimeout(d),this.settle(t,s,{status:"failed",output:f(),error:y(e)})}),r.on("exit",(e,n)=>{d!==null&&clearTimeout(d);const o=f();if(e===0){this.settle(t,s,{status:"succeeded",output:o,error:null});return}const c=e!==null?`exit ${e}`:`exit signal ${n??"unknown"}`,g=M();this.settle(t,s,{status:"failed",output:o,error:g?`${c}
|
|
2
|
+
${g}`:c})})}settle(t,s,l){if(!s.settled){s.settled=!0,this.active.delete(t.sessionId),this.livePids.delete(t.sessionId);try{t.onSettle(l)}catch{}}}}export function defaultKill(i){if(process.platform==="win32"){try{k("taskkill",["/PID",String(i),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{})}catch{}return}try{process.kill(-i,"SIGKILL")}catch{try{process.kill(i,"SIGKILL")}catch{}}}function y(i){return i instanceof Error?i.message:String(i)}
|
|
@@ -24,16 +24,29 @@ export interface InboxDeliveryOptions {
|
|
|
24
24
|
/** `/status` 的 Peer address 带 `uds:` 前缀;env 里不带。两种都接受。 */
|
|
25
25
|
export declare function inboxSocketPathOf(socket: string): string;
|
|
26
26
|
export declare function deliverViaInboxSocket(spec: PromptInboxSpec, target: InboxTarget, text: string, options?: InboxDeliveryOptions): Promise<void>;
|
|
27
|
+
/** 直投凭据落盘文件名(放 `<dataDir>/hooks/` 下;装配侧拼路径用同一常量)。 */
|
|
28
|
+
export declare const INBOX_TARGETS_FILE = "inbox-targets.json";
|
|
27
29
|
/**
|
|
28
|
-
* sessionId → 该会话的 inbox
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* sessionId → 该会话的 inbox 目标:由 hook 事件旁路上报(hook 进程是会话自己的 child,
|
|
31
|
+
* 继承会话导出的 env),并落 `<dataDir>/hooks/inbox-targets.json`(0600,与 auth.json
|
|
32
|
+
* 同口径的非 UI 面)。**凭据不进 payload、不落库、不进 UI、不写日志**。
|
|
33
|
+
*
|
|
34
|
+
* 为什么要落盘:凭据活在**会话进程**里(socket 由它托管、token 每进程一份),daemon
|
|
35
|
+
* 重启不动它们——只落 daemon 自己的记忆。于是「重启后首条手动消息只能走终端/中继」
|
|
36
|
+
* 这个窗口消失(原先要等下一次 hook 事件把凭据带回来)。会话自己 resume/重启换了
|
|
37
|
+
* socket(旧值即废)时,覆盖前那一刻只会**连不上 → 回落**,不猜不误投;新值随下一次
|
|
38
|
+
* hook 事件覆盖写回。会话删除/归档时 forget(落盘行一并清)。
|
|
32
39
|
*/
|
|
33
40
|
export declare class InboxSocketRegistry {
|
|
41
|
+
private readonly file?;
|
|
34
42
|
private readonly bySession;
|
|
43
|
+
/** 上次落盘的内容(hook 每次事件都上报,值没变就不重写盘)。 */
|
|
44
|
+
private persisted;
|
|
45
|
+
constructor(file?: string | undefined);
|
|
35
46
|
/** 上报/刷新(hook 每次事件都会带,覆盖写即最新)。socket 为空 = 该会话没有可用 inbox。 */
|
|
36
47
|
set(sessionId: string, target: InboxTarget | null): void;
|
|
37
48
|
get(sessionId: string): InboxTarget | undefined;
|
|
38
49
|
forget(sessionId: string): void;
|
|
50
|
+
/** 原子写(临时文件 + rename)+ 0600(Windows 上 chmod 近似 no-op,无害)。 */
|
|
51
|
+
private persist;
|
|
39
52
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"node:net";import{chmodSync as y,mkdirSync as d,readFileSync as k,renameSync as S,writeFileSync as b}from"node:fs";import{dirname as x}from"node:path";export function inboxSocketPathOf(s){return s.startsWith("uds:")?s.slice(4):s}export function deliverViaInboxSocket(s,t,e,o={}){const c=o.platform??process.platform,n=o.timeoutMs??3e3,l=inboxSocketPathOf(t.socket);return s.requiresAuthOn(c)&&!t.token?Promise.reject(new Error(`inbox delivery requires a token on platform "${c}"`)):new Promise((p,m)=>{const h=s.frame({token:t.token,text:e});let f=!1;const u=i=>{f||(f=!0,r.destroy(),m(i))},r=a.connect(l);r.setTimeout(n),r.on("timeout",()=>u(new Error(`inbox socket timeout after ${n}ms`))),r.on("error",i=>u(i)),r.on("connect",()=>{r.write(h,i=>{i?u(i):r.end()})}),r.on("close",()=>{f||(f=!0,p())})})}export const INBOX_TARGETS_FILE="inbox-targets.json";function O(s){try{const t=JSON.parse(k(s,"utf8"));if(typeof t!="object"||t===null)return{};const e={};for(const[o,c]of Object.entries(t)){const n=c;typeof n?.socket!="string"||!n.socket||(e[o]={socket:n.socket,token:typeof n.token=="string"&&n.token?n.token:null})}return e}catch{return{}}}export class InboxSocketRegistry{file;bySession;persisted;constructor(t){this.file=t;const e=t?O(t):{};this.bySession=new Map(Object.entries(e)),this.persisted=JSON.stringify(e)}set(t,e){const o=this.bySession.get(t);if(!e?.socket){o&&(this.bySession.delete(t),this.persist());return}o&&o.socket===e.socket&&o.token===e.token||(this.bySession.set(t,e),this.persist())}get(t){return this.bySession.get(t)}forget(t){this.bySession.delete(t)&&this.persist()}persist(){if(!this.file)return;const t=JSON.stringify(Object.fromEntries(this.bySession));if(t!==this.persisted)try{d(x(this.file),{recursive:!0});const e=`${this.file}.tmp`;b(e,`${t}
|
|
2
|
+
`,{encoding:"utf8",mode:384}),S(e,this.file),y(this.file,384),this.persisted=t}catch{}}}
|
|
@@ -20,6 +20,11 @@ import type { QuestionTracker } from './question-tracker.js';
|
|
|
20
20
|
* 为 `.failed.jsonl` 防毒丸热循环。行内 token 解析项目(项目已删 → 丢行,同
|
|
21
21
|
* 旧 /hooks 401 语义;归档项目同样丢行——server 不消费,行即焚);不可归因
|
|
22
22
|
* 的坏行直接丢(重试无意义)。
|
|
23
|
+
*
|
|
24
|
+
* **shard 按项目 token 分片**(hook-handler 认 token 不认会话)⇒ 同一 claim 里
|
|
25
|
+
* 常混着**同项目多个会话**的行。故凡会话级事实(inbox 凭据、pane env、改名回执)
|
|
26
|
+
* 一律**逐行**取,不得按组聚合——取整组最后一个会把 A 会话的 socket 记到 B 头上,
|
|
27
|
+
* 而直投照这个映射送,消息就落进别的会话(实事故,见 docs/DECISIONS.md)。
|
|
23
28
|
*/
|
|
24
29
|
export declare const INBOX_TICK_MS = 200;
|
|
25
30
|
export declare const INBOX_CLAIM_SUFFIX = ".claim.jsonl";
|
|
@@ -33,7 +38,8 @@ export interface InboxRecord {
|
|
|
33
38
|
deliveredTitle?: string | null;
|
|
34
39
|
/**
|
|
35
40
|
* 该会话的 inbox 直投凭据(hook 进程是会话自己的 child,继承这两个 env)。
|
|
36
|
-
*
|
|
41
|
+
* **逐行字段**(同 claim 里各会话的 socket 不同);**旁路字段:不进 payload、
|
|
42
|
+
* 不落库**——主线程只放内存供 layer① 直投用。
|
|
37
43
|
*/
|
|
38
44
|
messaging?: {
|
|
39
45
|
socket: string;
|
|
@@ -41,8 +47,8 @@ export interface InboxRecord {
|
|
|
41
47
|
} | null;
|
|
42
48
|
/**
|
|
43
49
|
* 该会话所在终端 pane 的定位 env(hook 进程生在会话自己的 pane 里)。
|
|
44
|
-
* **逐行字段**(同一 claim 里不同会话的 pane
|
|
45
|
-
*
|
|
50
|
+
* **逐行字段**(同一 claim 里不同会话的 pane 不同——错配会把键序打进别的会话
|
|
51
|
+
* 的模态框);同样不进 payload、不落库。
|
|
46
52
|
*/
|
|
47
53
|
terminalEnv?: Record<string, string> | null;
|
|
48
54
|
}
|
|
@@ -85,14 +91,22 @@ export interface IngestedHandlerDeps {
|
|
|
85
91
|
} | null): void;
|
|
86
92
|
/** hook 旁路上报的会话 pane 定位 env(内存态;层② 精确定位用)。 */
|
|
87
93
|
notePaneEnv?(sessionId: string, env: Record<string, string>): void;
|
|
88
|
-
/** UPS 事件 = 投递回执判据(prompt
|
|
89
|
-
|
|
94
|
+
/** UPS 事件 = 投递回执判据(prompt 原文与在途条目匹配);返回命中消息的随附图 id。
|
|
95
|
+
* `eventId` 随回执记下(对话面按它把投递行挂到这条事件的气泡上)。 */
|
|
96
|
+
onSessionPrompt?(sessionId: string, prompt: string, eventId?: number): string[];
|
|
97
|
+
/** 会话退出事件(`HARNESS_LIFECYCLE[<harness>].sessionExit`)= 旁路事实作废点。 */
|
|
98
|
+
sessionExited?(sessionId: string): void;
|
|
90
99
|
};
|
|
91
100
|
/** 阻塞式问答跟踪(toolName 不进帧域,挂点在此);缺省不跟踪。 */
|
|
92
101
|
questionTracker?: Pick<QuestionTracker, 'onEvent'>;
|
|
93
|
-
/** 会话转录路径上报(中断态探测用;转录路径在 payload
|
|
102
|
+
/** 会话转录路径上报(中断态探测用;转录路径在 payload 里,帧域不带)+ 换模型落定。 */
|
|
94
103
|
sessionProbe?: {
|
|
95
104
|
noteTranscript(sessionId: string, path: string | null): void;
|
|
105
|
+
noteModel(sessionId: string, model: string): void;
|
|
106
|
+
};
|
|
107
|
+
/** 上传件落库面:回执命中时把该消息的随附图挂到开轮事件上(气泡缩略图)。 */
|
|
108
|
+
uploads?: {
|
|
109
|
+
linkToEvent(eventId: number, uploadIds: readonly string[]): void;
|
|
96
110
|
};
|
|
97
111
|
}
|
|
98
112
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`)}catch{return[]}const
|
|
1
|
+
import{existsSync as g,readdirSync as h,readFileSync as k,renameSync as f,unlinkSync as j,writeFileSync as b}from"node:fs";import{join as a}from"node:path";import{isMainThread as T,parentPort as x,Worker as E,workerData as I}from"node:worker_threads";import{createRuntimeRegistry as S,frameFacts as w,switchedModelOf as M}from"@weavecode/harness";import{HARNESS_LIFECYCLE as O,isHarness as F}from"@weavecode/core";import{openDatabase as W}from"../db/db.js";import{HookEventRepository as D}from"../repositories/hook-events.js";import{ProjectRepository as P}from"../repositories/projects.js";import{SessionRepository as R}from"../repositories/sessions.js";import{appendOutbox as _}from"./mirror.js";export const INBOX_TICK_MS=200,INBOX_CLAIM_SUFFIX=".claim.jsonl",INBOX_FAILED_SUFFIX=".failed.jsonl";const L=5;export function drainInboxOnce(n,t=new Map){const e=a(n.hooksDir,"inbox");let i;try{i=h(e)}catch{return[]}const s=[];for(const c of i)c.endsWith(INBOX_FAILED_SUFFIX)||c.endsWith(".tmp")||c.endsWith(INBOX_CLAIM_SUFFIX)||c.endsWith(".jsonl")&&s.push(c);const o=[];for(const c of i)c.endsWith(INBOX_CLAIM_SUFFIX)&&o.push(...v(n,a(e,c),t));for(const c of s){const l=a(e,`${c.slice(0,-6)}${INBOX_CLAIM_SUFFIX}`);if(!g(l)){try{f(a(e,c),l)}catch{continue}o.push(...v(n,l,t))}}return o}function v(n,t,e){let i;try{i=k(t,"utf8").split(`
|
|
2
|
+
`)}catch{return[]}const s=new Map;for(const u of i){const d=u.trim();if(!d)continue;const r=C(d);if(!r)continue;const p=s.get(r.token)??{lines:[],inputs:[],delivered:[],terminals:[],messaging:[]};if(p.lines.push(d),p.project||(p.project=n.projects.getByToken(r.token),s.set(r.token,p)),!p.project||p.project.archivedAt)continue;const m=r.report&&typeof r.report=="object"?n.adapters.find(y=>y.source===r.report.source):void 0;if(!(!m||!r.report.eventType))try{p.inputs.push(m.normalize(r.report,p.project.id)),p.delivered.push(r.report.deliveredTitle??null),p.terminals.push(r.terminalEnv),p.messaging.push(r.messaging)}catch{}}const o=[],c=[];for(const u of s.values())if(!(!u.project||u.inputs.length===0))try{const d=A(n,u.project,u.inputs);for(let r=0;r<u.inputs.length;r++)o.push({eventId:d[r],projectId:u.project.id,input:u.inputs[r],deliveredTitle:u.delivered[r]??null,messaging:u.messaging[r]??null,terminalEnv:u.terminals[r]??null})}catch{c.push(...u.lines)}if(c.length===0){e.delete(t);try{j(t)}catch{}return o}const l=(e.get(t)??0)+1;if(e.set(t,l),l>=L){e.delete(t);try{f(t,t.replace(INBOX_CLAIM_SUFFIX,INBOX_FAILED_SUFFIX))}catch{}return o}try{b(t,c.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`)}catch{}return
|
|
4
|
+
`)}catch{}return o}function A(n,t,e){const i=n.hookEvents.insertMany(e),s=new Set;for(const o of e)!o.sessionId||s.has(o.sessionId)||(s.add(o.sessionId),n.hookSessions.touch(o.sessionId,t.id));return i}function C(n){try{const t=JSON.parse(n);if(!t||typeof t.token!="string"||!t.token||!t.report||typeof t.report!="object")return null;const e=t.messaging?.socket,i=typeof e=="string"&&e?{socket:e,token:typeof t.messaging?.token=="string"?t.messaging.token:null}:null;return{token:t.token,report:t.report,messaging:i,terminalEnv:N(t.terminal)}}catch{return null}}function N(n){if(typeof n!="object"||n===null)return null;const t={};for(const[e,i]of Object.entries(n))typeof i=="string"&&i&&(t[e]=i);return Object.keys(t).length>0?t:null}export function unparkFailedInbox(n){const t=a(n,"inbox");let e;try{e=h(t)}catch{return 0}let i=0;for(const s of e){if(!s.endsWith(INBOX_FAILED_SUFFIX))continue;const o=a(t,`${s.slice(0,-INBOX_FAILED_SUFFIX.length)}${INBOX_CLAIM_SUFFIX}`);if(!g(o))try{f(a(t,s),o),i++}catch{}}return i}export function handleIngestedRecords(n,t){for(const e of t){const i=n.projects.getById(e.projectId);if(!i)continue;let s=null;try{s=JSON.parse(e.input.payload)}catch{s=null}if(n.bus?.emit({kind:"event.ingested",eventId:e.eventId,projectId:i.id,sessionId:e.input.sessionId??null,eventType:e.input.eventType,...w(s),at:new Date().toISOString()}),e.input.sessionId){n.questionTracker?.onEvent({sessionId:e.input.sessionId,source:e.input.source,payload:s}),n.watchEngine?.onEvent({sessionId:e.input.sessionId,eventType:e.input.eventType,source:e.input.source}),n.sequenceEngine?.onEvent({sessionId:e.input.sessionId,eventType:e.input.eventType,source:e.input.source}),e.messaging&&n.messagePipe?.noteInboxSocket?.(e.input.sessionId,e.messaging),n.sessionProbe?.noteTranscript(e.input.sessionId,s?.transcriptPath??null);const o=M(e.input.eventType,s?.raw);if(o&&n.sessionProbe?.noteModel?.(e.input.sessionId,o),e.terminalEnv&&n.messagePipe?.notePaneEnv?.(e.input.sessionId,e.terminalEnv),e.input.eventType==="UserPromptSubmit"){const l=n.messagePipe?.onSessionPrompt?.(e.input.sessionId,B(s)??"",e.eventId)??[];l.length>0&&n.uploads?.linkToEvent(e.eventId,l)}const c=F(e.input.source)?O[e.input.source].sessionExit:null;c!==null&&e.input.eventType===c&&n.messagePipe?.sessionExited?.(e.input.sessionId),n.messagePipe?.hasQueued(e.input.sessionId)&&n.messagePipe.flushSession(e.input.sessionId)}n.dispatcher&&n.dispatcher.onIngest({eventId:e.eventId,project:i,sessionId:e.input.sessionId??null,payload:s??{eventType:e.input.eventType,toolName:null,toolInput:null,toolResponse:null,cwd:null,transcriptPath:null,raw:null},source:e.input.source,deliveredTitle:e.deliveredTitle??null}).then(o=>{o.deferred&&e.input.sessionId&&_(n.hooksDir,i.token,[{sessionId:e.input.sessionId,text:o.deferred}])}).catch(()=>{})}}function B(n){const t=n?.raw;return typeof t?.prompt=="string"&&t.prompt?t.prompt:null}export function startInboxWorker(n){return new E(new URL(import.meta.url),{workerData:{inboxWorker:!0,...n}})}if(!T&&I?.inboxWorker===!0){const n=I,t=W(n.dbPath),e={hooksDir:n.hooksDir,projects:new P(t),hookEvents:new D(t),hookSessions:new R(t),adapters:S().byCapability("events").flatMap(o=>o.events??[])},i=new Map,s=()=>{try{const o=drainInboxOnce(e,i);o.length>0&&x?.postMessage(o)}catch(o){console.error("[weave] inbox drain failed:",o)}};s(),setInterval(s,n.tickMs??INBOX_TICK_MS)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import f from"node:path";export const DISPATCH_MARKER="<!--weave-dispatch-->";const s=e=>process.platform==="win32"?e.toLowerCase():e;export function normalizePosix(e){return e.replace(/\\/g,"/")}function a(e){return/[.+^${}()|[\]\\]/.test(e)?`\\${e}`:e}const l=new Map;export function globToRegex(e){const r=l.get(e);if(r)return r;let t="";for(let n=0;n<e.length;n++){const c=e[n];c==="*"?e[n+1]==="*"?(n++,e[n+1]==="/"?(n++,t+="(?:.*/)?"):t+=".*"):t+="[^/]*":c==="?"?t+="[^/]":t+=a(c)}const o=new RegExp(`^${t}$`,"i");return l.set(e,o),o}export function matchGlob(e,r){return globToRegex(r).test(normalizePosix(e))}export function extractFilePath(e){if(typeof e!="object"||e===null)return null;const r=e;for(const t of["file_path","notebook_path","filePath"]){const o=r[t];if(typeof o=="string"&&o.length>0)return o}return null}function i(e,r){const t=s(normalizePosix(e)),o=s(normalizePosix(r).replace(/\/+$/,""));return t===o||t.startsWith(`${o}/`)}export function isCrossProjectPath(e,r,t){const o=s(normalizePosix(r));return i(e,r)?!1:t.some(n=>s(normalizePosix(n))!==o&&i(e,n))}export function renderTemplate(e,r){return e.replace(/\{(\w+)\}/g,(t,o)=>{const n=r[o];return n==null?t:String(n)})}export function templateVars(e){return{event:e.event,tool:e.tool,file:e.filePath?normalizePosix(e.filePath):null,cwd:e.cwd?normalizePosix(e.cwd):null,session:e.session,project:e.project,rule:e.rule}}export function matchesAnyGlob(e,r){return r.some(t=>matchGlob(e,t))}export function projectLabel(e){return f.basename(normalizePosix(e).replace(/\/+$/,""))||e}
|
|
@@ -21,6 +21,17 @@ import { HeadlessRunner, type SpawnLike } from './headless-runner.js';
|
|
|
21
21
|
* pending 只存在于 promptbox 文件。重启即丢 headless 终态 = 显式高级选项的
|
|
22
22
|
* 已文档代价。通道规格全部来自 MessagingSurface 能力面,本类不含 harness 硬编码。
|
|
23
23
|
*
|
|
24
|
+
* 层③ 只收「还有可能送达」的行:三层全无通路且目标已判死(claude 注册表
|
|
25
|
+
* `pidAlive === false`)时**不入队**,落 failed + `reason: 'offline'`(web 出中文
|
|
26
|
+
* 说明)——死会话的队列行永远不会被取走,排在那里只是骗人。判不动(null)不猜,
|
|
27
|
+
* 照旧入队。
|
|
28
|
+
*
|
|
29
|
+
* **同一会话严格按发送顺序投递**(顺序即真相:到达顺序错乱比慢一拍更糟):
|
|
30
|
+
* 队头还压着(上一条终端投递没回执 / 队列有积压 / 泵在推进)时新消息只入队尾,
|
|
31
|
+
* 由冲洗泵一条条推进;终端层把一条贴进输入框后必须等它的 UPS 回执才发下一条
|
|
32
|
+
* ——再贴一份会在同一个框里叠成一段,两条消息并成一条提交(直投/中继不压:
|
|
33
|
+
* 交出去即进入会话自己的队列,会话按序处理)。
|
|
34
|
+
*
|
|
24
35
|
* send() 校验失败同步返回错误码;成功立即返回(inject 已落 outbox,headless
|
|
25
36
|
* 「已启动」,prompt 视层可用性返回 delivering/pending),终态经回调后台落定,
|
|
26
37
|
* 绝不 throw 出 send()。
|
|
@@ -31,22 +42,41 @@ export type MessageMode = 'prompt' | 'inject' | 'headless' | 'auto';
|
|
|
31
42
|
export type MessageFromKind = 'dashboard' | 'session';
|
|
32
43
|
/** 管道消息状态:pending 只活在 promptbox 文件,其余在内存注册表。 */
|
|
33
44
|
export type PipeStatus = 'pending' | 'delivering' | 'running' | 'injected' | 'delivered' | 'succeeded' | 'failed' | 'timeout';
|
|
45
|
+
/** 随 prompt 投递的图(上传件引用;路径 = 落盘件的绝对路径,harness 合成引用形态)。 */
|
|
46
|
+
export interface MessageImage {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
mediaType: string;
|
|
50
|
+
path: string;
|
|
51
|
+
}
|
|
34
52
|
/** 管道消息(内存态;发号 = uuid,全生命周期稳定)。 */
|
|
35
53
|
export interface PipeMessage {
|
|
36
54
|
id: string;
|
|
37
55
|
sessionId: string;
|
|
56
|
+
/** **用户原文**(回执比对、气泡文案都用它);投递出去的文本是它经 harness
|
|
57
|
+
* `imageAttach.composePrompt` 合成的形态(带图时追加图引用),见 `wireTextOf`。 */
|
|
38
58
|
text: string;
|
|
59
|
+
/** 随附图(空/缺省 = 纯文本消息)。 */
|
|
60
|
+
images?: MessageImage[];
|
|
39
61
|
mode: MessageMode;
|
|
40
62
|
/** 单向注入(手动面:无接收方会话,中继载荷带「无需回复」注记);编排域不置。 */
|
|
41
63
|
oneWay?: boolean;
|
|
64
|
+
/** 发送人强制层② 终端(层序收窄成只剩它,且重发沿用)。 */
|
|
65
|
+
forceTerminal?: boolean;
|
|
42
66
|
/** prompt 通道的实际落法(socket 直投 / 中继 / 终端 send-text)。 */
|
|
43
67
|
via?: 'socket' | 'relay' | 'terminal';
|
|
44
68
|
/** 投递回执:会话自己的 UserPromptSubmit 与本文匹配上了(真到达,非「已交给」)。 */
|
|
45
69
|
acked?: boolean;
|
|
70
|
+
/** 回执命中的那条开轮事件 id:对话面据此把投递行精确挂到它的气泡上(比比对
|
|
71
|
+
* 原文可靠——重发只补的那记回车提交的是整个输入框,投递行记的原文与实际提交
|
|
72
|
+
* 的文本可以不一样)。 */
|
|
73
|
+
ackedEventId?: number | null;
|
|
46
74
|
/** 终态落定时刻(在途视图驻留窗口的起点;在途态无值)。 */
|
|
47
75
|
settledAt?: string | null;
|
|
48
76
|
/** 本条 = 该会话暂停闸的成因(未回执 / 投递失败);重发或回执清除。 */
|
|
49
77
|
stalled?: boolean;
|
|
78
|
+
/** 判死而没投出去(会话进程不在、三层全无通路):`failed` 的成因,web 据此出中文说明。 */
|
|
79
|
+
reason?: 'offline';
|
|
50
80
|
/** 实际投递通道(auto 落定后回填;pending = 尚未裁决成通道)。 */
|
|
51
81
|
channel: 'prompt' | 'inject' | 'headless' | null;
|
|
52
82
|
status: PipeStatus;
|
|
@@ -78,6 +108,8 @@ export interface PromptTerminal {
|
|
|
78
108
|
sendText(paneId: string, text: string): Promise<void>;
|
|
79
109
|
/** 裸键序注入(作答的选项键 / 中断的 ESC:模态框只吃键盘,不吃粘贴文本)。 */
|
|
80
110
|
sendKeys(paneId: string, keys: string): Promise<void>;
|
|
111
|
+
/** 关掉这个 pane(会话生命周期收尾);无通道的后端明确拒绝。 */
|
|
112
|
+
closePane(paneId: string): Promise<void>;
|
|
81
113
|
}
|
|
82
114
|
export interface MessageDelivererDeps {
|
|
83
115
|
sessions: SessionRepository;
|
|
@@ -113,6 +145,9 @@ export interface MessageDelivererDeps {
|
|
|
113
145
|
/** 未回执闸窗口(毫秒);缺省 120s——prompt 送达后没等到 UPS 回执即暂停该会话
|
|
114
146
|
* 的队列冲洗(防继续向 Held/Refused 的会话灌消息),手动重发或回执解除。 */
|
|
115
147
|
ackStallMs?: number;
|
|
148
|
+
/** 会话存活图(测试注入);缺省 `claudeLivenessById()`——同两个引擎(watch/sequence)
|
|
149
|
+
* 的取法:没有注册表就空图,会话一律「查不动」,不猜。 */
|
|
150
|
+
livenessOf?: () => Map<string, boolean>;
|
|
116
151
|
}
|
|
117
152
|
/** send() 入参(路由层已做 zod 形状校验)。 */
|
|
118
153
|
export interface SendInput {
|
|
@@ -123,6 +158,11 @@ export interface SendInput {
|
|
|
123
158
|
fromSessionId?: string | null;
|
|
124
159
|
/** 单向注入(手动面置 true:无接收方会话);编排域省略 = 双向对话保留。 */
|
|
125
160
|
oneWay?: boolean;
|
|
161
|
+
/** 强制层② 终端 send-text(手动面下拉选的通道):跳过直投与中继——宿主把
|
|
162
|
+
* 终端击键当用户输入,另外两层都是「另一个会话发的」。 */
|
|
163
|
+
forceTerminal?: boolean;
|
|
164
|
+
/** 随附图(已落盘的上传件);带图且目标 harness 的 `imageAttach` 为 null 即 409。 */
|
|
165
|
+
images?: readonly MessageImage[];
|
|
126
166
|
}
|
|
127
167
|
/** send() 返回:ok 由路由映射 200,否则 status 即 HTTP 码。 */
|
|
128
168
|
export type SendResult = {
|
|
@@ -143,6 +183,25 @@ export type AnswerResult = {
|
|
|
143
183
|
status: 400 | 404 | 409;
|
|
144
184
|
error: string;
|
|
145
185
|
};
|
|
186
|
+
/** 通道现况:ready = 现在就能投;unknown = 判不动(终端只剩标题/cwd 回落,被动面看不出来)。 */
|
|
187
|
+
interface ChannelState<R extends string> {
|
|
188
|
+
status: 'ready' | 'unavailable' | 'unknown';
|
|
189
|
+
reason: R | null;
|
|
190
|
+
}
|
|
191
|
+
/** 会话级投递诊断(`diagnose` 返回值;只含布尔与枚举,无凭据值)。 */
|
|
192
|
+
export interface SessionDeliveryDiagnosis {
|
|
193
|
+
/** 存活三态(同 `pidAliveOf` 口径:判不动 = null)。 */
|
|
194
|
+
alive: boolean | null;
|
|
195
|
+
inbox: ChannelState<'no-mechanism' | 'no-credentials' | 'auth-token-required'>;
|
|
196
|
+
relay: ChannelState<'no-mechanism' | 'no-peer-name'>;
|
|
197
|
+
terminal: ChannelState<'no-backend' | 'no-pane-env'>;
|
|
198
|
+
/** 该会话有没有上报过 pane 定位 env。 */
|
|
199
|
+
paneEnvReported: boolean;
|
|
200
|
+
/** 队列里压着的行数。 */
|
|
201
|
+
pending: number;
|
|
202
|
+
/** 暂停闸是否已置(未回执超窗 / 投递失败)。 */
|
|
203
|
+
stalled: boolean;
|
|
204
|
+
}
|
|
146
205
|
export declare class MessageDeliverer {
|
|
147
206
|
private readonly deps;
|
|
148
207
|
private readonly headless;
|
|
@@ -151,16 +210,29 @@ export declare class MessageDeliverer {
|
|
|
151
210
|
private readonly memory;
|
|
152
211
|
/** 有队列行的会话(ingest 冲洗守卫 + 刷新器探活索引;构造时从磁盘重建)。 */
|
|
153
212
|
private readonly queuedSessions;
|
|
154
|
-
/** 会话 inbox 直投目标(hook
|
|
213
|
+
/** 会话 inbox 直投目标(hook 旁路上报,落 `<dataDir>/hooks/inbox-targets.json` 0600)。 */
|
|
155
214
|
private readonly inboxSockets;
|
|
156
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* 会话所在终端 pane 的定位 env(hook 旁路上报)。落
|
|
217
|
+
* `<dataDir>/hooks/pane-envs.json` 0600——**只解 daemon 自己的重启**:pane 活在
|
|
218
|
+
* 会话终端里,重启不动它;不落盘的话重启后要等下一次 hook 事件才认回 pane,而
|
|
219
|
+
* 长时间没动静的会话根本等不到,于是从终端分组里掉出去。
|
|
220
|
+
*/
|
|
157
221
|
private readonly paneEnvs;
|
|
222
|
+
/** 上次落盘的 pane env(hook 每次事件都上报,值没变就不重写盘)。 */
|
|
223
|
+
private persistedPaneEnvs;
|
|
158
224
|
/** 已排自续冲洗的会话(防重复排拍)。 */
|
|
159
225
|
private readonly flushScheduled;
|
|
160
226
|
/** 正在冲洗的会话(重入闸:异步冲洗 + 多条触发源,防同批行被投两次)。 */
|
|
161
227
|
private readonly flushing;
|
|
162
228
|
/** 队列暂停闸(sessionId → 成因消息):未回执超窗 / 投递失败即置;重发或回执解除。 */
|
|
163
229
|
private readonly stalled;
|
|
230
|
+
/**
|
|
231
|
+
* 队头在等回执(sessionId → 消息 id):层② 终端把一条贴进输入框后,下一条必须
|
|
232
|
+
* 等它的 UPS 才发——再贴一份会在同一个框里叠成一段,两条消息并成一条提交。
|
|
233
|
+
* 直投/中投不压(交出去即入会话自己的队列,会话按序处理)。
|
|
234
|
+
*/
|
|
235
|
+
private readonly awaitingAck;
|
|
164
236
|
/**
|
|
165
237
|
* 刚删掉的队列行 id:冲洗「先把队列读进内存、再逐条投递」——这中间被删的行
|
|
166
238
|
* 仍在手里那一批里,靠它跳过(否则删掉的消息照样发出去)。只兜这一个窗口,
|
|
@@ -180,7 +252,8 @@ export declare class MessageDeliverer {
|
|
|
180
252
|
* 在途视图(GET /sessions/:id/messages):promptbox 待递送 ∪ 内存态——
|
|
181
253
|
* 在途(delivering/running)与 failed/timeout/暂停闸成因常驻;delivered/
|
|
182
254
|
* injected/succeeded 在驻留窗口(visibleTtlMs)内展示 via/acked,过后消失
|
|
183
|
-
*
|
|
255
|
+
* (历史在目标会话自己的转录里)。例外 = **已送达还没回执**的:过了窗口也留着,
|
|
256
|
+
* 它就是「还没落进对话」,等回执或未回执闸落定再说。
|
|
184
257
|
*/
|
|
185
258
|
listVisible(sessionId: string): PipeMessage[];
|
|
186
259
|
/** 该会话是否有队列行(ingest 冲洗守卫,O(1))。 */
|
|
@@ -197,6 +270,13 @@ export declare class MessageDeliverer {
|
|
|
197
270
|
* 只有「有进展」才续(通道不可用时不续,避免热循环);沿用节流间隔作拍长。
|
|
198
271
|
*/
|
|
199
272
|
private scheduleFlushContinuation;
|
|
273
|
+
/** 等回执的那条已经落地(回执到 / 失败 / 行没了)→ 撤防,返回 true。 */
|
|
274
|
+
private ackGateOpen;
|
|
275
|
+
/**
|
|
276
|
+
* 队头是否还压着:上一条终端投递没回执 / 队列有积压 / 泵正在推进。
|
|
277
|
+
* 是 → 新消息只能排到队尾;不是 → 立刻投(低延迟路径)。
|
|
278
|
+
*/
|
|
279
|
+
private blockedAhead;
|
|
200
280
|
/**
|
|
201
281
|
* hook 旁路上报的会话 inbox 目标(内存态;socket 空 = 该会话此刻不可直投)。
|
|
202
282
|
* token 只在此存活,不落库、不进 UI、不写日志。
|
|
@@ -210,17 +290,43 @@ export declare class MessageDeliverer {
|
|
|
210
290
|
* resume 到新窗口后,下一次事件就把定位改过来,与 inbox 凭据同一自愈口径)。
|
|
211
291
|
*/
|
|
212
292
|
notePaneEnv(sessionId: string, env: Record<string, string>): void;
|
|
293
|
+
/** 原子写(临时文件 + rename)+ 0600;失败静默(内存态照常能定位,下次再落)。 */
|
|
294
|
+
private persistPaneEnvs;
|
|
213
295
|
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
296
|
+
* 会话退出(`SessionEnd` 到达):旁路事实随进程作废——inbox 凭据出盘(旧 socket
|
|
297
|
+
* 已死,留着只会让下一次投递白试一轮)、pane 定位清(窗口随会话关)。**会话行与
|
|
298
|
+
* 它的对话照常保留**(那是历史,不是旁路事实),所以不走 `forgetSession` 的删会话
|
|
299
|
+
* 级联;压队的行此刻也已成死信 → 一并按 offline 落定(同 A 的口径)。
|
|
300
|
+
*/
|
|
301
|
+
sessionExited(sessionId: string): void;
|
|
302
|
+
/**
|
|
303
|
+
* 会话 → 所在可见屏幕(会话列表分块的数据面)。旁路 env 与投递路径共用同一份
|
|
304
|
+
* 缓存,不另采一次;后端没有反查能力 = 空表(那些会话不分组)。顺手摘掉已判死
|
|
305
|
+
* 会话的 env:那是上一次见到它时的快照,它不会再来报一次,留着只会让死会话常占块头。
|
|
216
306
|
*/
|
|
217
307
|
sessionTerminals(): Promise<Record<string, SessionTerminal | null>>;
|
|
308
|
+
/**
|
|
309
|
+
* 会话级投递诊断(只读内存态 + 既有 repo,纯现算):三通道各自「现在能不能投」
|
|
310
|
+
* + 队列积压/暂停闸。判定条件集就是投递路径的可用前提,不另立第二份事实源。
|
|
311
|
+
*
|
|
312
|
+
* 只回布尔与枚举——**socket 地址与 token 永不出栈**(与「凭据不进 UI/日志」同口径)。
|
|
313
|
+
*/
|
|
314
|
+
diagnose(sessionId: string): SessionDeliveryDiagnosis;
|
|
218
315
|
/**
|
|
219
316
|
* 投递回执:会话自己的 UserPromptSubmit 到了 —— 其 prompt 原文与在途条目匹配
|
|
220
317
|
* 即成真(`acked`)。中继/终端/socket 三路通用(中继的原文外面裹着 Claude Code
|
|
221
|
-
* 自己的 `<cross-session-message …>`
|
|
318
|
+
* 自己的 `<cross-session-message …>` 壳,比对时归一掉)。返回命中消息的随附图
|
|
319
|
+
* id(调用方挂到开轮事件上做气泡缩略图;空表 = 命中但没图 / 没命中)。
|
|
320
|
+
*
|
|
321
|
+
* 带图的消息比对放宽:claude 的粘贴处理器把图路径从 prompt 剥掉、还会把多行
|
|
322
|
+
* 文本 chunk 用空串连起来,`msg.text` 与 UPS 原文可能对不上——对不上不代表
|
|
323
|
+
* 没送达,按「去空白后相同」再认一次;纯图发送(无用户文本)的 UPS prompt 是
|
|
324
|
+
* 空的 / 只剩 `[Image #N]`,无文本可比,这样一条 UPS 认领最新那条纯图在途。
|
|
325
|
+
*
|
|
326
|
+
* `eventId` = 这条 UPS 自己的事件 id:命中即记下来,对话面据此把投递行精确挂到
|
|
327
|
+
* 对应气泡上(见 `PipeMessage.ackedEventId`)。
|
|
222
328
|
*/
|
|
223
|
-
onSessionPrompt(sessionId: string, prompt: string):
|
|
329
|
+
onSessionPrompt(sessionId: string, prompt: string, eventId?: number): string[];
|
|
224
330
|
/** 未回执闸布防:prompt 送达后 ackStallMs 内没等到 UPS 回执 → 暂停该会话队列。 */
|
|
225
331
|
private armAckWatch;
|
|
226
332
|
/** 置闸:成因消息标记 stalled(常驻在途视图)+ message.stalled 帧(web 重拉)。 */
|
|
@@ -239,8 +345,28 @@ export declare class MessageDeliverer {
|
|
|
239
345
|
*/
|
|
240
346
|
interrupt(sessionId: string): Promise<AnswerResult>;
|
|
241
347
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
348
|
+
* 关掉会话所在的 pane(会话生命周期收尾):宿主随 pane 一起退出——这是「退出
|
|
349
|
+
* 会话」的远程等价(harness 没有「请退出」这种信号)。**会话行与它的对话照常
|
|
350
|
+
* 保留**(那是历史,同 SessionEnd 口径),只把它从「活着」的世界里摘出去。
|
|
351
|
+
*/
|
|
352
|
+
closePane(sessionId: string): Promise<AnswerResult>;
|
|
353
|
+
/**
|
|
354
|
+
* 执行模式切换(Shift+Tab 的远程等价):一记固定键,宿主自己算下一个模式。
|
|
355
|
+
* 答「现在是哪个模式」不由这里管——Shift+Tab 不发任何 hook 事件、不落转录,
|
|
356
|
+
* 实时态只能是 hook 事件里最近一次的 `permission_mode`(「最后已知」)。
|
|
357
|
+
*/
|
|
358
|
+
cycleMode(sessionId: string): Promise<AnswerResult>;
|
|
359
|
+
/**
|
|
360
|
+
* 模型切换:往会话的输入行打宿主自己的 `/model <名>` 并提交(会话级、不落盘)。
|
|
361
|
+
* 名字是**用户自填**的(网关模型 ID 会增删,不做静态映射表),故只验形态不验
|
|
362
|
+
* 词表——宿主对未知名自己回 `Unknown model '…'`,那句话进会话转录、用户看得见。
|
|
363
|
+
*/
|
|
364
|
+
setModel(sessionId: string, name: string): Promise<AnswerResult>;
|
|
365
|
+
/**
|
|
366
|
+
* 键序注入路径(作答 / 中断 / 关 pane)共用的落点解析:会话 → 项目 → 终端通道
|
|
367
|
+
* → pane。全部失败原因是**可判定的语义拒绝**(404/409),调用方原样回给 HTTP;
|
|
368
|
+
* 两条 409 是给用户看的(web 直拼在「停止失败:」这类动作名后面),故写成中文
|
|
369
|
+
* 修法,动作名随调用方换。
|
|
244
370
|
*/
|
|
245
371
|
private sessionKeysTarget;
|
|
246
372
|
/**
|
|
@@ -262,12 +388,13 @@ export declare class MessageDeliverer {
|
|
|
262
388
|
/**
|
|
263
389
|
* 队列冲洗(幂等):直投命中即走;否则中继 / 终端按面定序(手动面终端优先);
|
|
264
390
|
* 都不行留队列。
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* 所以节流在这里统一兜)。超出的留队列,下轮触发(ingest / 刷新器)继续。
|
|
391
|
+
* **严格串行**:一轮只送一条,等它的 UPS 回执到了再自续下一拍——同一队列由各模式共用,
|
|
392
|
+
* 顺序与「一条一条」是队列本身的语义,不是各通道各自节流的副产品。
|
|
268
393
|
*/
|
|
269
394
|
flushSession(sessionId: string): Promise<void>;
|
|
270
395
|
private flushSessionInner;
|
|
396
|
+
/** 队列空了就把冲洗索引摘掉(本轮提前返回的路径都得过它,否则刷新器永远白探)。 */
|
|
397
|
+
private settleQueueIndex;
|
|
271
398
|
/** 刷新器入口:扫全部队列会话(只在队列非空时被调用才有意义)。 */
|
|
272
399
|
flushAll(): Promise<void>;
|
|
273
400
|
/** 会话删除级联:内存态 + 队列行。返回清理行数(口径与旧 DB 计数一致)。 */
|
|
@@ -291,7 +418,7 @@ export declare class MessageDeliverer {
|
|
|
291
418
|
* (无定位能力的终端 / 老 hook),歧义拒绝不打。
|
|
292
419
|
*/
|
|
293
420
|
private terminalPaneFor;
|
|
294
|
-
/** 层②
|
|
421
|
+
/** 层② 通道现取(装配期注入;与 settings 的 preset 无关,只有「没装」才是 null)。 */
|
|
295
422
|
private terminalChannel;
|
|
296
423
|
/** prompt 通道入口(send 的即时路径):层① 命中即时中继,层② 异步找 pane,都不行入队。 */
|
|
297
424
|
private deliverPrompt;
|
|
@@ -303,6 +430,22 @@ export declare class MessageDeliverer {
|
|
|
303
430
|
private tryInboxDeliver;
|
|
304
431
|
/** 入队(promptbox 追加 + 会话索引登记)。 */
|
|
305
432
|
private queueEntry;
|
|
433
|
+
/**
|
|
434
|
+
* 该会话是否已判死:claude 注册表 `pidAlive === false` 才认,`null` 不猜
|
|
435
|
+
* (codex / 新会话豁免窗 / SessionStart 空壳行都落 null)。判据与「已终止」
|
|
436
|
+
* 态、两条 terminated 补射同源(claude-liveness 的 pidAliveOf)——消息行与
|
|
437
|
+
* 会话行不会各说各话。
|
|
438
|
+
*/
|
|
439
|
+
private sessionJudgedDead;
|
|
440
|
+
/**
|
|
441
|
+
* 判死落定:三层全无通路、目标进程又不在——**不假装排队**,落 `failed` +
|
|
442
|
+
* `reason: 'offline'`(`message.finished` 帧照抛,既有 messageFailed 订阅提醒
|
|
443
|
+
* 生效)。**刻意不置暂停闸**:队列整批转 offline 后已空,闸只会挡住用户重发
|
|
444
|
+
* ——重发是有意的可逆出口(判活残差 / 会话其实活着时,一点就回来)。
|
|
445
|
+
*/
|
|
446
|
+
private failOffline;
|
|
447
|
+
/** 冲洗时判死:**该会话全部队列行**都是死信(死会话投不进去),整批落定 + 清队。 */
|
|
448
|
+
private failQueuedOffline;
|
|
306
449
|
/**
|
|
307
450
|
* 层① 中继:复用 HeadlessRunner 的 spawn 基建(win32 shell 单串 + stdin +
|
|
308
451
|
* 超时),键 = 合成键(不占目标会话的 headless 并发闸)。返回是否启动成功。
|
|
@@ -316,6 +459,20 @@ export declare class MessageDeliverer {
|
|
|
316
459
|
private settleRelay;
|
|
317
460
|
/** 层② 终端注入终态(语义同中继:成功 delivered / 失败 failed 可见)。 */
|
|
318
461
|
private runTerminalPrompt;
|
|
462
|
+
/**
|
|
463
|
+
* 层② 只补一记回车(重发「已贴进框、没回执」的行):文本在上一次投递里已经
|
|
464
|
+
* 落到会话的输入框,缺的只是那记提交键——重贴一次会在框里叠一份,用户收到
|
|
465
|
+
* 两遍正文与两遍图。
|
|
466
|
+
*/
|
|
467
|
+
private runTerminalSubmit;
|
|
468
|
+
private runTerminal;
|
|
469
|
+
/**
|
|
470
|
+
* 投递文本 = 用户原文经 harness `imageAttach.composePrompt` 现合成(带图时在
|
|
471
|
+
* 原文后追加图引用形态)。**只在投递那一刻合成**——`msg.text` 恒为用户原文
|
|
472
|
+
* (回执比对与气泡文案都要它),队列行也不存合成结果(换 harness 后仍按现面合成)。
|
|
473
|
+
*/
|
|
474
|
+
private wireTextOf;
|
|
475
|
+
private hasImages;
|
|
319
476
|
/** inject 通道:信封写 outbox → injected(fire-and-forget 语义)。 */
|
|
320
477
|
private deliverInject;
|
|
321
478
|
/** headless 通道:置 running → 无头 spawn;终态经 onSettle 后台回写。 */
|
|
@@ -326,3 +483,4 @@ export declare class MessageDeliverer {
|
|
|
326
483
|
private settle;
|
|
327
484
|
private bus;
|
|
328
485
|
}
|
|
486
|
+
export {};
|