Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ tsconfig.tsbuildinfo

# compiled
**/tailwind-output.css

# Внешние репозитории для справки
external/
2 changes: 1 addition & 1 deletion .kilocode/rules/restricted_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Files and directories that cannot be worked with (read, studied, modified)

Files and directories that cannot be worked with (read, studied, modified):
- directories: node_modules, dist, dist-zip, .cursor, .roocode, .gemini, external, backup
- filed: .env
- files: .env
14 changes: 14 additions & 0 deletions .roo/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
],
"env": {
"DEFAULT_MINIMUM_TOKENS": ""
}
}
}
}
35 changes: 2 additions & 33 deletions ProjectGraphAgent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ ProjectGraphAgent is a Jsonnet-driven project control system designed for AI age
- **Automation**: Grouped commits, AI command synchronization, CI workflow integration
- **Multi-Language Support**: TypeScript/JavaScript and Python adapters (extensible)



## Structure

* `project_graph.jsonnet`
Expand All @@ -31,7 +29,6 @@ ProjectGraphAgent is a Jsonnet-driven project control system designed for AI age
* `sync_ai_commands.mjs`: The script that synchronizes AI command definitions across various AI assistant rule files.
* `sync_to_standalone.mjs`: A script related to the project graph.


## Usage

### Quick Start
Expand Down Expand Up @@ -81,15 +78,13 @@ Add to `.github/workflows/*.yml`:
run: node ProjectGraphAgent/scripts/graph_validator.mjs
```



## AI Assistant Command Mapping

To streamline interaction with AI assistants, you can configure them to trigger `npm run graph:audit` and `npm run graph:commit` using simpler, more conversational commands. Below are examples of how to set this up for various AI assistants, based on the definitions in `graph_parts/ai_commands.jsonnet`.

**Important:** The exact syntax and capabilities may vary between AI assistants. Refer to your specific AI's documentation for precise configuration details.

### For Cursor (`.cursor/rules/general-rules.mdc`)
### For Kilocode (`.kilocode/rules/general-rules.md`)

```markdown
## Graph Audit
Expand All @@ -106,7 +101,6 @@ To streamline interaction with AI assistants, you can configure them to trigger
- **Trigger Phrase:** "sync-ai-commands"
- **Action:** Run `npm run sync:ai-commands`
- **Description:** Synchronizes AI command definitions across various AI assistant rule files.

```

### For Gemini Code Assistant (`.gemini/GEMINI.md`)
Expand All @@ -117,26 +111,6 @@ To streamline interaction with AI assistants, you can configure them to trigger
- **Command Aliases:** When the user requests "sync-ai-commands" or "sync ai" or "update ai rules" or "sync assistant commands", execute `npm run sync:ai-commands`.
```

### For Kilocode (`.kilocode/rules/general-rules.md`)

```markdown
## Graph Audit
- **Trigger Phrase:** "graph-audit"
- **Action:** Run `node project_graph/scripts/graph_generator.mjs`
- **Description:** Executes the project graph audit script to check for discrepancies between the graph definition and actual project files.

## Graph Commit
- **Trigger Phrase:** "graph-commit"
- **Action:** Run `npm run graph:commit`
- **Description:** Executes the AI Committer script to automatically categorize and commit staged changes based on project_graph.jsonnet rules.

## Sync Ai Commands
- **Trigger Phrase:** "sync-ai-commands"
- **Action:** Run `npm run sync:ai-commands`
- **Description:** Synchronizes AI command definitions across various AI assistant rule files.

```

### For Roo (`.roo/rules/rules.md`)

```markdown
Expand All @@ -154,16 +128,12 @@ To streamline interaction with AI assistants, you can configure them to trigger
- **Trigger Phrase:** "sync-ai-commands"
- **Action:** Run `npm run sync:ai-commands`
- **Description:** Synchronizes AI command definitions across various AI assistant rule files.

```



## Drift

- observedNotDeclared: 0
- declaredNotObserved: 13

