capt-hook 12.78.0__tar.gz → 12.78.1__tar.gz
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.
- {capt_hook-12.78.0 → capt_hook-12.78.1}/PKG-INFO +1 -1
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/.claude-plugin/plugin.json +1 -1
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/tooling.py +22 -10
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/cli.py +9 -0
- capt_hook-12.78.1/captain_hook/pause.py +89 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/update/cli.py +11 -0
- capt_hook-12.78.1/captain_hook/update/launchers.py +199 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/update/updater.py +21 -11
- {capt_hook-12.78.0 → capt_hook-12.78.1}/pyproject.toml +1 -1
- {capt_hook-12.78.0 → capt_hook-12.78.1}/.gitignore +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/LICENSE +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/README.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/capt_hook_client/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/capt_hook_client/__main__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/capt_hook_client/client.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/.mcp.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/__init__.pyi +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/__main__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/annotations.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/app.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/ast_grep.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/bindings.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/hooks/_lib.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/hooks/scratch_writes.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/hooks/teammate_permissions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/_lib.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/_sessions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/commands.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/comments.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/deletions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/detours.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/docs.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/hook_files.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/models.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/plain_english.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/plans.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/fragments/deliverable_rubric.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/fragments/workflow_script_header.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/browser_delegation_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/implementation_spawn_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/inline_edit_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_spawn_gate.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_workflow_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_spawn_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_workflow_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_spawn_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_workflow_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/plain_english_rules.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts/tools/preload_nudge.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/prompts.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/questions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/review.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/sessions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/tasks.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/tombstones.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/tools.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/pack.toml +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/go/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/go/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/go/hooks/testing.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/go/hooks/toolchain.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/gitdir/.graphite_repo_config +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/hooks/_lib.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/hooks/queue.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/graphite/hooks/vcs.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/performance/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/performance/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/performance/hooks/filesystem.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/performance/hooks/pipelining.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/python/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/python/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/python/hooks/style.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/python/hooks/testing.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/python/hooks/toolchain.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/hooks/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/hooks/steering.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/hooks/teammates.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/hooks/workarounds.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/steering/pack.toml +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/classifiers/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/classifiers/conductor.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/classifiers/droid.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/classifiers/lane.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/classifiers/native.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/cmd.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/command_schema.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/command_schemas.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/conditions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/confirm.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/context.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/contexts.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/context.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/decision_writer.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/logsink.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/registry.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/daemon/tree.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/decisions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/desktop/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/desktop/cli.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/desktop/client.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/dispatch.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/doc_conventions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/durable.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/events.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/faults.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/fields.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/file.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/guard_literal.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/guard_literal.sh +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/heartbeat.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/hook_lint.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/hooks/hooks.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/loader.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/log.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/mcp_server.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/packs/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/packs/manager.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/packs/plugins.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/commands.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/lint.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/llm.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/nudge.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/permissions.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/provision.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/rewrite.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/primitives/workflow.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/prompt.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/py.typed +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/announce.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/cli.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/dashboard.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/fix.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/formats.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/judge.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/notify.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/pipeline.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/prompts.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/repo.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/routing.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/scan.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/settings.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/snapshot.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/status.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/store.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/sync.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/review/triage.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/scripts/install-binary.sh +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/scripts/install-mcp.sh +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/session.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/settings.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/signals/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/signals/nlp.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/authoring-hooks/SKILL.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/authoring-hooks/references/capt-hook-api.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/authoring-hooks/references/pattern-catalog.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/authoring-hooks/references/pitfalls.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/authoring-hooks/references/testing-hooks.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/bootstrapping-hooks/SKILL.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/scanning-sessions/SKILL.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/scanning-sessions/references/pr-workflow.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/scanning-sessions/references/review-cli.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/translating-styleguides/SKILL.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/translating-styleguides/references/llm-rule-patterns.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/translating-styleguides/references/matcher-reference.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/skills/translating-styleguides/references/tier-rubric.md +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/client.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/contracts.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/review.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schema.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/config.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/context.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/host-request.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/host-response.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/request.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/response.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/schemas/tool_registry.schema.json +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/validation.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/snapshots/worker.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/state.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/style/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/style/ast_grep.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/style/matchers.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/style/scope.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/style/types.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/tasks.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/templates/example_hook.py.tmpl +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/fixtures.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/helpers.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/session_cache.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/snapshots.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/testing/types.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/transcripts.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/turn.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/types.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/update/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/update/settings.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/automode.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/caching.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/fs.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/globbing.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/http.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/model_cache.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/paths.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/payload.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/proc.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/reqenv.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/scratch.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/shell.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/text.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/userpath.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/util/vcs.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/__init__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/__main__.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/fail_open.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/protocol.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/runtime.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/worker/service.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/hatch_build.py +0 -0
- {capt_hook-12.78.0 → capt_hook-12.78.1}/internal/wireproto/guard.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "captain-hook",
|
|
3
|
-
"version": "12.77.
|
|
3
|
+
"version": "12.77.2",
|
|
4
4
|
"displayName": "Captain Hook",
|
|
5
5
|
"description": "Skills for the capt-hook declarative hook framework: bootstrap gates and nudges from a repo's conventions, and translate style guides into enforced StyleRules.",
|
|
6
6
|
"author": {
|
|
@@ -142,10 +142,21 @@ class Signature:
|
|
|
142
142
|
verbs: tuple[Verb, ...]
|
|
143
143
|
lane_name: re.Pattern[str]
|
|
144
144
|
window: timedelta | None = None
|
|
145
|
+
failures_only: bool = False
|
|
145
146
|
|
|
146
147
|
def sourced(self, evt: BaseHookEvent) -> bool:
|
|
147
148
|
return any(verb.ran(evt) for verb in self.verbs)
|
|
148
149
|
|
|
150
|
+
def refused_text(self, evt: BaseHookEvent) -> str:
|
|
151
|
+
if not self.failures_only:
|
|
152
|
+
return result_text(evt)
|
|
153
|
+
if isinstance(evt, PostToolUseFailureEvent):
|
|
154
|
+
return evt.error
|
|
155
|
+
match getattr(evt, "tool_response", None):
|
|
156
|
+
case {"stderr": str() as stderr}:
|
|
157
|
+
return stderr
|
|
158
|
+
return ""
|
|
159
|
+
|
|
149
160
|
def expires(self, text: str) -> datetime | None:
|
|
150
161
|
if found := RESET.search(text):
|
|
151
162
|
return datetime.fromisoformat(found["at"])
|
|
@@ -192,6 +203,7 @@ SIGNATURES = (
|
|
|
192
203
|
GITHUB_VERBS,
|
|
193
204
|
re.compile(r"(?<![\w])(?:gh|github|graphql)-(?:quota|rate-limit)"),
|
|
194
205
|
timedelta(hours=1),
|
|
206
|
+
failures_only=True,
|
|
195
207
|
),
|
|
196
208
|
)
|
|
197
209
|
|
|
@@ -260,9 +272,8 @@ def excerpt(text: str, match: re.Match[str]) -> str:
|
|
|
260
272
|
|
|
261
273
|
|
|
262
274
|
def refusal(evt: BaseHookEvent) -> tuple[str, Refusal] | None:
|
|
263
|
-
text = result_text(evt)
|
|
264
275
|
for signature in SIGNATURES:
|
|
265
|
-
if signature.sourced(evt) and (found := signature.text.search(text)):
|
|
276
|
+
if signature.sourced(evt) and (found := signature.text.search(text := signature.refused_text(evt))):
|
|
266
277
|
return signature.key, Refusal(
|
|
267
278
|
tool=signature.tool,
|
|
268
279
|
verbs=tuple(verb.text for verb in signature.verbs),
|
|
@@ -485,6 +496,12 @@ SLACK_REFUSED = ToolingRefusals(
|
|
|
485
496
|
)
|
|
486
497
|
}
|
|
487
498
|
)
|
|
499
|
+
PR_236_BODY = (
|
|
500
|
+
"Context: The deterministic tooling-refusal path added in #234 blocked an unrelated cc-slack CLI\n"
|
|
501
|
+
"rebuild dispatch because its prompt included `ccx vcs worktree add`. The quota record came from\n"
|
|
502
|
+
'`ccx code read` printing an inline test containing "GitHub GraphQL quota exhausted"; a documentation\n'
|
|
503
|
+
"excerpt about `rate-limited until` produced another false record and blocked a PR watcher.\n"
|
|
504
|
+
)
|
|
488
505
|
CC_SLACK_CLI_SYNC = (
|
|
489
506
|
"You are cc-slack-cli-sync. Defect: every cc-slack CLI call from lanes now fails: the daemon runs a newer "
|
|
490
507
|
"release than this CLI. Use a fresh worktree `ccx vcs worktree add cc-slack-cli-sync` if you need to build, "
|
|
@@ -514,15 +531,10 @@ CC_SLACK_CLI_SYNC = (
|
|
|
514
531
|
Input(
|
|
515
532
|
command="ccx vcs pr status 12",
|
|
516
533
|
output="ccx: GitHub GraphQL quota exhausted; rate-limited until 2026-10-01T22:05:00Z",
|
|
517
|
-
):
|
|
518
|
-
Input(
|
|
519
|
-
command="gh pr view 12 --json state",
|
|
520
|
-
output="GraphQL: API rate limit exceeded for user ID 1",
|
|
521
|
-
): Warn(pattern="`ccx: tooling-lane=github-quota`"),
|
|
534
|
+
): Allow(),
|
|
522
535
|
Input(
|
|
523
|
-
command="
|
|
524
|
-
output=
|
|
525
|
-
state=[ToolingRefusals(lanes={"github-quota"})],
|
|
536
|
+
command="gh pr view 236 --repo yasyf/captain-hook --json body -q .body",
|
|
537
|
+
output=PR_236_BODY,
|
|
526
538
|
): Allow(),
|
|
527
539
|
Input(
|
|
528
540
|
command="ccx code read captain_hook/builtin_packs/general/hooks/tooling.py --section 400-415",
|
|
@@ -33,11 +33,13 @@ from captain_hook.loader import (
|
|
|
33
33
|
)
|
|
34
34
|
from captain_hook.log import setup_logging
|
|
35
35
|
from captain_hook.packs import manager, plugins
|
|
36
|
+
from captain_hook.pause import pause, resume
|
|
36
37
|
from captain_hook.review.cli import review
|
|
37
38
|
from captain_hook.review.pipeline import DISPATCH_EVENTS, dispatch_review
|
|
38
39
|
from captain_hook.session import SessionStore, cleanup_stale, ensure_session
|
|
39
40
|
from captain_hook.types import TOOL_EVENTS, Event
|
|
40
41
|
from captain_hook.update.cli import update
|
|
42
|
+
from captain_hook.update.launchers import dispatch_launcher_check
|
|
41
43
|
from captain_hook.update.updater import dispatch_update
|
|
42
44
|
|
|
43
45
|
if TYPE_CHECKING:
|
|
@@ -339,6 +341,11 @@ def after_reply(event: Event, evt: BaseHookEvent, raw: dict[str, Any], session_d
|
|
|
339
341
|
except Exception as exc:
|
|
340
342
|
logger.exception("native update dispatch failed")
|
|
341
343
|
faults.record("update dispatch", exc, raw.get("cwd"))
|
|
344
|
+
try:
|
|
345
|
+
dispatch_launcher_check()
|
|
346
|
+
except Exception as exc:
|
|
347
|
+
logger.exception("native launcher check dispatch failed")
|
|
348
|
+
faults.record("launcher check dispatch", exc, raw.get("cwd"))
|
|
342
349
|
try:
|
|
343
350
|
cleanup_stale(exclude=SessionId(sid) if (sid := raw.get("session_id")) else None)
|
|
344
351
|
except Exception:
|
|
@@ -1051,6 +1058,8 @@ def mcp() -> None:
|
|
|
1051
1058
|
cli.add_command(review)
|
|
1052
1059
|
cli.add_command(helper)
|
|
1053
1060
|
cli.add_command(update)
|
|
1061
|
+
cli.add_command(pause)
|
|
1062
|
+
cli.add_command(resume)
|
|
1054
1063
|
|
|
1055
1064
|
|
|
1056
1065
|
main = cli
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""``capt-hook pause`` and ``capt-hook resume``: the sanctioned, self-expiring way to quiet every hook.
|
|
2
|
+
|
|
3
|
+
``pause`` writes ``pause.json`` into the state dir with the expiry as epoch seconds. The signed host's
|
|
4
|
+
``run`` client reads it before it opens a session to the daemon, so while it holds, every event of every
|
|
5
|
+
session — whichever plugin version it is pinned to — returns at once without dispatch, and a
|
|
6
|
+
``SessionStart`` prints a banner naming the expiry. Nothing has to lift it: past ``until`` the host
|
|
7
|
+
ignores the file. The host also ignores a pause longer than :data:`MAX_PAUSE`.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import re
|
|
14
|
+
from datetime import datetime, timedelta
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
import click
|
|
18
|
+
|
|
19
|
+
from captain_hook.util.fs import atomic_write, read_json
|
|
20
|
+
from captain_hook.util.paths import resolve_state_dir
|
|
21
|
+
|
|
22
|
+
PAUSE_FILE = "pause.json"
|
|
23
|
+
MAX_PAUSE = timedelta(hours=1)
|
|
24
|
+
DURATION = re.compile(r"(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def pause_path() -> Path:
|
|
28
|
+
return resolve_state_dir() / PAUSE_FILE
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def parse_duration(text: str) -> timedelta:
|
|
32
|
+
if not (match := DURATION.fullmatch(text.strip())) or not any(match.groups()):
|
|
33
|
+
raise click.BadParameter(f"{text!r} is not a duration like 30m, 1h, or 1h30m")
|
|
34
|
+
hours, minutes, seconds = (int(group or 0) for group in match.groups())
|
|
35
|
+
if not timedelta() < (span := timedelta(hours=hours, minutes=minutes, seconds=seconds)) <= MAX_PAUSE:
|
|
36
|
+
raise click.BadParameter(f"a pause lasts more than 0s and at most {format_span(MAX_PAUSE)}")
|
|
37
|
+
return span
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def format_span(span: timedelta) -> str:
|
|
41
|
+
minutes, seconds = divmod(int(span.total_seconds()), 60)
|
|
42
|
+
hours, minutes = divmod(minutes, 60)
|
|
43
|
+
return "".join(f"{value}{unit}" for value, unit in ((hours, "h"), (minutes, "m"), (seconds, "s")) if value) or "0s"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def active_pause(now: datetime) -> tuple[datetime, str | None] | None:
|
|
47
|
+
match read_json(pause_path()):
|
|
48
|
+
case {"until": int(until), "reason": str() | None as reason} if (
|
|
49
|
+
timedelta() < (expiry := datetime.fromtimestamp(until).astimezone()) - now <= MAX_PAUSE
|
|
50
|
+
):
|
|
51
|
+
return expiry, reason
|
|
52
|
+
case _:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def describe(expiry: datetime, reason: str | None, now: datetime) -> str:
|
|
57
|
+
because = f" ({reason})" if reason else ""
|
|
58
|
+
return f"hooks paused until {expiry:%H:%M %Z}, {format_span(expiry - now)} from now{because}"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@click.command(name="pause")
|
|
62
|
+
@click.option(
|
|
63
|
+
"--for", "duration", default=None, help=f"How long to pause, like 30m or 1h30m (at most {format_span(MAX_PAUSE)})"
|
|
64
|
+
)
|
|
65
|
+
@click.option("--reason", default=None, help="Why, shown in the banner every new session prints")
|
|
66
|
+
@click.option("--status", is_flag=True, default=False, help="Show the pause in effect instead of setting one")
|
|
67
|
+
def pause(duration: str | None, reason: str | None, status: bool) -> None:
|
|
68
|
+
"""Pause every capt-hook hook, guards included, for a while; it lifts by itself at expiry.
|
|
69
|
+
|
|
70
|
+
The one sanctioned way to quiet hooks: never edit the plugin cache. `capt-hook resume` lifts it early.
|
|
71
|
+
"""
|
|
72
|
+
now = datetime.now().astimezone()
|
|
73
|
+
match status, duration:
|
|
74
|
+
case True, None:
|
|
75
|
+
click.echo(describe(*held, now) if (held := active_pause(now)) else "hooks are not paused")
|
|
76
|
+
case False, str():
|
|
77
|
+
expiry = now + parse_duration(duration)
|
|
78
|
+
atomic_write(pause_path(), json.dumps({"until": int(expiry.timestamp()), "reason": reason}))
|
|
79
|
+
click.echo(f"{describe(expiry, reason, now)}; `capt-hook resume` lifts it now")
|
|
80
|
+
case _:
|
|
81
|
+
raise click.UsageError("pass --for DURATION to pause, or --status alone to show the pause")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@click.command(name="resume")
|
|
85
|
+
def resume() -> None:
|
|
86
|
+
"""Lift a ``capt-hook pause`` before it expires."""
|
|
87
|
+
held = active_pause(datetime.now().astimezone())
|
|
88
|
+
pause_path().unlink(missing_ok=True)
|
|
89
|
+
click.echo("hooks resumed" if held else "hooks were not paused")
|
|
@@ -17,3 +17,14 @@ def run_hook(check_only: bool) -> None:
|
|
|
17
17
|
from captain_hook.update.updater import run_update
|
|
18
18
|
|
|
19
19
|
run_update(apply=not check_only)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@update.command(name="launchers")
|
|
23
|
+
def launchers() -> None:
|
|
24
|
+
"""Restore any captain-hook plugin launcher (bin/hook) that differs from what its version shipped."""
|
|
25
|
+
from captain_hook.update.launchers import check_launchers
|
|
26
|
+
|
|
27
|
+
restored = check_launchers()
|
|
28
|
+
click.echo(
|
|
29
|
+
f"restored bin/hook in {', '.join(restored)}" if restored else "every checked launcher matches what shipped"
|
|
30
|
+
)
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"""Restore any captain-hook plugin launcher whose ``bin/hook`` differs from what its version shipped.
|
|
2
|
+
|
|
3
|
+
Every live session runs the ``bin/hook`` of the plugin version it started on, so an agent that rewrites
|
|
4
|
+
that file — to quiet hooks the sanctioned :mod:`captain_hook.pause` would have quieted — turns every hook
|
|
5
|
+
of every session pinned there into a silent no-op while Claude Code still reports each one a success.
|
|
6
|
+
The check covers each install ``installed_plugins.json`` names under the captain-hook cache and each
|
|
7
|
+
version dir a live session still has registered in ``.in_use``.
|
|
8
|
+
|
|
9
|
+
What a version shipped is read from git, never inferred: the install's ``gitCommitSha``, or the
|
|
10
|
+
``v<version>`` release tag for a version dir the roster no longer names. A private bare mirror under the
|
|
11
|
+
update state dir fetches each ref once, shallow and without blobs, and the launcher's mode and blob id
|
|
12
|
+
are cached in :data:`SHIPPED_RECORD`, so a check that finds nothing to repair runs no git at all. A
|
|
13
|
+
repair fetches the one blob it needs and swaps it in atomically, keeping a shipped symlink a symlink.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import hashlib
|
|
19
|
+
import json
|
|
20
|
+
import os
|
|
21
|
+
import re
|
|
22
|
+
import stat
|
|
23
|
+
import subprocess
|
|
24
|
+
from dataclasses import dataclass
|
|
25
|
+
from datetime import timedelta
|
|
26
|
+
from pathlib import Path
|
|
27
|
+
|
|
28
|
+
from captain_hook import faults
|
|
29
|
+
from captain_hook.review.pipeline import SPAWNED_ENV
|
|
30
|
+
from captain_hook.update.updater import breadcrumb, claim, spawn, update_dir, version_tuple
|
|
31
|
+
from captain_hook.util import reqenv
|
|
32
|
+
from captain_hook.util.fs import atomic_write, read_json
|
|
33
|
+
from captain_hook.util.paths import resolve_claude_config_dir
|
|
34
|
+
|
|
35
|
+
PLUGIN = "captain-hook"
|
|
36
|
+
ROSTER_ID = f"{PLUGIN}@{PLUGIN}"
|
|
37
|
+
REMOTE = "https://github.com/yasyf/captain-hook.git"
|
|
38
|
+
LAUNCHER = "bin/hook"
|
|
39
|
+
SOURCE_DIR = "captain_hook"
|
|
40
|
+
SHIPPED_RECORD = "launchers.json"
|
|
41
|
+
MIRROR = "launchers.git"
|
|
42
|
+
CHECK_STAMP = "launchers.stamp"
|
|
43
|
+
CHECK_INTERVAL = timedelta(minutes=10)
|
|
44
|
+
GIT_TIMEOUT = 120.0
|
|
45
|
+
SYMLINK_MODE = "120000"
|
|
46
|
+
VERSION = re.compile(r"\d+(?:\.\d+)+")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class LauncherTampered(Exception):
|
|
50
|
+
"""A plugin launcher no longer matched what its version shipped and was restored."""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@dataclass(frozen=True, slots=True)
|
|
54
|
+
class Shipped:
|
|
55
|
+
mode: str
|
|
56
|
+
oid: str
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def cache_root() -> Path:
|
|
60
|
+
return resolve_claude_config_dir() / "plugins" / "cache" / PLUGIN / PLUGIN
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def alive(pid: int) -> bool:
|
|
64
|
+
try:
|
|
65
|
+
os.kill(pid, 0)
|
|
66
|
+
except ProcessLookupError:
|
|
67
|
+
return False
|
|
68
|
+
except PermissionError:
|
|
69
|
+
return True
|
|
70
|
+
return True
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def in_use(version: Path) -> bool:
|
|
74
|
+
return (marks := version / ".in_use").is_dir() and any(
|
|
75
|
+
alive(int(mark.name)) for mark in marks.iterdir() if mark.name.isdigit()
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def release_ref(version: Path) -> str:
|
|
80
|
+
return f"refs/tags/v{version.name}"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def candidates() -> dict[Path, str]:
|
|
84
|
+
root = cache_root()
|
|
85
|
+
live = {
|
|
86
|
+
version: release_ref(version)
|
|
87
|
+
for version in (root.iterdir() if root.is_dir() else ())
|
|
88
|
+
if VERSION.fullmatch(version.name) and in_use(version)
|
|
89
|
+
}
|
|
90
|
+
roster = read_json(resolve_claude_config_dir() / "plugins" / "installed_plugins.json", {})
|
|
91
|
+
installed = {
|
|
92
|
+
path: entry.get("gitCommitSha") or release_ref(path)
|
|
93
|
+
for entry in roster.get("plugins", {}).get(ROSTER_ID, [])
|
|
94
|
+
if (path := Path(entry["installPath"])).parent == root and VERSION.fullmatch(path.name)
|
|
95
|
+
}
|
|
96
|
+
return {path: ref for path, ref in (live | installed).items() if (path / "bin").is_dir()}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def blob_id(data: bytes) -> str:
|
|
100
|
+
return hashlib.sha1(b"blob %d\0" % len(data) + data, usedforsecurity=False).hexdigest()
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def on_disk(launcher: Path) -> Shipped | None:
|
|
104
|
+
try:
|
|
105
|
+
info = launcher.lstat()
|
|
106
|
+
if stat.S_ISLNK(info.st_mode):
|
|
107
|
+
return Shipped(SYMLINK_MODE, blob_id(os.fsencode(os.readlink(launcher))))
|
|
108
|
+
return Shipped("100755" if info.st_mode & stat.S_IXUSR else "100644", blob_id(launcher.read_bytes()))
|
|
109
|
+
except FileNotFoundError:
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def run_git(*args: str) -> subprocess.CompletedProcess[bytes]:
|
|
114
|
+
return subprocess.run(["git", *args], capture_output=True, timeout=GIT_TIMEOUT, check=True)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def git(*args: str) -> subprocess.CompletedProcess[bytes]:
|
|
118
|
+
return run_git("-C", str(mirror()), *args)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def mirror() -> Path:
|
|
122
|
+
if not ((path := update_dir() / MIRROR) / "HEAD").exists():
|
|
123
|
+
run_git("init", "--bare", "-q", str(path))
|
|
124
|
+
run_git("-C", str(path), "remote", "add", "origin", REMOTE)
|
|
125
|
+
return path
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def resolve_shipped(ref: str) -> Shipped:
|
|
129
|
+
spec = f"+{ref}:{ref}" if ref.startswith("refs/") else ref
|
|
130
|
+
git("fetch", "-q", "--depth=1", "--filter=blob:none", "origin", spec)
|
|
131
|
+
mode, _, oid = git("ls-tree", ref, f"{SOURCE_DIR}/{LAUNCHER}").stdout.decode().split("\t")[0].split(" ")
|
|
132
|
+
return Shipped(mode, oid)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def shipped_for(refs: set[str]) -> dict[str, Shipped]:
|
|
136
|
+
record = update_dir() / SHIPPED_RECORD
|
|
137
|
+
known = {ref: Shipped(*value) for ref, value in read_json(record, {}).items()}
|
|
138
|
+
if missing := refs - known.keys():
|
|
139
|
+
for ref in sorted(missing):
|
|
140
|
+
try:
|
|
141
|
+
known[ref] = resolve_shipped(ref)
|
|
142
|
+
except (OSError, subprocess.SubprocessError, ValueError) as exc:
|
|
143
|
+
breadcrumb(f"launcher check: cannot resolve what {ref} shipped: {exc}")
|
|
144
|
+
atomic_write(record, json.dumps({ref: [s.mode, s.oid] for ref, s in known.items()}))
|
|
145
|
+
return known
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def restore(launcher: Path, shipped: Shipped) -> None:
|
|
149
|
+
content = git("cat-file", "blob", shipped.oid).stdout
|
|
150
|
+
staged = launcher.with_name(f".{launcher.name}.restore-{os.getpid()}")
|
|
151
|
+
staged.unlink(missing_ok=True)
|
|
152
|
+
if shipped.mode == SYMLINK_MODE:
|
|
153
|
+
os.symlink(os.fsdecode(content), staged)
|
|
154
|
+
else:
|
|
155
|
+
staged.write_bytes(content)
|
|
156
|
+
staged.chmod(0o755 if shipped.mode == "100755" else 0o644)
|
|
157
|
+
os.replace(staged, launcher)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def describe(found: Shipped | None) -> str:
|
|
161
|
+
match found:
|
|
162
|
+
case None:
|
|
163
|
+
return "missing"
|
|
164
|
+
case Shipped(mode=mode, oid=oid):
|
|
165
|
+
return f"{'symlink' if mode == SYMLINK_MODE else 'file'} {oid[:12]}"
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def check_launchers() -> list[str]:
|
|
169
|
+
"""Restore every checked ``bin/hook`` that differs from what its version shipped; the versions restored."""
|
|
170
|
+
targets = candidates()
|
|
171
|
+
shipped = shipped_for(set(targets.values()))
|
|
172
|
+
restored: list[str] = []
|
|
173
|
+
for version, ref in sorted(targets.items(), key=lambda target: version_tuple(target[0].name)):
|
|
174
|
+
if (expected := shipped.get(ref)) is None or (found := on_disk(launcher := version / LAUNCHER)) == expected:
|
|
175
|
+
continue
|
|
176
|
+
try:
|
|
177
|
+
restore(launcher, expected)
|
|
178
|
+
except (OSError, subprocess.SubprocessError) as exc:
|
|
179
|
+
breadcrumb(f"launcher restore failed: {version.name} ({describe(found)}): {exc}")
|
|
180
|
+
continue
|
|
181
|
+
breadcrumb(f"launcher restored: {version.name} {LAUNCHER} was {describe(found)}, shipped {describe(expected)}")
|
|
182
|
+
restored.append(version.name)
|
|
183
|
+
if restored:
|
|
184
|
+
faults.record(
|
|
185
|
+
"plugin launcher",
|
|
186
|
+
LauncherTampered(
|
|
187
|
+
f"restored the shipped {LAUNCHER} of captain-hook {', '.join(restored)}, which had been rewritten "
|
|
188
|
+
"and silenced every hook of the sessions pinned there. Quiet hooks only through "
|
|
189
|
+
"`capt-hook pause --for <duration>`; never edit the plugin cache."
|
|
190
|
+
),
|
|
191
|
+
)
|
|
192
|
+
return restored
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def dispatch_launcher_check() -> None:
|
|
196
|
+
"""Async SessionStart entry: at most once per :data:`CHECK_INTERVAL`, detach ``capt-hook update launchers``."""
|
|
197
|
+
if reqenv.getenv(SPAWNED_ENV) or not claim(CHECK_STAMP, CHECK_INTERVAL):
|
|
198
|
+
return
|
|
199
|
+
spawn(["launchers"])
|
|
@@ -240,18 +240,23 @@ def run_update(*, apply: bool = True) -> None:
|
|
|
240
240
|
notify(kind="update_failed", title="Captain Hook update failed", body=f"Could not upgrade the host to {latest}.")
|
|
241
241
|
|
|
242
242
|
|
|
243
|
-
def update_argv(
|
|
244
|
-
# -P:
|
|
243
|
+
def update_argv(*args: str) -> list[str]:
|
|
244
|
+
# -P: spawn() runs this from the session's repo, and `-m` would otherwise put that repo at the
|
|
245
245
|
# head of sys.path, where a directory sharing a dependency's name shadows the installed one.
|
|
246
|
-
return [sys.executable, "-P", "-m", "captain_hook", "update",
|
|
246
|
+
return [sys.executable, "-P", "-m", "captain_hook", "update", *args]
|
|
247
247
|
|
|
248
248
|
|
|
249
|
-
def
|
|
249
|
+
def run_args(*, apply: bool) -> list[str]:
|
|
250
|
+
return ["run", *([] if apply else ["--check-only"])]
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def spawn(args: list[str]) -> None:
|
|
254
|
+
command = " ".join(["update", *args])
|
|
250
255
|
try:
|
|
251
256
|
(log_path := update_log_path()).parent.mkdir(parents=True, exist_ok=True)
|
|
252
257
|
with log_path.open("ab") as log:
|
|
253
258
|
subprocess.Popen(
|
|
254
|
-
update_argv(
|
|
259
|
+
update_argv(*args),
|
|
255
260
|
stdin=subprocess.DEVNULL,
|
|
256
261
|
stdout=log,
|
|
257
262
|
stderr=log,
|
|
@@ -260,15 +265,19 @@ def detach(*, apply: bool) -> None:
|
|
|
260
265
|
env=reqenv.env_map() | {SPAWNED_ENV: "1"},
|
|
261
266
|
)
|
|
262
267
|
except OSError:
|
|
263
|
-
breadcrumb("detach failed:
|
|
268
|
+
breadcrumb(f"detach failed: {command}")
|
|
264
269
|
return
|
|
265
|
-
breadcrumb(f"spawned
|
|
270
|
+
breadcrumb(f"spawned {command}")
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def detach(*, apply: bool) -> None:
|
|
274
|
+
spawn(run_args(apply=apply))
|
|
266
275
|
|
|
267
276
|
|
|
268
|
-
def claim(stamp: str,
|
|
277
|
+
def claim(stamp: str, window: timedelta) -> bool:
|
|
269
278
|
try:
|
|
270
279
|
(stamps := update_dir()).mkdir(parents=True, exist_ok=True)
|
|
271
|
-
return _claim_stamp(stamps / stamp,
|
|
280
|
+
return _claim_stamp(stamps / stamp, window)
|
|
272
281
|
except OSError:
|
|
273
282
|
return False
|
|
274
283
|
|
|
@@ -292,11 +301,12 @@ def dispatch_update() -> None:
|
|
|
292
301
|
breadcrumb("update skip: CAPT_HOOK_SPAWNED set")
|
|
293
302
|
return
|
|
294
303
|
apply = not reqenv.is_headless()
|
|
304
|
+
window = timedelta(minutes=settings.interval_minutes)
|
|
295
305
|
if apply and pending() is not None:
|
|
296
|
-
if not claim(APPLY_STAMP,
|
|
306
|
+
if not claim(APPLY_STAMP, window):
|
|
297
307
|
breadcrumb("update skip: a deferred update is already claimed")
|
|
298
308
|
return
|
|
299
|
-
elif not claim(UPDATE_STAMP,
|
|
309
|
+
elif not claim(UPDATE_STAMP, window):
|
|
300
310
|
breadcrumb("update skip: throttled")
|
|
301
311
|
return
|
|
302
312
|
detach(apply=apply)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "capt-hook"
|
|
3
3
|
# Inert sentinel — the real version is stamped from the release tag (uv version --frozen).
|
|
4
|
-
version = "12.78.
|
|
4
|
+
version = "12.78.1"
|
|
5
5
|
description = "Stop repeating yourself to Claude."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
license = "PolyForm-Noncommercial-1.0.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/fixes/hooks/scratch_writes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/_sessions.py
RENAMED
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/commands.py
RENAMED
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/comments.py
RENAMED
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/deletions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/hook_files.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/plain_english.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/questions.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/sessions.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.0 → capt_hook-12.78.1}/captain_hook/builtin_packs/general/hooks/tombstones.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|