@weavecode/weave 0.1.6 → 0.1.8
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/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@weavecode/cli/dist/cli.js +3 -3
- 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.js +2 -2
- 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 +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +1 -0
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +2 -2
- 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 +3 -3
- 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/instruction-link.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/provision.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/package.json +5 -5
- package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
- package/node_modules/@weavecode/core/dist/harness.d.ts +89 -0
- 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/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 +4 -4
- package/node_modules/@weavecode/harness/dist/claude/capture.js +9 -9
- package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
- package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
- package/node_modules/@weavecode/harness/dist/claude/config.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/edits.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/images.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/liveness.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/narration.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/plan.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 -2
- package/node_modules/@weavecode/harness/dist/claude/resume.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/rewind.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/side-question.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +14 -14
- package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/transcript.js +7 -7
- package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/capture.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/commands.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/config.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/event-source.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/images.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/liveness.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/messaging.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/narration.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/plugins.js +3 -3
- package/node_modules/@weavecode/harness/dist/codex/provision.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/questions.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/rollout.js +5 -5
- package/node_modules/@weavecode/harness/dist/codex/side-question.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/titles.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/toml.js +13 -13
- package/node_modules/@weavecode/harness/dist/codex/transcript.js +2 -2
- package/node_modules/@weavecode/harness/dist/driver.d.ts +13 -0
- package/node_modules/@weavecode/harness/dist/driver.js +1 -1
- package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
- package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -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/dist/shared/json-cap.js +1 -1
- package/node_modules/@weavecode/harness/package.json +2 -2
- package/node_modules/@weavecode/server/dist/config/dotted.js +1 -1
- package/node_modules/@weavecode/server/dist/config/profiles.js +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.js +3 -3
- 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/config-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/cron.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/dashboard-pusher.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/data-bus.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/decision-config.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/entry.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -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/liveness.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/mcp-orchestration.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/narration-watcher.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-ghostty.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-iterm.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-konsole.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-terminal-app.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-wezterm.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/backend-wt.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/backend.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/pty-terminals.js +4 -4
- package/node_modules/@weavecode/server/dist/daemon/opener/shared.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/wezterm-mux.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/wt.js +3 -3
- package/node_modules/@weavecode/server/dist/daemon/opener.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +6 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
- package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/prompt-images.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/hooks-admin.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/market.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/orchestration.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/path-refs.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/project-files.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/projects.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/search.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/session-control.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/session-insights.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/uploads.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/watches.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/server.d.ts +2 -0
- package/node_modules/@weavecode/server/dist/daemon/server.js +8 -8
- package/node_modules/@weavecode/server/dist/daemon/session-open.d.ts +17 -0
- package/node_modules/@weavecode/server/dist/daemon/session-open.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -1
- 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.js +1 -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/daemon/upload-sessions.js +1 -1
- package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
- package/node_modules/@weavecode/server/dist/db/db.js +2 -2
- package/node_modules/@weavecode/server/dist/db/layout.js +1 -1
- 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/dashboard-rate.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/decision-judge.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/channels.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/keys.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/queue.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/relay.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/send.js +2 -2
- package/node_modules/@weavecode/server/dist/hooks/delivery/views.d.ts +3 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/views.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
- package/node_modules/@weavecode/server/dist/hooks/edge-extract.js +1 -1
- 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.js +2 -2
- 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.js +5 -5
- package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
- package/node_modules/@weavecode/server/dist/hooks/orchestration-engine.js +7 -7
- package/node_modules/@weavecode/server/dist/hooks/orchestration-graph.js +1 -1
- 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.js +8 -8
- package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
- 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/session-purge.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/synthetic-sessions.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
- 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/index.js +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.js +1 -1
- package/node_modules/@weavecode/server/dist/install/global-config.js +1 -1
- package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
- package/node_modules/@weavecode/server/dist/install/init-files.js +2 -2
- package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
- package/node_modules/@weavecode/server/dist/install/installer.js +1 -1
- 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.js +1 -1
- 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.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 +6 -0
- package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
- 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/orchestrations.js +7 -7
- package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
- 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.js +2 -2
- package/node_modules/@weavecode/server/dist/repositories/uploads.js +11 -11
- package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
- package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -1
- package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -3
- 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.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/abnfDiagram-WEYOIA3C-t5OQjhuS.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{arc-DH8-rYAa.js → arc-De-uH_Q9.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-ImPclD43.js +36 -0
- package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-pT5eO-cB.js → blockDiagram-RJAE7QA3-B5xEQs6X.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-DHDBDMb1.js → c4Diagram-XDPPPE54-DP8MjIgJ.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/channel-C0RGiobt.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-CT951PH5.js → chunk-2E7WHVMD-C3UFIDyj.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-E5AD7_ZY.js → chunk-2Q5K7J3B-Bgw-3YfG.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-DWz9qkcy.js → chunk-4EMNKR2T-Dy_Wq9qn.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D32C0DXX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-ci6YzbO5.js → chunk-5VM5RSS4-Dpmi-9Gi.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-CY4mr2f4.js → chunk-JWPE2WC7-CEYXaZDX.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CON8zyg8.js → chunk-VQ5W62QI-A616Pgzo.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-CnxFMLWV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-BhjCTig8.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-GiWZ9xtF.js → classDiagram-v2-4MYWR3UA-rzlq5tPv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-CxWQXzj8.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-9B__MaRM.js → cynefin-EF2NZ3EQ-AFHjx2wU.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-Bp_Oaf9U.js +62 -0
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-7oUPIU35.js +4 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D_rS_rSY.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Duc_cKMb.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-CckywF4W.js → diagram-ODIL2UCW-DA0XFVXm.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-Dpjlc7Wh.js → diagram-PFBEJUXE-D1U0Xhtt.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-CbDFY871.js +41 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-DgRJ3zL1.js → diagram-TYUNFSNR-jPg9AxQv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-ZHfGTB0N.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-Ch6Gs9G9.js → elk-QONTBCTQ-C-ESJrUi.js} +3 -3
- package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-COxT-Pxb.js → erDiagram-KYQIGQAA-DGK7TeHj.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-CJVWnTBa.js → flowDiagram-IUGLLWBU-CVV4rL8v.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-CuAwNvbm.js +292 -0
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-D_15Wtf-.js +106 -0
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-ClqhbrCa.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-BNjEDIZy.js → ishikawaDiagram-HPEHV2GE-CUJ891JX.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-Cao6h91a.js → journeyDiagram-BOSHW7O7-B4skiMu-.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-CXIx2CHQ.js → kanban-definition-FNSA4HC5-UNGJR_y_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-BEB-UwbR.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-B_0jS_Gz.js +1096 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-Czzlavi4.css +11 -0
- package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D39fi_iR.js → mermaid.core-knGXJfjz.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-DHqpz_AK.js → mindmap-definition-6OY57UG3-CEldbr3a.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-cNCkGLx3.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pet-DJCpIDM5.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-CfMEFiQD.js +39 -0
- package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-zSM6o7mB.js → quadrantDiagram-D57K4MC3-knmi2rwP.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-BJ7AzhEo.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-CbCLBjHf.js → requirementDiagram-EQYSW5RA-Dte2LGQM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-BucVk6EP.js → sankeyDiagram-SY24JHO5-3noLaWgd.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-Dg8CYEnT.js → sequenceDiagram-BLEHNHQU-CclOWTTc.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-B82sbLhA.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-BvK2l3is.js → stateDiagram-v2-A6IESKWZ-BXfVDwSN.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-D4lKZaeV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DbdFh_d6.js +8 -0
- package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-CadU4Qq4.js → timeline-definition-JXYKGLGB-D6H6zP5b.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-BYuZwTDZ.js → usecaseDiagram-WPOLBNNX-D2J2bKo_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-C7zgxe07.js → vennDiagram-Q3Y3IDCW-pdRbIkpB.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-DA4Otf4s.js → wardleyDiagram-IVAIDKWA-Cyd2QPMf.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-Bs5YGwMU.js → xychartDiagram-4URNHDU4-Bd4BkwVM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/icons/apple-touch-icon.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-192.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-512.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-maskable-512.png +0 -0
- package/node_modules/@weavecode/server/web/dist/index.html +12 -2
- package/node_modules/@weavecode/server/web/dist/manifest.webmanifest +16 -0
- package/node_modules/@weavecode/server/web/dist/pet.html +60 -0
- package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
- package/node_modules/@weavecode/templates/dist/index.js +1 -1
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/scripts/assemble-pet.mjs +308 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
- package/node_modules/@weavecode/templates/package.json +2 -2
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/README.md +3 -8
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/package.json +1 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.d.ts +4 -2
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.js +10 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.mjs +10 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.js +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/README.md +3 -8
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/package.json +1 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.d.ts +4 -2
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.js +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.mjs +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.js +10 -1
- package/package.json +11 -7
- package/scripts/preinstall.mjs +70 -0
- package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-CbIFQh0R.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-qnv6S0sc.js +0 -36
- package/node_modules/@weavecode/server/web/dist/assets/channel-BHPeeuzN.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D-SgWD8w.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-DXXXZ4pW.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-CukvPvkM.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-D7aJ-akq.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-B2ujZh2k.js +0 -62
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-nHaB6IWf.js +0 -4
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-xKfjDvgr.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-BHT2-5mY.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-M6WznOaW.js +0 -41
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-BzzVN__a.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-BkRpWPUl.js +0 -292
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-Ba8BJcvZ.js +0 -106
- package/node_modules/@weavecode/server/web/dist/assets/index-CtifxEiF.css +0 -11
- package/node_modules/@weavecode/server/web/dist/assets/index-FwH9INgS.js +0 -1090
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-HTQ5FUNK.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-65WmlvQb.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-Cpy1nsER.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-B1IyNqzr.js +0 -39
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-oM4XJIwA.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-C51zb7Oc.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Ds7QOfXW.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-ByBF02UJ.js +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import s from"node:path";import{lstat as
|
|
2
|
-
`,"utf-8"),this.result.modifiedFiles.push(c)):(await m(c),this.result.removedFiles.push(c))}const h=s.join(e,".gitignore");await
|
|
3
|
-
`,"utf-8"),this.result.modifiedFiles.push(t)):(await m(t),this.result.removedFiles.push(t))}async sweepInstructionFiles(t){for(const i of[...
|
|
4
|
-
`,"utf-8"),this.result.modifiedFiles.push(e))}}if(t&&!await
|
|
5
|
-
`).map(
|
|
6
|
-
`))
|
|
1
|
+
import s from"node:path";import{lstat as T,readdir as _,readFile as G,rm as O,rmdir as W,unlink as m,writeFile as v}from"node:fs/promises";import{HARNESS_DIRS as x,HARNESS_KEYS as N,INSTRUCTION_FILES as S,logger as H}from"@weavecode/core";import{hashFile as C,projectPackFiles as U,unregisterProject as B}from"@weavecode/server";import{templateRegistry as F}from"@weavecode/templates";import{stripWeaveSettings as L}from"./settings-gen.js";import{stripWeaveMcp as V}from"./mcp-gen.js";import{WEAVE_BLOCK_START as J,WEAVE_BLOCK_END as R,WEAVE_MANAGED_HEADER as K}from"./claudemd-gen.js";import{WEAVE_HELPER_MARKER as q}from"./harnesses/claude.js";import{registerPluginTemplates as z}from"./plugin-templates.js";import{NESTED_GITIGNORE as Y}from"./executor.js";import{COMMIT_MESSAGE as $,findGitRepoRoot as Q,defaultGitExec as X}from"./git-commit.js";import{t as Z}from"../i18n/index.js";const tt="chore: weave uninstall \u79FB\u9664 init \u751F\u6210\u7269",k=S[1],et=[...S,".mcp.json",...N.map(n=>x[n].projectDir),".weave"];async function D(n){try{return await T(n),!0}catch{return!1}}async function p(n){try{return await G(n,"utf-8")}catch{return null}}async function b(n){const t=await p(n);if(t!==null)try{const i=JSON.parse(t);if(i&&typeof i=="object"&&!Array.isArray(i))return i}catch{}}async function j(n){const t=[];let i;try{i=await _(n,{withFileTypes:!0})}catch{return t}for(const e of i){const a=s.join(n,e.name);e.isDirectory()?t.push(...await j(a)):t.push(a)}return t}async function it(n,t){const[i,e]=await Promise.all([p(n),p(t)]);return i!==null&&i===e}async function A(n,t,i){let e=n;const a=s.resolve(t);for(;;){if(s.resolve(e)===a||!e.startsWith(a+s.sep))return;try{await W(e),i.push(e)}catch{return}e=s.dirname(e)}}class st{targetDir;execGit;dbPath;hooksDir;result;constructor(t){this.targetDir=s.resolve(t.targetDir),this.execGit=t.execGit??X,this.dbPath=t.dbPath,this.hooksDir=t.hooksDir,this.result={status:"ok",removedFiles:[],removedDirs:[],modifiedFiles:[],keptUserFiles:[],git:"no-changes",server:{outcome:"absent"}}}async run(){const t=s.join(this.targetDir,".weave");if(!await D(t))return this.result.status="not-initialized",this.unregisterFromServer(),this.result;const i=await U(this.targetDir),e=await rt(t);let a=[];try{a=(await z(this.targetDir)).registered}catch(r){H.warn(Z("uninstall.pluginScanFailed",{error:String(r)}))}for(const r of N)await this.sweepHarness(r,a);return await this.sweepMcp(),await this.sweepInstructionFiles(e),await this.sweepPackFiles(i),await O(t,{recursive:!0,force:!0}),this.result.removedDirs.push(t),await this.runGit(),this.unregisterFromServer(),this.result}unregisterFromServer(){try{const t=B(this.targetDir,this.dbPath,this.hooksDir);t&&(this.result.server={outcome:"removed",name:t.name,purged:t.purged})}catch(t){this.result.server={outcome:"failed",error:t instanceof Error?t.message:String(t)}}}async sweepHarness(t,i){const e=s.join(this.targetDir,x[t].projectDir);if(!await D(e))return;const a=s.join(e,"helpers");for(const o of await j(a)){const u=await p(o);u!==null&&u.includes(q)?(await m(o),this.result.removedFiles.push(o)):this.result.keptUserFiles.push(o)}const r=[["skills",F.getSkillsSourceDir()],["commands",F.getCommandsSourceDir()],["agents",F.getAgentsSourceDir()]];for(const[o,u]of r)u&&await this.removeTemplateMirrors(s.join(e,o),u);for(const o of i){const u=o.sourcePath;if(o.category==="skill")await this.removeTemplateMirrors(s.join(e,"skills",s.basename(u)),u);else{const y=o.category==="command"?"commands":"agents",l=s.join(e,y,s.basename(u));await this.removeIfSame(l,u)}}const c=s.join(e,"settings.json"),f=await b(c);if(f){const o=L(f);Object.keys(o).length>0?(await v(c,JSON.stringify(o,null,2)+`
|
|
2
|
+
`,"utf-8"),this.result.modifiedFiles.push(c)):(await m(c),this.result.removedFiles.push(c))}const h=s.join(e,".gitignore");await p(h)===Y&&(await m(h),this.result.removedFiles.push(h));for(const o of["helpers","skills","commands","agents"])await A(s.join(e,o),this.targetDir,this.result.removedDirs);await A(e,this.targetDir,this.result.removedDirs)}async removeTemplateMirrors(t,i){for(const e of await j(i)){const a=s.relative(i,e);await this.removeIfSame(s.join(t,a),e)}}async removeIfSame(t,i){await D(t)&&(await it(t,i)?(await m(t),this.result.removedFiles.push(t)):this.result.keptUserFiles.push(t))}async sweepMcp(){const t=s.join(this.targetDir,".mcp.json"),i=await b(t);if(!i)return;const e=V(i);Object.keys(e).length>0?(await v(t,JSON.stringify(e,null,2)+`
|
|
3
|
+
`,"utf-8"),this.result.modifiedFiles.push(t)):(await m(t),this.result.removedFiles.push(t))}async sweepInstructionFiles(t){for(const i of[...S].reverse()){const e=s.join(this.targetDir,i);let a;try{a=await T(e)}catch{continue}if(a.isSymbolicLink()){await m(e),this.result.removedFiles.push(e);continue}if(!a.isFile())continue;const r=await p(e);if(r===null)continue;if(r.includes(K)){await m(e),this.result.removedFiles.push(e);continue}const c=r.indexOf(J),f=r.indexOf(R);if(c!==-1&&f!==-1&&f>c){const h=(r.slice(0,c)+r.slice(f+R.length)).replace(/\s+$/,"");h===""?(await m(e),this.result.removedFiles.push(e)):(await v(e,h+`
|
|
4
|
+
`,"utf-8"),this.result.modifiedFiles.push(e))}}if(t&&!await D(s.join(this.targetDir,k))){const i=await p(t);i!==null&&(await v(s.join(this.targetDir,k),i,"utf-8"),this.result.restoredFromBackup=s.join(this.targetDir,k))}}async sweepPackFiles(t){for(const[e,a]of t){const r=s.resolve(this.targetDir,e);r!==this.targetDir&&!r.startsWith(this.targetDir+s.sep)||(await C(r)===a?(await m(r).catch(()=>{}),this.result.removedFiles.push(r)):await D(r)&&this.result.keptUserFiles.push(r))}const i=[...new Set([...t.keys()].map(e=>s.dirname(s.resolve(this.targetDir,e))))];for(const e of i)await A(e,this.targetDir,this.result.removedDirs)}async git(t){return this.execGit("git",t,{cwd:this.targetDir})}async runGit(){if(!await Q(this.targetDir)){this.result.git="skipped-not-repo";return}try{if((await this.git(["diff","--cached","--quiet"])).code!==0){this.result.git="skipped-dirty-index";return}const e=await this.git(["log","-1","--format=%s %H %P"]);if(e.code===0){const[l,d,w]=e.stdout.trimEnd().split(" ");if(l===$&&w){const I=await this.git(["diff-tree","--no-commit-id","--name-only","-r",d]),P=I.code===0?I.stdout.split(`
|
|
5
|
+
`).map(g=>g.trim()).filter(Boolean):[],M=g=>et.some(E=>g===E||g===E+"/"||g.startsWith(E+"/"));if(P.length>0&&P.every(M)){const g=await this.git(["reset","--mixed","HEAD~1"]);if(g.code===0){this.result.git="reset",this.result.gitSha=w.slice(0,7);return}this.result.git="failed",this.result.gitError=g.stderr.trim()||"git reset failed";return}}}const a=[...this.result.removedFiles,...this.result.modifiedFiles,...this.result.restoredFromBackup?[this.result.restoredFromBackup]:[],s.join(this.targetDir,".weave")],r=[...new Set(a.map(l=>s.relative(this.targetDir,l).replace(/\\/g,"/")))],c=50,f=new Set;for(let l=0;l<r.length;l+=c){const d=await this.git(["ls-files","--",...r.slice(l,l+c)]);if(d.code!==0){this.result.git="failed",this.result.gitError=d.stderr.trim()||"git ls-files failed";return}for(const w of d.stdout.split(`
|
|
6
|
+
`))w.trim()&&f.add(w.trim().replace(/\\/g,"/"))}const h=[...f];if(h.length>0)for(let l=0;l<h.length;l+=c){const d=await this.git(["add","--",...h.slice(l,l+c)]);if(d.code!==0){this.result.git="failed",this.result.gitError=d.stderr.trim()||"git add failed";return}}if((await this.git(["diff","--cached","--quiet"])).code===0){this.result.git="no-changes";return}const u=await this.git(["commit","-m",tt]);if(u.code!==0){this.result.git="failed",this.result.gitError=u.stderr.trim()||"git commit failed";return}const y=await this.git(["rev-parse","--short","HEAD"]);this.result.git="committed",this.result.gitSha=y.code===0?y.stdout.trim():void 0}catch(i){this.result.git="failed",this.result.gitError=i instanceof Error?i.message:String(i)}}}async function rt(n){const t=s.join(n,"backup");let i;try{i=await _(t)}catch{return null}const e=i.filter(a=>S.some(r=>a.startsWith(r+"."))).sort();return e.length>0?s.join(t,e[e.length-1]):null}export async function executeUninstall(n){return new st(n).run()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HARNESS_DRIVERS as
|
|
1
|
+
import{HARNESS_DRIVERS as o,createRuntimeRegistry as s}from"@weavecode/harness";import{ClaudeInitTemplate as c}from"./harnesses/claude.js";import{CodexInitTemplate as a}from"./harnesses/codex.js";const r={claude:c,codex:a};export function buildInitRegistry(){const t=s();for(const e of Object.keys(r)){const i=o[e],n={...i,capabilities:i.capabilities.includes("init")?i.capabilities:[...i.capabilities,"init"],init:r[e]};t.unregister(e),t.register(n)}return t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as c}from"./i18n/index.js";export class CommandParser{commands=new Map;globalOptions=[];constructor(){this.initGlobalOptions()}initGlobalOptions(){this.globalOptions=[{name:"help",short:"h",description:"flag.help",type:"boolean",default:!1},{name:"version",short:"V",description:"flag.version",type:"boolean",default:!1},{name:"verbose",short:"v",description:"flag.verbose",type:"boolean",default:!1},{name:"quiet",short:"q",description:"flag.quiet",type:"boolean",default:!1}]}registerCommand(e){if(this.commands.set(e.name,e),e.aliases)for(const t of e.aliases)this.commands.set(t,e)}getCommand(e){return this.commands.get(e)}getAllCommands(){const e=new Set;return Array.from(this.commands.values()).filter(t=>e.has(t)?!1:(e.add(t),!0))}parse(e){const t={command:[],flags:{_:[]},positional:[],raw:[...e]};let s;for(let r=0;r<e.length;r++){const i=e[r];if(i.startsWith("-"))break;if(t.command.length===0&&this.commands.has(i)){s=this.commands.get(i),t.command.push(i);continue}if(t.command.length===1&&s?.subcommands){const l=s.subcommands.find(u=>u.name===i||u.aliases?.includes(i));if(l){s=l,t.command.push(i);continue}}if(t.command.length===2&&s?.subcommands){const l=s.subcommands.find(u=>u.name===i||u.aliases?.includes(i));if(l){s=l,t.command.push(i);continue}}break}const f=this.buildAliases(s),n=this.booleanFlags(s);let a=!0,o=t.command.length;for(;o<e.length;){const r=e[o];if(r==="--"){a=!1,o++;continue}if(a&&r.startsWith("-")){const i=this.parseFlag(e,o,f,n);Object.assign(t.flags,i.flags),o=i.nextIndex;continue}t.positional.push(r),t.flags._.push(r),o++}return this.applyDefaults(t.flags,s),t}validateFlags(e,t){const s=[],f=[...this.globalOptions,...t?.options??[]];for(const n of f){const a=this.normalizeKey(n.name);if(n.required&&e[a]===void 0&&s.push(c("cli.missingRequired",{name:n.name})),n.choices&&e[a]!==void 0){const o=String(e[a]);n.choices.includes(o)||s.push(c("cli.invalidChoice",{name:n.name,value:o,choices:n.choices.join(", ")}))}if(n.validate&&e[a]!==void 0){const o=n.validate(e[a]);o!==!0&&s.push(o)}}return s}getGlobalOptions(){return[...this.globalOptions]}parseFlag(e,t,s,f){const n={},a=e[t];let o=t+1;if(a.startsWith("--")){const r=a.indexOf("=");if(r!==-1){const i=a.slice(2,r);n[this.normalizeKey(i)]=this.parseValue(a.slice(r+1))}else if(a.startsWith("--no-")){const i=a.slice(5);n[this.normalizeKey(i)]=!1}else{const i=a.slice(2),l=this.normalizeKey(i);f.has(l)?o<e.length&&this.isBooleanLiteral(e[o])?(n[l]=e[o].toLowerCase()==="true",o++):n[l]=!0:o<e.length&&this.isFlagValue(e[o])?(n[l]=this.parseValue(e[o]),o++):n[l]=!0}}else if(a.startsWith("-")){const r=a.slice(1);if(r.length===1){const i=s[r]||r,l=this.normalizeKey(i);f.has(l)?o<e.length&&this.isBooleanLiteral(e[o])?(n[l]=e[o].toLowerCase()==="true",o++):n[l]=!0:o<e.length&&this.isFlagValue(e[o])?(n[l]=this.parseValue(e[o]),o++):n[l]=!0}else for(const i of r){const l=s[i]||i;n[this.normalizeKey(l)]=!0}}return{flags:n,nextIndex:o}}isFlagValue(e){return e.startsWith("-")?/^-\d*\.?\d+(?:[eE][+-]?\d+)?$/.test(e):!0}isBooleanLiteral(e){const t=e.toLowerCase();return t==="true"||t==="false"}parseValue(e){if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;const t=Number(e);return!isNaN(t)&&e.trim()!==""?t:e}normalizeKey(e){return e.replace(/-([a-z])/g,(t,s)=>s.toUpperCase())}buildAliases(e){const t={};for(const s of this.globalOptions)s.short&&(t[s.short]=s.name);if(e?.options)for(const s of e.options)s.short&&(t[s.short]=s.name);return t}booleanFlags(e){const t=new Set;for(const s of this.globalOptions)s.type==="boolean"&&t.add(this.normalizeKey(s.name));if(e?.options)for(const s of e.options)s.type==="boolean"?t.add(this.normalizeKey(s.name)):s.type&&t.delete(this.normalizeKey(s.name));return t}applyDefaults(e,t){const s=[];t?.options&&s.push(t.options),s.push(this.globalOptions);for(const f of s)for(const n of f){const a=this.normalizeKey(n.name);e[a]===void 0&&n.default!==void 0&&(e[a]=n.default)}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const m={31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",90:"gray"},p={41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",100:"gray"};function h(n,
|
|
1
|
+
const m={31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",90:"gray"},p={41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",100:"gray"};function h(t,n,o){const e=u=>Math.max(0,Math.min(255,Math.round(u))).toString(16).padStart(2,"0");return`#${e(t)}${e(n)}${e(o)}`}export function toInkColor(t){const n="ansi256:";return t.startsWith(n)?`ansi256(${t.slice(n.length)})`:t}function b(t,n,o){if(t[n]!==o)return null;if(t[n+1]==="5"&&t[n+2]!==void 0){const e=Number(t[n+2]);return Number.isInteger(e)&&e>=0&&e<=255?{value:`ansi256:${e}`,next:n+3}:null}if(t[n+1]==="2"&&t[n+4]!==void 0){const[e,u,s]=[t[n+2],t[n+3],t[n+4]].map(Number);return[e,u,s].every(i=>Number.isFinite(i))?{value:h(e,u,s),next:n+5}:null}return null}export function parseAnsiSpans(t){const n=[];let o,e="";const u=()=>{o&&o.text&&n.push(o),o=void 0},s=()=>{e&&(n.push({text:e}),e="")},i=()=>(o||(s(),o={text:""}),o),d=t.split(/(\x1b\[[0-9;]*m)/);for(const c of d){const g=/^\x1b\[([0-9;]*)m$/.exec(c);if(!g){c&&(o?o.text+=c:e+=c);continue}const a=g[1].split(";").filter(r=>r!=="");for(let r=0;r<a.length;){const x=b(a,r,"38");if(x){i().color=x.value,r=x.next;continue}const f=b(a,r,"48");if(f){i().backgroundColor=f.value,r=f.next;continue}const l=a[r];l==="0"?u():l==="1"?i().bold=!0:l==="2"?i().dim=!0:m[l]?i().color=m[l]:p[l]&&(i().backgroundColor=p[l]),r++}}return u(),s(),n}export function stripAnsi(t){return t.replace(/\x1b\[[0-9;]*m/g,"")}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weavecode/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "CLI entry point for weave — parser, commands, and init executor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"node": ">=22.5.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@weavecode/core": "^0.1.
|
|
26
|
-
"@weavecode/harness": "^0.1.
|
|
27
|
-
"@weavecode/server": "^0.1.
|
|
28
|
-
"@weavecode/templates": "^0.1.
|
|
25
|
+
"@weavecode/core": "^0.1.8",
|
|
26
|
+
"@weavecode/harness": "^0.1.8",
|
|
27
|
+
"@weavecode/server": "^0.1.8",
|
|
28
|
+
"@weavecode/templates": "^0.1.8"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"node:path";import{lstat as g,readFile as f,readlink as m,access as y}from"node:fs/promises";const o="CLAUDE.md",u="AGENTS.md",p=".claude/helpers/statusline.cjs",w=".claude/settings.json";async function h(t){try{return await y(t),!0}catch{return!1}}async function l(t){try{if(!(await g(t)).isSymbolicLink())return"file";const n=a.resolve(a.dirname(t),await m(t));return await h(n)?"link":"dangling"}catch{return"absent"}}async function S(t){const s=a.join(t,u);if(await l(s)!=="file")return null;const n=(await f(s,"utf-8").catch(()=>"")).trim();return{id:"instruction-link-not-materialised",params:{agents:u,claude:o},ok:n!==o}}async function j(t){const s=await l(a.join(t,o)),n=await l(a.join(t,u));return s==="absent"||n==="absent"?null:{id:"instruction-files-duplicated",params:{claude:o,agents:u},ok:!(s==="file"&&n==="file")}}async function E(t){const s=[];for(const n of[o,u]){const e=await l(a.join(t,n));if(e==="dangling"){s.push({id:"instruction-link-dangling",params:{name:n},ok:!1});break}e==="link"&&s.push({id:"instruction-link-dangling",params:{name:n},ok:!0})}return s}function L(t){const s=/"([^"]+)"/.exec(t);if(s)return s[1];const n=t.trim().split(/\s+/),e=n[n.length-1];return e&&d(e).includes(p)?e:null}function d(t){return t.replace(/\\/g,"/")}async function b(t){const s=a.join(t,w);let n;try{n=JSON.parse(await f(s,"utf-8"))}catch{return[]}const e=n.statusLine;if(!e||typeof e!="object")return[];const r=e.command;if(typeof r!="string"||!d(r).includes(p))return[];const i=L(r);if(!i)return[{id:"statusline-path-unresolved",params:{command:r},ok:!1}];const c=[{id:"statusline-path-unresolved",params:{command:r},ok:!0}],k=a.resolve(t)+a.sep;return a.resolve(i).startsWith(k)?(c.push({id:"statusline-path-foreign",params:{path:i},ok:!0}),c.push({id:"statusline-script-missing",params:{path:i},ok:await h(i)}),c):(c.push({id:"statusline-path-foreign",params:{path:i},ok:!1}),c)}export async function checkHarness(t){const[s,n,e,r]=await Promise.all([S(t),j(t),E(t),b(t)]);return[s,n,...e,...r].filter(i=>i!==null)}
|
|
@@ -236,9 +236,98 @@ export declare const VISUALIZATION_PROTOCOL: {
|
|
|
236
236
|
readonly referencePrefix: "visualize";
|
|
237
237
|
/** 引用行结尾(可缺席)。 */
|
|
238
238
|
readonly referenceSuffix: "";
|
|
239
|
+
/**
|
|
240
|
+
* 同义写法(识别侧一并接受,生成侧仍以上面的 canonical 形为准):模型实测
|
|
241
|
+
* 会把三枚私有区字符整组写成 LANGUAGE TAG 区(U+E200→U+E0000、U+E202→
|
|
242
|
+
* U+E0001、U+E201→U+E0002)——屏上全不可见、语义一致,认不出整块就静默
|
|
243
|
+
* 退化成普通文本(2026-10-30 转录实测)。**降级形(裸 `visualize`)也认**:
|
|
244
|
+
* 压缩摘要这一层常把不可见字符整个吃掉,模型据摘要复述时写出的就是裸行
|
|
245
|
+
* (同日实测两条,都在压缩之后)。裸行只在一整行恰好是 `visualize` + 合法
|
|
246
|
+
* JSON 且带 path 时才成立,正文里的提及(带前缀文字 / 反引号包裹)不命中。
|
|
247
|
+
*/
|
|
248
|
+
readonly referencePrefixAliases: readonly ["visualize", "visualize"];
|
|
249
|
+
readonly referenceSuffixAliases: readonly [""];
|
|
239
250
|
/** fragment 文件大小上限(字节)。 */
|
|
240
251
|
readonly maxFragmentBytes: number;
|
|
241
252
|
};
|
|
253
|
+
/**
|
|
254
|
+
* 宠物精灵契约——桌面宠物窗的资产文法与动画时长表(跨 harness 统一,
|
|
255
|
+
* 模型侧由 skill 教;资产格式与 codex 的 v2 pet 兼容,社区现成资产可直接导入)。
|
|
256
|
+
* 网格/行号/帧时长与 codex TUI 的 default_animations 对齐(2026-10-31 考证);
|
|
257
|
+
* 时长表是宿主内建默认,manifest 不写时长。
|
|
258
|
+
*/
|
|
259
|
+
export declare const PET_SPRITE_CONTRACT: {
|
|
260
|
+
/** 单元格尺寸与列数(8 列 × 192×208)。 */
|
|
261
|
+
readonly cellWidth: 192;
|
|
262
|
+
readonly cellHeight: 208;
|
|
263
|
+
readonly columns: 8;
|
|
264
|
+
/** v1 = 9 行(仅标准动画);v2 = 11 行(+2 行 16 方向注视)。 */
|
|
265
|
+
readonly rowsV1: 9;
|
|
266
|
+
readonly rowsV2: 11;
|
|
267
|
+
/** v2 标记值:manifest 缺此值按 v1 处理,2288 高的资产会被拒。 */
|
|
268
|
+
readonly spriteVersionV2: 2;
|
|
269
|
+
/** spritesheet 文件大小上限(字节)。 */
|
|
270
|
+
readonly maxSpritesheetBytes: number;
|
|
271
|
+
/**
|
|
272
|
+
* 行号 → 帧数与时长(ms)。idle 单列时长;其余 uniform 帧间隔 + 尾帧加长。
|
|
273
|
+
* 播放模式:主循环 ×3 后接 idle 帧回落(loop_start = 主段帧数)。
|
|
274
|
+
*/
|
|
275
|
+
readonly animations: {
|
|
276
|
+
readonly idle: {
|
|
277
|
+
readonly row: 0;
|
|
278
|
+
readonly frames: 6;
|
|
279
|
+
readonly durationsMs: readonly [1680, 660, 660, 840, 840, 1920];
|
|
280
|
+
};
|
|
281
|
+
readonly 'running-right': {
|
|
282
|
+
readonly row: 1;
|
|
283
|
+
readonly frames: 8;
|
|
284
|
+
readonly frameMs: 120;
|
|
285
|
+
readonly finalMs: 220;
|
|
286
|
+
};
|
|
287
|
+
readonly 'running-left': {
|
|
288
|
+
readonly row: 2;
|
|
289
|
+
readonly frames: 8;
|
|
290
|
+
readonly frameMs: 120;
|
|
291
|
+
readonly finalMs: 220;
|
|
292
|
+
};
|
|
293
|
+
readonly waving: {
|
|
294
|
+
readonly row: 3;
|
|
295
|
+
readonly frames: 4;
|
|
296
|
+
readonly frameMs: 140;
|
|
297
|
+
readonly finalMs: 280;
|
|
298
|
+
};
|
|
299
|
+
readonly jumping: {
|
|
300
|
+
readonly row: 4;
|
|
301
|
+
readonly frames: 5;
|
|
302
|
+
readonly frameMs: 140;
|
|
303
|
+
readonly finalMs: 280;
|
|
304
|
+
};
|
|
305
|
+
readonly failed: {
|
|
306
|
+
readonly row: 5;
|
|
307
|
+
readonly frames: 8;
|
|
308
|
+
readonly frameMs: 140;
|
|
309
|
+
readonly finalMs: 240;
|
|
310
|
+
};
|
|
311
|
+
readonly waiting: {
|
|
312
|
+
readonly row: 6;
|
|
313
|
+
readonly frames: 6;
|
|
314
|
+
readonly frameMs: 150;
|
|
315
|
+
readonly finalMs: 260;
|
|
316
|
+
};
|
|
317
|
+
readonly running: {
|
|
318
|
+
readonly row: 7;
|
|
319
|
+
readonly frames: 6;
|
|
320
|
+
readonly frameMs: 120;
|
|
321
|
+
readonly finalMs: 220;
|
|
322
|
+
};
|
|
323
|
+
readonly review: {
|
|
324
|
+
readonly row: 8;
|
|
325
|
+
readonly frames: 6;
|
|
326
|
+
readonly frameMs: 150;
|
|
327
|
+
readonly finalMs: 280;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
242
331
|
/**
|
|
243
332
|
* 可选 harness 键序(= 名单表):`--harness` flag 值域与 init 交互多选的
|
|
244
333
|
* 选项表共用(批 5)。经名单表派生而非 `Object.keys(HARNESS_EVENTS)`——
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const HARNESS_NAMES=["claude","codex"];export function isHarness(e){return typeof e=="string"&&HARNESS_NAMES.includes(e)}export const HARNESS_EVENTS={claude:["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","Stop","StopFailure","SubagentStop","Notification","PostToolUseFailure","PermissionRequest","PermissionDenied","SubagentStart","PreCompact","SessionEnd","PreModelSwitch","PostModelSwitch"],codex:["SessionStart","UserPromptSubmit","Stop","TurnAborted","PostToolUse","SessionEnd","PreCompact","PostCompact","SubagentStart","SubagentStop","PermissionRequest"]},HARNESS_TOOL_EVENTS={claude:["PreToolUse","PostToolUse","PostToolUseFailure"],codex:["PostToolUse"]},INJECTABLE_EVENTS={claude:["PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop"],codex:[]},TITLE_EFFECTIVE_EVENTS={claude:["SessionStart","UserPromptSubmit"],codex:[]},HARNESS_EVENT_UNION=[...new Set(Object.values(HARNESS_EVENTS).flat())],HARNESS_DIRS={claude:{projectDir:".claude",userDir:".claude"},codex:{projectDir:".codex",userDir:".codex"}},HARNESS_INSTRUCTION_FILES={claude:["CLAUDE.md"],codex:["AGENTS.md"]},HARNESS_LIFECYCLE={claude:{open:"UserPromptSubmit",close:["Stop","StopFailure"],closeFailed:["StopFailure"],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:["AskUserQuestion","ExitPlanMode"],sessionExit:"SessionEnd"},codex:{open:"UserPromptSubmit",close:["Stop","TurnAborted"],closeFailed:[],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:[],sessionExit:"SessionEnd"}},HARNESS_COMPACTION={claude:{start:"PreCompact",end:"SessionStart",endSource:"compact"},codex:{start:null,end:null,endSource:null}},HARNESS_SESSION_CONTROL={claude:{modeNames:["default","acceptEdits","plan","auto","dontAsk","bypassPermissions"],modelNames:["default","opus","sonnet","haiku","fable"],modelFactEvents:["PostModelSwitch","SessionStart"],effortLevels:["low","medium","high","xhigh","max"]},codex:{modeNames:[],modelNames:[],modelFactEvents:[],effortLevels:[]}},VISUALIZATION_PROTOCOL={referencePrefix:"\uE200visualize\uE202",referenceSuffix:"\uE201",maxFragmentBytes:1024*1024},HARNESS_KEYS=HARNESS_NAMES,INSTRUCTION_FILES=[...new Set(HARNESS_KEYS.flatMap(e=>[...HARNESS_INSTRUCTION_FILES[e]]))];
|
|
1
|
+
export const HARNESS_NAMES=["claude","codex"];export function isHarness(e){return typeof e=="string"&&HARNESS_NAMES.includes(e)}export const HARNESS_EVENTS={claude:["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","Stop","StopFailure","SubagentStop","Notification","PostToolUseFailure","PermissionRequest","PermissionDenied","SubagentStart","PreCompact","SessionEnd","PreModelSwitch","PostModelSwitch"],codex:["SessionStart","UserPromptSubmit","Stop","TurnAborted","PostToolUse","SessionEnd","PreCompact","PostCompact","SubagentStart","SubagentStop","PermissionRequest"]},HARNESS_TOOL_EVENTS={claude:["PreToolUse","PostToolUse","PostToolUseFailure"],codex:["PostToolUse"]},INJECTABLE_EVENTS={claude:["PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop"],codex:[]},TITLE_EFFECTIVE_EVENTS={claude:["SessionStart","UserPromptSubmit"],codex:[]},HARNESS_EVENT_UNION=[...new Set(Object.values(HARNESS_EVENTS).flat())],HARNESS_DIRS={claude:{projectDir:".claude",userDir:".claude"},codex:{projectDir:".codex",userDir:".codex"}},HARNESS_INSTRUCTION_FILES={claude:["CLAUDE.md"],codex:["AGENTS.md"]},HARNESS_LIFECYCLE={claude:{open:"UserPromptSubmit",close:["Stop","StopFailure"],closeFailed:["StopFailure"],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:["AskUserQuestion","ExitPlanMode"],sessionExit:"SessionEnd"},codex:{open:"UserPromptSubmit",close:["Stop","TurnAborted"],closeFailed:[],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:[],sessionExit:"SessionEnd"}},HARNESS_COMPACTION={claude:{start:"PreCompact",end:"SessionStart",endSource:"compact"},codex:{start:null,end:null,endSource:null}},HARNESS_SESSION_CONTROL={claude:{modeNames:["default","acceptEdits","plan","auto","dontAsk","bypassPermissions"],modelNames:["default","opus","sonnet","haiku","fable"],modelFactEvents:["PostModelSwitch","SessionStart"],effortLevels:["low","medium","high","xhigh","max"]},codex:{modeNames:[],modelNames:[],modelFactEvents:[],effortLevels:[]}},VISUALIZATION_PROTOCOL={referencePrefix:"\uE200visualize\uE202",referenceSuffix:"\uE201",referencePrefixAliases:["\u{E0000}visualize\u{E0001}","visualize"],referenceSuffixAliases:["\u{E0002}"],maxFragmentBytes:1024*1024},PET_SPRITE_CONTRACT={cellWidth:192,cellHeight:208,columns:8,rowsV1:9,rowsV2:11,spriteVersionV2:2,maxSpritesheetBytes:8*1024*1024,animations:{idle:{row:0,frames:6,durationsMs:[1680,660,660,840,840,1920]},"running-right":{row:1,frames:8,frameMs:120,finalMs:220},"running-left":{row:2,frames:8,frameMs:120,finalMs:220},waving:{row:3,frames:4,frameMs:140,finalMs:280},jumping:{row:4,frames:5,frameMs:140,finalMs:280},failed:{row:5,frames:8,frameMs:140,finalMs:240},waiting:{row:6,frames:6,frameMs:150,finalMs:260},running:{row:7,frames:6,frameMs:120,finalMs:220},review:{row:8,frames:6,frameMs:150,finalMs:280}}},HARNESS_KEYS=HARNESS_NAMES,INSTRUCTION_FILES=[...new Set(HARNESS_KEYS.flatMap(e=>[...HARNESS_INSTRUCTION_FILES[e]]))];
|
|
@@ -4,7 +4,7 @@ export type { HookRule, HookRuleSource, HookRuleFilter, HookRuleOrigin, HandlerC
|
|
|
4
4
|
export { HookRuleSchema, HookRuleSourceSchema, HookRuleFilterSchema, HookRuleOriginSchema, HandlerConfigSchema, HookDispatchStatusSchema, HookDispatchModeSchema, PluginRuleEntrySchema, WeavePluginManifestSchema, WEAVE_PLUGIN_MANIFEST, CLAUDE_HOOK_EVENTS, INJECTABLE_HOOK_EVENTS, } from './types.js';
|
|
5
5
|
export { InitOptionsSchema, PresetSchema, resolveComponents } from './types.js';
|
|
6
6
|
export { normalizeHookRuleSource, hookSourceHarness } from './types.js';
|
|
7
|
-
export { type Harness, type InstructionFile, HARNESS_EVENTS, HARNESS_KEYS, HARNESS_NAMES, HARNESS_EVENT_UNION, HARNESS_TOOL_EVENTS, HARNESS_INSTRUCTION_FILES, INSTRUCTION_FILES, INJECTABLE_EVENTS, TITLE_EFFECTIVE_EVENTS, HARNESS_DIRS, HARNESS_LIFECYCLE, HARNESS_COMPACTION, HARNESS_SESSION_CONTROL, VISUALIZATION_PROTOCOL, type HarnessCompaction, isHarness, } from './harness.js';
|
|
7
|
+
export { type Harness, type InstructionFile, HARNESS_EVENTS, HARNESS_KEYS, HARNESS_NAMES, HARNESS_EVENT_UNION, HARNESS_TOOL_EVENTS, HARNESS_INSTRUCTION_FILES, INSTRUCTION_FILES, INJECTABLE_EVENTS, TITLE_EFFECTIVE_EVENTS, HARNESS_DIRS, HARNESS_LIFECYCLE, HARNESS_COMPACTION, HARNESS_SESSION_CONTROL, VISUALIZATION_PROTOCOL, PET_SPRITE_CONTRACT, type HarnessCompaction, isHarness, } from './harness.js';
|
|
8
8
|
export { TERMINAL_LOCATOR_ENV, TERMINAL_LOCATOR_ENV_KEYS } from './terminal.js';
|
|
9
9
|
export { type ToolScope, type ToolCategory, type EnableOverride, type InstallState, type ToolStateRow, } from './tool.js';
|
|
10
10
|
export { DEFAULT_COMPONENTS, FULL_COMPONENTS, MINIMAL_COMPONENTS } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{HookRuleSchema,HookRuleSourceSchema,HookRuleFilterSchema,HookRuleOriginSchema,HandlerConfigSchema,HookDispatchStatusSchema,HookDispatchModeSchema,PluginRuleEntrySchema,WeavePluginManifestSchema,WEAVE_PLUGIN_MANIFEST,CLAUDE_HOOK_EVENTS,INJECTABLE_HOOK_EVENTS}from"./types.js";export{InitOptionsSchema,PresetSchema,resolveComponents}from"./types.js";export{normalizeHookRuleSource,hookSourceHarness}from"./types.js";export{HARNESS_EVENTS,HARNESS_KEYS,HARNESS_NAMES,HARNESS_EVENT_UNION,HARNESS_TOOL_EVENTS,HARNESS_INSTRUCTION_FILES,INSTRUCTION_FILES,INJECTABLE_EVENTS,TITLE_EFFECTIVE_EVENTS,HARNESS_DIRS,HARNESS_LIFECYCLE,HARNESS_COMPACTION,HARNESS_SESSION_CONTROL,VISUALIZATION_PROTOCOL,isHarness}from"./harness.js";export{TERMINAL_LOCATOR_ENV,TERMINAL_LOCATOR_ENV_KEYS}from"./terminal.js";export{DEFAULT_COMPONENTS,FULL_COMPONENTS,MINIMAL_COMPONENTS}from"./types.js";export{DEFAULT_HOOKS,DEFAULT_SKILLS,DEFAULT_COMMANDS,DEFAULT_AGENTS,DEFAULT_MCP}from"./types.js";export{detectPlatform}from"./platform.js";export{checkHarness}from"./harness-checks.js";export{ensureDir,writeFileIfAbsent,fileExists}from"./utils/fs.js";export{logger,formatTable}from"./utils/logger.js";
|
|
1
|
+
export{HookRuleSchema,HookRuleSourceSchema,HookRuleFilterSchema,HookRuleOriginSchema,HandlerConfigSchema,HookDispatchStatusSchema,HookDispatchModeSchema,PluginRuleEntrySchema,WeavePluginManifestSchema,WEAVE_PLUGIN_MANIFEST,CLAUDE_HOOK_EVENTS,INJECTABLE_HOOK_EVENTS}from"./types.js";export{InitOptionsSchema,PresetSchema,resolveComponents}from"./types.js";export{normalizeHookRuleSource,hookSourceHarness}from"./types.js";export{HARNESS_EVENTS,HARNESS_KEYS,HARNESS_NAMES,HARNESS_EVENT_UNION,HARNESS_TOOL_EVENTS,HARNESS_INSTRUCTION_FILES,INSTRUCTION_FILES,INJECTABLE_EVENTS,TITLE_EFFECTIVE_EVENTS,HARNESS_DIRS,HARNESS_LIFECYCLE,HARNESS_COMPACTION,HARNESS_SESSION_CONTROL,VISUALIZATION_PROTOCOL,PET_SPRITE_CONTRACT,isHarness}from"./harness.js";export{TERMINAL_LOCATOR_ENV,TERMINAL_LOCATOR_ENV_KEYS}from"./terminal.js";export{DEFAULT_COMPONENTS,FULL_COMPONENTS,MINIMAL_COMPONENTS}from"./types.js";export{DEFAULT_HOOKS,DEFAULT_SKILLS,DEFAULT_COMMANDS,DEFAULT_AGENTS,DEFAULT_MCP}from"./types.js";export{detectPlatform}from"./platform.js";export{checkHarness}from"./harness-checks.js";export{ensureDir,writeFileIfAbsent,fileExists}from"./utils/fs.js";export{logger,formatTable}from"./utils/logger.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"node:os";import i from"node:path";export function detectPlatform(){const c=n.platform(),a=n.arch(),
|
|
1
|
+
import n from"node:os";import i from"node:path";export function detectPlatform(){const c=n.platform(),a=n.arch(),s=n.homedir();let e,o,r;switch(c){case"win32":e="windows",o=process.env.PSModulePath?"powershell":"cmd",r=process.env.APPDATA||i.join(s,"AppData","Roaming");break;case"darwin":e="darwin",o=process.env.SHELL?.includes("zsh")?"zsh":"bash",r=i.join(s,"Library","Application Support");break;default:e="linux",o=process.env.SHELL?.includes("zsh")?"zsh":process.env.SHELL?.includes("bash")?"bash":"sh",r=process.env.XDG_CONFIG_HOME||i.join(s,".config")}return{os:e,arch:a,nodeVersion:process.version,shell:o,homeDir:s,configDir:r}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{HARNESS_EVENTS as
|
|
1
|
+
import{z as e}from"zod";import{HARNESS_EVENTS as i,HARNESS_NAMES as r,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=i.claude,INJECTABLE_HOOK_EVENTS=s.claude;const a=e.enum(r),l=e.enum([...r,"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(t){return t.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:t.event}:t}export function hookSourceHarness(t){return t.kind==="claude-event"?"claude":t.kind==="hook-event"?t.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()}),e.object({type:e.literal("classify"),prompt:e.string().min(1),prefilter:e.array(e.string().min(1)).optional(),cooldownMs:e.number().int().positive().optional(),routes:e.array(e.object({label:e.string().min(1),url:e.string().url(),secret:e.string().optional(),headers:e.record(e.string(),e.string()).optional()})).min(1)})]),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(a).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(a).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(t,o){const n=t==="minimal"?MINIMAL_COMPONENTS:t==="full"?FULL_COMPONENTS:DEFAULT_COMPONENTS;return o?{...n,...o}:{...n}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir as i,readFile as
|
|
1
|
+
import{mkdir as i,readFile as a,writeFile as n,stat as u}from"node:fs/promises";import c from"node:path";export async function ensureDir(t){await i(t,{recursive:!0})}export async function writeFileIfAbsent(t,r,e){try{if(await a(t,"utf-8"),!e)return!1}catch{}return await ensureDir(c.dirname(t)),await n(t,r,"utf-8"),!0}export async function fileExists(t){try{return await u(t),!0}catch{return!1}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const l={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m"};function o
|
|
1
|
+
const l={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m"};function e(o,n){return process.env.NO_COLOR?o:`${l[n]}${o}${l.reset}`}export const logger={info(o){console.log(e(o,"cyan"))},success(o){console.log(e(o,"green"))},warn(o){console.log(e(o,"yellow"))},error(o){console.error(e(o,"red"))},dim(o){console.log(e(o,"dim"))}};export function formatTable(o){const n=Math.max(...o.map(([r])=>r.length));return o.map(([r,c])=>` ${r.padEnd(n+2)}${c}`).join(`
|
|
2
2
|
`)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readFile as
|
|
2
|
-
`,"utf-8");return}const
|
|
3
|
-
`,"utf-8")},async mcpRemove(
|
|
4
|
-
`,"utf-8"),!0):!1},classify(
|
|
1
|
+
import{readFile as d,writeFile as u}from"node:fs/promises";import n from"node:path";import{FILE_ASSET_SPECS as S}from"../shared/file-specs.js";const l=".mcp.json",p=".claude.json";export class ClaudeJsonCorruptError extends Error{constructor(t){super(t),this.name="ClaudeJsonCorruptError"}}function f(r){if(!r||r.includes("/")||r.includes("\\")||r.includes(".."))throw new Error(`Invalid asset name: "${r}"`)}async function j(r){try{const t=JSON.parse(await d(r,"utf-8"));return t&&typeof t=="object"?t:{}}catch{return{}}}export async function readClaudeJson(r){const t=n.join(r,p);let o;try{o=await d(t,"utf-8")}catch{return{}}let e;try{e=JSON.parse(o)}catch(s){throw new ClaudeJsonCorruptError(`~/.claude.json is not valid JSON \u2014 refusing to write: ${s instanceof Error?s.message:String(s)}`)}if(!e||typeof e!="object"||Array.isArray(e))throw new ClaudeJsonCorruptError("~/.claude.json is not a JSON object \u2014 refusing to write");return e}export const CLAUDE_ASSETS={harness:"claude",targetDir(r,t,o,e){const s=S[r].dirs.claude;if(t==="user"){if(!s?.user)throw new Error(`"${r}" is project-scoped only (no user-level directory)`);return n.join(e,...s.user.split("/"))}if(!s?.project)throw new Error(`"${r}" has no Claude project surface`);return n.join(o,...s.project.split("/"))},projectSkillsRoots:()=>[".claude/skills"],globalSkillsRoots:r=>[n.join(r,...".claude/skills".split("/"))],userConfigFile:r=>n.join(r,".claude","settings.json"),mcpScopes:()=>["project","user"],mcpDest:(r,t)=>r==="project"?".mcp.json":n.join(t,".claude.json"),pluginCacheDir:r=>n.join(r,".claude","plugins","cache"),async mcpRead(r,t,o){if(r==="project")return(await j(n.join(t,l))).mcpServers??{};const e=(await readClaudeJson(o)).mcpServers;return!e||typeof e!="object"||Array.isArray(e)?{}:e},async mcpWrite(r,t,o,e,s){if(f(e),r==="project"){const i=n.join(t,l),a=await j(i);a.mcpServers={...a.mcpServers??{},[e]:s},await u(i,`${JSON.stringify(a,null,2)}
|
|
2
|
+
`,"utf-8");return}const c=await readClaudeJson(o);c.mcpServers={...c.mcpServers??{},[e]:s},await u(n.join(o,p),`${JSON.stringify(c,null,2)}
|
|
3
|
+
`,"utf-8")},async mcpRemove(r,t,o,e){f(e);const s=r==="project"?n.join(t,l):n.join(o,p),c=r==="project"?await j(s):await readClaudeJson(o),i=c.mcpServers??{};return e in i?(delete i[e],c.mcpServers=i,await u(s,`${JSON.stringify(c,null,2)}
|
|
4
|
+
`,"utf-8"),!0):!1},classify(r){return r===".claude"||r.startsWith(".claude/")||r===".mcp.json"?!0:r.slice(r.lastIndexOf("/")+1)==="CLAUDE.md"},ignore(r){return r===".claude"||r.startsWith(".claude/")?r===".claude/projects"||r.startsWith(".claude/projects/")||r===".claude/cache"||r.startsWith(".claude/cache/")||r===".claude/worktrees"||r.startsWith(".claude/worktrees/"):r!==".mcp.json"&&r!=="CLAUDE.md"}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{homedir as
|
|
1
|
+
import{homedir as u}from"node:os";import{access as j,mkdir as f,readFile as h,unlink as _,writeFile as v}from"node:fs/promises";import i from"node:path";import{HARNESS_DIRS as d,HARNESS_EVENTS as N,INJECTABLE_EVENTS as k,TERMINAL_LOCATOR_ENV_KEYS as b,TITLE_EFFECTIVE_EVENTS as T}from"@weavecode/core";import{CLAUDE_PROMPT_INBOX as m}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
|
|
@@ -28,15 +28,15 @@ const crypto = require('crypto');
|
|
|
28
28
|
const HOOK_GUARD_MS = 2000;
|
|
29
29
|
// Events that can carry additionalContext back via hook output (harness
|
|
30
30
|
// contract; mirrors INJECTABLE_EVENTS server-side).
|
|
31
|
-
const INJECTABLE_EVENTS = ${JSON.stringify(
|
|
31
|
+
const INJECTABLE_EVENTS = ${JSON.stringify(k[t])};
|
|
32
32
|
// The host applies hookSpecificOutput.sessionTitle ONLY on these events (mirrors
|
|
33
33
|
// TITLE_EFFECTIVE_EVENTS) \u2014 tool events record hook_success but drop the field
|
|
34
34
|
// (verified against Claude Code 2.1.296).
|
|
35
|
-
const TITLE_EVENTS = ${JSON.stringify(
|
|
35
|
+
const TITLE_EVENTS = ${JSON.stringify(T[t])};
|
|
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(b)};
|
|
40
40
|
const INBOX_MAX_BYTES = 4 * 1024 * 1024;
|
|
41
41
|
const INBOX_MAX_LINES = 1000;
|
|
42
42
|
const OUTBOX_MAX_LINES = 200;
|
|
@@ -80,9 +80,9 @@ function hooksDir() {
|
|
|
80
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
|
|
81
81
|
// \u884C\u7684\u65C1\u8DEF\u5B57\u6BB5\uFF08\u4E0D\u8FDB report/payload\uFF09\u3002
|
|
82
82
|
function messagingEnv() {
|
|
83
|
-
var sock = process.env.${
|
|
83
|
+
var sock = process.env.${m.socketEnv};
|
|
84
84
|
if (!sock) return null;
|
|
85
|
-
return { socket: sock, token: process.env.${
|
|
85
|
+
return { socket: sock, token: process.env.${m.tokenEnv} || null };
|
|
86
86
|
}
|
|
87
87
|
|
|
88
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
|
|
@@ -381,6 +381,6 @@ async function main() {
|
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
main().catch(function () { process.exit(0); });
|
|
384
|
-
`}export const HOOK_HANDLER_MARKER=".claude/helpers/hook-handler.cjs";function
|
|
385
|
-
`,"utf-8")}export async function readUserCapture(e={}){const t=e.home??
|
|
386
|
-
`,"utf-8")}export async function uninstallUserCapture(e={}){const t=e.home??
|
|
384
|
+
`}export const HOOK_HANDLER_MARKER=".claude/helpers/hook-handler.cjs";function l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e){return e.replace(/\\/g,"/")}export function groupIsWeave(e){if(!l(e))return!1;const t=e.hooks;return Array.isArray(t)?t.some(n=>l(n)&&typeof n.command=="string"&&E(n.command).includes(HOOK_HANDLER_MARKER)):!1}export function captureHookGroup(e,t){const n=`node "${E(t)}/hook-handler.cjs"`,r=!k.claude.includes(e);return[{matcher:"*",hooks:[{type:"command",command:n,...r?{async:!0}:{}}]}]}export function sweepWeaveHookEvents(e){if(!l(e))return;const t={};for(const[n,r]of Object.entries(e)){if(!Array.isArray(r)){t[n]=r;continue}const s=r.filter(a=>!groupIsWeave(a));s.length>0&&(t[n]=s)}return Object.keys(t).length>0?t:void 0}export function captureGroupsPresent(e){if(!l(e))return!1;const t=e.hooks;return l(t)?Object.values(t).some(n=>Array.isArray(n)&&n.some(groupIsWeave)):!1}function y(e){return i.join(e,d.claude.userDir,"settings.json")}function p(e){return i.join(e,d.claude.userDir,"helpers")}const S="@version weave@";async function I(e){try{return await j(e),!0}catch{return!1}}async function g(e){let t;try{t=await h(e,"utf-8")}catch{return{}}let n;try{n=JSON.parse(t)}catch{throw new Error(`user settings is not parseable JSON: ${e}`)}if(!l(n))throw new Error(`user settings is not a JSON object: ${e}`);return n}async function w(e){let t;try{t=await g(e)}catch{return}const n=sweepWeaveHookEvents(t.hooks);n===void 0?delete t.hooks:t.hooks=n,await f(i.dirname(e),{recursive:!0}),await v(e,JSON.stringify(t,null,2)+`
|
|
385
|
+
`,"utf-8")}export async function readUserCapture(e={}){const t=e.home??u(),n=await g(y(t));return{installed:captureGroupsPresent(n),helperPresent:await I(i.join(p(t),"hook-handler.cjs"))}}export async function readScriptHealth(e={}){const t=e.home??u(),n=i.join(p(t),"hook-handler.cjs"),r=e.projectPath?i.join(e.projectPath,d.claude.projectDir,"helpers","hook-handler.cjs"):null,s=(await readUserCapture({home:t})).installed,a=s?"user":r?"project":"none",c=s?n:r??n;let o=null;try{o=await h(c,"utf-8")}catch{o=null}return{source:a,present:o!==null,weaveOwned:o!==null&&o.includes(S),generatedVersion:o?.match(/@version weave@(\S+)/)?.[1]??null,reportsInbox:o!==null&&o.includes(m.socketEnv),reportsPaneEnv:o!==null&&o.includes("terminalEnv()")}}export async function installUserCapture(e){const t=e.home??u(),n=p(t);await f(n,{recursive:!0}),await v(i.join(n,"hook-handler.cjs"),generateHookHandler(e.version),"utf-8");const r=y(t),s=await g(r),a=sweepWeaveHookEvents(s.hooks)??{};for(const c of N.claude){const o=a[c];a[c]=Array.isArray(o)?[...o,...captureHookGroup(c,n)]:captureHookGroup(c,n)}s.hooks=a,await f(i.dirname(r),{recursive:!0}),await v(r,JSON.stringify(s,null,2)+`
|
|
386
|
+
`,"utf-8")}export async function uninstallUserCapture(e={}){const t=e.home??u();await w(y(t));const n=i.join(p(t),"hook-handler.cjs");try{(await h(n,"utf-8")).includes(S)&&await _(n)}catch{}}export async function stripProjectCapture(e){await w(i.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)};
|
|
@@ -3,6 +3,8 @@ import { type PluginExecutor } from './plugins.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* 转录里的命令执行:`<command-name>` 那一条之后若紧跟 `<local-command-stdout>`,
|
|
5
5
|
* 就是一次内建命令(skill 命令后面跟的是 isMeta 展开正文,不算——它已经有 UPS 气泡)。
|
|
6
|
+
* bash 模式同构:`<bash-input>` 之后紧跟 `<bash-stdout>`(+`<bash-stderr>`)——
|
|
7
|
+
* bash 不发 UPS、hook 域零事件,转录这两行是它执行过的唯一证据。
|
|
6
8
|
*
|
|
7
9
|
* 按**字节游标**增量累积(同 narration):`pending`(等 stdout 的那条命令)是跨行
|
|
8
10
|
* 状态,跟着游标一起存——两行可能分在两次读里。文件被截断/换掉 ⇒ 全部作废重来。
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{readdir as
|
|
2
|
-
`).find(
|
|
1
|
+
import{readdir as k,readFile as S,stat as A}from"node:fs/promises";import{homedir as M}from"node:os";import c from"node:path";import{execCli as L}from"./plugins.js";import{readNewLines as j,transcriptSize as I}from"./transcript-cursor.js";const E=[{name:"add-dir",description:"Add a new working directory",argsHint:"[<path>]",source:"builtin"},{name:"artifacts",description:"Browse your published and shared artifacts",source:"builtin"},{name:"auto-mode-setup",description:"Teach auto mode about your environment, plus optional rule tweaks",source:"builtin"},{name:"autocompact",description:"Set how full the context gets before auto-summarizing",argsHint:"[auto|<tokens>]",source:"builtin"},{name:"background",description:"Send this session to the background and free the terminal",argsHint:"[prompt]",source:"builtin"},{name:"branch",description:"Create a branch of the current conversation at this point",argsHint:"[name]",source:"builtin"},{name:"brief",description:"Toggle brief-only mode",source:"builtin"},{name:"btw",description:"Ask a quick side question without interrupting the main conversation",argsHint:"[question]",source:"builtin"},{name:"bug",description:"Report a bug or share your conversation",argsHint:"[report]",source:"builtin"},{name:"cd",description:"Move this session to a new working directory",argsHint:"[<path>]",source:"builtin"},{name:"clear",description:"Start a new session with empty context; previous session stays on disk (resumable with /resume)",source:"builtin"},{name:"cloud-plugins",description:"Choose whether cloud sessions use the plugins enabled on this machine",source:"builtin"},{name:"code-review",description:"Review the current diff or a PR for bugs and cleanups",source:"builtin"},{name:"color",description:"Set the prompt bar color for this session",source:"builtin"},{name:"compact",description:"Free up context by summarizing the conversation so far",argsHint:"[instructions]",source:"builtin"},{name:"config",description:"Open settings",argsHint:"[key=value]",source:"builtin"},{name:"context",description:"Visualize current context usage as a colored grid",argsHint:"[all]",source:"builtin"},{name:"copy",description:"Copy Claude's last response to clipboard (or /copy N for the Nth-latest)",source:"builtin"},{name:"daemon",description:"Manage background services and routines",source:"builtin"},{name:"debug",description:"Turn on debug logging and investigate problems",argsHint:"[issue description]",source:"builtin"},{name:"design-login",description:"Authorize design-system access for /design-sync with your claude.ai account",source:"builtin"},{name:"diff",description:"View uncommitted changes and per-turn diffs",source:"builtin"},{name:"doctor",description:"Health-check your setup and fix issues: installation, unused extensions, duplicated or bloated memory files, slow hooks, updates, permissions",source:"builtin"},{name:"effort",description:"Set effort level for model usage",argsHint:"[level]",source:"builtin"},{name:"exit",description:"Exit the CLI",source:"builtin"},{name:"export",description:"Export the current conversation to a file or clipboard",argsHint:"[filename]",source:"builtin"},{name:"feedback",description:"Send feedback to Anthropic or report a bug",argsHint:"[report]",source:"builtin"},{name:"focus",description:"Toggle focus view: just your prompt, summary, and response",source:"builtin"},{name:"fork",description:"Spawn a background agent that inherits the full conversation",argsHint:"[<directive>]",source:"builtin"},{name:"goal",description:"Set a goal Claude checks before stopping",argsHint:"[<condition> | clear]",source:"builtin"},{name:"help",description:"Show help and available commands",source:"builtin"},{name:"hooks",description:"View hook configurations for tool events",argsHint:"[name]",source:"builtin"},{name:"ide",description:"Manage IDE integrations and show status",argsHint:"[open]",source:"builtin"},{name:"init",description:"Initialize a CLAUDE.md for this project",source:"builtin",inline:!0},{name:"insights",description:"Generate a report analyzing your Claude Code sessions",source:"builtin",inline:!0},{name:"install",description:"Install Claude Code native build",argsHint:"[options]",source:"builtin"},{name:"install-github-app",description:"Set up Claude GitHub Actions for a repository",source:"builtin"},{name:"install-slack-app",description:"Install the Claude Slack app",source:"builtin"},{name:"keybindings",description:"Open your keyboard shortcuts file",source:"builtin"},{name:"list-agents",description:"List subagents, teammates, and other Claude sessions you can message",source:"builtin"},{name:"login",description:"Sign in with your Anthropic account",source:"builtin"},{name:"logout",description:"Sign out from your Anthropic account",source:"builtin"},{name:"loops",description:"List, create, and delete loops",argsHint:"[name]",source:"builtin"},{name:"mcp",description:"Manage MCP servers",source:"builtin"},{name:"memory",description:"Edit CLAUDE.md files and memory settings",source:"builtin"},{name:"mobile",description:"Show QR code to download the Claude mobile app",source:"builtin"},{name:"model",description:"Set the AI model for Claude Code",argsHint:"[model]",source:"builtin"},{name:"permissions",description:"Manage allow and deny tool permission rules",argsHint:"[open|<description>]",source:"builtin"},{name:"plan",description:"Enable plan mode or view the current session plan",argsHint:"[open|<description>]",source:"builtin"},{name:"plugin",description:"Manage Claude Code plugins",source:"builtin"},{name:"powerup",description:"Discover Claude Code features through quick interactive lessons",argsHint:"[name]",source:"builtin"},{name:"privacy-settings",description:"View and update your privacy settings",source:"builtin"},{name:"radio",description:"Listen to Claude FM lo-fi radio",source:"builtin"},{name:"rate-limit-options",description:"Manage usage limits and upgrade options",source:"builtin"},{name:"recap",description:"Generate a one-line session recap now",source:"builtin"},{name:"release-notes",description:"View release notes",source:"builtin"},{name:"reload-plugins",description:"Activate pending plugin changes in the current session",argsHint:"[--force]",source:"builtin"},{name:"reload-skills",description:"Pick up skills added or changed on disk during this session",source:"builtin"},{name:"rename",description:"Rename the current conversation",argsHint:"[name]",source:"builtin"},{name:"resume",description:"Resume a previous conversation",argsHint:"[conversation id or search term]",source:"builtin"},{name:"rewind",description:"Restore the code and/or conversation to a previous point",source:"builtin"},{name:"scroll-speed",description:"Adjust mouse wheel scroll speed",source:"builtin"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch",source:"builtin"},{name:"skill-doctor",description:"Show which loaded skills are unused and costing context",source:"builtin"},{name:"skills",description:"List available skills",source:"builtin"},{name:"status",description:"Show Claude Code status including version, model, account, API connectivity, and tool statuses",source:"builtin"},{name:"statusline",description:"Set up Claude Code's status line UI",source:"builtin",inline:!0},{name:"stickers",description:"Order Claude Code stickers",source:"builtin"},{name:"stop",description:"Stop this background session; transcript and worktree are kept",source:"builtin"},{name:"subtask",description:"Send a subagent off with your full context; its result comes back here",argsHint:"[<task>]",source:"builtin"},{name:"tasks",description:"View and manage everything running in the background",source:"builtin"},{name:"terminal-setup",description:"Check terminal setup for key bindings like Shift+Enter",source:"builtin"},{name:"theme",description:"Change the theme",source:"builtin"},{name:"tui",description:"Set the terminal UI renderer (default | fullscreen)",argsHint:"[default|fullscreen]",source:"builtin"},{name:"ultraplan",description:"Draft an editable plan in a cloud session",argsHint:"[<prompt>]",source:"builtin"},{name:"ultrareview",description:"Start a cloud agent that finds and verifies bugs in your branch",source:"builtin"},{name:"upgrade",description:"Upgrade to Max for higher rate limits and more Opus",source:"builtin"},{name:"usage",description:"Show session cost, plan usage, and activity stats",source:"builtin"},{name:"usage-credits",description:"Configure usage credits or request them from your admin when you hit a limit",source:"builtin"},{name:"version",description:"Show this session's version (autoupdate may have a newer one)",source:"builtin"},{name:"wellbeing",description:"Configure optional break reminders and quiet-hours nudges",source:"builtin"},{name:"workflows",description:"Browse running and completed workflows",source:"builtin"}];function v(n){const t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(n)?.[1]??"",i=/^description:\s*(.+)$/m.exec(t)?.[1]?.trim().replace(/^["']|["']$/g,"");return i||(n.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,"").split(`
|
|
2
|
+
`).find(o=>o.trim()!==""&&!o.startsWith("#"))?.trim()??"")}async function C(n){try{const t=await A(n);return t.isDirectory()?"dir":t.isFile()?"file":"other"}catch{return"other"}}async function O(n){try{const t=[];for(const i of await k(n,{withFileTypes:!0})){if(!i.name.endsWith(".md"))continue;const e=c.join(n,i.name);(i.isFile()||i.isSymbolicLink()&&await C(e)==="file")&&t.push(e)}return t}catch{return[]}}async function m(n){try{const t=[];for(const i of await k(n,{withFileTypes:!0})){const e=c.join(n,i.name);(i.isDirectory()||i.isSymbolicLink()&&await C(e)==="dir")&&t.push(e)}return t}catch{return[]}}async function H(n){const t=[],i=async(e,o)=>{for(const s of await O(e)){const r=`${o}${c.basename(s,".md")}`,a=v(await S(s,"utf8").catch(()=>""));t.push({name:r,description:a,source:"command",inline:!0})}for(const s of await m(e))await i(s,`${o}${c.basename(s)}:`)};return await i(n,""),t}async function g(n,t="",i="skill"){const e=[];for(const o of await m(n)){const s=v(await S(c.join(o,"SKILL.md"),"utf8").catch(()=>""));e.push({name:`${t}${c.basename(o)}`,description:s,source:i,inline:!0})}return e}async function $(n){const t=[],i=new Set;for(const e of await m(c.join(n,"plugins","cache")))for(const o of await m(e)){const s=c.basename(o);if(!i.has(s))for(const r of await m(o)){const a=await g(c.join(r,"skills"),`${s}:`,"plugin");if(a.length>0){i.add(s),t.push(...a);break}}}return t}async function T(n){try{const{stdout:t}=await n(["plugin","list","--json"],{timeoutMs:15e3}),i=JSON.parse(t);if(!Array.isArray(i))return null;const e=[];for(const o of i){if(!o||typeof o!="object")continue;const s=o;if(typeof s.id!="string"||typeof s.installPath!="string")continue;const r=s.id.lastIndexOf("@");e.push({plugin:r>0?s.id.slice(0,r):s.id,enabled:s.enabled===!0,installPath:s.installPath})}return e}catch{return null}}async function z(n){const t=await T(n);if(!t)return null;const i=[];for(const e of t)e.enabled&&i.push(...await g(c.join(e.installPath,"skills"),`${e.plugin}:`,"plugin"));return i}function D(n){const t=new Set,i=[];for(const e of n)t.has(e.name)||(t.add(e.name),i.push(e));return i}const R=n=>typeof n=="string"?n:"";function _(n){return/<command-args>([\s\S]*?)<\/command-args>/.exec(n)?.[1]?.trim()??""}const d=new Map,F=64;export async function commandExecutions(n){const t=I(n);if(t===null)return d.delete(n),null;const i=d.get(n);d.delete(n);const e=i??{cur:{offset:0},out:[],pending:null};t<e.cur.offset&&(e.cur.offset=0,e.out=[],e.pending=null);const o=j(n,e.cur,t);if(o===null)return null;const s=e.out;let r=e.pending;for(const a of o){if(!a.includes("<command-")&&!a.includes("<local-command-stdout>")&&!a.includes("<bash-"))continue;let l;try{l=JSON.parse(a)}catch{continue}if(l===null||typeof l!="object")continue;const p=l,u=p.message?.content;if(typeof u!="string")continue;const f=R(p.timestamp),b=/<command-name>([^<]*)<\/command-name>/.exec(u)?.[1]?.trim();if(b?.startsWith("/")){r={name:b.slice(1),args:_(u),at:f};continue}const h=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(u)?.[1];if(h!==void 0){r={name:h.trim(),args:"",at:f,sigil:"!"};continue}const x=/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/.exec(u)?.[1]??/<bash-stdout>([\s\S]*?)<\/bash-stdout>/.exec(u)?.[1]??"";if(r===null)continue;const w=/<bash-stderr>([\s\S]*?)<\/bash-stderr>/.exec(u)?.[1]?.trim()??"",y=[x.replace(/\u001b\[[0-9;]*m/g,"").trim(),w?`[stderr] ${w}`:""].filter(Boolean).join(`
|
|
3
|
+
`);s.push({...r,...y!==""?{output:y}:{}}),r=null}if(e.pending=r,d.size>=F){const a=d.keys().next().value;a!==void 0&&d.delete(a)}return d.set(n,e),s}const U=6e4,N=16;export function createClaudeCommandSurface(n={}){const t=n.exec??L,i=new Map;return{harness:"claude",inputModes:[{kind:"slash",sigil:"/",named:!0},{kind:"bash",sigil:"!",named:!1}],async list({projectPath:e,homedir:o=M()}){const s=`${e}\0${o}`,r=Date.now(),a=i.get(s);if(a&&r-a.at<U)return a.rows;const l=c.join(o,".claude"),p=D([...E,...await H(c.join(e,".claude","commands")),...await H(c.join(l,"commands")),...await g(c.join(e,".claude","skills")),...await g(c.join(l,"skills")),...await z(t)??await $(l)]);if(i.size>=N){const u=i.keys().next().value;u!==void 0&&i.delete(u)}return i.set(s,{at:r,rows:p}),p},executions:e=>e?commandExecutions(e):Promise.resolve(null)}}export const CLAUDE_COMMANDS=createClaudeCommandSurface();
|