feat(plugin): add PostHog tracking to plugin initialization
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -18,6 +18,7 @@ import { injectServerAuthIntoClient, log, logLegacyPluginStartupWarning } from "
|
||||
import { detectExternalSkillPlugin, getSkillPluginConflictWarning } from "./shared/external-plugin-detector"
|
||||
import { startBackgroundCheck as startTmuxCheck } from "./tools/interactive-bash"
|
||||
import { lspManager } from "./tools/lsp/client"
|
||||
import { createPluginPostHog, getPostHogDistinctId } from "./shared/posthog"
|
||||
|
||||
let activePluginDispose: PluginDispose | null = null
|
||||
|
||||
@@ -37,6 +38,16 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
await activePluginDispose?.()
|
||||
|
||||
const pluginConfig = loadPluginConfig(ctx.directory, ctx)
|
||||
|
||||
const posthog = createPluginPostHog()
|
||||
posthog.capture({
|
||||
distinctId: getPostHogDistinctId(),
|
||||
event: "plugin_loaded",
|
||||
properties: {
|
||||
has_openclaw: !!pluginConfig.openclaw,
|
||||
tmux_enabled: isTmuxIntegrationEnabled(pluginConfig),
|
||||
},
|
||||
})
|
||||
if (pluginConfig.openclaw) {
|
||||
await initializeOpenClaw(pluginConfig.openclaw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user