bd867019f9
Adds a new Codex plugin component `telemetry` that emits a single omo_codex_daily_active event (reason: session_start) from every Codex SessionStart hook, with the same UTC-day deduplication, hashed installation identifier, and four-flag opt-out as the install-time event. Previously omo-codex telemetry only fired on install_completed, so DAU/WAU/MAU under-reported real Codex usage. - New plugin component packages/omo-codex/plugin/components/telemetry/ mirrors the rules/comment-checker/lsp pattern: own src/, tsc build, vitest tests, package.json (posthog-node dep), hooks/hooks.json. - src/codex-hook.ts wraps createPluginPostHog().trackActive(..., "session_start") with safeShutdown so Codex session startup never blocks on telemetry. - Plugin root hooks.json + workspaces register the new component alongside rules and ultrawork on SessionStart. - Aggregate test expectations updated to include the telemetry directory. - cross-package-equivalence.test.ts pins product-identity constants and shouldDisablePostHog behavior to stay byte-equivalent between the CLI installer (src/telemetry/) and the plugin runtime (plugin/components/telemetry/src/), so the two PostHog sources never drift on event name, distinct_id base, dedup file path, or opt-out flags. - PostHogActivityReason union in the CLI-side posthog.ts gains "session_start" so future CLI paths can emit the same reason without a type break.
109 lines
2.4 KiB
JSON
109 lines
2.4 KiB
JSON
{
|
|
"hooks": {
|
|
"SessionStart": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook session-start",
|
|
"timeout": 10,
|
|
"statusMessage": "loading OMO project rules"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "python3 \"${PLUGIN_ROOT}/components/ultrawork/hooks/sync-agents.py\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/telemetry/dist/cli.js\" hook session-start",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"UserPromptSubmit": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook user-prompt-submit",
|
|
"timeout": 10,
|
|
"statusMessage": "loading OMO project rules"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "python3 \"${PLUGIN_ROOT}/components/ultrawork/hooks/ultrawork-detector.py\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/ultragoal/dist/cli.js\" hook user-prompt-submit",
|
|
"timeout": 10,
|
|
"statusMessage": "checking OMO ultragoal steering"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "^(apply_patch|write|Write|edit|Edit|multi_edit|multiedit|MultiEdit)$",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/comment-checker/dist/cli.js\" hook post-tool-use",
|
|
"timeout": 30,
|
|
"statusMessage": "checking OMO comments"
|
|
},
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-tool-use",
|
|
"timeout": 60,
|
|
"statusMessage": "checking OMO LSP diagnostics"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "^apply_patch$",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-tool-use",
|
|
"timeout": 10,
|
|
"statusMessage": "matching OMO project rules"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"PostCompact": [
|
|
{
|
|
"matcher": "manual|auto",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-compact",
|
|
"timeout": 10,
|
|
"statusMessage": "resetting OMO project rule cache"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|