@gitton-dev/types 0.0.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.
package/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # Gitton
2
+
3
+ **Git Client for Vibe Coding**
4
+
5
+ Gitton is a Git client designed for the AI coding era. Run Claude Code, Cursor CLI, and other AI assistants directly in the integrated terminal. Features AI-powered commit message generation, code review, and PR description generation.
6
+
7
+ ![Gitton Working Copy](https://jsers.dev/images/gitton-working-copy.png)
8
+
9
+ ## Philosophy
10
+
11
+ Gitton represents a paradigm shift in development tools for the AI era. With AI coding assistants like Claude Code, Cursor CLI, and Aider, developers spend less time in traditional editors and more time in terminals.
12
+
13
+ **Terminal-First Approach** - Rather than another code editor, Gitton integrates a terminal for AI instruction. Give instructions to AI in the terminal, review results and commit in a powerful Git client.
14
+
15
+ **Advanced Git Features** - AI-assisted development requires *more* sophisticated Git capabilities. Since AI generates large code blocks that may include unintended changes, you need granular version control.
16
+
17
+ **GitHub-Exclusive Focus** - Deep GitHub integration enables PR management, inline commenting, AI-generated PR descriptions, and automated code reviews—all within the app.
18
+
19
+ **Strip unnecessary features while thoroughly refining essential ones.** For the AI era, that means: powerful Git operations, terminal integration, and seamless GitHub workflows—without editor complexity.
20
+
21
+ ## Features
22
+
23
+ ### Visual History & Navigation
24
+
25
+ ![Gitton History](https://jsers.dev/images/gitton-history.png)
26
+
27
+ - **Intuitive Graph View** - Visualize your project history with color-coded branch graphs
28
+ - **Easy Operations** - Cherry-pick, revert, and reset commits with a click
29
+ - **Reflog Support** - Complete operation history for easy recovery from mistakes
30
+
31
+ ### Branches & Reflog
32
+
33
+ ![Gitton Branches](https://jsers.dev/images/gitton-branches.png)
34
+
35
+ ### GitHub Integration
36
+
37
+ ![Gitton Pull Requests](https://jsers.dev/images/gitton-pull-requests.png)
38
+
39
+ - **Pull Requests** - Create, review, and merge PRs without leaving the app
40
+ - **AI-Generated PR Descriptions** - Let AI write your PR descriptions from commit diffs
41
+ - **AI Code Review** - Get intelligent feedback on your changes
42
+
43
+ ![Gitton AI Review](https://jsers.dev/images/gitton-ai-review.png)
44
+
45
+ ### AI-Powered Workflows
46
+
47
+ - **Multi-Provider Support** - OpenAI, Anthropic, Google, and Ollama
48
+ - **Conventional Commit Messages** - Auto-generate meaningful commit messages
49
+ - **Security Analysis** - AI-powered security scanning of your changes
50
+
51
+ ### Parallel Development with Worktrees
52
+
53
+ ![Gitton Worktrees](https://jsers.dev/images/gitton-worktrees.png)
54
+
55
+ - **Multiple Worktrees** - Work on different branches simultaneously
56
+ - **Independent Sessions** - Run separate AI tool sessions in each worktree
57
+
58
+ ### Integrated Terminal
59
+
60
+ ![Gitton Terminal](https://jsers.dev/images/gitton-terminal.png)
61
+
62
+ - **AI Tool Ready** - Claude Code, Cursor, GitHub Copilot - use any tool you like
63
+ - **Full Shell Access** - Execute any command within your repository
64
+
65
+ ### Plugin System
66
+
67
+ Extend Gitton's functionality with plugins:
68
+ - Add custom sidebar panels
69
+ - Add settings tabs
70
+ - Add context menu items
71
+ - Register Git hooks (pre-commit, post-push, etc.)
72
+
73
+ ## Plugin Development
74
+
75
+ Create plugins to extend Gitton. See `gitton-plugin.d.ts` for TypeScript definitions.
76
+
77
+ ### Plugin Structure
78
+
79
+ ```
80
+ my-gitton-plugin/
81
+ ├── package.json # Plugin manifest in "gitton" field
82
+ ├── ui/
83
+ │ └── sidebar.html # UI extension HTML
84
+ └── ...
85
+ ```
86
+
87
+ ### package.json Example
88
+
89
+ ```json
90
+ {
91
+ "name": "gitton-plugin-example",
92
+ "version": "1.0.0",
93
+ "gitton": {
94
+ "displayName": "Example Plugin",
95
+ "version": "1.0.0",
96
+ "description": "An example plugin for Gitton",
97
+ "permissions": ["ui:sidebar", "settings:read", "settings:write"],
98
+ "extensionPoints": {
99
+ "sidebar": {
100
+ "entry": "ui/sidebar.html",
101
+ "icon": "Puzzle",
102
+ "position": "bottom"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Plugin API
110
+
111
+ Access the `gitton` global object in your plugin HTML:
112
+
113
+ ```typescript
114
+ // Settings
115
+ const value = await gitton.settings.get('myKey');
116
+ await gitton.settings.set('myKey', { foo: 'bar' });
117
+
118
+ // Notifications
119
+ gitton.ui.showNotification('Hello!', 'info');
120
+
121
+ // Open external URL
122
+ await gitton.ui.openExternal('https://github.com');
123
+
124
+ // HTTP requests
125
+ const result = await gitton.network.fetch('https://api.example.com/data');
126
+
127
+ // GitHub CLI
128
+ const prList = await gitton.gh.run(['pr', 'list', '--json', 'number,title']);
129
+
130
+ // File system (within repo only)
131
+ const content = await gitton.fs.readFile('.gitignore');
132
+ await gitton.fs.writeFile('temp.txt', 'content');
133
+ ```
134
+
135
+ ### Permissions
136
+
137
+ | Permission | Description |
138
+ |------------|-------------|
139
+ | `ui:sidebar` | Add sidebar panel |
140
+ | `ui:settings` | Add settings tab |
141
+ | `ui:repositorySettings` | Add repository settings tab |
142
+ | `ui:contextMenu` | Add context menu items |
143
+ | `settings:read` | Read plugin settings |
144
+ | `settings:write` | Write plugin settings |
145
+ | `network:fetch` | Make HTTP requests |
146
+ | `git:read` | Read Git information |
147
+ | `git:write` | Execute Git operations |
148
+ | `git:hooks` | Register Git hooks |
149
+
150
+ ### Marketplace
151
+
152
+ Publish your plugin on GitHub with the `gitton-plugin` topic to appear in the Gitton marketplace.
153
+
154
+ ## Pricing
155
+
156
+ - **Free Trial** - 7 days
157
+ - **Pro** - $19.99 one-time purchase (no subscription)
158
+
159
+ ## Links
160
+
161
+ - [Website](https://jsers.dev/service/gitton)
162
+ - [Philosophy](https://jsers.dev/service/gitton/blog/gitton-philosophy)
163
+
164
+ ## License
165
+
166
+ MIT License
167
+
168
+ ## Author
169
+
170
+ godai
@@ -0,0 +1,399 @@
1
+ /**
2
+ * Gitton Plugin API Type Definitions
3
+ *
4
+ * This file provides TypeScript type definitions for developing Gitton plugins.
5
+ * Include this file in your plugin project to get full IntelliSense support.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+
10
+ /**
11
+ * Plugin permissions that can be requested in package.json
12
+ */
13
+ export type PluginPermission =
14
+ | 'ui:sidebar'
15
+ | 'ui:settings'
16
+ | 'ui:repositorySettings'
17
+ | 'ui:contextMenu'
18
+ | 'settings:read'
19
+ | 'settings:write'
20
+ | 'network:fetch'
21
+ | 'git:read'
22
+ | 'git:write'
23
+ | 'git:hooks'
24
+
25
+ /**
26
+ * Git hook types that plugins can register
27
+ */
28
+ export type HookType =
29
+ | 'preCommit'
30
+ | 'postCommit'
31
+ | 'preCheckout'
32
+ | 'postCheckout'
33
+ | 'prePush'
34
+ | 'postPush'
35
+ | 'preMerge'
36
+ | 'postMerge'
37
+ | 'onRepositoryOpen'
38
+ | 'onRepositoryClose'
39
+
40
+ /**
41
+ * Notification types for UI notifications
42
+ */
43
+ export type NotificationType = 'info' | 'warning' | 'error'
44
+
45
+ /**
46
+ * Context menu target types
47
+ */
48
+ export type ContextMenuTarget = 'commit' | 'file' | 'branch' | 'tag' | 'stash'
49
+
50
+ /**
51
+ * Theme setting
52
+ */
53
+ export type Theme = 'light' | 'dark' | 'system'
54
+
55
+ /**
56
+ * Sidebar extension configuration
57
+ */
58
+ export interface SidebarExtension {
59
+ /** HTML file path relative to plugin root */
60
+ entry: string
61
+ /** Lucide icon name (e.g., "Puzzle", "Settings", "GitBranch") */
62
+ icon?: string
63
+ /** Position in sidebar */
64
+ position?: 'top' | 'bottom'
65
+ }
66
+
67
+ /**
68
+ * Settings tab extension configuration
69
+ */
70
+ export interface SettingsTabExtension {
71
+ /** HTML file path relative to plugin root */
72
+ entry: string
73
+ /** Tab label displayed in settings */
74
+ label: string
75
+ }
76
+
77
+ /**
78
+ * Repository settings extension configuration
79
+ */
80
+ export interface RepositorySettingsExtension {
81
+ /** HTML file path relative to plugin root */
82
+ entry: string
83
+ /** Tab label displayed in repository settings */
84
+ label: string
85
+ /** Lucide icon name */
86
+ icon?: string
87
+ }
88
+
89
+ /**
90
+ * Context menu extension configuration
91
+ */
92
+ export interface ContextMenuExtension {
93
+ /** Unique identifier for the menu item */
94
+ id: string
95
+ /** Display label for the menu item */
96
+ label: string
97
+ /** Contexts where this menu item should appear */
98
+ context: ContextMenuTarget[]
99
+ }
100
+
101
+ /**
102
+ * Extension points configuration
103
+ */
104
+ export interface ExtensionPoints {
105
+ sidebar?: SidebarExtension
106
+ settingsTab?: SettingsTabExtension
107
+ repositorySettings?: RepositorySettingsExtension
108
+ contextMenu?: ContextMenuExtension[]
109
+ }
110
+
111
+ /**
112
+ * Plugin manifest (gitton field in package.json)
113
+ */
114
+ export interface PluginManifest {
115
+ /** Display name shown in Gitton UI */
116
+ displayName: string
117
+ /** Plugin version (semver) */
118
+ version: string
119
+ /** Plugin description */
120
+ description?: string
121
+ /** Plugin author */
122
+ author?: string
123
+ /** Plugin icon (Lucide icon name) */
124
+ icon?: string
125
+ /** Minimum Gitton version required */
126
+ minGittonVersion?: string
127
+ /** Permissions required by the plugin */
128
+ permissions: PluginPermission[]
129
+ /** Git hooks the plugin wants to register */
130
+ hooks?: HookType[]
131
+ /** UI extension points */
132
+ extensionPoints?: ExtensionPoints
133
+ /** JSON Schema for plugin configuration */
134
+ configSchema?: Record<string, unknown>
135
+ }
136
+
137
+ /**
138
+ * Context provided to hooks
139
+ */
140
+ export interface HookContext {
141
+ /** Repository path */
142
+ repoPath: string
143
+ /** Current branch name */
144
+ currentBranch?: string
145
+ /** Additional data depending on hook type */
146
+ data: Record<string, unknown>
147
+ }
148
+
149
+ /**
150
+ * Result returned from hook handlers
151
+ */
152
+ export interface HookResult {
153
+ /** Set to false to cancel the operation */
154
+ proceed: boolean
155
+ /** Message to show to the user */
156
+ message?: string
157
+ /** Modified data to pass to subsequent hooks/operations */
158
+ modifiedData?: Record<string, unknown>
159
+ }
160
+
161
+ /**
162
+ * Context provided to plugin UI
163
+ */
164
+ export interface GittonContext {
165
+ /** Current repository path (null if no repo is open) */
166
+ repoPath: string | null
167
+ /** Current theme */
168
+ theme: Theme
169
+ }
170
+
171
+ /**
172
+ * Network fetch result
173
+ */
174
+ export interface FetchResult {
175
+ /** HTTP status code */
176
+ status: number
177
+ /** HTTP status text */
178
+ statusText: string
179
+ /** Response headers */
180
+ headers: Record<string, string>
181
+ /** Response body as text */
182
+ body: string
183
+ }
184
+
185
+ /**
186
+ * GitHub CLI execution result
187
+ */
188
+ export interface GhResult {
189
+ /** Exit code */
190
+ exitCode: number
191
+ /** Standard output */
192
+ stdout: string
193
+ /** Standard error */
194
+ stderr: string
195
+ }
196
+
197
+ /**
198
+ * Directory entry from readdir
199
+ */
200
+ export interface DirEntry {
201
+ /** Entry name */
202
+ name: string
203
+ /** Whether it's a directory */
204
+ isDirectory: boolean
205
+ /** Whether it's a file */
206
+ isFile: boolean
207
+ }
208
+
209
+ /**
210
+ * Settings API for reading and writing plugin settings
211
+ */
212
+ export interface SettingsAPI {
213
+ /**
214
+ * Get a setting value
215
+ * @param key - Setting key
216
+ * @returns The setting value, or undefined if not set
217
+ */
218
+ get(key: string): Promise<unknown>
219
+
220
+ /**
221
+ * Set a setting value
222
+ * @param key - Setting key
223
+ * @param value - Setting value (must be JSON-serializable)
224
+ */
225
+ set(key: string, value: unknown): Promise<void>
226
+
227
+ /**
228
+ * Get all settings for this plugin
229
+ * @returns Object containing all settings
230
+ */
231
+ getAll(): Promise<Record<string, unknown>>
232
+ }
233
+
234
+ /**
235
+ * UI API for interacting with Gitton's user interface
236
+ */
237
+ export interface UIAPI {
238
+ /**
239
+ * Show a notification to the user
240
+ * @param message - Message to display
241
+ * @param type - Notification type (default: 'info')
242
+ */
243
+ showNotification(message: string, type?: NotificationType): void
244
+
245
+ /**
246
+ * Open an external URL in the default browser
247
+ * @param url - URL to open
248
+ */
249
+ openExternal(url: string): Promise<void>
250
+
251
+ /**
252
+ * Get the current theme
253
+ * @returns Current theme setting
254
+ */
255
+ getTheme(): Promise<Theme>
256
+ }
257
+
258
+ /**
259
+ * Network API for making HTTP requests
260
+ */
261
+ export interface NetworkAPI {
262
+ /**
263
+ * Make an HTTP request
264
+ * @param url - Request URL
265
+ * @param options - Fetch options (method, headers, body, etc.)
266
+ * @returns Response object
267
+ */
268
+ fetch(url: string, options?: RequestInit): Promise<FetchResult>
269
+ }
270
+
271
+ /**
272
+ * GitHub CLI API
273
+ */
274
+ export interface GhAPI {
275
+ /**
276
+ * Run a GitHub CLI command
277
+ * @param args - Command arguments (e.g., ['pr', 'list', '--json', 'number'])
278
+ * @returns Command result
279
+ * @example
280
+ * const result = await gitton.gh.run(['pr', 'list', '--json', 'number,title']);
281
+ * const prs = JSON.parse(result.stdout);
282
+ */
283
+ run(args: string[]): Promise<GhResult>
284
+ }
285
+
286
+ /**
287
+ * File system API (restricted to repository directory)
288
+ */
289
+ export interface FsAPI {
290
+ /**
291
+ * Read a file
292
+ * @param path - File path relative to repository root
293
+ * @returns File contents as string
294
+ */
295
+ readFile(path: string): Promise<string>
296
+
297
+ /**
298
+ * Write a file
299
+ * @param path - File path relative to repository root
300
+ * @param content - Content to write
301
+ */
302
+ writeFile(path: string, content: string): Promise<void>
303
+
304
+ /**
305
+ * List directory contents
306
+ * @param path - Directory path relative to repository root
307
+ * @returns Array of directory entries
308
+ */
309
+ readdir(path: string): Promise<DirEntry[]>
310
+
311
+ /**
312
+ * Check if a file or directory exists
313
+ * @param path - Path relative to repository root
314
+ * @returns True if exists
315
+ */
316
+ exists(path: string): Promise<boolean>
317
+
318
+ /**
319
+ * Delete a file
320
+ * @param path - File path relative to repository root
321
+ */
322
+ unlink(path: string): Promise<void>
323
+
324
+ /**
325
+ * Change file permissions
326
+ * @param path - File path relative to repository root
327
+ * @param mode - Permission mode (e.g., 0o755)
328
+ */
329
+ chmod(path: string, mode: number): Promise<void>
330
+ }
331
+
332
+ /**
333
+ * Main Gitton Plugin API
334
+ *
335
+ * This object is available as `window.gitton` in plugin HTML files.
336
+ */
337
+ export interface GittonPluginAPI {
338
+ /** Plugin ID assigned by Gitton */
339
+ readonly pluginId: string
340
+
341
+ /** Settings API */
342
+ readonly settings: SettingsAPI
343
+
344
+ /** UI API */
345
+ readonly ui: UIAPI
346
+
347
+ /** Network API */
348
+ readonly network: NetworkAPI
349
+
350
+ /** GitHub CLI API */
351
+ readonly gh: GhAPI
352
+
353
+ /** File system API */
354
+ readonly fs: FsAPI
355
+
356
+ /** Current context (updated when repository changes) */
357
+ readonly context: GittonContext
358
+ }
359
+
360
+ /**
361
+ * Context change event detail
362
+ */
363
+ export interface ContextChangeEventDetail {
364
+ repoPath: string | null
365
+ theme: Theme
366
+ }
367
+
368
+ declare global {
369
+ interface Window {
370
+ /**
371
+ * Gitton Plugin API
372
+ *
373
+ * Available in all plugin HTML files loaded by Gitton.
374
+ *
375
+ * @example
376
+ * // Read a setting
377
+ * const value = await gitton.settings.get('myKey');
378
+ *
379
+ * // Show a notification
380
+ * gitton.ui.showNotification('Hello from plugin!', 'info');
381
+ *
382
+ * // Make an HTTP request
383
+ * const result = await gitton.network.fetch('https://api.example.com/data');
384
+ *
385
+ * // Run GitHub CLI command
386
+ * const prs = await gitton.gh.run(['pr', 'list', '--json', 'number']);
387
+ */
388
+ gitton: GittonPluginAPI
389
+ }
390
+
391
+ interface WindowEventMap {
392
+ /**
393
+ * Fired when the context changes (e.g., repository opened/closed, theme changed)
394
+ */
395
+ 'gitton:contextchange': CustomEvent<ContextChangeEventDetail>
396
+ }
397
+ }
398
+
399
+ export {}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@gitton-dev/types",
3
+ "version": "0.0.0",
4
+ "description": "TypeScript type definitions for Gitton plugins",
5
+ "main": "gitton-plugin.d.ts",
6
+ "types": "gitton-plugin.d.ts",
7
+ "files": [
8
+ "gitton-plugin.d.ts",
9
+ "README.md"
10
+ ],
11
+ "keywords": [
12
+ "gitton",
13
+ "gitton-plugin",
14
+ "typescript",
15
+ "types"
16
+ ],
17
+ "author": "godai",
18
+ "license": "MIT",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git@github.com:gitton-dev/gitton-plugins.git",
22
+ "directory": "packages/types"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/gitton-dev/gitton-plugins/issues"
26
+ },
27
+ "homepage": "https://jsers.dev/service/gitton"
28
+ }