@smwb/onreel-git-mcp 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import type { RepoAdapter } from './repo.types.ts';
2
+ import type { AdapterContext, TrackerDefinition } from './tracker.types.ts';
3
+ /** Адаптер репозитория трекера (D-008); трекер без раздела repo — TrackerError('unsupported', 'Трекер <title> не ведёт репозиторий.'). */
4
+ export declare function repoAdapterOf(definition: TrackerDefinition, context: AdapterContext): RepoAdapter;
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ /** Видимость репозитория единой модели (#23): GitHub, GitLab и SourceCraft называют её одними словами. */
3
+ export declare const repoVisibilitySchema: z.ZodEnum<{
4
+ internal: "internal";
5
+ private: "private";
6
+ public: "public";
7
+ }>;
8
+ /** Фильтры списка веток — имена полей BranchQuery. */
9
+ export declare const branchFilterSchema: z.ZodEnum<{
10
+ search: "search";
11
+ }>;
12
+ export declare const repoSchema: z.ZodObject<{
13
+ name: z.ZodString;
14
+ defaultBranch: z.ZodOptional<z.ZodString>;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ visibility: z.ZodOptional<z.ZodEnum<{
17
+ internal: "internal";
18
+ private: "private";
19
+ public: "public";
20
+ }>>;
21
+ links: z.ZodArray<z.ZodObject<{
22
+ url: z.ZodString;
23
+ title: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ export declare const branchSchema: z.ZodObject<{
27
+ name: z.ZodString;
28
+ sha: z.ZodOptional<z.ZodString>;
29
+ protected: z.ZodOptional<z.ZodBoolean>;
30
+ isDefault: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strip>;
32
+ export type RepoVisibility = z.infer<typeof repoVisibilitySchema>;
33
+ export type BranchFilter = z.infer<typeof branchFilterSchema>;
34
+ export type Repo = z.infer<typeof repoSchema>;
35
+ export type Branch = z.infer<typeof branchSchema>;
@@ -0,0 +1,20 @@
1
+ import type { Branch, BranchFilter, Repo } from './repo.schema.ts';
2
+ import type { AdapterContext, ListCapabilities, PageQuery, TrackerPage } from './tracker.types.ts';
3
+ export type BranchQuery = PageQuery & {
4
+ /** Подстрока имени ветки: GitLab и SourceCraft фильтруют сервером, GitHub — по полученной странице. */
5
+ search?: string | undefined;
6
+ };
7
+ /** Карточка репозитория и ветки git-хостинга того же подключения. */
8
+ export type RepoAdapter = {
9
+ get(): Promise<Repo>;
10
+ branches(query: BranchQuery): Promise<TrackerPage<Branch>>;
11
+ };
12
+ /** Возможности раздела repo: список веток описан как другие списки (D-004); сортировки веток нет. */
13
+ export type RepoCapabilities = {
14
+ branches: ListCapabilities<BranchFilter, never>;
15
+ };
16
+ /** Раздел repo определения трекера (D-008): на том же подключении, что и задачи. */
17
+ export type RepoDefinition = {
18
+ capabilities: RepoCapabilities;
19
+ create(context: AdapterContext): RepoAdapter;
20
+ };
@@ -0,0 +1,2 @@
1
+ import type { RepoDefinition } from './repo.types.ts';
2
+ export declare function sourcecraftRepo(): RepoDefinition;
@@ -2,6 +2,7 @@ import type { Issue, IssueComment, IssuePriority, IssueStatusCategory, TrackerDe
2
2
  import type { LocalIssueStore } from '../kernel/store.types.ts';
3
3
  import type { CiDefinition } from './ci.types.ts';
4
4
  import type { PullRequestDefinition } from './pull.types.ts';
5
+ import type { RepoDefinition } from './repo.types.ts';
5
6
  import type { CommentFilter, IssueFilter, IssueSortField } from './tracker.const.ts';
6
7
  /**
7
8
  * fetch контекста. requestJson и requestText передают redirect: 'manual' и проходят редиректы сами: обёртка
@@ -125,8 +126,10 @@ export type TrackerDefinition = {
125
126
  pulls?: PullRequestDefinition | undefined;
126
127
  /** CI трекера на том же подключении (D-005); нет — ciAdapterOf отказывает unsupported. */
127
128
  ci?: CiDefinition | undefined;
129
+ /** Репозиторий git-хостинга на том же подключении (D-008); нет — repoAdapterOf отказывает unsupported. */
130
+ repo?: RepoDefinition | undefined;
128
131
  /**
129
- * Origin API, к которому адаптер (и его разделы pulls и ci) обращается с токеном подключения, например
132
+ * Origin API, к которому адаптер (и его разделы pulls, ci и repo) обращается с токеном подключения, например
130
133
  * https://api.github.com. Потребитель привязывает к нему токен: правка url на другой origin — повод спросить
131
134
  * токен заново. Неверное подключение — TrackerError, как у create. Нет — трекер не объявил origin (у local
132
135
  * сети и токена нет).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smwb/onreel-git-mcp",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Библиотека модулей, выделенных из onreel: git-операции и безопасные пути, список файлов worktree, жизненный цикл worktree против порта WorktreeStore, адаптеры трекеров GitHub/GitLab/Jira/SourceCraft/локального и MCP-сервер на stdio",
5
5
  "keywords": [
6
6
  "git",