-
Notifications
You must be signed in to change notification settings - Fork 1
fix(defender): give each Defender plugin its own daemon #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * Where this plugin's daemon lives. The hook client and the daemon both import these, so | ||
| * they can never disagree about the socket or state file they share. | ||
| * | ||
| * The name is per plugin. stackone-defender and stackone-defender-antigravity pin different | ||
| * dependency trees, and each client replaces any daemon that does not match its own. With | ||
| * one shared identity, installing both made them kill each other's daemon on every scan. | ||
| */ | ||
| import { homedir } from "os"; | ||
| import { join } from "path"; | ||
|
|
||
| const DIR = join(homedir(), ".claude"); | ||
| const NAME = "defender-antigravity"; | ||
|
|
||
| export const SOCKET_PATH = join(DIR, `${NAME}.sock`); | ||
| export const LOCK_PATH = join(DIR, `${NAME}-daemon.lock`); | ||
| export const STATE_PATH = join(DIR, `${NAME}-daemon.json`); | ||
| export const DAEMON_LOG = join(DIR, `${NAME}-daemon.log`); | ||
| // Separate from the daemon log so client appends don't race the daemon's rotation. | ||
| export const CLIENT_LOG = join(DIR, `${NAME}-client.log`); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * Where this plugin's daemon lives. The hook client and the daemon both import these, so | ||
| * they can never disagree about the socket or state file they share. | ||
| * | ||
| * The name is per plugin. stackone-defender and stackone-defender-antigravity pin different | ||
| * dependency trees, and each client replaces any daemon that does not match its own. With | ||
| * one shared identity, installing both made them kill each other's daemon on every scan. | ||
| */ | ||
| import { homedir } from "os"; | ||
| import { join } from "path"; | ||
|
|
||
| const DIR = join(homedir(), ".claude"); | ||
| const NAME = "defender"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: This entire script set is vendored twice: Prompt for AI agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point, but I'm keeping it out of this PR. The duplication predates this change. The two plugins already carry separate copies of Sharing the scripts at packaging time, or adding a sync check, is worth doing, but it's a change to how both plugins are built. It should be reviewed on its own rather than folded into a bug fix. |
||
|
|
||
| export const SOCKET_PATH = join(DIR, `${NAME}.sock`); | ||
| export const LOCK_PATH = join(DIR, `${NAME}-daemon.lock`); | ||
| export const STATE_PATH = join(DIR, `${NAME}-daemon.json`); | ||
| export const DAEMON_LOG = join(DIR, `${NAME}-daemon.log`); | ||
| // Separate from the daemon log so client appends don't race the daemon's rotation. | ||
| export const CLIENT_LOG = join(DIR, `${NAME}-client.log`); | ||
Uh oh!
There was an error while loading. Please reload this page.