@stanco323/oh-my-claude-code 4.10.3 → 4.11.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +65 -18
- package/bridge/cli.cjs +3030 -1784
- package/bridge/mcp-server.cjs +128 -98
- package/bridge/runtime-cli.cjs +174 -136
- package/bridge/team-bridge.cjs +102 -96
- package/bridge/team-mcp.cjs +40 -29
- package/bridge/team.js +102 -88
- package/dist/__tests__/auto-update.test.js +8 -9
- package/dist/__tests__/auto-update.test.js.map +1 -1
- package/dist/__tests__/cli-config-stop-callback.test.js +26 -0
- package/dist/__tests__/cli-config-stop-callback.test.js.map +1 -1
- package/dist/__tests__/config-dir.test.d.ts +2 -0
- package/dist/__tests__/config-dir.test.d.ts.map +1 -0
- package/dist/__tests__/config-dir.test.js +184 -0
- package/dist/__tests__/config-dir.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcement-levels.test.js +45 -1
- package/dist/__tests__/delegation-enforcement-levels.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +9 -7
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hooks-command-escaping.test.js +17 -10
- package/dist/__tests__/hooks-command-escaping.test.js.map +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api-lock.test.js +5 -5
- package/dist/__tests__/hud/usage-api-lock.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api-stale.test.js +2 -2
- package/dist/__tests__/hud/usage-api-stale.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api.test.js +98 -0
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/hud-api-key-source.test.js +2 -2
- package/dist/__tests__/hud-api-key-source.test.js.map +1 -1
- package/dist/__tests__/hud-marketplace-resolution.test.js +3 -1
- package/dist/__tests__/hud-marketplace-resolution.test.js.map +1 -1
- package/dist/__tests__/hud-windows.test.js +7 -6
- package/dist/__tests__/hud-windows.test.js.map +1 -1
- package/dist/__tests__/installer-omc-reference.test.js +122 -6
- package/dist/__tests__/installer-omc-reference.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +33 -9
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/omc-tools-server.test.js +5 -5
- package/dist/__tests__/pre-tool-enforcer.test.js +34 -14
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/preemptive-compaction-hook.test.d.ts +2 -0
- package/dist/__tests__/preemptive-compaction-hook.test.d.ts.map +1 -0
- package/dist/__tests__/preemptive-compaction-hook.test.js +163 -0
- package/dist/__tests__/preemptive-compaction-hook.test.js.map +1 -0
- package/dist/__tests__/purge-stale-cache.test.js +1 -1
- package/dist/__tests__/purge-stale-cache.test.js.map +1 -1
- package/dist/__tests__/release-generation.test.d.ts +2 -0
- package/dist/__tests__/release-generation.test.d.ts.map +1 -0
- package/dist/__tests__/release-generation.test.js +79 -0
- package/dist/__tests__/release-generation.test.js.map +1 -0
- package/dist/__tests__/runtime-guidance-plan-ralph.test.d.ts +2 -0
- package/dist/__tests__/runtime-guidance-plan-ralph.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-guidance-plan-ralph.test.js +87 -0
- package/dist/__tests__/runtime-guidance-plan-ralph.test.js.map +1 -0
- package/dist/__tests__/session-history-search.test.js +31 -3
- package/dist/__tests__/session-history-search.test.js.map +1 -1
- package/dist/__tests__/setup-claude-md-script.test.js +9 -1
- package/dist/__tests__/setup-claude-md-script.test.js.map +1 -1
- package/dist/__tests__/setup-no-plugin-flag.test.d.ts +2 -0
- package/dist/__tests__/setup-no-plugin-flag.test.d.ts.map +1 -0
- package/dist/__tests__/setup-no-plugin-flag.test.js +15 -0
- package/dist/__tests__/setup-no-plugin-flag.test.js.map +1 -0
- package/dist/__tests__/shared-memory.test.js +40 -2
- package/dist/__tests__/shared-memory.test.js.map +1 -1
- package/dist/__tests__/skills.test.js +45 -1
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/cli/__tests__/launch.test.js +48 -14
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/commands/__tests__/team-role-shorthand.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/team-role-shorthand.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/team-role-shorthand.test.js +63 -0
- package/dist/cli/commands/__tests__/team-role-shorthand.test.js.map +1 -0
- package/dist/cli/commands/__tests__/team.test.js +21 -0
- package/dist/cli/commands/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/adapt.d.ts.map +1 -1
- package/dist/cli/commands/adapt.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +1 -1
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +30 -17
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/index.js +16 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +22 -14
- package/dist/cli/launch.js.map +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/constants/names.d.ts +1 -0
- package/dist/constants/names.d.ts.map +1 -1
- package/dist/constants/names.js +1 -0
- package/dist/constants/names.js.map +1 -1
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +4 -4
- package/dist/features/auto-update.js.map +1 -1
- package/dist/features/background-agent/manager.js +1 -1
- package/dist/features/background-agent/manager.js.map +1 -1
- package/dist/features/builtin-skills/runtime-guidance.d.ts.map +1 -1
- package/dist/features/builtin-skills/runtime-guidance.js +35 -3
- package/dist/features/builtin-skills/runtime-guidance.js.map +1 -1
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +53 -1
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/session-history-search/index.d.ts.map +1 -1
- package/dist/features/session-history-search/index.js +1 -4
- package/dist/features/session-history-search/index.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +4 -0
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge.test.js +42 -1
- package/dist/hooks/__tests__/bridge.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +2 -2
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
- package/dist/hooks/autopilot/enforcement.js +20 -4
- package/dist/hooks/autopilot/enforcement.js.map +1 -1
- package/dist/hooks/bridge.d.ts +15 -0
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +38 -1
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/factcheck/__tests__/factcheck.test.js +6 -5
- package/dist/hooks/factcheck/__tests__/factcheck.test.js.map +1 -1
- package/dist/hooks/factcheck/config.d.ts +2 -2
- package/dist/hooks/factcheck/config.d.ts.map +1 -1
- package/dist/hooks/factcheck/config.js +6 -4
- package/dist/hooks/factcheck/config.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/learner/auto-invoke.js +1 -1
- package/dist/hooks/learner/auto-invoke.js.map +1 -1
- package/dist/hooks/learner/config.js +1 -1
- package/dist/hooks/learner/config.js.map +1 -1
- package/dist/hooks/learner/constants.js +1 -1
- package/dist/hooks/learner/constants.js.map +1 -1
- package/dist/hooks/omc-orchestrator/constants.d.ts +1 -1
- package/dist/hooks/omc-orchestrator/constants.d.ts.map +1 -1
- package/dist/hooks/omc-orchestrator/constants.js +2 -2
- package/dist/hooks/omc-orchestrator/constants.js.map +1 -1
- package/dist/hooks/omc-orchestrator/index.d.ts.map +1 -1
- package/dist/hooks/omc-orchestrator/index.js +10 -7
- package/dist/hooks/omc-orchestrator/index.js.map +1 -1
- package/dist/hooks/permission-handler/index.js +1 -1
- package/dist/hooks/permission-handler/index.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +21 -4
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +91 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
- package/dist/hooks/rules-injector/constants.d.ts +0 -2
- package/dist/hooks/rules-injector/constants.d.ts.map +1 -1
- package/dist/hooks/rules-injector/constants.js +0 -2
- package/dist/hooks/rules-injector/constants.js.map +1 -1
- package/dist/hooks/rules-injector/finder.d.ts +3 -3
- package/dist/hooks/rules-injector/finder.d.ts.map +1 -1
- package/dist/hooks/rules-injector/finder.js +7 -6
- package/dist/hooks/rules-injector/finder.js.map +1 -1
- package/dist/hooks/rules-injector/index.d.ts +1 -1
- package/dist/hooks/rules-injector/index.d.ts.map +1 -1
- package/dist/hooks/rules-injector/index.js +3 -6
- package/dist/hooks/rules-injector/index.js.map +1 -1
- package/dist/hooks/setup/__tests__/stdin-symlink.test.d.ts +2 -0
- package/dist/hooks/setup/__tests__/stdin-symlink.test.d.ts.map +1 -0
- package/dist/hooks/setup/__tests__/stdin-symlink.test.js +184 -0
- package/dist/hooks/setup/__tests__/stdin-symlink.test.js.map +1 -0
- package/dist/hooks/setup/index.d.ts +13 -0
- package/dist/hooks/setup/index.d.ts.map +1 -1
- package/dist/hooks/setup/index.js +100 -2
- package/dist/hooks/setup/index.js.map +1 -1
- package/dist/hooks/skill-bridge.cjs +19 -13
- package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/index.js +7 -3
- package/dist/hooks/subagent-tracker/index.js.map +1 -1
- package/dist/hooks/todo-continuation/index.js +1 -1
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hooks/wiki/__tests__/ingest.test.d.ts +5 -0
- package/dist/hooks/wiki/__tests__/ingest.test.d.ts.map +1 -0
- package/dist/hooks/wiki/__tests__/ingest.test.js +180 -0
- package/dist/hooks/wiki/__tests__/ingest.test.js.map +1 -0
- package/dist/hooks/wiki/__tests__/lint.test.d.ts +5 -0
- package/dist/hooks/wiki/__tests__/lint.test.d.ts.map +1 -0
- package/dist/hooks/wiki/__tests__/lint.test.js +162 -0
- package/dist/hooks/wiki/__tests__/lint.test.js.map +1 -0
- package/dist/hooks/wiki/__tests__/query.test.d.ts +5 -0
- package/dist/hooks/wiki/__tests__/query.test.d.ts.map +1 -0
- package/dist/hooks/wiki/__tests__/query.test.js +119 -0
- package/dist/hooks/wiki/__tests__/query.test.js.map +1 -0
- package/dist/hooks/wiki/__tests__/session-hooks.test.d.ts +5 -0
- package/dist/hooks/wiki/__tests__/session-hooks.test.d.ts.map +1 -0
- package/dist/hooks/wiki/__tests__/session-hooks.test.js +40 -0
- package/dist/hooks/wiki/__tests__/session-hooks.test.js.map +1 -0
- package/dist/hooks/wiki/__tests__/storage.test.d.ts +5 -0
- package/dist/hooks/wiki/__tests__/storage.test.d.ts.map +1 -0
- package/dist/hooks/wiki/__tests__/storage.test.js +277 -0
- package/dist/hooks/wiki/__tests__/storage.test.js.map +1 -0
- package/dist/hooks/wiki/index.d.ts +13 -0
- package/dist/hooks/wiki/index.d.ts.map +1 -0
- package/dist/hooks/wiki/index.js +16 -0
- package/dist/hooks/wiki/index.js.map +1 -0
- package/dist/hooks/wiki/ingest.d.ts +20 -0
- package/dist/hooks/wiki/ingest.d.ts.map +1 -0
- package/dist/hooks/wiki/ingest.js +115 -0
- package/dist/hooks/wiki/ingest.js.map +1 -0
- package/dist/hooks/wiki/lint.d.ts +25 -0
- package/dist/hooks/wiki/lint.d.ts.map +1 -0
- package/dist/hooks/wiki/lint.js +166 -0
- package/dist/hooks/wiki/lint.js.map +1 -0
- package/dist/hooks/wiki/query.d.ts +27 -0
- package/dist/hooks/wiki/query.d.ts.map +1 -0
- package/dist/hooks/wiki/query.js +97 -0
- package/dist/hooks/wiki/query.js.map +1 -0
- package/dist/hooks/wiki/session-hooks.d.ts +42 -0
- package/dist/hooks/wiki/session-hooks.d.ts.map +1 -0
- package/dist/hooks/wiki/session-hooks.js +228 -0
- package/dist/hooks/wiki/session-hooks.js.map +1 -0
- package/dist/hooks/wiki/storage.d.ts +73 -0
- package/dist/hooks/wiki/storage.d.ts.map +1 -0
- package/dist/hooks/wiki/storage.js +343 -0
- package/dist/hooks/wiki/storage.js.map +1 -0
- package/dist/hooks/wiki/types.d.ts +136 -0
- package/dist/hooks/wiki/types.d.ts.map +1 -0
- package/dist/hooks/wiki/types.js +19 -0
- package/dist/hooks/wiki/types.js.map +1 -0
- package/dist/hud/custom-rate-provider.js +1 -1
- package/dist/hud/custom-rate-provider.js.map +1 -1
- package/dist/hud/elements/api-key-source.js +1 -1
- package/dist/hud/elements/api-key-source.js.map +1 -1
- package/dist/hud/index.js +1 -1
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/state.js +1 -1
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +6 -2
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/installer/__tests__/standalone-hook-reconcile.test.js +3 -0
- package/dist/installer/__tests__/standalone-hook-reconcile.test.js.map +1 -1
- package/dist/installer/hooks.d.ts +0 -2
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +1 -5
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +3 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +176 -32
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/mcp-registry.js +2 -2
- package/dist/installer/mcp-registry.js.map +1 -1
- package/dist/lib/release-generation.d.ts +20 -0
- package/dist/lib/release-generation.d.ts.map +1 -0
- package/dist/lib/release-generation.js +198 -0
- package/dist/lib/release-generation.js.map +1 -0
- package/dist/lib/shared-memory.d.ts +2 -1
- package/dist/lib/shared-memory.d.ts.map +1 -1
- package/dist/lib/shared-memory.js +4 -2
- package/dist/lib/shared-memory.js.map +1 -1
- package/dist/lib/worktree-paths.d.ts.map +1 -1
- package/dist/lib/worktree-paths.js +36 -10
- package/dist/lib/worktree-paths.js.map +1 -1
- package/dist/mcp/omc-tools-server.d.ts +2 -0
- package/dist/mcp/omc-tools-server.d.ts.map +1 -1
- package/dist/mcp/omc-tools-server.js +9 -2
- package/dist/mcp/omc-tools-server.js.map +1 -1
- package/dist/notifications/__tests__/config-merge.test.js +1 -1
- package/dist/notifications/__tests__/config-merge.test.js.map +1 -1
- package/dist/notifications/__tests__/profiles.test.js +1 -1
- package/dist/notifications/__tests__/profiles.test.js.map +1 -1
- package/dist/notifications/config.js +1 -1
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/hook-config.js +1 -1
- package/dist/notifications/hook-config.js.map +1 -1
- package/dist/openclaw/__tests__/config.test.js +1 -1
- package/dist/openclaw/__tests__/config.test.js.map +1 -1
- package/dist/openclaw/config.js +1 -1
- package/dist/openclaw/config.js.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/team/__tests__/api-interop.dispatch.test.js +2 -1
- package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/bridge-integration.test.js +5 -3
- package/dist/team/__tests__/bridge-integration.test.js.map +1 -1
- package/dist/team/__tests__/edge-cases.test.js +6 -7
- package/dist/team/__tests__/edge-cases.test.js.map +1 -1
- package/dist/team/__tests__/inbox-outbox.test.js +2 -2
- package/dist/team/__tests__/inbox-outbox.test.js.map +1 -1
- package/dist/team/__tests__/message-router.test.js +6 -5
- package/dist/team/__tests__/message-router.test.js.map +1 -1
- package/dist/team/__tests__/outbox-reader.test.js +2 -2
- package/dist/team/__tests__/outbox-reader.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.dispatch.test.js +4 -4
- package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/shell-affinity.test.js +16 -0
- package/dist/team/__tests__/shell-affinity.test.js.map +1 -1
- package/dist/team/__tests__/team-registration.test.js +3 -2
- package/dist/team/__tests__/team-registration.test.js.map +1 -1
- package/dist/team/__tests__/team-status.test.js +3 -3
- package/dist/team/__tests__/team-status.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +6 -1
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/bridge-entry.js +1 -1
- package/dist/team/bridge-entry.js.map +1 -1
- package/dist/team/inbox-outbox.js +1 -1
- package/dist/team/inbox-outbox.js.map +1 -1
- package/dist/team/message-router.js +1 -1
- package/dist/team/message-router.js.map +1 -1
- package/dist/team/outbox-reader.js +1 -1
- package/dist/team/outbox-reader.js.map +1 -1
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +6 -17
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/task-file-ops.js +1 -1
- package/dist/team/task-file-ops.js.map +1 -1
- package/dist/team/team-registration.js +1 -1
- package/dist/team/team-registration.js.map +1 -1
- package/dist/team/team-status.js +1 -1
- package/dist/team/team-status.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +39 -4
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/unified-team.js +1 -1
- package/dist/team/unified-team.js.map +1 -1
- package/dist/tools/shared-memory-tools.d.ts.map +1 -1
- package/dist/tools/shared-memory-tools.js +2 -1
- package/dist/tools/shared-memory-tools.js.map +1 -1
- package/dist/tools/skills-tools.d.ts.map +1 -1
- package/dist/tools/skills-tools.js +3 -2
- package/dist/tools/skills-tools.js.map +1 -1
- package/dist/tools/wiki-tools.d.ts +74 -0
- package/dist/tools/wiki-tools.d.ts.map +1 -0
- package/dist/tools/wiki-tools.js +370 -0
- package/dist/tools/wiki-tools.js.map +1 -0
- package/dist/utils/config-dir.d.ts +21 -1
- package/dist/utils/config-dir.d.ts.map +1 -1
- package/dist/utils/config-dir.js +45 -4
- package/dist/utils/config-dir.js.map +1 -1
- package/dist/utils/paths.d.ts +0 -5
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +1 -8
- package/dist/utils/paths.js.map +1 -1
- package/docs/CLAUDE.md +1 -1
- package/hooks/hooks.json +15 -0
- package/package.json +1 -1
- package/scripts/cleanup-orphans.mjs +2 -2
- package/scripts/context-guard-stop.mjs +10 -4
- package/scripts/find-node.sh +13 -1
- package/scripts/keyword-detector.mjs +9 -2
- package/scripts/lib/config-dir.cjs +31 -0
- package/scripts/lib/config-dir.mjs +29 -0
- package/scripts/lib/config-dir.sh +18 -0
- package/scripts/lib/pre-tool-enforcer-preflight.mjs +63 -0
- package/scripts/persistent-mode.cjs +29 -6
- package/scripts/persistent-mode.mjs +24 -4
- package/scripts/plugin-setup.mjs +18 -7
- package/scripts/post-tool-verifier.mjs +200 -7
- package/scripts/pre-tool-enforcer.mjs +15 -56
- package/scripts/release.ts +158 -224
- package/scripts/session-start.mjs +6 -4
- package/scripts/session-summary.mjs +6 -1
- package/scripts/setup-claude-md.sh +4 -2
- package/scripts/setup-progress.sh +4 -1
- package/scripts/skill-injector.mjs +2 -1
- package/scripts/sync-version.sh +3 -3
- package/scripts/test-pr25.sh +9 -5
- package/scripts/uninstall.sh +5 -2
- package/scripts/wiki-pre-compact.mjs +17 -0
- package/scripts/wiki-session-end.mjs +17 -0
- package/scripts/wiki-session-start.mjs +17 -0
- package/skills/cancel/SKILL.md +4 -4
- package/skills/configure-notifications/SKILL.md +12 -12
- package/skills/hud/SKILL.md +4 -4
- package/skills/learner/SKILL.md +1 -1
- package/skills/omc-doctor/SKILL.md +25 -25
- package/skills/omc-setup/SKILL.md +1 -1
- package/skills/omc-setup/phases/02-configure.md +2 -2
- package/skills/omc-setup/phases/03-integrations.md +7 -7
- package/skills/omc-setup/phases/04-welcome.md +3 -3
- package/skills/ralph/SKILL.md +6 -2
- package/skills/skill/SKILL.md +9 -9
- package/skills/team/SKILL.md +1 -1
- package/skills/wiki/SKILL.md +67 -0
- package/templates/hooks/keyword-detector.mjs +4 -2
- package/templates/hooks/lib/config-dir.mjs +29 -0
- package/templates/hooks/persistent-mode.mjs +24 -4
- package/templates/hooks/session-start.mjs +7 -4
package/bridge/team-bridge.cjs
CHANGED
|
@@ -46,13 +46,13 @@ __export(bridge_entry_exports, {
|
|
|
46
46
|
validateConfigPath: () => validateConfigPath
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(bridge_entry_exports);
|
|
49
|
-
var
|
|
49
|
+
var import_fs12 = require("fs");
|
|
50
50
|
var import_path12 = require("path");
|
|
51
51
|
var import_os3 = require("os");
|
|
52
52
|
|
|
53
53
|
// src/team/mcp-team-bridge.ts
|
|
54
54
|
var import_child_process3 = require("child_process");
|
|
55
|
-
var
|
|
55
|
+
var import_fs10 = require("fs");
|
|
56
56
|
var import_path10 = require("path");
|
|
57
57
|
|
|
58
58
|
// src/team/fs-utils.ts
|
|
@@ -102,30 +102,36 @@ function validateResolvedPath(resolvedPath, expectedBase) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// src/team/task-file-ops.ts
|
|
105
|
-
var
|
|
105
|
+
var import_fs4 = require("fs");
|
|
106
106
|
var import_path5 = require("path");
|
|
107
107
|
|
|
108
|
-
// src/utils/
|
|
108
|
+
// src/utils/config-dir.ts
|
|
109
109
|
var import_path2 = require("path");
|
|
110
|
-
var import_fs2 = require("fs");
|
|
111
110
|
var import_os = require("os");
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return process.env.CLAUDE_CONFIG_DIR || (0, import_node_path.join)((0, import_node_os.homedir)(), ".claude");
|
|
111
|
+
function stripTrailingSep(p) {
|
|
112
|
+
if (!p.endsWith(import_path2.sep)) {
|
|
113
|
+
return p;
|
|
114
|
+
}
|
|
115
|
+
return p === (0, import_path2.parse)(p).root ? p : p.slice(0, -1);
|
|
118
116
|
}
|
|
119
|
-
|
|
120
|
-
// src/utils/paths.ts
|
|
121
117
|
function getClaudeConfigDir() {
|
|
122
|
-
|
|
118
|
+
const home = (0, import_os.homedir)();
|
|
119
|
+
const configured = process.env.CLAUDE_CONFIG_DIR?.trim();
|
|
120
|
+
if (!configured) {
|
|
121
|
+
return stripTrailingSep((0, import_path2.normalize)((0, import_path2.join)(home, ".claude")));
|
|
122
|
+
}
|
|
123
|
+
if (configured === "~") {
|
|
124
|
+
return stripTrailingSep((0, import_path2.normalize)(home));
|
|
125
|
+
}
|
|
126
|
+
if (configured.startsWith("~/") || configured.startsWith("~\\")) {
|
|
127
|
+
return stripTrailingSep((0, import_path2.normalize)((0, import_path2.join)(home, configured.slice(2))));
|
|
128
|
+
}
|
|
129
|
+
return stripTrailingSep((0, import_path2.normalize)(configured));
|
|
123
130
|
}
|
|
124
|
-
var STALE_THRESHOLD_MS = 24 * 60 * 60 * 1e3;
|
|
125
131
|
|
|
126
132
|
// src/team/tmux-session.ts
|
|
127
133
|
var import_child_process = require("child_process");
|
|
128
|
-
var
|
|
134
|
+
var import_fs2 = require("fs");
|
|
129
135
|
var import_path3 = require("path");
|
|
130
136
|
var import_util = require("util");
|
|
131
137
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -155,7 +161,7 @@ function killSession(teamName, workerName) {
|
|
|
155
161
|
|
|
156
162
|
// src/platform/index.ts
|
|
157
163
|
var path = __toESM(require("path"), 1);
|
|
158
|
-
var
|
|
164
|
+
var import_fs3 = require("fs");
|
|
159
165
|
|
|
160
166
|
// src/platform/process-utils.ts
|
|
161
167
|
var import_child_process2 = require("child_process");
|
|
@@ -240,19 +246,19 @@ function acquireTaskLock(teamName, taskId, opts) {
|
|
|
240
246
|
const lockPath = (0, import_path5.join)(dir, `${sanitizeTaskId(taskId)}.lock`);
|
|
241
247
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
242
248
|
try {
|
|
243
|
-
const fd = (0,
|
|
249
|
+
const fd = (0, import_fs4.openSync)(lockPath, import_fs4.constants.O_CREAT | import_fs4.constants.O_EXCL | import_fs4.constants.O_WRONLY, 384);
|
|
244
250
|
const payload = JSON.stringify({
|
|
245
251
|
pid: process.pid,
|
|
246
252
|
workerName: opts?.workerName ?? "",
|
|
247
253
|
timestamp: Date.now()
|
|
248
254
|
});
|
|
249
|
-
(0,
|
|
255
|
+
(0, import_fs4.writeSync)(fd, payload, null, "utf-8");
|
|
250
256
|
return { fd, path: lockPath };
|
|
251
257
|
} catch (err) {
|
|
252
258
|
if (err && typeof err === "object" && "code" in err && err.code === "EEXIST") {
|
|
253
259
|
if (attempt === 0 && isLockStale(lockPath, staleLockMs)) {
|
|
254
260
|
try {
|
|
255
|
-
(0,
|
|
261
|
+
(0, import_fs4.unlinkSync)(lockPath);
|
|
256
262
|
} catch {
|
|
257
263
|
}
|
|
258
264
|
continue;
|
|
@@ -266,21 +272,21 @@ function acquireTaskLock(teamName, taskId, opts) {
|
|
|
266
272
|
}
|
|
267
273
|
function releaseTaskLock(handle) {
|
|
268
274
|
try {
|
|
269
|
-
(0,
|
|
275
|
+
(0, import_fs4.closeSync)(handle.fd);
|
|
270
276
|
} catch {
|
|
271
277
|
}
|
|
272
278
|
try {
|
|
273
|
-
(0,
|
|
279
|
+
(0, import_fs4.unlinkSync)(handle.path);
|
|
274
280
|
} catch {
|
|
275
281
|
}
|
|
276
282
|
}
|
|
277
283
|
function isLockStale(lockPath, staleLockMs) {
|
|
278
284
|
try {
|
|
279
|
-
const stat = (0,
|
|
285
|
+
const stat = (0, import_fs4.statSync)(lockPath);
|
|
280
286
|
const ageMs = Date.now() - stat.mtimeMs;
|
|
281
287
|
if (ageMs < staleLockMs) return false;
|
|
282
288
|
try {
|
|
283
|
-
const raw = (0,
|
|
289
|
+
const raw = (0, import_fs4.readFileSync)(lockPath, "utf-8");
|
|
284
290
|
const payload = JSON.parse(raw);
|
|
285
291
|
if (payload.pid && isProcessAlive(payload.pid)) return false;
|
|
286
292
|
} catch {
|
|
@@ -310,9 +316,9 @@ function legacyTasksDir(teamName) {
|
|
|
310
316
|
}
|
|
311
317
|
function resolveTaskPathForRead(teamName, taskId, cwd) {
|
|
312
318
|
const canonical = (0, import_path5.join)(canonicalTasksDir(teamName, cwd), `${sanitizeTaskId(taskId)}.json`);
|
|
313
|
-
if ((0,
|
|
319
|
+
if ((0, import_fs4.existsSync)(canonical)) return canonical;
|
|
314
320
|
const legacy = (0, import_path5.join)(legacyTasksDir(teamName), `${sanitizeTaskId(taskId)}.json`);
|
|
315
|
-
if ((0,
|
|
321
|
+
if ((0, import_fs4.existsSync)(legacy)) return legacy;
|
|
316
322
|
return canonical;
|
|
317
323
|
}
|
|
318
324
|
function resolveTaskPathForWrite(teamName, taskId, cwd) {
|
|
@@ -323,9 +329,9 @@ function failureSidecarPath(teamName, taskId, cwd) {
|
|
|
323
329
|
}
|
|
324
330
|
function readTask(teamName, taskId, opts) {
|
|
325
331
|
const filePath = resolveTaskPathForRead(teamName, taskId, opts?.cwd);
|
|
326
|
-
if (!(0,
|
|
332
|
+
if (!(0, import_fs4.existsSync)(filePath)) return null;
|
|
327
333
|
try {
|
|
328
|
-
const raw = (0,
|
|
334
|
+
const raw = (0, import_fs4.readFileSync)(filePath, "utf-8");
|
|
329
335
|
return JSON.parse(raw);
|
|
330
336
|
} catch {
|
|
331
337
|
return null;
|
|
@@ -337,7 +343,7 @@ function updateTask(teamName, taskId, updates, opts) {
|
|
|
337
343
|
const readPath = resolveTaskPathForRead(teamName, taskId, opts?.cwd);
|
|
338
344
|
let task;
|
|
339
345
|
try {
|
|
340
|
-
const raw = (0,
|
|
346
|
+
const raw = (0, import_fs4.readFileSync)(readPath, "utf-8");
|
|
341
347
|
task = JSON.parse(raw);
|
|
342
348
|
} catch {
|
|
343
349
|
throw new Error(`Task file not found or malformed: ${taskId}`);
|
|
@@ -366,7 +372,7 @@ function updateTask(teamName, taskId, updates, opts) {
|
|
|
366
372
|
}
|
|
367
373
|
async function findNextTask(teamName, workerName, opts) {
|
|
368
374
|
const dir = canonicalTasksDir(teamName, opts?.cwd);
|
|
369
|
-
if (!(0,
|
|
375
|
+
if (!(0, import_fs4.existsSync)(dir)) return null;
|
|
370
376
|
const taskIds = listTaskIds(teamName, opts);
|
|
371
377
|
for (const id of taskIds) {
|
|
372
378
|
const task = readTask(teamName, id, opts);
|
|
@@ -385,7 +391,7 @@ async function findNextTask(teamName, workerName, opts) {
|
|
|
385
391
|
let taskData;
|
|
386
392
|
try {
|
|
387
393
|
const readPath = resolveTaskPathForRead(teamName, id, opts?.cwd);
|
|
388
|
-
const raw = (0,
|
|
394
|
+
const raw = (0, import_fs4.readFileSync)(readPath, "utf-8");
|
|
389
395
|
taskData = JSON.parse(raw);
|
|
390
396
|
} catch {
|
|
391
397
|
continue;
|
|
@@ -424,9 +430,9 @@ function writeTaskFailure(teamName, taskId, error, opts) {
|
|
|
424
430
|
}
|
|
425
431
|
function readTaskFailure(teamName, taskId, opts) {
|
|
426
432
|
const filePath = failureSidecarPath(teamName, taskId, opts?.cwd);
|
|
427
|
-
if (!(0,
|
|
433
|
+
if (!(0, import_fs4.existsSync)(filePath)) return null;
|
|
428
434
|
try {
|
|
429
|
-
const raw = (0,
|
|
435
|
+
const raw = (0, import_fs4.readFileSync)(filePath, "utf-8");
|
|
430
436
|
return JSON.parse(raw);
|
|
431
437
|
} catch {
|
|
432
438
|
return null;
|
|
@@ -434,9 +440,9 @@ function readTaskFailure(teamName, taskId, opts) {
|
|
|
434
440
|
}
|
|
435
441
|
function listTaskIds(teamName, opts) {
|
|
436
442
|
const scanDir = (dir) => {
|
|
437
|
-
if (!(0,
|
|
443
|
+
if (!(0, import_fs4.existsSync)(dir)) return [];
|
|
438
444
|
try {
|
|
439
|
-
return (0,
|
|
445
|
+
return (0, import_fs4.readdirSync)(dir).filter((f) => f.endsWith(".json") && !f.includes(".tmp.") && !f.includes(".failure.") && !f.endsWith(".lock")).map((f) => f.replace(".json", ""));
|
|
440
446
|
} catch {
|
|
441
447
|
return [];
|
|
442
448
|
}
|
|
@@ -454,7 +460,7 @@ function listTaskIds(teamName, opts) {
|
|
|
454
460
|
}
|
|
455
461
|
|
|
456
462
|
// src/team/inbox-outbox.ts
|
|
457
|
-
var
|
|
463
|
+
var import_fs5 = require("fs");
|
|
458
464
|
var import_path6 = require("path");
|
|
459
465
|
var MAX_INBOX_READ_SIZE = 10 * 1024 * 1024;
|
|
460
466
|
function teamsDir(teamName) {
|
|
@@ -488,32 +494,32 @@ function appendOutbox(teamName, workerName, message) {
|
|
|
488
494
|
}
|
|
489
495
|
function rotateOutboxIfNeeded(teamName, workerName, maxLines) {
|
|
490
496
|
const filePath = outboxPath(teamName, workerName);
|
|
491
|
-
if (!(0,
|
|
497
|
+
if (!(0, import_fs5.existsSync)(filePath)) return;
|
|
492
498
|
try {
|
|
493
|
-
const content = (0,
|
|
499
|
+
const content = (0, import_fs5.readFileSync)(filePath, "utf-8");
|
|
494
500
|
const lines = content.split("\n").filter((l) => l.trim());
|
|
495
501
|
if (lines.length <= maxLines) return;
|
|
496
502
|
const keepCount = Math.floor(maxLines / 2);
|
|
497
503
|
const kept = keepCount === 0 ? [] : lines.slice(-keepCount);
|
|
498
504
|
const tmpPath = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
499
505
|
writeFileWithMode(tmpPath, kept.join("\n") + "\n");
|
|
500
|
-
(0,
|
|
506
|
+
(0, import_fs5.renameSync)(tmpPath, filePath);
|
|
501
507
|
} catch {
|
|
502
508
|
}
|
|
503
509
|
}
|
|
504
510
|
function rotateInboxIfNeeded(teamName, workerName, maxSizeBytes) {
|
|
505
511
|
const filePath = inboxPath(teamName, workerName);
|
|
506
|
-
if (!(0,
|
|
512
|
+
if (!(0, import_fs5.existsSync)(filePath)) return;
|
|
507
513
|
try {
|
|
508
|
-
const stat = (0,
|
|
514
|
+
const stat = (0, import_fs5.statSync)(filePath);
|
|
509
515
|
if (stat.size <= maxSizeBytes) return;
|
|
510
|
-
const content = (0,
|
|
516
|
+
const content = (0, import_fs5.readFileSync)(filePath, "utf-8");
|
|
511
517
|
const lines = content.split("\n").filter((l) => l.trim());
|
|
512
518
|
const keepCount = Math.max(1, Math.floor(lines.length / 2));
|
|
513
519
|
const kept = lines.slice(-keepCount);
|
|
514
520
|
const tmpPath = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
515
521
|
writeFileWithMode(tmpPath, kept.join("\n") + "\n");
|
|
516
|
-
(0,
|
|
522
|
+
(0, import_fs5.renameSync)(tmpPath, filePath);
|
|
517
523
|
const cursorFile = inboxCursorPath(teamName, workerName);
|
|
518
524
|
atomicWriteJson(cursorFile, { bytesRead: 0 });
|
|
519
525
|
} catch {
|
|
@@ -522,16 +528,16 @@ function rotateInboxIfNeeded(teamName, workerName, maxSizeBytes) {
|
|
|
522
528
|
function readNewInboxMessages(teamName, workerName) {
|
|
523
529
|
const inbox = inboxPath(teamName, workerName);
|
|
524
530
|
const cursorFile = inboxCursorPath(teamName, workerName);
|
|
525
|
-
if (!(0,
|
|
531
|
+
if (!(0, import_fs5.existsSync)(inbox)) return [];
|
|
526
532
|
let offset = 0;
|
|
527
|
-
if ((0,
|
|
533
|
+
if ((0, import_fs5.existsSync)(cursorFile)) {
|
|
528
534
|
try {
|
|
529
|
-
const cursor = JSON.parse((0,
|
|
535
|
+
const cursor = JSON.parse((0, import_fs5.readFileSync)(cursorFile, "utf-8"));
|
|
530
536
|
offset = cursor.bytesRead;
|
|
531
537
|
} catch {
|
|
532
538
|
}
|
|
533
539
|
}
|
|
534
|
-
const stat = (0,
|
|
540
|
+
const stat = (0, import_fs5.statSync)(inbox);
|
|
535
541
|
if (stat.size < offset) {
|
|
536
542
|
offset = 0;
|
|
537
543
|
}
|
|
@@ -541,12 +547,12 @@ function readNewInboxMessages(teamName, workerName) {
|
|
|
541
547
|
if (cappedSize < readSize) {
|
|
542
548
|
console.warn(`[inbox-outbox] Inbox for ${workerName} exceeds ${MAX_INBOX_READ_SIZE} bytes, reading truncated`);
|
|
543
549
|
}
|
|
544
|
-
const fd = (0,
|
|
550
|
+
const fd = (0, import_fs5.openSync)(inbox, "r");
|
|
545
551
|
const buffer = Buffer.alloc(cappedSize);
|
|
546
552
|
try {
|
|
547
|
-
(0,
|
|
553
|
+
(0, import_fs5.readSync)(fd, buffer, 0, buffer.length, offset);
|
|
548
554
|
} finally {
|
|
549
|
-
(0,
|
|
555
|
+
(0, import_fs5.closeSync)(fd);
|
|
550
556
|
}
|
|
551
557
|
const newData = buffer.toString("utf-8");
|
|
552
558
|
const lastNewlineIdx = newData.lastIndexOf("\n");
|
|
@@ -583,9 +589,9 @@ function readNewInboxMessages(teamName, workerName) {
|
|
|
583
589
|
}
|
|
584
590
|
function checkShutdownSignal(teamName, workerName) {
|
|
585
591
|
const filePath = signalPath(teamName, workerName);
|
|
586
|
-
if (!(0,
|
|
592
|
+
if (!(0, import_fs5.existsSync)(filePath)) return null;
|
|
587
593
|
try {
|
|
588
|
-
const raw = (0,
|
|
594
|
+
const raw = (0, import_fs5.readFileSync)(filePath, "utf-8");
|
|
589
595
|
return JSON.parse(raw);
|
|
590
596
|
} catch {
|
|
591
597
|
return null;
|
|
@@ -593,18 +599,18 @@ function checkShutdownSignal(teamName, workerName) {
|
|
|
593
599
|
}
|
|
594
600
|
function deleteShutdownSignal(teamName, workerName) {
|
|
595
601
|
const filePath = signalPath(teamName, workerName);
|
|
596
|
-
if ((0,
|
|
602
|
+
if ((0, import_fs5.existsSync)(filePath)) {
|
|
597
603
|
try {
|
|
598
|
-
(0,
|
|
604
|
+
(0, import_fs5.unlinkSync)(filePath);
|
|
599
605
|
} catch {
|
|
600
606
|
}
|
|
601
607
|
}
|
|
602
608
|
}
|
|
603
609
|
function checkDrainSignal(teamName, workerName) {
|
|
604
610
|
const filePath = drainSignalPath(teamName, workerName);
|
|
605
|
-
if (!(0,
|
|
611
|
+
if (!(0, import_fs5.existsSync)(filePath)) return null;
|
|
606
612
|
try {
|
|
607
|
-
const raw = (0,
|
|
613
|
+
const raw = (0, import_fs5.readFileSync)(filePath, "utf-8");
|
|
608
614
|
return JSON.parse(raw);
|
|
609
615
|
} catch {
|
|
610
616
|
return null;
|
|
@@ -612,20 +618,20 @@ function checkDrainSignal(teamName, workerName) {
|
|
|
612
618
|
}
|
|
613
619
|
function deleteDrainSignal(teamName, workerName) {
|
|
614
620
|
const filePath = drainSignalPath(teamName, workerName);
|
|
615
|
-
if ((0,
|
|
621
|
+
if ((0, import_fs5.existsSync)(filePath)) {
|
|
616
622
|
try {
|
|
617
|
-
(0,
|
|
623
|
+
(0, import_fs5.unlinkSync)(filePath);
|
|
618
624
|
} catch {
|
|
619
625
|
}
|
|
620
626
|
}
|
|
621
627
|
}
|
|
622
628
|
|
|
623
629
|
// src/team/team-registration.ts
|
|
624
|
-
var
|
|
630
|
+
var import_fs7 = require("fs");
|
|
625
631
|
var import_path7 = require("path");
|
|
626
632
|
|
|
627
633
|
// src/lib/file-lock.ts
|
|
628
|
-
var
|
|
634
|
+
var import_fs6 = require("fs");
|
|
629
635
|
var path3 = __toESM(require("path"), 1);
|
|
630
636
|
|
|
631
637
|
// src/lib/atomic-write.ts
|
|
@@ -647,9 +653,9 @@ function shadowRegistryPath(workingDirectory) {
|
|
|
647
653
|
}
|
|
648
654
|
function unregisterMcpWorker(teamName, workerName, workingDirectory) {
|
|
649
655
|
const configFile = configPath(teamName);
|
|
650
|
-
if ((0,
|
|
656
|
+
if ((0, import_fs7.existsSync)(configFile)) {
|
|
651
657
|
try {
|
|
652
|
-
const raw = (0,
|
|
658
|
+
const raw = (0, import_fs7.readFileSync)(configFile, "utf-8");
|
|
653
659
|
const config = JSON.parse(raw);
|
|
654
660
|
const members = Array.isArray(config.members) ? config.members : [];
|
|
655
661
|
config.members = members.filter((m) => m.name !== workerName);
|
|
@@ -658,9 +664,9 @@ function unregisterMcpWorker(teamName, workerName, workingDirectory) {
|
|
|
658
664
|
}
|
|
659
665
|
}
|
|
660
666
|
const shadowFile = shadowRegistryPath(workingDirectory);
|
|
661
|
-
if ((0,
|
|
667
|
+
if ((0, import_fs7.existsSync)(shadowFile)) {
|
|
662
668
|
try {
|
|
663
|
-
const registry = JSON.parse((0,
|
|
669
|
+
const registry = JSON.parse((0, import_fs7.readFileSync)(shadowFile, "utf-8"));
|
|
664
670
|
registry.workers = (registry.workers || []).filter((w) => w.name !== workerName);
|
|
665
671
|
atomicWriteJson(shadowFile, registry);
|
|
666
672
|
} catch {
|
|
@@ -673,9 +679,9 @@ function isMcpWorker(member) {
|
|
|
673
679
|
function listMcpWorkers(teamName, workingDirectory) {
|
|
674
680
|
const workers = /* @__PURE__ */ new Map();
|
|
675
681
|
const configFile = configPath(teamName);
|
|
676
|
-
if ((0,
|
|
682
|
+
if ((0, import_fs7.existsSync)(configFile)) {
|
|
677
683
|
try {
|
|
678
|
-
const raw = (0,
|
|
684
|
+
const raw = (0, import_fs7.readFileSync)(configFile, "utf-8");
|
|
679
685
|
const config = JSON.parse(raw);
|
|
680
686
|
const members = Array.isArray(config.members) ? config.members : [];
|
|
681
687
|
for (const m of members) {
|
|
@@ -687,9 +693,9 @@ function listMcpWorkers(teamName, workingDirectory) {
|
|
|
687
693
|
}
|
|
688
694
|
}
|
|
689
695
|
const shadowFile = shadowRegistryPath(workingDirectory);
|
|
690
|
-
if ((0,
|
|
696
|
+
if ((0, import_fs7.existsSync)(shadowFile)) {
|
|
691
697
|
try {
|
|
692
|
-
const registry = JSON.parse((0,
|
|
698
|
+
const registry = JSON.parse((0, import_fs7.readFileSync)(shadowFile, "utf-8"));
|
|
693
699
|
for (const w of registry.workers || []) {
|
|
694
700
|
workers.set(w.name, w);
|
|
695
701
|
}
|
|
@@ -700,7 +706,7 @@ function listMcpWorkers(teamName, workingDirectory) {
|
|
|
700
706
|
}
|
|
701
707
|
|
|
702
708
|
// src/team/heartbeat.ts
|
|
703
|
-
var
|
|
709
|
+
var import_fs8 = require("fs");
|
|
704
710
|
var import_path8 = require("path");
|
|
705
711
|
function heartbeatPath(workingDirectory, teamName, workerName) {
|
|
706
712
|
return (0, import_path8.join)(workingDirectory, ".omc", "state", "team-bridge", sanitizeName(teamName), `${sanitizeName(workerName)}.heartbeat.json`);
|
|
@@ -711,9 +717,9 @@ function writeHeartbeat(workingDirectory, data) {
|
|
|
711
717
|
}
|
|
712
718
|
function readHeartbeat(workingDirectory, teamName, workerName) {
|
|
713
719
|
const filePath = heartbeatPath(workingDirectory, teamName, workerName);
|
|
714
|
-
if (!(0,
|
|
720
|
+
if (!(0, import_fs8.existsSync)(filePath)) return null;
|
|
715
721
|
try {
|
|
716
|
-
const raw = (0,
|
|
722
|
+
const raw = (0, import_fs8.readFileSync)(filePath, "utf-8");
|
|
717
723
|
return JSON.parse(raw);
|
|
718
724
|
} catch {
|
|
719
725
|
return null;
|
|
@@ -732,23 +738,23 @@ function isWorkerAlive(workingDirectory, teamName, workerName, maxAgeMs) {
|
|
|
732
738
|
}
|
|
733
739
|
function deleteHeartbeat(workingDirectory, teamName, workerName) {
|
|
734
740
|
const filePath = heartbeatPath(workingDirectory, teamName, workerName);
|
|
735
|
-
if ((0,
|
|
741
|
+
if ((0, import_fs8.existsSync)(filePath)) {
|
|
736
742
|
try {
|
|
737
|
-
(0,
|
|
743
|
+
(0, import_fs8.unlinkSync)(filePath);
|
|
738
744
|
} catch {
|
|
739
745
|
}
|
|
740
746
|
}
|
|
741
747
|
}
|
|
742
748
|
|
|
743
749
|
// src/team/audit-log.ts
|
|
744
|
-
var
|
|
750
|
+
var import_node_path = require("node:path");
|
|
745
751
|
var DEFAULT_MAX_LOG_SIZE = 5 * 1024 * 1024;
|
|
746
752
|
function getLogPath(workingDirectory, teamName) {
|
|
747
|
-
return (0,
|
|
753
|
+
return (0, import_node_path.join)(workingDirectory, ".omc", "logs", `team-bridge-${teamName}.jsonl`);
|
|
748
754
|
}
|
|
749
755
|
function logAuditEvent(workingDirectory, event) {
|
|
750
756
|
const logPath = getLogPath(workingDirectory, event.teamName);
|
|
751
|
-
const dir = (0,
|
|
757
|
+
const dir = (0, import_node_path.join)(workingDirectory, ".omc", "logs");
|
|
752
758
|
validateResolvedPath(logPath, workingDirectory);
|
|
753
759
|
ensureDirWithMode(dir);
|
|
754
760
|
const line = JSON.stringify(event) + "\n";
|
|
@@ -756,7 +762,7 @@ function logAuditEvent(workingDirectory, event) {
|
|
|
756
762
|
}
|
|
757
763
|
|
|
758
764
|
// src/team/permissions.ts
|
|
759
|
-
var
|
|
765
|
+
var import_node_path2 = require("node:path");
|
|
760
766
|
function matchGlob(pattern, path4) {
|
|
761
767
|
let pi = 0;
|
|
762
768
|
let si = 0;
|
|
@@ -810,8 +816,8 @@ function matchGlob(pattern, path4) {
|
|
|
810
816
|
return pi === pattern.length;
|
|
811
817
|
}
|
|
812
818
|
function isPathAllowed(permissions, filePath, workingDirectory) {
|
|
813
|
-
const absPath = (0,
|
|
814
|
-
const relPath = (0,
|
|
819
|
+
const absPath = (0, import_node_path2.resolve)(workingDirectory, filePath);
|
|
820
|
+
const relPath = (0, import_node_path2.relative)(workingDirectory, absPath);
|
|
815
821
|
if (relPath.startsWith("..")) return false;
|
|
816
822
|
for (const pattern of permissions.deniedPaths) {
|
|
817
823
|
if (matchGlob(pattern, relPath)) return false;
|
|
@@ -855,8 +861,8 @@ function findPermissionViolations(changedPaths, permissions, cwd) {
|
|
|
855
861
|
const violations = [];
|
|
856
862
|
for (const filePath of changedPaths) {
|
|
857
863
|
if (!isPathAllowed(permissions, filePath, cwd)) {
|
|
858
|
-
const absPath = (0,
|
|
859
|
-
const relPath = (0,
|
|
864
|
+
const absPath = (0, import_node_path2.resolve)(cwd, filePath);
|
|
865
|
+
const relPath = (0, import_node_path2.relative)(cwd, absPath);
|
|
860
866
|
let reason;
|
|
861
867
|
if (relPath.startsWith("..")) {
|
|
862
868
|
reason = `Path escapes working directory: ${relPath}`;
|
|
@@ -899,18 +905,18 @@ function getBuiltinExternalDefaultModel(provider) {
|
|
|
899
905
|
}
|
|
900
906
|
|
|
901
907
|
// src/team/team-status.ts
|
|
902
|
-
var
|
|
908
|
+
var import_fs9 = require("fs");
|
|
903
909
|
var import_path9 = require("path");
|
|
904
910
|
|
|
905
911
|
// src/team/usage-tracker.ts
|
|
906
912
|
var import_node_fs = require("node:fs");
|
|
907
|
-
var
|
|
913
|
+
var import_node_path3 = require("node:path");
|
|
908
914
|
function getUsageLogPath(workingDirectory, teamName) {
|
|
909
|
-
return (0,
|
|
915
|
+
return (0, import_node_path3.join)(workingDirectory, ".omc", "logs", `team-usage-${teamName}.jsonl`);
|
|
910
916
|
}
|
|
911
917
|
function recordTaskUsage(workingDirectory, teamName, record) {
|
|
912
918
|
const logPath = getUsageLogPath(workingDirectory, teamName);
|
|
913
|
-
const dir = (0,
|
|
919
|
+
const dir = (0, import_node_path3.join)(workingDirectory, ".omc", "logs");
|
|
914
920
|
validateResolvedPath(logPath, workingDirectory);
|
|
915
921
|
ensureDirWithMode(dir);
|
|
916
922
|
appendFileWithMode(logPath, JSON.stringify(record) + "\n");
|
|
@@ -990,9 +996,9 @@ function peekRecentOutboxMessages(teamName, workerName, maxMessages = 10) {
|
|
|
990
996
|
const safeName = sanitizeName(teamName);
|
|
991
997
|
const safeWorker = sanitizeName(workerName);
|
|
992
998
|
const outboxPath2 = (0, import_path9.join)(getClaudeConfigDir(), "teams", safeName, "outbox", `${safeWorker}.jsonl`);
|
|
993
|
-
if (!(0,
|
|
999
|
+
if (!(0, import_fs9.existsSync)(outboxPath2)) return [];
|
|
994
1000
|
try {
|
|
995
|
-
const content = (0,
|
|
1001
|
+
const content = (0, import_fs9.readFileSync)(outboxPath2, "utf-8");
|
|
996
1002
|
const lines = content.split("\n").filter((l) => l.trim());
|
|
997
1003
|
const recentLines = lines.slice(-maxMessages);
|
|
998
1004
|
const messages = [];
|
|
@@ -1292,11 +1298,11 @@ function getOutputPath(config, taskId) {
|
|
|
1292
1298
|
}
|
|
1293
1299
|
function readOutputSummary(outputFile) {
|
|
1294
1300
|
try {
|
|
1295
|
-
if (!(0,
|
|
1301
|
+
if (!(0, import_fs10.existsSync)(outputFile)) return "(no output file)";
|
|
1296
1302
|
const buf = Buffer.alloc(1024);
|
|
1297
|
-
const fd = (0,
|
|
1303
|
+
const fd = (0, import_fs10.openSync)(outputFile, "r");
|
|
1298
1304
|
try {
|
|
1299
|
-
const bytesRead = (0,
|
|
1305
|
+
const bytesRead = (0, import_fs10.readSync)(fd, buf, 0, 1024, 0);
|
|
1300
1306
|
if (bytesRead === 0) return "(empty output)";
|
|
1301
1307
|
const content = buf.toString("utf-8", 0, bytesRead);
|
|
1302
1308
|
if (content.length > 500) {
|
|
@@ -1304,7 +1310,7 @@ function readOutputSummary(outputFile) {
|
|
|
1304
1310
|
}
|
|
1305
1311
|
return content;
|
|
1306
1312
|
} finally {
|
|
1307
|
-
(0,
|
|
1313
|
+
(0, import_fs10.closeSync)(fd);
|
|
1308
1314
|
}
|
|
1309
1315
|
} catch {
|
|
1310
1316
|
return "(error reading output)";
|
|
@@ -1863,7 +1869,7 @@ ${violationSummary}`
|
|
|
1863
1869
|
// src/lib/worktree-paths.ts
|
|
1864
1870
|
var import_crypto = require("crypto");
|
|
1865
1871
|
var import_child_process4 = require("child_process");
|
|
1866
|
-
var
|
|
1872
|
+
var import_fs11 = require("fs");
|
|
1867
1873
|
var import_os2 = require("os");
|
|
1868
1874
|
var import_path11 = require("path");
|
|
1869
1875
|
var MAX_WORKTREE_CACHE_SIZE = 8;
|
|
@@ -1907,7 +1913,7 @@ function validateConfigPath(configPath2, homeDir, claudeConfigDir) {
|
|
|
1907
1913
|
if (!isUnderHome || !isTrustedSubpath) return false;
|
|
1908
1914
|
try {
|
|
1909
1915
|
const parentDir = (0, import_path12.resolve)(resolved, "..");
|
|
1910
|
-
const realParent = (0,
|
|
1916
|
+
const realParent = (0, import_fs12.realpathSync)(parentDir);
|
|
1911
1917
|
if (!realParent.startsWith(homeDir + "/") && realParent !== homeDir) {
|
|
1912
1918
|
return false;
|
|
1913
1919
|
}
|
|
@@ -1918,14 +1924,14 @@ function validateConfigPath(configPath2, homeDir, claudeConfigDir) {
|
|
|
1918
1924
|
function validateBridgeWorkingDirectory(workingDirectory) {
|
|
1919
1925
|
let stat;
|
|
1920
1926
|
try {
|
|
1921
|
-
stat = (0,
|
|
1927
|
+
stat = (0, import_fs12.statSync)(workingDirectory);
|
|
1922
1928
|
} catch {
|
|
1923
1929
|
throw new Error(`workingDirectory does not exist: ${workingDirectory}`);
|
|
1924
1930
|
}
|
|
1925
1931
|
if (!stat.isDirectory()) {
|
|
1926
1932
|
throw new Error(`workingDirectory is not a directory: ${workingDirectory}`);
|
|
1927
1933
|
}
|
|
1928
|
-
const resolved = (0,
|
|
1934
|
+
const resolved = (0, import_fs12.realpathSync)(workingDirectory);
|
|
1929
1935
|
const home = (0, import_os3.homedir)();
|
|
1930
1936
|
if (!resolved.startsWith(home + "/") && resolved !== home) {
|
|
1931
1937
|
throw new Error(`workingDirectory is outside home directory: ${resolved}`);
|
|
@@ -1950,7 +1956,7 @@ function main() {
|
|
|
1950
1956
|
}
|
|
1951
1957
|
let config;
|
|
1952
1958
|
try {
|
|
1953
|
-
const raw = (0,
|
|
1959
|
+
const raw = (0, import_fs12.readFileSync)(configPath2, "utf-8");
|
|
1954
1960
|
config = JSON.parse(raw);
|
|
1955
1961
|
} catch (err) {
|
|
1956
1962
|
console.error(`Failed to read config from ${configPath2}: ${err.message}`);
|