@event4u/agent-config 2.2.2 → 2.4.0

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.
Files changed (68) hide show
  1. package/.agent-src/commands/onboard.md +14 -9
  2. package/.agent-src/rules/external-reference-deep-dive.md +69 -0
  3. package/.agent-src/skills/ai-council/SKILL.md +5 -3
  4. package/.agent-src/skills/using-git-worktrees/SKILL.md +1 -1
  5. package/.agent-src/templates/agents/agent-project-settings.example.yml +4 -3
  6. package/.agent-src/templates/copilot-instructions.md +7 -0
  7. package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +29 -7
  8. package/.agent-src/templates/scripts/work_engine/_lib/user_global_paths.py +249 -0
  9. package/.agent-src/templates/scripts/work_engine/hooks/settings.py +8 -5
  10. package/.claude-plugin/marketplace.json +27 -1
  11. package/CHANGELOG.md +79 -0
  12. package/README.md +1 -8
  13. package/config/agent-settings.template.yml +5 -3
  14. package/docs/architecture.md +1 -1
  15. package/docs/catalog.md +5 -3
  16. package/docs/contracts/installed-tools-lockfile.md +142 -0
  17. package/docs/customization.md +23 -17
  18. package/docs/decisions/ADR-007-agent-discovery-scopes.md +6 -0
  19. package/docs/decisions/ADR-009-event4u-namespace.md +188 -0
  20. package/docs/decisions/INDEX.md +1 -0
  21. package/docs/development.md +37 -0
  22. package/docs/getting-started.md +1 -1
  23. package/docs/guidelines/agent-infra/installed-tools-manifest.md +1 -1
  24. package/docs/guidelines/agent-infra/layered-settings.md +6 -4
  25. package/docs/installation.md +17 -2
  26. package/docs/migration/v1-to-v2.md +45 -0
  27. package/docs/setup/per-ide/antigravity.md +63 -0
  28. package/docs/setup/per-ide/augment.md +77 -0
  29. package/docs/setup/per-ide/claude-desktop.md +107 -65
  30. package/docs/setup/per-ide/codebuddy.md +63 -0
  31. package/docs/setup/per-ide/continue.md +68 -0
  32. package/docs/setup/per-ide/droid.md +65 -0
  33. package/docs/setup/per-ide/jetbrains.md +76 -0
  34. package/docs/setup/per-ide/kilocode.md +66 -0
  35. package/docs/setup/per-ide/kiro.md +72 -0
  36. package/docs/setup/per-ide/opencode.md +62 -0
  37. package/docs/setup/per-ide/qoder.md +63 -0
  38. package/docs/setup/per-ide/roocode.md +68 -0
  39. package/docs/setup/per-ide/trae.md +63 -0
  40. package/docs/setup/per-ide/warp.md +63 -0
  41. package/docs/setup/per-ide/zed.md +73 -0
  42. package/package.json +1 -1
  43. package/scripts/_cli/cmd_doctor.py +351 -0
  44. package/scripts/_cli/cmd_prune.py +317 -0
  45. package/scripts/_cli/cmd_uninstall.py +465 -0
  46. package/scripts/_cli/cmd_update.py +30 -4
  47. package/scripts/_cli/cmd_versions.py +147 -0
  48. package/scripts/_lib/agent_settings.py +29 -7
  49. package/scripts/_lib/agents_overlay.py +15 -4
  50. package/scripts/_lib/claude_desktop_bundler.py +150 -0
  51. package/scripts/_lib/fs_atomic.py +116 -0
  52. package/scripts/_lib/installed_lock.py +37 -4
  53. package/scripts/_lib/installed_tools.py +189 -45
  54. package/scripts/_lib/json_pointers.py +260 -0
  55. package/scripts/_lib/update_check.py +29 -5
  56. package/scripts/_lib/user_global_paths.py +249 -0
  57. package/scripts/agent-config +69 -0
  58. package/scripts/ai_council/__init__.py +4 -3
  59. package/scripts/ai_council/budget_guard.py +34 -4
  60. package/scripts/ai_council/bundler.py +2 -0
  61. package/scripts/ai_council/clients.py +28 -7
  62. package/scripts/compress.py +78 -15
  63. package/scripts/install +8 -0
  64. package/scripts/install-hooks.sh +54 -1
  65. package/scripts/install.py +1149 -53
  66. package/scripts/install_anthropic_key.sh +5 -3
  67. package/scripts/install_openai_key.sh +5 -3
  68. package/scripts/skill_trigger_eval.py +13 -2
package/scripts/install CHANGED
@@ -39,6 +39,11 @@
39
39
  # prompt = always show the 3-option chooser
40
40
  # --custom-path <d> Use <d> as the project root when prompted; rejected with
41
41
  # --scope=global / --global.
42
+ # --offline Skip every network call (post-install update banner +
43
+ # downstream registry fetchers). Sets AGENT_CONFIG_OFFLINE=1
44
+ # for child subprocesses. All bridge content is bundled
45
+ # in the package, so install itself is already offline-safe;
46
+ # this flag is the explicit air-gap / CI guarantee.
42
47
  # --help, -h Show this help
43
48
  #
44
49
  # Examples:
@@ -69,6 +74,7 @@ LIST_TOOLS=false
69
74
  GLOBAL=false
70
75
  SCOPE=""
