@weavecode/weave 0.1.0 → 0.1.2
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 +3 -3
- package/node_modules/@weavecode/cli/dist/commands/daemon.d.ts +7 -0
- 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/i18n/dict/en.js +6 -12
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +44 -2
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +6 -12
- package/node_modules/@weavecode/cli/dist/init/claudemd-gen.d.ts +2 -3
- 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 +1 -1
- package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
- package/node_modules/@weavecode/cli/dist/init/harnesses/zcode.d.ts +29 -0
- package/node_modules/@weavecode/cli/dist/init/harnesses/zcode.js +1 -0
- 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/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/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/package.json +5 -5
- 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 +2 -2
- package/node_modules/@weavecode/core/dist/index.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 -19
- package/node_modules/@weavecode/core/dist/types.js +1 -1
- package/node_modules/@weavecode/core/package.json +1 -1
- package/node_modules/@weavecode/harness/dist/claude/assets.d.ts +10 -0
- package/node_modules/@weavecode/harness/dist/claude/assets.js +4 -1
- package/node_modules/@weavecode/harness/dist/claude/capture.d.ts +15 -3
- package/node_modules/@weavecode/harness/dist/claude/capture.js +15 -9
- 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 +10 -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 +39 -0
- package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/plan.d.ts +2 -0
- package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -0
- 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/side-question.d.ts +12 -0
- package/node_modules/@weavecode/harness/dist/claude/side-question.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/config.d.ts +200 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/config.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/generator.d.ts +12 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +745 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.d.ts +10 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/surface.d.ts +20 -0
- package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -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/index.d.ts +1 -0
- package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/mcp.d.ts +30 -0
- package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -0
- package/node_modules/@weavecode/harness/dist/codex/messaging.js +1 -1
- package/node_modules/@weavecode/harness/dist/driver.d.ts +168 -3
- 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/registry-wiring.d.ts +3 -1
- package/node_modules/@weavecode/harness/dist/zcode/assets.d.ts +8 -0
- package/node_modules/@weavecode/harness/dist/zcode/assets.js +1 -0
- package/node_modules/@weavecode/harness/dist/zcode/capture.d.ts +36 -0
- package/node_modules/@weavecode/harness/dist/zcode/capture.js +3 -0
- package/node_modules/@weavecode/harness/dist/zcode/detect.d.ts +2 -0
- package/node_modules/@weavecode/harness/dist/zcode/detect.js +1 -0
- package/node_modules/@weavecode/harness/dist/zcode/event-source.d.ts +8 -0
- package/node_modules/@weavecode/harness/dist/zcode/event-source.js +1 -0
- package/node_modules/@weavecode/harness/dist/zcode/index.d.ts +13 -0
- package/node_modules/@weavecode/harness/dist/zcode/index.js +1 -0
- package/node_modules/@weavecode/harness/dist/zcode/mcp.d.ts +6 -0
- package/node_modules/@weavecode/harness/dist/zcode/mcp.js +2 -0
- package/node_modules/@weavecode/harness/dist/zcode/messaging.d.ts +13 -0
- package/node_modules/@weavecode/harness/dist/zcode/messaging.js +1 -0
- package/node_modules/@weavecode/harness/dist/zcode/resume.d.ts +7 -0
- package/node_modules/@weavecode/harness/dist/zcode/resume.js +1 -0
- 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 +13 -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 +15 -0
- package/node_modules/@weavecode/server/dist/daemon/server.js +8 -6
- package/node_modules/@weavecode/server/dist/daemon/session-probe.d.ts +72 -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/snapshot-refresher.d.ts +7 -1
- package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/sse-hub.d.ts +40 -0
- package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -0
- 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 +38 -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.d.ts +5 -0
- 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 +27 -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 +200 -13
- package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +3 -2
- package/node_modules/@weavecode/server/dist/hooks/mirror.d.ts +9 -4
- 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 +7 -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/side-questions.d.ts +41 -0
- package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -0
- 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.d.ts +10 -0
- package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
- package/node_modules/@weavecode/server/dist/install/codex-toml.d.ts +8 -26
- 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.d.ts +2 -4
- package/node_modules/@weavecode/server/dist/install/global-config.js +1 -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.d.ts +3 -5
- package/node_modules/@weavecode/server/dist/install/installer.js +1 -3
- package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
- package/node_modules/@weavecode/server/dist/install/mcp-rows.d.ts +5 -5
- 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.d.ts +7 -0
- 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 +32 -8
- package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/side-questions.d.ts +50 -0
- package/node_modules/@weavecode/server/dist/repositories/side-questions.js +6 -0
- 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/config.d.ts +4 -198
- package/node_modules/@weavecode/server/dist/statusline/config.js +1 -1
- package/node_modules/@weavecode/server/dist/statusline/generator.d.ts +5 -0
- package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -676
- package/node_modules/@weavecode/server/dist/statusline/manager.d.ts +7 -5
- package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -4
- package/node_modules/@weavecode/server/dist/surfaces.d.ts +11 -1
- 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-CHWbLAje.js +594 -0
- package/node_modules/@weavecode/server/web/dist/assets/index-D0s5v8QS.css +11 -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
|
@@ -38,10 +38,23 @@ export declare const HooksConfigSchema: z.ZodObject<{
|
|
|
38
38
|
userPromptSubmit: z.ZodBoolean;
|
|
39
39
|
sessionStart: z.ZodBoolean;
|
|
40
40
|
stop: z.ZodBoolean;
|
|
41
|
+
/** 回合 API 错误收尾(代替 Stop)——不采集则该轮永远卡「生成中」。 */
|
|
42
|
+
stopFailure: z.ZodBoolean;
|
|
41
43
|
subagentStop: z.ZodBoolean;
|
|
44
|
+
subagentStart: z.ZodBoolean;
|
|
42
45
|
notification: z.ZodBoolean;
|
|
46
|
+
/** 工具执行失败(成功面 PostToolUse 之外的失败信号)。 */
|
|
47
|
+
postToolUseFailure: z.ZodBoolean;
|
|
48
|
+
/** 即将请求工具权限(比 permission_prompt 即时;带建议的权限更新)。 */
|
|
49
|
+
permissionRequest: z.ZodBoolean;
|
|
50
|
+
/** auto 模式分类器拒绝(带 reason)。 */
|
|
51
|
+
permissionDenied: z.ZodBoolean;
|
|
43
52
|
/** 压缩开始事件(压缩态实时信号;收尾笔 SessionStart 无开关,恒在采集面)。 */
|
|
44
53
|
preCompact: z.ZodBoolean;
|
|
54
|
+
/** 会话退出事件(旁路凭据/定位随进程作废的信号,web 状态机据此落「关闭」)。 */
|
|
55
|
+
sessionEnd: z.ZodBoolean;
|
|
56
|
+
/** 模型切换确认(Pre 置位 / Post 落定成对登记——落定笔只服务于这一件事)。 */
|
|
57
|
+
preModelSwitch: z.ZodBoolean;
|
|
45
58
|
timeout: z.ZodDefault<z.ZodNumber>;
|
|
46
59
|
continueOnError: z.ZodDefault<z.ZodBoolean>;
|
|
47
60
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -50,9 +63,16 @@ export declare const HooksConfigSchema: z.ZodObject<{
|
|
|
50
63
|
userPromptSubmit: boolean;
|
|
51
64
|
sessionStart: boolean;
|
|
52
65
|
stop: boolean;
|
|
66
|
+
stopFailure: boolean;
|
|
53
67
|
subagentStop: boolean;
|
|
68
|
+
subagentStart: boolean;
|
|
54
69
|
notification: boolean;
|
|
70
|
+
postToolUseFailure: boolean;
|
|
71
|
+
permissionRequest: boolean;
|
|
72
|
+
permissionDenied: boolean;
|
|
55
73
|
preCompact: boolean;
|
|
74
|
+
sessionEnd: boolean;
|
|
75
|
+
preModelSwitch: boolean;
|
|
56
76
|
timeout: number;
|
|
57
77
|
continueOnError: boolean;
|
|
58
78
|
}, {
|
|
@@ -61,9 +81,16 @@ export declare const HooksConfigSchema: z.ZodObject<{
|
|
|
61
81
|
userPromptSubmit: boolean;
|
|
62
82
|
sessionStart: boolean;
|
|
63
83
|
stop: boolean;
|
|
84
|
+
stopFailure: boolean;
|
|
64
85
|
subagentStop: boolean;
|
|
86
|
+
subagentStart: boolean;
|
|
65
87
|
notification: boolean;
|
|
88
|
+
postToolUseFailure: boolean;
|
|
89
|
+
permissionRequest: boolean;
|
|
90
|
+
permissionDenied: boolean;
|
|
66
91
|
preCompact: boolean;
|
|
92
|
+
sessionEnd: boolean;
|
|
93
|
+
preModelSwitch: boolean;
|
|
67
94
|
timeout?: number | undefined;
|
|
68
95
|
continueOnError?: boolean | undefined;
|
|
69
96
|
}>;
|
|
@@ -72,7 +99,7 @@ export type HooksConfig = z.infer<typeof HooksConfigSchema>;
|
|
|
72
99
|
* 兼容 re-export(CROSS §2.2):存量 import 路径不变,
|
|
73
100
|
* 实际表已下沉 `harness.ts` 的 `HARNESS_EVENTS.claude`。
|
|
74
101
|
*/
|
|
75
|
-
export declare const CLAUDE_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SessionStart", "Stop", "SubagentStop", "Notification", "PreCompact"];
|
|
102
|
+
export declare const CLAUDE_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SessionStart", "Stop", "StopFailure", "SubagentStop", "Notification", "PostToolUseFailure", "PermissionRequest", "PermissionDenied", "SubagentStart", "PreCompact", "SessionEnd", "PreModelSwitch", "PostModelSwitch"];
|
|
76
103
|
/** 兼容 re-export:`INJECTABLE_EVENTS.claude`。 */
|
|
77
104
|
export declare const INJECTABLE_HOOK_EVENTS: readonly ["PostToolUse", "UserPromptSubmit", "SessionStart", "Stop", "SubagentStop"];
|
|
78
105
|
export declare const HookRuleSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
@@ -405,14 +432,6 @@ export declare const HookRuleSchema: z.ZodObject<{
|
|
|
405
432
|
export type HookRule = z.infer<typeof HookRuleSchema>;
|
|
406
433
|
/** 插件包 manifest 文件名(约定位于插件根目录)。 */
|
|
407
434
|
export declare const WEAVE_PLUGIN_MANIFEST = "weave-plugin.json";
|
|
408
|
-
/**
|
|
409
|
-
* weave 注入消息的来源标记(唯一事实源:server 的直投路径用它当前缀)。
|
|
410
|
-
* 直投把消息写成语义上的「用户消息」——会话分不出是手打还是控制台注入,
|
|
411
|
-
* 这个标记就是转录里唯一可见的凭据;`weave init` 生成的 CLAUDE.md 块用同一个
|
|
412
|
-
* 常量向会话解释它的含义(会话要据此知道这条消息该怎么处理)。标记**只**加在
|
|
413
|
-
* 直投这一条路径,中继/终端兜底/注入都不带。
|
|
414
|
-
*/
|
|
415
|
-
export declare const WEAVE_INJECTION_MARKER = "[weave] ";
|
|
416
435
|
/**
|
|
417
436
|
* rules.json 的元素:完整 HookRule 去掉 id/projectId(加载器生成),
|
|
418
437
|
* enabled 可省略(默认 true,但用户在 dashboard 的开关改动会被保留)。
|
|
@@ -843,10 +862,79 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
|
|
|
843
862
|
claudeMd: boolean;
|
|
844
863
|
agentsMd: boolean;
|
|
845
864
|
}>;
|
|
865
|
+
/**
|
|
866
|
+
* 本次 init 生效的采集/MCP 开关(含 `--hooks`/`--mcp` 覆盖结果)——daemon 的
|
|
867
|
+
* init 文件漂移检测据此重建期望态;旧文件无此字段 → 回落 DEFAULT_*。
|
|
868
|
+
*/
|
|
869
|
+
hooks: z.ZodOptional<z.ZodObject<{
|
|
870
|
+
preToolUse: z.ZodOptional<z.ZodBoolean>;
|
|
871
|
+
postToolUse: z.ZodOptional<z.ZodBoolean>;
|
|
872
|
+
userPromptSubmit: z.ZodOptional<z.ZodBoolean>;
|
|
873
|
+
sessionStart: z.ZodOptional<z.ZodBoolean>;
|
|
874
|
+
stop: z.ZodOptional<z.ZodBoolean>;
|
|
875
|
+
stopFailure: z.ZodOptional<z.ZodBoolean>;
|
|
876
|
+
subagentStop: z.ZodOptional<z.ZodBoolean>;
|
|
877
|
+
subagentStart: z.ZodOptional<z.ZodBoolean>;
|
|
878
|
+
notification: z.ZodOptional<z.ZodBoolean>;
|
|
879
|
+
postToolUseFailure: z.ZodOptional<z.ZodBoolean>;
|
|
880
|
+
permissionRequest: z.ZodOptional<z.ZodBoolean>;
|
|
881
|
+
permissionDenied: z.ZodOptional<z.ZodBoolean>;
|
|
882
|
+
preCompact: z.ZodOptional<z.ZodBoolean>;
|
|
883
|
+
sessionEnd: z.ZodOptional<z.ZodBoolean>;
|
|
884
|
+
preModelSwitch: z.ZodOptional<z.ZodBoolean>;
|
|
885
|
+
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
886
|
+
continueOnError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
887
|
+
}, "strip", z.ZodTypeAny, {
|
|
888
|
+
preToolUse?: boolean | undefined;
|
|
889
|
+
postToolUse?: boolean | undefined;
|
|
890
|
+
userPromptSubmit?: boolean | undefined;
|
|
891
|
+
sessionStart?: boolean | undefined;
|
|
892
|
+
stop?: boolean | undefined;
|
|
893
|
+
stopFailure?: boolean | undefined;
|
|
894
|
+
subagentStop?: boolean | undefined;
|
|
895
|
+
subagentStart?: boolean | undefined;
|
|
896
|
+
notification?: boolean | undefined;
|
|
897
|
+
postToolUseFailure?: boolean | undefined;
|
|
898
|
+
permissionRequest?: boolean | undefined;
|
|
899
|
+
permissionDenied?: boolean | undefined;
|
|
900
|
+
preCompact?: boolean | undefined;
|
|
901
|
+
sessionEnd?: boolean | undefined;
|
|
902
|
+
preModelSwitch?: boolean | undefined;
|
|
903
|
+
timeout?: number | undefined;
|
|
904
|
+
continueOnError?: boolean | undefined;
|
|
905
|
+
}, {
|
|
906
|
+
preToolUse?: boolean | undefined;
|
|
907
|
+
postToolUse?: boolean | undefined;
|
|
908
|
+
userPromptSubmit?: boolean | undefined;
|
|
909
|
+
sessionStart?: boolean | undefined;
|
|
910
|
+
stop?: boolean | undefined;
|
|
911
|
+
stopFailure?: boolean | undefined;
|
|
912
|
+
subagentStop?: boolean | undefined;
|
|
913
|
+
subagentStart?: boolean | undefined;
|
|
914
|
+
notification?: boolean | undefined;
|
|
915
|
+
postToolUseFailure?: boolean | undefined;
|
|
916
|
+
permissionRequest?: boolean | undefined;
|
|
917
|
+
permissionDenied?: boolean | undefined;
|
|
918
|
+
preCompact?: boolean | undefined;
|
|
919
|
+
sessionEnd?: boolean | undefined;
|
|
920
|
+
preModelSwitch?: boolean | undefined;
|
|
921
|
+
timeout?: number | undefined;
|
|
922
|
+
continueOnError?: boolean | undefined;
|
|
923
|
+
}>>;
|
|
924
|
+
mcp: z.ZodOptional<z.ZodObject<{
|
|
925
|
+
weave: z.ZodOptional<z.ZodBoolean>;
|
|
926
|
+
autoStart: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
927
|
+
}, "strip", z.ZodTypeAny, {
|
|
928
|
+
weave?: boolean | undefined;
|
|
929
|
+
autoStart?: boolean | undefined;
|
|
930
|
+
}, {
|
|
931
|
+
weave?: boolean | undefined;
|
|
932
|
+
autoStart?: boolean | undefined;
|
|
933
|
+
}>>;
|
|
846
934
|
}, "strip", z.ZodTypeAny, {
|
|
847
935
|
initVersion: string;
|
|
848
936
|
initTimestamp: string;
|
|
849
|
-
preset: "
|
|
937
|
+
preset: "default" | "minimal" | "full";
|
|
850
938
|
components: {
|
|
851
939
|
agents: boolean;
|
|
852
940
|
settings: boolean;
|
|
@@ -857,11 +945,34 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
|
|
|
857
945
|
claudeMd: boolean;
|
|
858
946
|
agentsMd: boolean;
|
|
859
947
|
};
|
|
948
|
+
mcp?: {
|
|
949
|
+
weave?: boolean | undefined;
|
|
950
|
+
autoStart?: boolean | undefined;
|
|
951
|
+
} | undefined;
|
|
860
952
|
harnesses?: ("claude" | "codex")[] | undefined;
|
|
953
|
+
hooks?: {
|
|
954
|
+
preToolUse?: boolean | undefined;
|
|
955
|
+
postToolUse?: boolean | undefined;
|
|
956
|
+
userPromptSubmit?: boolean | undefined;
|
|
957
|
+
sessionStart?: boolean | undefined;
|
|
958
|
+
stop?: boolean | undefined;
|
|
959
|
+
stopFailure?: boolean | undefined;
|
|
960
|
+
subagentStop?: boolean | undefined;
|
|
961
|
+
subagentStart?: boolean | undefined;
|
|
962
|
+
notification?: boolean | undefined;
|
|
963
|
+
postToolUseFailure?: boolean | undefined;
|
|
964
|
+
permissionRequest?: boolean | undefined;
|
|
965
|
+
permissionDenied?: boolean | undefined;
|
|
966
|
+
preCompact?: boolean | undefined;
|
|
967
|
+
sessionEnd?: boolean | undefined;
|
|
968
|
+
preModelSwitch?: boolean | undefined;
|
|
969
|
+
timeout?: number | undefined;
|
|
970
|
+
continueOnError?: boolean | undefined;
|
|
971
|
+
} | undefined;
|
|
861
972
|
}, {
|
|
862
973
|
initVersion: string;
|
|
863
974
|
initTimestamp: string;
|
|
864
|
-
preset: "
|
|
975
|
+
preset: "default" | "minimal" | "full";
|
|
865
976
|
components: {
|
|
866
977
|
agents: boolean;
|
|
867
978
|
settings: boolean;
|
|
@@ -872,7 +983,30 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
|
|
|
872
983
|
claudeMd: boolean;
|
|
873
984
|
agentsMd: boolean;
|
|
874
985
|
};
|
|
986
|
+
mcp?: {
|
|
987
|
+
weave?: boolean | undefined;
|
|
988
|
+
autoStart?: boolean | undefined;
|
|
989
|
+
} | undefined;
|
|
875
990
|
harnesses?: ("claude" | "codex")[] | undefined;
|
|
991
|
+
hooks?: {
|
|
992
|
+
preToolUse?: boolean | undefined;
|
|
993
|
+
postToolUse?: boolean | undefined;
|
|
994
|
+
userPromptSubmit?: boolean | undefined;
|
|
995
|
+
sessionStart?: boolean | undefined;
|
|
996
|
+
stop?: boolean | undefined;
|
|
997
|
+
stopFailure?: boolean | undefined;
|
|
998
|
+
subagentStop?: boolean | undefined;
|
|
999
|
+
subagentStart?: boolean | undefined;
|
|
1000
|
+
notification?: boolean | undefined;
|
|
1001
|
+
postToolUseFailure?: boolean | undefined;
|
|
1002
|
+
permissionRequest?: boolean | undefined;
|
|
1003
|
+
permissionDenied?: boolean | undefined;
|
|
1004
|
+
preCompact?: boolean | undefined;
|
|
1005
|
+
sessionEnd?: boolean | undefined;
|
|
1006
|
+
preModelSwitch?: boolean | undefined;
|
|
1007
|
+
timeout?: number | undefined;
|
|
1008
|
+
continueOnError?: boolean | undefined;
|
|
1009
|
+
} | undefined;
|
|
876
1010
|
}>;
|
|
877
1011
|
export type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;
|
|
878
1012
|
export declare const PlatformInfoSchema: z.ZodObject<{
|
|
@@ -939,9 +1073,16 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
939
1073
|
userPromptSubmit: z.ZodOptional<z.ZodBoolean>;
|
|
940
1074
|
sessionStart: z.ZodOptional<z.ZodBoolean>;
|
|
941
1075
|
stop: z.ZodOptional<z.ZodBoolean>;
|
|
1076
|
+
stopFailure: z.ZodOptional<z.ZodBoolean>;
|
|
942
1077
|
subagentStop: z.ZodOptional<z.ZodBoolean>;
|
|
1078
|
+
subagentStart: z.ZodOptional<z.ZodBoolean>;
|
|
943
1079
|
notification: z.ZodOptional<z.ZodBoolean>;
|
|
1080
|
+
postToolUseFailure: z.ZodOptional<z.ZodBoolean>;
|
|
1081
|
+
permissionRequest: z.ZodOptional<z.ZodBoolean>;
|
|
1082
|
+
permissionDenied: z.ZodOptional<z.ZodBoolean>;
|
|
944
1083
|
preCompact: z.ZodOptional<z.ZodBoolean>;
|
|
1084
|
+
sessionEnd: z.ZodOptional<z.ZodBoolean>;
|
|
1085
|
+
preModelSwitch: z.ZodOptional<z.ZodBoolean>;
|
|
945
1086
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
946
1087
|
continueOnError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
947
1088
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -950,9 +1091,16 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
950
1091
|
userPromptSubmit?: boolean | undefined;
|
|
951
1092
|
sessionStart?: boolean | undefined;
|
|
952
1093
|
stop?: boolean | undefined;
|
|
1094
|
+
stopFailure?: boolean | undefined;
|
|
953
1095
|
subagentStop?: boolean | undefined;
|
|
1096
|
+
subagentStart?: boolean | undefined;
|
|
954
1097
|
notification?: boolean | undefined;
|
|
1098
|
+
postToolUseFailure?: boolean | undefined;
|
|
1099
|
+
permissionRequest?: boolean | undefined;
|
|
1100
|
+
permissionDenied?: boolean | undefined;
|
|
955
1101
|
preCompact?: boolean | undefined;
|
|
1102
|
+
sessionEnd?: boolean | undefined;
|
|
1103
|
+
preModelSwitch?: boolean | undefined;
|
|
956
1104
|
timeout?: number | undefined;
|
|
957
1105
|
continueOnError?: boolean | undefined;
|
|
958
1106
|
}, {
|
|
@@ -961,9 +1109,16 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
961
1109
|
userPromptSubmit?: boolean | undefined;
|
|
962
1110
|
sessionStart?: boolean | undefined;
|
|
963
1111
|
stop?: boolean | undefined;
|
|
1112
|
+
stopFailure?: boolean | undefined;
|
|
964
1113
|
subagentStop?: boolean | undefined;
|
|
1114
|
+
subagentStart?: boolean | undefined;
|
|
965
1115
|
notification?: boolean | undefined;
|
|
1116
|
+
postToolUseFailure?: boolean | undefined;
|
|
1117
|
+
permissionRequest?: boolean | undefined;
|
|
1118
|
+
permissionDenied?: boolean | undefined;
|
|
966
1119
|
preCompact?: boolean | undefined;
|
|
1120
|
+
sessionEnd?: boolean | undefined;
|
|
1121
|
+
preModelSwitch?: boolean | undefined;
|
|
967
1122
|
timeout?: number | undefined;
|
|
968
1123
|
continueOnError?: boolean | undefined;
|
|
969
1124
|
}>>;
|
|
@@ -1012,7 +1167,7 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
1012
1167
|
weave?: boolean | undefined;
|
|
1013
1168
|
autoStart?: boolean | undefined;
|
|
1014
1169
|
};
|
|
1015
|
-
preset: "
|
|
1170
|
+
preset: "default" | "minimal" | "full";
|
|
1016
1171
|
components: {
|
|
1017
1172
|
agents?: boolean | undefined;
|
|
1018
1173
|
settings?: boolean | undefined;
|
|
@@ -1023,21 +1178,28 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
1023
1178
|
claudeMd?: boolean | undefined;
|
|
1024
1179
|
agentsMd?: boolean | undefined;
|
|
1025
1180
|
};
|
|
1026
|
-
targetDir: string;
|
|
1027
|
-
force: boolean;
|
|
1028
|
-
interactive: boolean;
|
|
1029
1181
|
hooks: {
|
|
1030
1182
|
preToolUse?: boolean | undefined;
|
|
1031
1183
|
postToolUse?: boolean | undefined;
|
|
1032
1184
|
userPromptSubmit?: boolean | undefined;
|
|
1033
1185
|
sessionStart?: boolean | undefined;
|
|
1034
1186
|
stop?: boolean | undefined;
|
|
1187
|
+
stopFailure?: boolean | undefined;
|
|
1035
1188
|
subagentStop?: boolean | undefined;
|
|
1189
|
+
subagentStart?: boolean | undefined;
|
|
1036
1190
|
notification?: boolean | undefined;
|
|
1191
|
+
postToolUseFailure?: boolean | undefined;
|
|
1192
|
+
permissionRequest?: boolean | undefined;
|
|
1193
|
+
permissionDenied?: boolean | undefined;
|
|
1037
1194
|
preCompact?: boolean | undefined;
|
|
1195
|
+
sessionEnd?: boolean | undefined;
|
|
1196
|
+
preModelSwitch?: boolean | undefined;
|
|
1038
1197
|
timeout?: number | undefined;
|
|
1039
1198
|
continueOnError?: boolean | undefined;
|
|
1040
1199
|
};
|
|
1200
|
+
targetDir: string;
|
|
1201
|
+
force: boolean;
|
|
1202
|
+
interactive: boolean;
|
|
1041
1203
|
harnesses?: ("claude" | "codex")[] | undefined;
|
|
1042
1204
|
}, {
|
|
1043
1205
|
agents?: {
|
|
@@ -1053,7 +1215,7 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
1053
1215
|
weave?: boolean | undefined;
|
|
1054
1216
|
autoStart?: boolean | undefined;
|
|
1055
1217
|
} | undefined;
|
|
1056
|
-
preset?: "
|
|
1218
|
+
preset?: "default" | "minimal" | "full" | undefined;
|
|
1057
1219
|
harnesses?: ("claude" | "codex")[] | undefined;
|
|
1058
1220
|
components?: {
|
|
1059
1221
|
agents?: boolean | undefined;
|
|
@@ -1065,21 +1227,28 @@ export declare const InitOptionsSchema: z.ZodObject<{
|
|
|
1065
1227
|
claudeMd?: boolean | undefined;
|
|
1066
1228
|
agentsMd?: boolean | undefined;
|
|
1067
1229
|
} | undefined;
|
|
1068
|
-
targetDir?: string | undefined;
|
|
1069
|
-
force?: boolean | undefined;
|
|
1070
|
-
interactive?: boolean | undefined;
|
|
1071
1230
|
hooks?: {
|
|
1072
1231
|
preToolUse?: boolean | undefined;
|
|
1073
1232
|
postToolUse?: boolean | undefined;
|
|
1074
1233
|
userPromptSubmit?: boolean | undefined;
|
|
1075
1234
|
sessionStart?: boolean | undefined;
|
|
1076
1235
|
stop?: boolean | undefined;
|
|
1236
|
+
stopFailure?: boolean | undefined;
|
|
1077
1237
|
subagentStop?: boolean | undefined;
|
|
1238
|
+
subagentStart?: boolean | undefined;
|
|
1078
1239
|
notification?: boolean | undefined;
|
|
1240
|
+
postToolUseFailure?: boolean | undefined;
|
|
1241
|
+
permissionRequest?: boolean | undefined;
|
|
1242
|
+
permissionDenied?: boolean | undefined;
|
|
1079
1243
|
preCompact?: boolean | undefined;
|
|
1244
|
+
sessionEnd?: boolean | undefined;
|
|
1245
|
+
preModelSwitch?: boolean | undefined;
|
|
1080
1246
|
timeout?: number | undefined;
|
|
1081
1247
|
continueOnError?: boolean | undefined;
|
|
1082
1248
|
} | undefined;
|
|
1249
|
+
targetDir?: string | undefined;
|
|
1250
|
+
force?: boolean | undefined;
|
|
1251
|
+
interactive?: boolean | undefined;
|
|
1083
1252
|
}>;
|
|
1084
1253
|
export type InitOptions = z.infer<typeof InitOptionsSchema>;
|
|
1085
1254
|
export declare const InitResultSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{HARNESS_EVENTS as r,HARNESS_NAMES as a,INJECTABLE_EVENTS as s}from"./harness.js";export const PresetSchema=e.enum(["minimal","default","full"]),InitComponentsSchema=e.object({settings:e.boolean(),skills:e.boolean(),commands:e.boolean(),agents:e.boolean(),helpers:e.boolean(),mcp:e.boolean(),claudeMd:e.boolean(),agentsMd:e.boolean()}),HooksConfigSchema=e.object({preToolUse:e.boolean(),postToolUse:e.boolean(),userPromptSubmit:e.boolean(),sessionStart:e.boolean(),stop:e.boolean(),subagentStop:e.boolean(),notification:e.boolean(),preCompact:e.boolean(),timeout:e.number().default(5e3),continueOnError:e.boolean().default(!0)}),CLAUDE_HOOK_EVENTS=r.claude,INJECTABLE_HOOK_EVENTS=s.claude;const i=e.enum(a),l=e.enum([...a,"any"]);export const HookRuleSourceSchema=e.discriminatedUnion("kind",[e.object({kind:e.literal("hook-event"),harness:l,event:e.string().min(1)}),e.object({kind:e.literal("webhook"),routeId:e.string().min(1)}),e.object({kind:e.literal("claude-event"),event:e.string().min(1)})]);export function normalizeHookRuleSource(n){return n.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:n.event}:n}export function hookSourceHarness(n){return n.kind==="claude-event"?"claude":n.kind==="hook-event"?n.harness:null}export const HookRuleFilterSchema=e.object({toolNames:e.array(e.string().min(1)).optional(),pathGlobs:e.array(e.string().min(1)).optional(),crossProjectOnly:e.boolean().optional()}),HandlerConfigSchema=e.discriminatedUnion("type",[e.object({type:e.literal("log")}),e.object({type:e.literal("webhook"),url:e.string().url(),secret:e.string().optional(),headers:e.record(e.string(),e.string()).optional()}),e.object({type:e.literal("inject"),template:e.string().min(1)}),e.object({type:e.literal("manual"),template:e.string().min(1)}),e.object({type:e.literal("plugin"),pluginId:e.string().min(1),handlerType:e.string().min(1),config:e.record(e.string(),e.unknown()).optional()})]),HookRuleOriginSchema=e.enum(["user","plugin","builtin"]),HookRuleSchema=e.object({id:e.string().min(1),name:e.string().min(1),enabled:e.boolean(),priority:e.number().int(),projectId:e.number().int().nullable(),source:HookRuleSourceSchema,filter:HookRuleFilterSchema.default({}),handler:HandlerConfigSchema,timeoutMs:e.number().int().positive().default(5e3),record:e.boolean().default(!0),origin:HookRuleOriginSchema.default("user"),pluginId:e.string().min(1).nullable().default(null)}),WEAVE_PLUGIN_MANIFEST="weave-plugin.json",
|
|
1
|
+
import{z as e}from"zod";import{HARNESS_EVENTS as r,HARNESS_NAMES as a,INJECTABLE_EVENTS as s}from"./harness.js";export const PresetSchema=e.enum(["minimal","default","full"]),InitComponentsSchema=e.object({settings:e.boolean(),skills:e.boolean(),commands:e.boolean(),agents:e.boolean(),helpers:e.boolean(),mcp:e.boolean(),claudeMd:e.boolean(),agentsMd:e.boolean()}),HooksConfigSchema=e.object({preToolUse:e.boolean(),postToolUse:e.boolean(),userPromptSubmit:e.boolean(),sessionStart:e.boolean(),stop:e.boolean(),stopFailure:e.boolean(),subagentStop:e.boolean(),subagentStart:e.boolean(),notification:e.boolean(),postToolUseFailure:e.boolean(),permissionRequest:e.boolean(),permissionDenied:e.boolean(),preCompact:e.boolean(),sessionEnd:e.boolean(),preModelSwitch:e.boolean(),timeout:e.number().default(5e3),continueOnError:e.boolean().default(!0)}),CLAUDE_HOOK_EVENTS=r.claude,INJECTABLE_HOOK_EVENTS=s.claude;const i=e.enum(a),l=e.enum([...a,"any"]);export const HookRuleSourceSchema=e.discriminatedUnion("kind",[e.object({kind:e.literal("hook-event"),harness:l,event:e.string().min(1)}),e.object({kind:e.literal("webhook"),routeId:e.string().min(1)}),e.object({kind:e.literal("claude-event"),event:e.string().min(1)})]);export function normalizeHookRuleSource(n){return n.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:n.event}:n}export function hookSourceHarness(n){return n.kind==="claude-event"?"claude":n.kind==="hook-event"?n.harness:null}export const HookRuleFilterSchema=e.object({toolNames:e.array(e.string().min(1)).optional(),pathGlobs:e.array(e.string().min(1)).optional(),crossProjectOnly:e.boolean().optional()}),HandlerConfigSchema=e.discriminatedUnion("type",[e.object({type:e.literal("log")}),e.object({type:e.literal("webhook"),url:e.string().url(),secret:e.string().optional(),headers:e.record(e.string(),e.string()).optional()}),e.object({type:e.literal("inject"),template:e.string().min(1)}),e.object({type:e.literal("manual"),template:e.string().min(1)}),e.object({type:e.literal("plugin"),pluginId:e.string().min(1),handlerType:e.string().min(1),config:e.record(e.string(),e.unknown()).optional()})]),HookRuleOriginSchema=e.enum(["user","plugin","builtin"]),HookRuleSchema=e.object({id:e.string().min(1),name:e.string().min(1),enabled:e.boolean(),priority:e.number().int(),projectId:e.number().int().nullable(),source:HookRuleSourceSchema,filter:HookRuleFilterSchema.default({}),handler:HandlerConfigSchema,timeoutMs:e.number().int().positive().default(5e3),record:e.boolean().default(!0),origin:HookRuleOriginSchema.default("user"),pluginId:e.string().min(1).nullable().default(null)}),WEAVE_PLUGIN_MANIFEST="weave-plugin.json",PluginRuleEntrySchema=HookRuleSchema.omit({id:!0,projectId:!0}).extend({enabled:e.boolean().optional(),priority:e.number().int().optional()}),WeavePluginManifestSchema=e.object({manifestVersion:e.literal(1),id:e.string().regex(/^[a-z][a-z0-9-]{0,63}$/),name:e.string().min(1),version:e.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/),description:e.string().optional(),author:e.string().optional(),engines:e.object({weave:e.string().optional()}).optional(),rules:e.array(e.string().min(1)).default([]),handlers:e.array(e.object({type:e.string().min(1),entry:e.string().min(1)})).default([]),requires:e.object({events:e.array(e.string().min(1)).optional()}).optional(),templates:e.object({skills:e.array(e.string().min(1)).optional(),commands:e.array(e.string().min(1)).optional(),agents:e.array(e.string().min(1)).optional()}).optional(),mcpServers:e.record(e.string(),e.unknown()).optional(),subscribe:e.object({events:e.array(e.string().min(1)),entry:e.string().min(1)}).optional(),statusline:e.object({entry:e.string().min(1)}).optional(),config:e.record(e.string(),e.unknown()).optional()}),HookDispatchStatusSchema=e.enum(["pending","injected","running","succeeded","failed","timeout"]),HookDispatchModeSchema=e.enum(["auto","manual"]),SkillsConfigSchema=e.object({core:e.boolean()}),CommandsConfigSchema=e.object({core:e.boolean()}),AgentsConfigSchema=e.object({core:e.boolean()}),MCPConfigSchema=e.object({weave:e.boolean(),autoStart:e.boolean().default(!1)}),RuntimeConfigSchema=e.object({initVersion:e.string(),initTimestamp:e.string(),preset:PresetSchema,harnesses:e.array(i).optional(),components:InitComponentsSchema,hooks:HooksConfigSchema.partial().optional(),mcp:MCPConfigSchema.partial().optional()}),PlatformInfoSchema=e.object({os:e.enum(["windows","darwin","linux"]),arch:e.enum(["x64","arm64"]),nodeVersion:e.string(),shell:e.enum(["powershell","cmd","bash","zsh","sh"]),homeDir:e.string(),configDir:e.string()}),InitOptionsSchema=e.object({targetDir:e.string().default(process.cwd()),force:e.boolean().default(!1),interactive:e.boolean().default(!0),preset:PresetSchema.default("default"),harnesses:e.array(i).optional(),components:InitComponentsSchema.partial().default({}),hooks:HooksConfigSchema.partial().default({}),skills:SkillsConfigSchema.partial().default({}),commands:CommandsConfigSchema.partial().default({}),agents:AgentsConfigSchema.partial().default({}),mcp:MCPConfigSchema.partial().default({})}),InitResultSchema=e.object({success:e.boolean(),platform:PlatformInfoSchema,created:e.object({directories:e.array(e.string()),files:e.array(e.string())}),skipped:e.array(e.string()),merged:e.array(e.string()),updated:e.array(e.string()),errors:e.array(e.string()),removed:e.array(e.string()),summary:e.object({skillsCount:e.number(),commandsCount:e.number(),agentsCount:e.number(),hooksEnabled:e.number()})}),MINIMAL_COMPONENTS={settings:!0,skills:!0,commands:!1,agents:!1,helpers:!1,mcp:!1,claudeMd:!0,agentsMd:!0},DEFAULT_COMPONENTS={settings:!0,skills:!0,commands:!1,agents:!1,helpers:!0,mcp:!0,claudeMd:!0,agentsMd:!0},FULL_COMPONENTS={settings:!0,skills:!0,commands:!0,agents:!0,helpers:!0,mcp:!0,claudeMd:!0,agentsMd:!0},DEFAULT_HOOKS={preToolUse:!0,postToolUse:!0,userPromptSubmit:!0,sessionStart:!0,stop:!0,stopFailure:!0,subagentStop:!0,subagentStart:!0,notification:!0,postToolUseFailure:!0,permissionRequest:!0,permissionDenied:!0,preCompact:!0,sessionEnd:!0,preModelSwitch:!0,timeout:5e3,continueOnError:!0},DEFAULT_SKILLS={core:!0},DEFAULT_COMMANDS={core:!0},DEFAULT_AGENTS={core:!0},DEFAULT_MCP={weave:!1,autoStart:!1};export function resolveComponents(n,o){const t=n==="minimal"?MINIMAL_COMPONENTS:n==="full"?FULL_COMPONENTS:DEFAULT_COMPONENTS;return o?{...t,...o}:{...t}}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { AssetSurface } from '../driver.js';
|
|
2
|
+
/**
|
|
3
|
+
* `~/.claude.json` 解析不了就拒写:那是 Claude Code 自己的运行时文件,里面还有
|
|
4
|
+
* weave 不认识的键,宁可报错也不冒毁掉的风险。
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClaudeJsonCorruptError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
/** `~/.claude.json` 的整份读(含 MCP 之外的键);解析不了就抛,坏文件下任何
|
|
10
|
+
* 结论都不可信。 */
|
|
11
|
+
export declare function readClaudeJson(homedir: string): Promise<Record<string, unknown>>;
|
|
2
12
|
/**
|
|
3
13
|
* Claude Code 资产表面(批 4a 迁入):文件资产目标目录、skills 项目/全局根、
|
|
4
14
|
* 用户级配置路径、路径归属与 watch 观测集——原 `install/file-assets.ts`、
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{readFile as j,writeFile as u}from"node:fs/promises";import o from"node:path";import{FILE_ASSET_SPECS as m}from"../shared/file-specs.js";const l=".mcp.json",p=".claude.json";export class ClaudeJsonCorruptError extends Error{constructor(r){super(r),this.name="ClaudeJsonCorruptError"}}function f(e){if(!e||e.includes("/")||e.includes("\\")||e.includes(".."))throw new Error(`Invalid asset name: "${e}"`)}async function d(e){try{const r=JSON.parse(await j(e,"utf-8"));return r&&typeof r=="object"?r:{}}catch{return{}}}export async function readClaudeJson(e){const r=o.join(e,p);let c;try{c=await j(r,"utf-8")}catch{return{}}let t;try{t=JSON.parse(c)}catch(s){throw new ClaudeJsonCorruptError(`~/.claude.json is not valid JSON \u2014 refusing to write: ${s instanceof Error?s.message:String(s)}`)}if(!t||typeof t!="object"||Array.isArray(t))throw new ClaudeJsonCorruptError("~/.claude.json is not a JSON object \u2014 refusing to write");return t}export const CLAUDE_ASSETS={harness:"claude",targetDir(e,r,c,t){const s=m[e].dirs.claude;if(r==="user"){if(!s?.user)throw new Error(`"${e}" is project-scoped only (no user-level directory)`);return o.join(t,...s.user.split("/"))}if(!s?.project)throw new Error(`"${e}" has no Claude project surface`);return o.join(c,...s.project.split("/"))},projectSkillsDir:()=>".claude/skills",globalSkillsRoots:e=>[o.join(e,...".claude/skills".split("/"))],userConfigFile:e=>o.join(e,".claude","settings.json"),mcpScopes:()=>["project","user"],mcpDest:(e,r)=>e==="project"?".mcp.json":o.join(r,".claude.json"),pluginCacheDir:e=>o.join(e,".claude","plugins","cache"),async mcpRead(e,r,c){if(e==="project")return(await d(o.join(r,l))).mcpServers??{};const t=(await readClaudeJson(c)).mcpServers;return!t||typeof t!="object"||Array.isArray(t)?{}:t},async mcpWrite(e,r,c,t,s){if(f(t),e==="project"){const i=o.join(r,l),a=await d(i);a.mcpServers={...a.mcpServers??{},[t]:s},await u(i,`${JSON.stringify(a,null,2)}
|
|
2
|
+
`,"utf-8");return}const n=await readClaudeJson(c);n.mcpServers={...n.mcpServers??{},[t]:s},await u(o.join(c,p),`${JSON.stringify(n,null,2)}
|
|
3
|
+
`,"utf-8")},async mcpRemove(e,r,c,t){f(t);const s=e==="project"?o.join(r,l):o.join(c,p),n=e==="project"?await d(s):await readClaudeJson(c),i=n.mcpServers??{};return t in i?(delete i[t],n.mcpServers=i,await u(s,`${JSON.stringify(n,null,2)}
|
|
4
|
+
`,"utf-8"),!0):!1},classify(e){return e===".claude"||e.startsWith(".claude/")||e===".mcp.json"?!0:e.slice(e.lastIndexOf("/")+1)==="CLAUDE.md"},ignore(e){return e===".claude"||e.startsWith(".claude/")?e===".claude/projects"||e.startsWith(".claude/projects/")||e===".claude/cache"||e.startsWith(".claude/cache/"):e!==".mcp.json"&&e!=="CLAUDE.md"}};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Harness } from '@weavecode/core';
|
|
2
|
+
import type { CaptureDeps, CaptureScriptHealth, CaptureState, CaptureSurface } from '../driver.js';
|
|
2
3
|
/**
|
|
3
4
|
* weave 采集集成(hook-handler 脚本 + settings hooks 组)的 claude 实现——
|
|
4
5
|
* tool-object-model §2.6 基石:user 档安装/启用面(跨项目采集,不依赖逐项目
|
|
@@ -8,9 +9,10 @@ import type { CaptureDeps, CaptureState, CaptureSurface } from '../driver.js';
|
|
|
8
9
|
/**
|
|
9
10
|
* hook-handler 脚本(跨端契约正文见脚本头注释)。version 只作脚本内的 weave
|
|
10
11
|
* 版本标记(`@version weave@<version>`,weave 特性文件的覆写判据),由调用方
|
|
11
|
-
* 传入——harness 包不依赖 server(版本常量在那边)。
|
|
12
|
+
* 传入——harness 包不依赖 server(版本常量在那边)。harness = 这份脚本自己
|
|
13
|
+
* 归属的 harness:镜像里同时躺着同项目各 harness 的注入规则,脚本按此过滤。
|
|
12
14
|
*/
|
|
13
|
-
export declare function generateHookHandler(version: string): string;
|
|
15
|
+
export declare function generateHookHandler(version: string, harness?: Harness): string;
|
|
14
16
|
/**
|
|
15
17
|
* weave 采集组的路径段判据:weave 的 hook 命令永远指向某个 `.claude/helpers/
|
|
16
18
|
* hook-handler.cjs`(项目档与 user 档同形),命令含该段即 weave 组;用户
|
|
@@ -35,6 +37,16 @@ export declare function sweepWeaveHookEvents(hooks: unknown): Record<string, unk
|
|
|
35
37
|
/** settings 里是否已有 weave 采集组(user 档 installed 判据)。 */
|
|
36
38
|
export declare function captureGroupsPresent(settings: unknown): boolean;
|
|
37
39
|
export declare function readUserCapture(deps?: CaptureDeps): Promise<CaptureState>;
|
|
40
|
+
/**
|
|
41
|
+
* 生效采集脚本的健康(诊断面只读):与运行时同判据取「哪一支在 firing」——
|
|
42
|
+
* user settings 里有采集组 = user 档脚本;否则项目档(给了 `projectPath` 才看得到);
|
|
43
|
+
* 两支都指不到 = none。`source` 是**生效分支**(不是「文件在不在」,后者是 `present`)。
|
|
44
|
+
* 判的是正文「会不会上报」而非「能不能跑」:脚本是旧版 weave 生成的(升级 npm
|
|
45
|
+
* 包不会重写它)就不含凭据上报,dashboard 于是永远收不到 inbox 目标。
|
|
46
|
+
*/
|
|
47
|
+
export declare function readScriptHealth(deps?: CaptureDeps & {
|
|
48
|
+
projectPath?: string;
|
|
49
|
+
}): Promise<CaptureScriptHealth>;
|
|
38
50
|
/**
|
|
39
51
|
* user 档采集安装(幂等):user 级 hook-handler 脚本 + `~/.claude/settings.json`
|
|
40
52
|
* 的 weave 采集组(marker 清扫后并入,用户其余键永不动)。脚本锚点在 cwd/token,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{homedir as
|
|
1
|
+
import{homedir as l}from"node:os";import{access as k,mkdir as E,readFile as f,unlink as A,writeFile as h}from"node:fs/promises";import o from"node:path";import{HARNESS_DIRS as d,HARNESS_EVENTS as C,INJECTABLE_EVENTS as S,TERMINAL_LOCATOR_ENV_KEYS as w}from"@weavecode/core";import{CLAUDE_PROMPT_INBOX as v}from"./prompt-inbox.js";export function generateHookHandler(e,t="claude"){return`#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* weave hook-handler \u2014 collects Claude Code hook events into the global weave
|
|
4
4
|
* data directory and renders locally-mirrored injections. No network, no
|
|
@@ -36,13 +36,14 @@ const TITLE_EVENTS = ['SessionStart', 'UserPromptSubmit'];
|
|
|
36
36
|
// Terminal pane locator env (mirrors TERMINAL_LOCATOR_ENV_KEYS in @weavecode/core):
|
|
37
37
|
// captured in the pane's own child process and reported on the inbox line's side
|
|
38
38
|
// channel, so the daemon can address THIS session's pane exactly.
|
|
39
|
-
const TERMINAL_ENV_KEYS = ${JSON.stringify(
|
|
39
|
+
const TERMINAL_ENV_KEYS = ${JSON.stringify(w)};
|
|
40
40
|
const INBOX_MAX_BYTES = 4 * 1024 * 1024;
|
|
41
41
|
const INBOX_MAX_LINES = 1000;
|
|
42
42
|
const OUTBOX_MAX_LINES = 200;
|
|
43
43
|
const DEDUPE_WINDOW_MS = 60000;
|
|
44
44
|
const DISPATCH_MARKER = '<!--weave-dispatch-->';
|
|
45
45
|
const MIRROR_VERSION = 1;
|
|
46
|
+
const OWN_HARNESS = ${JSON.stringify(t)};
|
|
46
47
|
|
|
47
48
|
// Ultimate safety net: never let this process outlive the hook window.
|
|
48
49
|
const GUARD = setTimeout(function () { process.exit(0); }, HOOK_GUARD_MS);
|
|
@@ -79,9 +80,9 @@ function hooksDir() {
|
|
|
79
80
|
// \u8BE5\u4F1A\u8BDD\u7684 hooks \u4E0E Bash\uFF09\uFF1Adaemon \u4FA7\u53EA\u653E\u5185\u5B58\u3001\u4E0D\u843D\u5E93\u4E0D\u8FDB UI \u2014\u2014 \u4E0A\u62A5\u8D70 inbox
|
|
80
81
|
// \u884C\u7684\u65C1\u8DEF\u5B57\u6BB5\uFF08\u4E0D\u8FDB report/payload\uFF09\u3002
|
|
81
82
|
function messagingEnv() {
|
|
82
|
-
var sock = process.env.${
|
|
83
|
+
var sock = process.env.${v.socketEnv};
|
|
83
84
|
if (!sock) return null;
|
|
84
|
-
return { socket: sock, token: process.env.${
|
|
85
|
+
return { socket: sock, token: process.env.${v.tokenEnv} || null };
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
// \u7EC8\u7AEF\u628A\u300C\u672C pane\u300D\u5BFC\u51FA\u7684\u73AF\u5883\u53D8\u91CF\uFF08wezterm \u7B49\uFF09\u3002\u672C\u8FDB\u7A0B\u751F\u5728\u4F1A\u8BDD\u81EA\u5DF1\u7684 pane \u91CC\uFF0C
|
|
@@ -311,7 +312,7 @@ async function main() {
|
|
|
311
312
|
|
|
312
313
|
// 1. Collection first: a kill mid-injection still leaves the event on disk.
|
|
313
314
|
appendInbox(path.join(hooksDir(), 'inbox'), token, {
|
|
314
|
-
source:
|
|
315
|
+
source: OWN_HARNESS,
|
|
315
316
|
eventType: eventType,
|
|
316
317
|
sessionId: sessionId,
|
|
317
318
|
cwd: parsed.cwd || projectDir,
|
|
@@ -334,7 +335,12 @@ async function main() {
|
|
|
334
335
|
var dirty = false;
|
|
335
336
|
for (var i = 0; i < mirror.rules.length; i++) {
|
|
336
337
|
var rule = mirror.rules[i];
|
|
337
|
-
if (!rule
|
|
338
|
+
if (!rule) continue;
|
|
339
|
+
// \u955C\u50CF\u6309\u9879\u76EE\u5206\u7247\u3001\u540C\u9879\u76EE\u5404 harness \u5171\u8BFB\u4E00\u4EFD\uFF0C\u6545\u89C4\u5219\u81EA\u5E26\u5F52\u5C5E\u7968\uFF08\u7F3A\u7701 = \u8001
|
|
340
|
+
// \u955C\u50CF/\u8001 daemon \u5199\u7684\u90A3\u79CD\uFF0C\u5F53\u5E74\u53EA\u6709 claude \u4F1A\u8FDB\u955C\u50CF\uFF09\u3002
|
|
341
|
+
var owner = rule.harness || 'claude';
|
|
342
|
+
if (owner !== 'any' && owner !== OWN_HARNESS) continue;
|
|
343
|
+
if (!Array.isArray(rule.events) || rule.events.indexOf(eventType) === -1) continue;
|
|
338
344
|
if (rule.tools && (!toolName || rule.tools.indexOf(toolName) === -1)) continue;
|
|
339
345
|
if (rule.globs && rule.globs.length > 0) {
|
|
340
346
|
if (!filePath || !matchAnyGlob(filePath, rule.globs)) continue;
|
|
@@ -375,6 +381,6 @@ async function main() {
|
|
|
375
381
|
}
|
|
376
382
|
|
|
377
383
|
main().catch(function () { process.exit(0); });
|
|
378
|
-
`}export const HOOK_HANDLER_MARKER=".claude/helpers/hook-handler.cjs";function
|
|
379
|
-
`,"utf-8")}export async function readUserCapture(e={}){const t=e.home??
|
|
380
|
-
`,"utf-8")}export async function uninstallUserCapture(e={}){const t=e.home??
|
|
384
|
+
`}export const HOOK_HANDLER_MARKER=".claude/helpers/hook-handler.cjs";function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function D(e){return e.replace(/\\/g,"/")}export function groupIsWeave(e){if(!c(e))return!1;const t=e.hooks;return Array.isArray(t)?t.some(r=>c(r)&&typeof r.command=="string"&&D(r.command).includes(HOOK_HANDLER_MARKER)):!1}export function captureHookGroup(e,t){const r=`node "${D(t)}/hook-handler.cjs"`,u=!S.claude.includes(e);return[{matcher:"*",hooks:[{type:"command",command:r,...u?{async:!0}:{}}]}]}export function sweepWeaveHookEvents(e){if(!c(e))return;const t={};for(const[r,u]of Object.entries(e)){if(!Array.isArray(u)){t[r]=u;continue}const i=u.filter(s=>!groupIsWeave(s));i.length>0&&(t[r]=i)}return Object.keys(t).length>0?t:void 0}export function captureGroupsPresent(e){if(!c(e))return!1;const t=e.hooks;return c(t)?Object.values(t).some(r=>Array.isArray(r)&&r.some(groupIsWeave)):!1}function F(e){return o.join(e,d.claude.userDir,"settings.json")}function p(e){return o.join(e,d.claude.userDir,"helpers")}const y="@version weave@";async function j(e){try{return await k(e),!0}catch{return!1}}async function m(e){let t;try{t=await f(e,"utf-8")}catch{return{}}let r;try{r=JSON.parse(t)}catch{throw new Error(`user settings is not parseable JSON: ${e}`)}if(!c(r))throw new Error(`user settings is not a JSON object: ${e}`);return r}async function g(e){let t;try{t=await m(e)}catch{return}const r=sweepWeaveHookEvents(t.hooks);r===void 0?delete t.hooks:t.hooks=r,await E(o.dirname(e),{recursive:!0}),await h(e,JSON.stringify(t,null,2)+`
|
|
385
|
+
`,"utf-8")}export async function readUserCapture(e={}){const t=e.home??l(),r=await m(F(t));return{installed:captureGroupsPresent(r),helperPresent:await j(o.join(p(t),"hook-handler.cjs"))}}export async function readScriptHealth(e={}){const t=e.home??l(),r=o.join(p(t),"hook-handler.cjs"),u=e.projectPath?o.join(e.projectPath,d.claude.projectDir,"helpers","hook-handler.cjs"):null,i=(await readUserCapture({home:t})).installed,s=i?"user":u?"project":"none",a=i?r:u??r;let n=null;try{n=await f(a,"utf-8")}catch{n=null}return{source:s,present:n!==null,weaveOwned:n!==null&&n.includes(y),generatedVersion:n?.match(/@version weave@(\S+)/)?.[1]??null,reportsInbox:n!==null&&n.includes(v.socketEnv),reportsPaneEnv:n!==null&&n.includes("terminalEnv()")}}export async function installUserCapture(e){const t=e.home??l(),r=p(t);await E(r,{recursive:!0}),await h(o.join(r,"hook-handler.cjs"),generateHookHandler(e.version),"utf-8");const u=F(t),i=await m(u),s=sweepWeaveHookEvents(i.hooks)??{};for(const a of C.claude){const n=s[a];s[a]=Array.isArray(n)?[...n,...captureHookGroup(a,r)]:captureHookGroup(a,r)}i.hooks=s,await E(o.dirname(u),{recursive:!0}),await h(u,JSON.stringify(i,null,2)+`
|
|
386
|
+
`,"utf-8")}export async function uninstallUserCapture(e={}){const t=e.home??l();await g(F(t));const r=o.join(p(t),"hook-handler.cjs");try{(await f(r,"utf-8")).includes(y)&&await A(r)}catch{}}export async function stripProjectCapture(e){await g(o.join(e,d.claude.projectDir,"settings.json"))}export const CLAUDE_CAPTURE={harness:"claude",readUserCapture:e=>readUserCapture(e),installUserCapture:e=>installUserCapture(e),uninstallUserCapture:e=>uninstallUserCapture(e),stripProjectCapture,scriptHealth:e=>readScriptHealth(e)};
|
|
@@ -38,7 +38,7 @@ export declare function expandPayloadRefs(payload: Record<string, unknown>): Rec
|
|
|
38
38
|
export declare class ClaudeEventSource implements EventSource {
|
|
39
39
|
readonly source: "claude";
|
|
40
40
|
/** 采集面事件表(批 1 下沉 core 的 HARNESS_EVENTS.claude;旧 HookAdapter 无此字段)。 */
|
|
41
|
-
readonly events: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SessionStart", "Stop", "SubagentStop", "Notification", "PreCompact"];
|
|
41
|
+
readonly events: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SessionStart", "Stop", "StopFailure", "SubagentStop", "Notification", "PostToolUseFailure", "PermissionRequest", "PermissionDenied", "SubagentStart", "PreCompact", "SessionEnd", "PreModelSwitch", "PostModelSwitch"];
|
|
42
42
|
normalize(report: ClaudeHookReport, projectId: number): ClaudeHookEventInput;
|
|
43
43
|
}
|
|
44
44
|
/** 事件接入实例(driver events 槽消费;normalize 无状态,单例安全)。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HARNESS_EVENTS as
|
|
1
|
+
import{HARNESS_EVENTS as l}from"@weavecode/core";function u(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function c(e,...t){for(const n of t)if(e[n]!=null)return e[n];return null}const f=[["toolName",["tool_name","toolName"]],["toolInput",["tool_input","toolInput"]],["toolResponse",["tool_response","toolResponse"]],["cwd",["cwd"]],["transcriptPath",["transcript_path","transcriptPath"]]],d=/^<\$\.([A-Za-z0-9_]+(?:\.[A-Za-z0-9_]+)*)>$/,p=4e3,y=200;function i(e){if(typeof e=="string")return e.length>p?`${e.slice(0,p)}\u2026`:e;if(Array.isArray(e))return e.slice(0,y).map(i);if(e&&typeof e=="object"){const t={};for(const[n,o]of Object.entries(e))t[n]=i(o);return t}return e}function _(e){const t={...e};for(const[n,o]of f)for(const r of o)r in t&&(t[r]=`<$.${n}>`);return t}export function expandPayloadRefs(e){const t=e.raw;if(!t||typeof t!="object"||Array.isArray(t))return e;const n={...t};for(const[o,r]of Object.entries(n)){const a=typeof r=="string"?d.exec(r):null;a&&(n[o]=g(e,a[1]))}return{...e,raw:n}}function g(e,t){let n=e;for(const o of t.split(".")){if(!n||typeof n!="object")return null;n=n[o]}return n??null}export class ClaudeEventSource{source="claude";events=l.claude;normalize(t,n){const o=u(t.payload),r=t.eventType||String(o.hook_event_name??"unknown"),a=t.sessionId??c(o,"session_id","sessionId"),s={eventType:r,toolName:c(o,"tool_name","toolName"),toolInput:i(c(o,"tool_input","toolInput")),toolResponse:i(c(o,"tool_response","toolResponse")),cwd:t.cwd??c(o,"cwd"),transcriptPath:c(o,"transcript_path","transcriptPath"),raw:_(o)};return{projectId:n,source:"claude",eventType:r,sessionId:a??void 0,payload:JSON.stringify(s)}}}export const CLAUDE_EVENT_SOURCE=new ClaudeEventSource;export function frameFacts(e){const t=e?.raw,n=t&&typeof t=="object"&&typeof t.agent_id=="string"?t.agent_id:void 0;let o;if(e?.eventType==="PostToolUse"&&e.toolName==="Agent"){const s=e.toolResponse;s?.isAsync&&typeof s.agentId=="string"&&(o=s.agentId)}let r;Array.isArray(t&&typeof t=="object"?t.background_tasks:void 0)&&(r=t.background_tasks.filter(s=>s&&typeof s.id=="string"&&typeof s.status=="string").map(s=>({id:s.id,status:s.status})));const a={};return n&&(a.agentId=n),o&&(a.spawnAgentId=o),r&&(a.backgroundTasks=r),a}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function generateAutoMemoryHook(e){return`#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* weave auto-memory-hook
|
|
4
|
+
* Triggered on UserPromptSubmit to record user context.
|
|
5
|
+
* @version weave@${e}
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const chunks = [];
|
|
10
|
+
process.stdin.on('data', (c) => chunks.push(c));
|
|
11
|
+
process.stdin.on('end', () => {
|
|
12
|
+
try {
|
|
13
|
+
const input = JSON.parse(Buffer.concat(chunks).toString('utf-8'));
|
|
14
|
+
process.stderr.write('[weave] auto-memory: session active\\n');
|
|
15
|
+
} catch {
|
|
16
|
+
// ignore
|
|
17
|
+
}
|
|
18
|
+
process.exit(0);
|
|
19
|
+
});
|
|
20
|
+
`}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HarnessDriver } from '../driver.js';
|
|
2
2
|
export { ClaudeEventSource, CLAUDE_EVENT_SOURCE, frameFacts, expandPayloadRefs } from './event-source.js';
|
|
3
3
|
export type { ClaudeFrameFacts, FramePayloadLike } from './event-source.js';
|
|
4
|
+
export { CLAUDE_ASSETS, ClaudeJsonCorruptError, readClaudeJson } from './assets.js';
|
|
4
5
|
export { CLAUDE_PLUGINS, createClaudePluginSurface, WEAVE_MARKETPLACE } from './plugins.js';
|
|
5
6
|
export type { PluginExecutor, PluginExecResult } from './plugins.js';
|
|
6
7
|
export { CLAUDE_PLUGIN_STATE } from './plugin-state.js';
|
|
@@ -10,9 +11,17 @@ export { CLAUDE_MESSAGING } from './messaging.js';
|
|
|
10
11
|
export { CLAUDE_BLOCKING_PROMPT } from './questions.js';
|
|
11
12
|
export { CLAUDE_PROMPT_RELAY } from './prompt.js';
|
|
12
13
|
export { CLAUDE_PROMPT_INBOX } from './prompt-inbox.js';
|
|
13
|
-
export {
|
|
14
|
+
export { CLAUDE_SIDE_QUESTION } from './side-question.js';
|
|
15
|
+
export { interruptMarkerAt, currentModelAt, currentModeAt } from './transcript.js';
|
|
16
|
+
export { modelAliasTargets, aliasOfModel, startedModelOf, switchedModelOf, effortLevelOf, type ModelAliasTarget } from './model-aliases.js';
|
|
14
17
|
export { resolveClaudePeer } from './peers.js';
|
|
15
18
|
export { CLAUDE_CAPTURE, generateHookHandler, captureHookGroup, sweepWeaveHookEvents, groupIsWeave, captureGroupsPresent, readUserCapture, installUserCapture, uninstallUserCapture, stripProjectCapture, HOOK_HANDLER_MARKER, } from './capture.js';
|
|
19
|
+
export { generateSettingsJson, mergeSettingsJson, stripWeaveSettings, type SettingsGeneratorInput, } from './settings-gen.js';
|
|
20
|
+
export { generateMcpJson, mergeMcpJson, stripWeaveMcp, type McpGeneratorInput } from './mcp-gen.js';
|
|
21
|
+
export { generateAutoMemoryHook } from './helpers-gen.js';
|
|
22
|
+
export { CLAUDE_STATUSLINE } from './statusline/surface.js';
|
|
23
|
+
export { generateStatuslineScript, type GenerateStatuslineOptions, } from './statusline/generator.js';
|
|
24
|
+
export * from './statusline/config.js';
|
|
16
25
|
/**
|
|
17
26
|
* Claude 接入模块的驱动:批 4a 补 assets、批 4b 补 events/resume、批 5 补
|
|
18
27
|
* detect、批 3 补 plugins、P2 补 pluginState、session-orchestration 批 1 补
|