-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add opencode plugin and xdg defaults #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0d14a5f
feat: add opencode plugin and xdg db defaults
oritwoen 7bad87d
fix: guard tool hook against null output
oritwoen cd4bbe6
fix: guard event hook against missing payload
oritwoen 34c9ab5
test: tighten plugin and db-path edge cases
oritwoen 16b0b98
fix: handle session idle events explicitly
oritwoen 4d7ca6d
test: track plugin hooks for teardown cleanup
oritwoen 48f24d0
test: align observation cap check with FTS results
oritwoen 4bcaa1b
Merge origin/main into opencode-plugin-xdg-defaults
oritwoen afe611f
fix: align opencode plugin with async obsxa API
oritwoen 978c941
fix: harden plugin session handling and db path validation
oritwoen c497d95
fix: create local db directory before opening sqlite file
oritwoen 6fd2812
chore: refresh pnpm lockfile
oritwoen a3e35cd
chore: apply automated updates
autofix-ci[bot] 87c9629
fix: harden obsxa context injection and project-scoped recall
oritwoen 19c5282
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] c6be4f0
chore: apply automated updates
autofix-ci[bot] 77ef324
Merge branch 'main' into opencode-plugin-xdg-defaults
oritwoen 4771e88
fix: align opencode hook types and harden event/context handling
oritwoen 2808140
Merge remote-tracking branch 'origin/main' into opencode-plugin-xdg-d…
oritwoen 0b1e8dc
chore: apply automated updates
autofix-ci[bot] 5fb1f29
fix: keep opencode plugin input backward compatible
oritwoen 44d0d6e
chore: pin dev dependency versions
oritwoen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { homedir } from "node:os"; | ||
| import { posix, win32 } from "node:path"; | ||
|
|
||
| function isAbsoluteForPlatform(path: string, platform: NodeJS.Platform): boolean { | ||
| return platform === "win32" ? win32.isAbsolute(path) : posix.isAbsolute(path); | ||
| } | ||
|
|
||
| export function getDefaultDbPath( | ||
| env: NodeJS.ProcessEnv = process.env, | ||
| home = homedir(), | ||
| platform: NodeJS.Platform = process.platform, | ||
| ): string { | ||
| const xdgDataHome = env.XDG_DATA_HOME?.trim(); | ||
| const localAppData = env.LOCALAPPDATA?.trim(); | ||
|
|
||
| if (xdgDataHome && xdgDataHome.length > 0 && isAbsoluteForPlatform(xdgDataHome, platform)) { | ||
| return platform === "win32" | ||
| ? win32.join(xdgDataHome, "obsxa", "obsxa.db") | ||
| : posix.join(xdgDataHome, "obsxa", "obsxa.db"); | ||
| } | ||
|
|
||
| if (platform === "win32") { | ||
| if (localAppData && localAppData.length > 0 && win32.isAbsolute(localAppData)) { | ||
| return win32.join(localAppData, "obsxa", "obsxa.db"); | ||
| } | ||
| if (!home || home.trim().length === 0 || !win32.isAbsolute(home)) { | ||
| throw new Error("Home directory must not be empty"); | ||
| } | ||
| return win32.join(home, "AppData", "Local", "obsxa", "obsxa.db"); | ||
| } | ||
|
|
||
| if (!home || home.trim().length === 0 || !posix.isAbsolute(home)) { | ||
| throw new Error("Home directory must not be empty"); | ||
| } | ||
|
|
||
| const fallbackDataHome = | ||
| platform === "darwin" | ||
| ? posix.join(home, "Library", "Application Support") | ||
| : posix.join(home, ".local", "share"); | ||
|
|
||
| return posix.join(fallbackDataHome, "obsxa", "obsxa.db"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.