71
76
  CUSTOM_PATH=""
77
+ OFFLINE=false
72
78
 
73
79
  # Single source of truth for valid tool IDs (also referenced by install.sh / install.py).
74
80
  VALID_TOOLS="claude-code claude-desktop cursor windsurf cline gemini-cli copilot augment aider codex roocode continue kilocode zed jetbrains kiro all"
@@ -150,6 +156,7 @@ while [[ $# -gt 0 ]]; do
150
156
  --scope=*) SCOPE="${1#*=}"; shift ;;
151
157
  --custom-path) CUSTOM_PATH="$2"; shift 2 ;;
152
158
  --custom-path=*) CUSTOM_PATH="${1#*=}"; shift ;;
159
+ --offline) OFFLINE=true; shift ;;
153
160
  --help|-h) show_help; exit 0 ;;
154
161
  *) err "Unknown argument: $1"; show_help >&2; exit 1 ;;
155
162
  esac
@@ -297,6 +304,7 @@ run_bridges() {
297
304
  $GLOBAL && args+=(--global)
298
305
  [[ -n "$SCOPE" ]] && args+=(--scope="$SCOPE")
299
306
  [[ -n "$CUSTOM_PATH" ]] && args+=(--custom-path="$CUSTOM_PATH")
307
+ $OFFLINE && args+=(--offline)
300
308
  args+=(--tools="$TOOLS")
301
309
  "$python_bin" "$INSTALL_PY" "${args[@]}"
302
310
  }
@@ -119,7 +119,9 @@ if [ -x ./agent-config ]; then
119
119
  ./agent-config chat-history:checkpoint --payload "\$payload" \
120
120
  >/dev/null 2>&1 || true
121
121
  fi
122
- exit 0
122
+ # NOTE: no explicit exit 0 here — the auto-sync block (appended below
123
+ # for post-merge / post-checkout) needs to run after this. Every
124
+ # command above is guarded by "|| true", so the implicit exit is 0.
123
125
  EOF
124
126
  chmod +x "$HOOKS_DIR/$name"
125
127
  echo "✅ $name hook installed."
@@ -129,3 +131,54 @@ write_chat_history_hook "post-commit" "git:post-commit"
129
131
  write_chat_history_hook "post-merge" "git:post-merge"
130
132
  write_chat_history_hook "post-checkout" "git:post-checkout"
131
133
  write_chat_history_hook "post-rewrite" "git:post-rewrite"
134
+
135
+ # Auto-sync agent-tool projections after pull / branch-switch ---------------
136
+ #
137
+ # When `.agent-src.uncompressed/`, `.agent-src/`, `scripts/compress.py`,
138
+ # `.agent-tools.yml`, or `Taskfile.yml` change between the previous and
139
+ # new HEAD, the developer's working tree has stale `.claude/`,
140
+ # `.augment/`, etc. projections until they remember to run `task sync`.
141
+ # These hooks bridge that gap: fast idempotent re-projection.
142
+ #
143
+ # Bypass: `git pull --no-verify` does not exist, but devs can disable the
144
+ # hooks per-command via `git -c core.hooksPath=/dev/null ...` or by
145
+ # editing the file. Runtime ~200 ms when nothing relevant changed
146
+ # (path-diff check exits early); ~2 s on full re-projection.
147
+
148
+ append_auto_sync_block() {
149
+ local name="$1"
150
+ local arg_offset="$2" # post-merge: $1=is_squash; post-checkout: $3=is_branch
151
+ cat >> "$HOOKS_DIR/$name" << EOF
152
+
153
+ # --- auto-sync agent-tool projections ---------------------------------------
154
+ # Skip when this is a file-checkout (post-checkout \$3 = 0) — only fire on
155
+ # branch switches and merges, where source files realistically changed.
156
+ if [ "$name" = "post-checkout" ] && [ "\${3:-1}" = "0" ]; then
157
+ exit 0
158
+ fi
159
+
160
+ # Range: prev..new. For post-merge git provides ORIG_HEAD; for
161
+ # post-checkout the previous SHA is \$1.
162
+ if [ "$name" = "post-merge" ]; then
163
+ prev="\$(git rev-parse ORIG_HEAD 2>/dev/null || echo)"
164
+ new="\$(git rev-parse HEAD 2>/dev/null || echo)"
165
+ elif [ "$name" = "post-checkout" ]; then
166
+ prev="\${1:-}"
167
+ new="\${2:-}"
168
+ fi
169
+
170
+ if [ -n "\$prev" ] && [ -n "\$new" ] && [ "\$prev" != "\$new" ]; then
171
+ if git diff --name-only "\$prev" "\$new" 2>/dev/null | \\
172
+ grep -qE '^(\\.agent-src(\\.uncompressed)?/|scripts/compress\\.py|\\.agent-tools\\.yml|Taskfile\\.yml)'; then
173
+ if command -v task >/dev/null 2>&1; then
174
+ task sync >/dev/null 2>&1 || true
175
+ task generate-tools >/dev/null 2>&1 || true
176
+ fi
177
+ fi
178
+ fi
179
+ EOF
180
+ }
181
+
182
+ append_auto_sync_block "post-merge" "1"
183
+ append_auto_sync_block "post-checkout" "3"
184
+ echo "✅ Auto-sync block appended to post-merge / post-checkout hooks."