- declaredNotObserved: 10

## Development Workflow

Expand Down Expand Up @@ -305,4 +275,3 @@ Inherits the repository license (GPL-3.0-or-later by default).
## Contributing

See `CONTRIBUTING.md` for development guidelines and contribution process.

113 changes: 113 additions & 0 deletions ProjectGraphAgent/graph_parts/README_path_indexing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Индексация для поиска по файловым путям в ProjectGraphAgent

## Обзор

Система индексации добавляет быстрый поиск по файловым путям без изменения основной структуры `entities.jsonnet`. AI-агенты могут теперь эффективно находить сущности по путям файлов, директориям и типам файлов.

## Основные возможности

### 1. Поиск по точному пути
```jsonnet
// Найти конкретный файл
local entity = graph.templates.PathSearch.findByPath("package.json");
```

### 2. Поиск по директории
```jsonnet
// Найти все файлы в директории
local files = graph.templates.PathSearch.findByDirectory("packages");
```

### 3. Поиск по типу файла
```jsonnet
// Найти все JSON файлы
local jsonFiles = graph.templates.PathSearch.findByFileType("json");

// Найти все TypeScript файлы
local tsFiles = graph.templates.PathSearch.findByFileType("ts");
```

### 4. Поиск по имени файла
```jsonnet
// Найти все package.json файлы
local packageFiles = graph.templates.PathSearch.findByFileName("package.json");
```

### 5. Поиск с паттернами
```jsonnet
// Найти файлы содержащие паттерн
local memoryFiles = graph.templates.PathSearch.findByPattern("memory-bank");
```

## Индексы

Система создает следующие индексы:

- **pathIndex**: `путь → entity` - быстрый поиск по полному пути
- **directoryIndex**: `директория → [entities]` - файлы по директориям
- **fileTypeIndex**: `расширение → [entities]` - файлы по типу
- **fileNameIndex**: `имя_файла → [entities]` - файлы с одинаковыми именами

## Вспомогательные функции

```jsonnet
// Проверить существование файла
local exists = graph.templates.PathSearch.pathExists("src/main.ts");

// Получить статистику индексов
local stats = graph.templates.PathSearch.getIndexStats();

// Получить родительскую директорию
local parent = graph.templates.PathSearch.getParentDirectory("src/utils/helper.ts");

// Получить расширение файла
local ext = graph.templates.PathSearch.getFileExtension("component.tsx");

// Получить базовое имя файла
local name = graph.templates.PathSearch.getFileName("src/components/Button.tsx");
```

## Примеры использования для AI-агентов

### Анализ зависимостей проекта
```jsonnet
local packageFiles = graph.templates.PathSearch.findByFileName("package.json");
// Анализировать зависимости во всех package.json файлах
```

### Поиск документации
```jsonnet
local docs = graph.templates.PathSearch.findByFileType("md");
// Найти всю документацию проекта
```

### Навигация по коду
```jsonnet
local tsFiles = graph.templates.PathSearch.findByFileType("ts");
local tsxFiles = graph.templates.PathSearch.findByFileType("tsx");
// Проанализировать всю кодовую базу
```

## Преимущества

1. **Быстрый поиск** - индексы обеспечивают O(1) доступ к файлам по пути
2. **Сохранение структуры** - основная структура entities.jsonnet не изменена
3. **Гибкость** - поддержка различных типов поиска
4. **Надежность** - встроенные проверки существования файлов
5. **Простота использования** - интуитивный API для AI-агентов

## Советы по использованию

- Используйте `pathExists()` перед доступом к файлу
- Комбинируйте поиск по типу и директории для точного targeting
- Кешируйте результаты при многократном использовании
- Используйте `getIndexStats()` для отладки и мониторинга

## Доступ к примерам

Полные примеры доступны через:
```jsonnet
local examples = graph.pathSearchExamples;
```

Примеры включают реальные сценарии использования AI-агентами в различных ситуациях анализа и навигации по проекту.
Loading
Loading