mirror of
https://github.com/rait-09/obsidian-agent-client.git
synced 2026-07-22 06:43:37 +00:00
Add prettier and editor settings
This commit is contained in:
parent
3fc9409e2d
commit
8a2bd9baf9
10 changed files with 111 additions and 6 deletions
10
.prettierignore
Normal file
10
.prettierignore
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
node_modules/
|
||||
.git/
|
||||
.github/
|
||||
.serena/
|
||||
.claude/
|
||||
main.js
|
||||
*.json
|
||||
*.md
|
||||
*.css
|
||||
data.json
|
||||
13
.prettierrc
Normal file
13
.prettierrc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"useTabs": true,
|
||||
"tabWidth": 4,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always",
|
||||
"endOfLine": "lf",
|
||||
"printWidth": 80,
|
||||
"proseWrap": "preserve"
|
||||
}
|
||||
36
.zed/settings.json
Normal file
36
.zed/settings.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"tab_size": 4,
|
||||
"hard_tabs": true,
|
||||
"format_on_save": "on",
|
||||
"remove_trailing_whitespace_on_save": true,
|
||||
"ensure_final_newline_on_save": true,
|
||||
"languages": {
|
||||
"TypeScript": {
|
||||
"tab_size": 4,
|
||||
"hard_tabs": true,
|
||||
"formatter": "prettier",
|
||||
"code_actions_on_format": {
|
||||
"source.fixAll.eslint": false
|
||||
},
|
||||
"format_on_save": "on"
|
||||
},
|
||||
"TSX": {
|
||||
"tab_size": 4,
|
||||
"hard_tabs": true,
|
||||
"formatter": "prettier",
|
||||
"code_actions_on_format": {
|
||||
"source.fixAll.eslint": false
|
||||
},
|
||||
"format_on_save": "on"
|
||||
},
|
||||
"JavaScript": {
|
||||
"tab_size": 4,
|
||||
"hard_tabs": true,
|
||||
"formatter": "prettier",
|
||||
"code_actions_on_format": {
|
||||
"source.fixAll.eslint": false
|
||||
},
|
||||
"format_on_save": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -170,6 +170,15 @@ npm run dev
|
|||
npm run build
|
||||
```
|
||||
|
||||
コードフォーマット(Prettier):
|
||||
```bash
|
||||
# コードのフォーマットをチェック
|
||||
npm run format:check
|
||||
|
||||
# フォーマットを自動修正
|
||||
npm run format
|
||||
```
|
||||
|
||||
## 🗺️ ロードマップ
|
||||
|
||||
- **モデル切り替え機能**: チャット画面から各エージェントのモデルを直接変更する
|
||||
|
|
|
|||
|
|
@ -172,6 +172,15 @@ For production builds:
|
|||
npm run build
|
||||
```
|
||||
|
||||
Code formatting with Prettier:
|
||||
```bash
|
||||
# Check code formatting
|
||||
npm run format:check
|
||||
|
||||
# Auto-fix formatting issues
|
||||
npm run format
|
||||
```
|
||||
|
||||
## 🗺️ Roadmap
|
||||
|
||||
- **Model Switching Support**: Change the active model for each agent directly from the chat interface
|
||||
|
|
|
|||
17
package-lock.json
generated
17
package-lock.json
generated
|
|
@ -22,6 +22,7 @@
|
|||
"builtin-modules": "3.3.0",
|
||||
"esbuild": "0.17.3",
|
||||
"obsidian": "latest",
|
||||
"prettier": "^3.4.2",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.7.4"
|
||||
}
|
||||
|
|
@ -2076,6 +2077,22 @@
|
|||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
|
||||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
"scripts": {
|
||||
"dev": "node esbuild.config.mjs",
|
||||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||
"version": "node version-bump.mjs && git add manifest.json versions.json"
|
||||
"version": "node version-bump.mjs && git add manifest.json versions.json",
|
||||
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
||||
"format:check": "prettier --check \"src/**/*.{ts,tsx}\""
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
@ -20,6 +22,7 @@
|
|||
"builtin-modules": "3.3.0",
|
||||
"esbuild": "0.17.3",
|
||||
"obsidian": "latest",
|
||||
"prettier": "^3.4.2",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.7.4"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@
|
|||
* wraps Obsidian's file access APIs with domain-friendly interface.
|
||||
*/
|
||||
|
||||
import type { IVaultAccess, NoteMetadata } from "../../core/domain/ports/vault-access.port";
|
||||
import type {
|
||||
IVaultAccess,
|
||||
NoteMetadata,
|
||||
} from "../../core/domain/ports/vault-access.port";
|
||||
import { NoteMentionService } from "./mention-service";
|
||||
import type AgentClientPlugin from "../../infrastructure/obsidian-plugin/plugin";
|
||||
import { TFile } from "obsidian";
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ export class HandlePermissionUseCase {
|
|||
/**
|
||||
* Deny a permission request by selecting the reject option
|
||||
*/
|
||||
async denyPermission(requestId: string): Promise<RespondToPermissionResult> {
|
||||
async denyPermission(
|
||||
requestId: string,
|
||||
): Promise<RespondToPermissionResult> {
|
||||
// For denial, we typically select a "reject" option
|
||||
// The actual option ID would need to be determined from the permission request
|
||||
// This is a simplified implementation
|
||||
|
|
@ -146,8 +148,8 @@ export class HandlePermissionUseCase {
|
|||
}
|
||||
|
||||
// Fall back to any option with "allow" in the name
|
||||
const allowByName = request.options.find(
|
||||
(option) => option.name.toLowerCase().includes("allow"),
|
||||
const allowByName = request.options.find((option) =>
|
||||
option.name.toLowerCase().includes("allow"),
|
||||
);
|
||||
if (allowByName) {
|
||||
return allowByName;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
import type { AgentEnvVar, CustomAgentSettings } from "../infrastructure/obsidian-plugin/plugin";
|
||||
import type {
|
||||
AgentEnvVar,
|
||||
CustomAgentSettings,
|
||||
} from "../infrastructure/obsidian-plugin/plugin";
|
||||
import type { BaseAgentSettings } from "../core/domain/models/agent-config";
|
||||
import type { AgentConfig } from "../core/domain/ports/agent-client.port";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue