xling 0.3.0 → 0.4.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 +112 -23
- package/dist/{base-BWvHbkly.js → base-BDWlyPnr.js} +10 -11
- package/dist/{base-EQ6uvBQs.d.ts → base-C-NPqEhs.d.ts} +19 -20
- package/dist/base-CRTwHcps.js +30 -0
- package/dist/base-CqP3N9Eo.d.ts +39 -0
- package/dist/{claude-BsdlWM7z.js → claude-BvlLXKkI.js} +7 -9
- package/dist/{claude-D7KdpYHQ.js → claude-NvQoYxJY.js} +13 -16
- package/dist/{claudeDefault-pd-Kyu6o.js → claudeDefault-E3SAE4Ef.js} +1 -2
- package/dist/{codex-UJ2PYHA6.js → codex-DX7doGgq.js} +11 -17
- package/dist/{codex-Crifr9cw.js → codex-DrigbqRY.js} +8 -10
- package/dist/commands/git/index.d.ts +12 -0
- package/dist/commands/git/index.js +37 -0
- package/dist/commands/git/prc.d.ts +13 -0
- package/dist/commands/git/prc.js +123 -0
- package/dist/commands/git/prr.d.ts +14 -0
- package/dist/commands/git/prr.js +82 -0
- package/dist/commands/git/prv.d.ts +14 -0
- package/dist/commands/git/prv.js +72 -0
- package/dist/commands/git/worktree.d.ts +13 -0
- package/dist/commands/git/worktree.js +137 -0
- package/dist/commands/git/wta.d.ts +13 -0
- package/dist/commands/git/wta.js +80 -0
- package/dist/commands/git/wtl.d.ts +12 -0
- package/dist/commands/git/wtl.js +44 -0
- package/dist/commands/git/wtp.d.ts +12 -0
- package/dist/commands/git/wtp.js +44 -0
- package/dist/commands/git/wtr.d.ts +13 -0
- package/dist/commands/git/wtr.js +79 -0
- package/dist/commands/git/wts.d.ts +13 -0
- package/dist/commands/git/wts.js +62 -0
- package/dist/commands/settings/get.d.ts +5 -13
- package/dist/commands/settings/get.js +14 -15
- package/dist/commands/settings/inspect.d.ts +4 -10
- package/dist/commands/settings/inspect.js +13 -14
- package/dist/commands/settings/list.d.ts +4 -11
- package/dist/commands/settings/list.js +13 -14
- package/dist/commands/settings/set.d.ts +5 -13
- package/dist/commands/settings/set.js +13 -14
- package/dist/commands/settings/switch.d.ts +5 -15
- package/dist/commands/settings/switch.js +14 -15
- package/dist/commands/x/index.d.ts +4 -15
- package/dist/commands/x/index.js +9 -10
- package/dist/create-CKUHliul.js +95 -0
- package/dist/dispatcher-C0-p8F1o.js +33 -0
- package/dist/{dispatcher-BUU7wUgm.js → dispatcher-DXa91-tV.js} +15 -24
- package/dist/{dispatcher-Co94YvDc.js → dispatcher-RcoXqvot.js} +13 -16
- package/dist/domain/git.d.ts +2 -0
- package/dist/domain/git.js +3 -0
- package/dist/domain/interfaces.d.ts +2 -2
- package/dist/domain/types.d.ts +1 -1
- package/dist/domain/validators.d.ts +15 -56
- package/dist/domain/validators.js +22 -20
- package/dist/{editor-D4qoje1V.js → editor-CUiekAEb.js} +2 -3
- package/dist/{errors-CAZ5k5YT.js → errors-pXKbCKbL.js} +38 -12
- package/dist/{format-Cqecj3RS.js → format-GMs1vKBL.js} +6 -7
- package/dist/{fsStore-BPnFUGta.js → fsStore-MvYlG65t.js} +12 -13
- package/dist/{gemini-Qo5146d_.js → gemini-DuEXfwHS.js} +7 -10
- package/dist/git-BZvqM5hz.js +12 -0
- package/dist/git-C_Qfadu_.d.ts +69 -0
- package/dist/interfaces-CbUR78_2.d.ts +69 -0
- package/dist/pr-DjdO-vJk.js +61 -0
- package/dist/run.js +2 -3
- package/dist/runner-DYk4q6mP.js +145 -0
- package/dist/services/git/create.d.ts +13 -0
- package/dist/services/git/create.js +6 -0
- package/dist/services/git/dispatcher.d.ts +18 -0
- package/dist/services/git/dispatcher.js +10 -0
- package/dist/services/git/pr.d.ts +14 -0
- package/dist/services/git/pr.js +6 -0
- package/dist/services/git/utils.d.ts +14 -0
- package/dist/services/git/utils.js +5 -0
- package/dist/services/git/view.d.ts +13 -0
- package/dist/services/git/view.js +6 -0
- package/dist/services/git/worktree.d.ts +13 -0
- package/dist/services/git/worktree.js +5 -0
- package/dist/services/launch/adapters/base.d.ts +3 -3
- package/dist/services/launch/adapters/base.js +2 -2
- package/dist/services/launch/adapters/claude.d.ts +9 -11
- package/dist/services/launch/adapters/claude.js +3 -3
- package/dist/services/launch/adapters/codex.d.ts +10 -12
- package/dist/services/launch/adapters/codex.js +3 -3
- package/dist/services/launch/dispatcher.d.ts +18 -27
- package/dist/services/launch/dispatcher.js +6 -6
- package/dist/services/settings/adapters/base.d.ts +3 -3
- package/dist/services/settings/adapters/base.js +3 -3
- package/dist/services/settings/adapters/claude.d.ts +17 -20
- package/dist/services/settings/adapters/claude.js +7 -7
- package/dist/services/settings/adapters/codex.d.ts +18 -24
- package/dist/services/settings/adapters/codex.js +4 -4
- package/dist/services/settings/adapters/gemini.d.ts +15 -18
- package/dist/services/settings/adapters/gemini.js +4 -4
- package/dist/services/settings/dispatcher.d.ts +16 -19
- package/dist/services/settings/dispatcher.js +10 -10
- package/dist/services/settings/fsStore.d.ts +24 -27
- package/dist/services/settings/fsStore.js +2 -2
- package/dist/services/settings/templates/claudeDefault.d.ts +3 -4
- package/dist/services/settings/templates/claudeDefault.js +1 -1
- package/dist/{types--0tjriPy.d.ts → types-h3oFUAyV.d.ts} +17 -18
- package/dist/utils/editor.d.ts +1 -2
- package/dist/utils/editor.js +2 -2
- package/dist/utils/errors.d.ts +39 -22
- package/dist/utils/errors.js +2 -2
- package/dist/utils/format.d.ts +8 -9
- package/dist/utils/format.js +1 -1
- package/dist/utils/logger.d.ts +9 -10
- package/dist/utils/logger.js +5 -6
- package/dist/utils/runner.d.ts +34 -18
- package/dist/utils/runner.js +2 -2
- package/dist/utils-DDnNMPIq.js +35 -0
- package/dist/view-JZaEEspp.js +84 -0
- package/dist/worktree-CYc33agA.js +203 -0
- package/package.json +1 -1
- package/dist/base-BWvHbkly.js.map +0 -1
- package/dist/base-BXJVsMwL.d.ts +0 -45
- package/dist/base-BXJVsMwL.d.ts.map +0 -1
- package/dist/base-DdIJJBHV.js +0 -34
- package/dist/base-DdIJJBHV.js.map +0 -1
- package/dist/base-EQ6uvBQs.d.ts.map +0 -1
- package/dist/claude-BsdlWM7z.js.map +0 -1
- package/dist/claude-D7KdpYHQ.js.map +0 -1
- package/dist/claudeDefault-pd-Kyu6o.js.map +0 -1
- package/dist/codex-Crifr9cw.js.map +0 -1
- package/dist/codex-UJ2PYHA6.js.map +0 -1
- package/dist/commands/settings/get.d.ts.map +0 -1
- package/dist/commands/settings/get.js.map +0 -1
- package/dist/commands/settings/inspect.d.ts.map +0 -1
- package/dist/commands/settings/inspect.js.map +0 -1
- package/dist/commands/settings/list.d.ts.map +0 -1
- package/dist/commands/settings/list.js.map +0 -1
- package/dist/commands/settings/set.d.ts.map +0 -1
- package/dist/commands/settings/set.js.map +0 -1
- package/dist/commands/settings/switch.d.ts.map +0 -1
- package/dist/commands/settings/switch.js.map +0 -1
- package/dist/commands/x/index.d.ts.map +0 -1
- package/dist/commands/x/index.js.map +0 -1
- package/dist/dispatcher-BUU7wUgm.js.map +0 -1
- package/dist/dispatcher-Co94YvDc.js.map +0 -1
- package/dist/domain/validators.d.ts.map +0 -1
- package/dist/domain/validators.js.map +0 -1
- package/dist/editor-D4qoje1V.js.map +0 -1
- package/dist/errors-CAZ5k5YT.js.map +0 -1
- package/dist/format-Cqecj3RS.js.map +0 -1
- package/dist/fsStore-BPnFUGta.js.map +0 -1
- package/dist/gemini-Qo5146d_.js.map +0 -1
- package/dist/interfaces-DRNAGN0l.d.ts +0 -75
- package/dist/interfaces-DRNAGN0l.d.ts.map +0 -1
- package/dist/run.js.map +0 -1
- package/dist/runner-BE7zZq1g.js +0 -89
- package/dist/runner-BE7zZq1g.js.map +0 -1
- package/dist/services/launch/adapters/claude.d.ts.map +0 -1
- package/dist/services/launch/adapters/codex.d.ts.map +0 -1
- package/dist/services/launch/dispatcher.d.ts.map +0 -1
- package/dist/services/settings/adapters/claude.d.ts.map +0 -1
- package/dist/services/settings/adapters/codex.d.ts.map +0 -1
- package/dist/services/settings/adapters/gemini.d.ts.map +0 -1
- package/dist/services/settings/dispatcher.d.ts.map +0 -1
- package/dist/services/settings/fsStore.d.ts.map +0 -1
- package/dist/services/settings/templates/claudeDefault.d.ts.map +0 -1
- package/dist/types--0tjriPy.d.ts.map +0 -1
- package/dist/utils/editor.d.ts.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/runner.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ The fastest way to start your AI tools! Just type `xling x` to launch Claude Cod
|
|
|
54
54
|
**Claude Code is launched by default** - the ultimate convenience!
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
#
|
|
57
|
+
# Fastest way - Start Claude Code instantly
|
|
58
58
|
xling x
|
|
59
59
|
|
|
60
60
|
# Continue last conversation/session
|
|
@@ -93,6 +93,97 @@ xling x -t codex -C /path/to/project
|
|
|
93
93
|
- Claude Code: `--dangerously-skip-permissions`
|
|
94
94
|
- Codex: `--dangerously-bypass-approvals-and-sandbox`
|
|
95
95
|
|
|
96
|
+
### Git Workflow Commands
|
|
97
|
+
|
|
98
|
+
Manage PRs and worktrees with intelligent fallback strategies.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Checkout PR (uses gh CLI if available, falls back to git)
|
|
102
|
+
xling git:prr 123
|
|
103
|
+
|
|
104
|
+
# Checkout PR to a specific branch
|
|
105
|
+
xling git:prr 456 --branch my-feature
|
|
106
|
+
|
|
107
|
+
# Force git fallback (skip gh CLI)
|
|
108
|
+
xling git:prr 789 --no-gh --remote upstream
|
|
109
|
+
|
|
110
|
+
# Create PR
|
|
111
|
+
xling git:prc
|
|
112
|
+
|
|
113
|
+
# Create PR with title and body
|
|
114
|
+
xling git:prc --title "Add feature X" --body "Implements feature X"
|
|
115
|
+
|
|
116
|
+
# Create PR and preview in browser
|
|
117
|
+
xling git:prc --web
|
|
118
|
+
|
|
119
|
+
# Create PR and preview in specific browser
|
|
120
|
+
xling git:prc --web --browser safari
|
|
121
|
+
|
|
122
|
+
# Create draft PR
|
|
123
|
+
xling git:prc --draft --title "WIP: Feature Y"
|
|
124
|
+
|
|
125
|
+
# Create PR with reviewers and labels
|
|
126
|
+
xling git:prc --reviewer user1 --reviewer user2 --label bug
|
|
127
|
+
|
|
128
|
+
# View PR in browser
|
|
129
|
+
xling git:prv 123
|
|
130
|
+
|
|
131
|
+
# View PR in specific browser
|
|
132
|
+
xling git:prv 456 --browser safari
|
|
133
|
+
xling git:prv 789 --browser firefox
|
|
134
|
+
xling git:prv 999 --browser arc
|
|
135
|
+
|
|
136
|
+
# List worktrees
|
|
137
|
+
xling git:wtl
|
|
138
|
+
|
|
139
|
+
# Add new worktree (defaults to main branch)
|
|
140
|
+
xling git:wta
|
|
141
|
+
xling git:wta -b feature/login
|
|
142
|
+
xling git:wta -b feature/login -p ../custom-path
|
|
143
|
+
|
|
144
|
+
# Switch to worktree (outputs path for cd)
|
|
145
|
+
cd $(xling git:wts) # Switch to main
|
|
146
|
+
cd $(xling git:wts -b feature/login) # Switch to specific branch
|
|
147
|
+
|
|
148
|
+
# Remove worktree
|
|
149
|
+
xling git:wtr -b main # By branch name
|
|
150
|
+
xling git:wtr -b xling-feature # By directory name
|
|
151
|
+
xling git:wtr -p ../repo-feature # By path
|
|
152
|
+
|
|
153
|
+
# Prune stale worktrees
|
|
154
|
+
xling git:wtp
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**PR Checkout Strategies:**
|
|
158
|
+
- **gh strategy**: Uses `gh pr checkout <id>` (preferred, requires GitHub CLI)
|
|
159
|
+
- **git fallback**: Uses `git fetch origin pull/<id>/head:<branch>` + `git switch <branch>`
|
|
160
|
+
- Automatic detection: gh CLI availability is checked automatically
|
|
161
|
+
- Manual override: Use `--no-gh` to force git strategy
|
|
162
|
+
|
|
163
|
+
**PR Creation Features:**
|
|
164
|
+
- Interactive mode: Run without flags for guided PR creation
|
|
165
|
+
- Direct mode: Specify title, body, and other options via flags
|
|
166
|
+
- Draft PRs: Use `--draft` flag for work-in-progress PRs
|
|
167
|
+
- Reviewers & Labels: Add multiple reviewers and labels
|
|
168
|
+
- Browser preview: Use `--web` to open PR in browser after creation
|
|
169
|
+
- Custom browser: Combine `--web --browser <name>` for specific browser
|
|
170
|
+
|
|
171
|
+
**Worktree Features:**
|
|
172
|
+
- **Focused commands**: Separate commands for each action (`wtl`, `wta`, `wts`, `wtr`, `wtp`)
|
|
173
|
+
- **Smart switching**: `wts` outputs path only, use with `cd $(xling git:wts -b <branch>)`
|
|
174
|
+
- **Auto-path generation**: Auto-generates path as `../repo-name-branch-name` when adding
|
|
175
|
+
- **Smart naming**: Branch names with `/` are converted to `-` (e.g., `feature/login` → `xling-feature-login`)
|
|
176
|
+
- **Intelligent matching**: Remove/switch by branch name, directory name, or full path
|
|
177
|
+
- **Default branch**: Defaults to `main` branch for `wta` and `wts`
|
|
178
|
+
- **Branch occupation check**: Prevents creating worktree for branch already in use
|
|
179
|
+
|
|
180
|
+
**Browser Support:**
|
|
181
|
+
- macOS: chrome, safari, firefox, arc, edge, dia
|
|
182
|
+
- Linux: chrome, firefox, edge, dia (via `google-chrome`, `firefox`, `microsoft-edge`, `dia`)
|
|
183
|
+
- Windows: chrome, firefox, arc, edge, dia
|
|
184
|
+
- Default: chrome
|
|
185
|
+
- Note: Safari only available on macOS; Arc has limited Linux support
|
|
186
|
+
|
|
96
187
|
### List Settings
|
|
97
188
|
|
|
98
189
|
```bash
|
|
@@ -111,8 +202,7 @@ xling settings:list --tool codex --table
|
|
|
111
202
|
> block from `~/.codex/config.toml`, helping you audit provider names, base URLs,
|
|
112
203
|
> and env key bindings at a glance.
|
|
113
204
|
|
|
114
|
-
`settings:list`
|
|
115
|
-
`--json`。其余命令仍以 JSON 为默认输出,可通过 `--no-json` 获取文本格式。
|
|
205
|
+
`settings:list` prints a concise YAML-style summary by default. Add `--table` or `--json` for structured output. Other commands default to JSON and can switch to plain text with `--no-json`.
|
|
116
206
|
|
|
117
207
|
### Get Settings File
|
|
118
208
|
|
|
@@ -137,11 +227,9 @@ xling settings:set --tool claude --scope user --name hxi
|
|
|
137
227
|
xling settings:set --tool claude --scope project --name default --ide cursor --no-json
|
|
138
228
|
```
|
|
139
229
|
|
|
140
|
-
`settings:set`
|
|
141
|
-
`settings.<name>.json`,并使用 `--ide` 指定编辑器(默认 VS Code 的 `code`)。
|
|
230
|
+
`settings:set` now focuses on whole-file editing: pass `--name` (defaults to `default`) to create or open `settings.<name>.json`, and use `--ide` to pick the editor command (defaults to VS Code's `code`).
|
|
142
231
|
|
|
143
|
-
> Note:
|
|
144
|
-
> `developerShortcuts.runCommand` 这类键级参数。
|
|
232
|
+
> Note: Every `settings:*` command relies solely on flags such as `--tool`, `--scope`, and `--name`; key-level overrides like `developerShortcuts.runCommand` are no longer supported.
|
|
145
233
|
|
|
146
234
|
### Switch Profiles or Claude Variants
|
|
147
235
|
|
|
@@ -159,9 +247,7 @@ xling settings:switch hxi --tool claude --scope user --force
|
|
|
159
247
|
xling settings:switch hxi --tool claude --scope user --force --backup
|
|
160
248
|
```
|
|
161
249
|
|
|
162
|
-
Claude switches
|
|
163
|
-
然后提示 `overwrite / backup / cancel`。若要非交互执行,使用 `--force`,并可
|
|
164
|
-
通过 `--backup` 强制保留 `.bak`。Codex 保持原行为,直接切换 profile。
|
|
250
|
+
Claude switches now show an interactive diff preview: the command prints a unified diff and then prompts for `overwrite / backup / cancel`. Use `--force` for non-interactive runs, optionally paired with `--backup` to keep a `.bak`. Codex continues to switch profiles immediately.
|
|
165
251
|
|
|
166
252
|
### Inspect Configuration
|
|
167
253
|
|
|
@@ -209,19 +295,22 @@ The project follows SOLID principles:
|
|
|
209
295
|
|
|
210
296
|
```
|
|
211
297
|
xling/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
298
|
+
|- bin/ # CLI entry point (compiled)
|
|
299
|
+
| |- run.js
|
|
300
|
+
|- src/
|
|
301
|
+
| |- commands/ # oclif commands
|
|
302
|
+
| | |- git/ # Git workflow commands
|
|
303
|
+
| | |- settings/ # Settings management commands
|
|
304
|
+
| | |- x/ # Quick launcher
|
|
305
|
+
| |- domain/ # Types and interfaces
|
|
306
|
+
| |- services/ # Business logic
|
|
307
|
+
| | |- git/ # Git services (pr, worktree, view)
|
|
308
|
+
| | |- settings/
|
|
309
|
+
| | |- adapters/ # Tool adapters
|
|
310
|
+
| | |- fsStore.ts # File system operations
|
|
311
|
+
| | |- dispatcher.ts
|
|
312
|
+
| |- utils/ # Utilities
|
|
313
|
+
|- test/ # Tests and fixtures
|
|
225
314
|
```
|
|
226
315
|
|
|
227
316
|
## Development
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as readJSON, c as writeJSON, i as getFileInfo, r as fileExists } from "./fsStore-
|
|
1
|
+
import { c as InvalidScopeError } from "./errors-pXKbCKbL.js";
|
|
2
|
+
import { a as readJSON, c as writeJSON, i as getFileInfo, r as fileExists } from "./fsStore-MvYlG65t.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/settings/adapters/base.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Abstract adapter implementation
|
|
7
7
|
*/
|
|
8
8
|
var BaseAdapter = class {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* List all configuration entries for a scope
|
|
11
11
|
*/
|
|
12
12
|
async list(scope) {
|
|
13
13
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -19,13 +19,13 @@ var BaseAdapter = class {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Default switchProfile implementation (throws unless overridden)
|
|
23
23
|
*/
|
|
24
24
|
async switchProfile(_scope, _profile, _options) {
|
|
25
25
|
throw new Error(`Tool ${this.toolId} does not support profile switching`);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Inspect the configuration file
|
|
29
29
|
*/
|
|
30
30
|
async inspect(scope) {
|
|
31
31
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -45,19 +45,19 @@ var BaseAdapter = class {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Default edit implementation (throws unless overridden)
|
|
49
49
|
*/
|
|
50
50
|
async edit(scope, _options) {
|
|
51
51
|
throw new Error(`Tool ${this.toolId} does not support edit for ${scope}`);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Read the configuration file (subclasses may override)
|
|
55
55
|
*/
|
|
56
56
|
readConfig(path) {
|
|
57
57
|
return readJSON(path);
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Write the configuration file (subclasses may override)
|
|
61
61
|
*/
|
|
62
62
|
writeConfig(path, data, backup = true) {
|
|
63
63
|
writeJSON(path, data, backup);
|
|
@@ -65,5 +65,4 @@ var BaseAdapter = class {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
//#endregion
|
|
68
|
-
export { BaseAdapter as t };
|
|
69
|
-
//# sourceMappingURL=base-BWvHbkly.js.map
|
|
68
|
+
export { BaseAdapter as t };
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
import { f as SettingsResult, m as ToolId, n as InspectResult, p as SwitchOptions, s as Scope, t as EditOptions, u as SettingsListData } from "./types
|
|
2
|
-
import { n as SettingsAdapter } from "./interfaces-
|
|
1
|
+
import { f as SettingsResult, m as ToolId, n as InspectResult, p as SwitchOptions, s as Scope, t as EditOptions, u as SettingsListData } from "./types-h3oFUAyV.js";
|
|
2
|
+
import { n as SettingsAdapter } from "./interfaces-CbUR78_2.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/settings/adapters/base.d.ts
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
* Abstract adapter implementation
|
|
8
|
+
*/
|
|
9
9
|
declare abstract class BaseAdapter implements SettingsAdapter {
|
|
10
10
|
abstract readonly toolId: ToolId;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* Methods every adapter must implement
|
|
13
|
+
*/
|
|
14
14
|
abstract resolvePath(scope: Scope): string;
|
|
15
15
|
abstract validateScope(scope: Scope): boolean;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
* List all configuration entries for a scope
|
|
18
|
+
*/
|
|
19
19
|
list(scope: Scope): Promise<SettingsListData>;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* Default switchProfile implementation (throws unless overridden)
|
|
22
|
+
*/
|
|
23
23
|
switchProfile(_scope: Scope, _profile: string, _options?: SwitchOptions): Promise<SettingsResult>;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* Inspect the configuration file
|
|
26
|
+
*/
|
|
27
27
|
inspect(scope: Scope): Promise<InspectResult>;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* Default edit implementation (throws unless overridden)
|
|
30
|
+
*/
|
|
31
31
|
edit(scope: Scope, _options: EditOptions): Promise<SettingsResult>;
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
* Read the configuration file (subclasses may override)
|
|
34
|
+
*/
|
|
35
35
|
protected readConfig(path: string): Record<string, unknown>;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
* Write the configuration file (subclasses may override)
|
|
38
|
+
*/
|
|
39
39
|
protected writeConfig(path: string, data: Record<string, unknown>, backup?: boolean): void;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
export { BaseAdapter as t };
|
|
43
|
-
//# sourceMappingURL=base-EQ6uvBQs.d.ts.map
|
|
42
|
+
export { BaseAdapter as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { n as getExecutableVersion, t as checkExecutable } from "./runner-DYk4q6mP.js";
|
|
2
|
+
|
|
3
|
+
//#region src/services/launch/adapters/base.ts
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base implementing SOLID principles:
|
|
6
|
+
* - SRP: only responsible for building command specs
|
|
7
|
+
* - Template Method: subclasses override specific pieces
|
|
8
|
+
* - DRY: shares validateAvailability and getVersion logic
|
|
9
|
+
*/
|
|
10
|
+
var BaseLaunchAdapter = class {
|
|
11
|
+
/**
|
|
12
|
+
* Default availability check (subclasses may override)
|
|
13
|
+
*/
|
|
14
|
+
async validateAvailability() {
|
|
15
|
+
return checkExecutable(this.executable);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Default version check (subclasses may override)
|
|
19
|
+
*/
|
|
20
|
+
async getVersion() {
|
|
21
|
+
try {
|
|
22
|
+
return await getExecutableVersion(this.executable);
|
|
23
|
+
} catch {
|
|
24
|
+
return "unknown";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { BaseLaunchAdapter as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { m as ToolId, r as LaunchCommandSpec } from "./types-h3oFUAyV.js";
|
|
2
|
+
import { t as LaunchAdapter } from "./interfaces-CbUR78_2.js";
|
|
3
|
+
|
|
4
|
+
//#region src/services/launch/adapters/base.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Abstract base implementing SOLID principles:
|
|
8
|
+
* - SRP: only responsible for building command specs
|
|
9
|
+
* - Template Method: subclasses override specific pieces
|
|
10
|
+
* - DRY: shares validateAvailability and getVersion logic
|
|
11
|
+
*/
|
|
12
|
+
declare abstract class BaseLaunchAdapter implements LaunchAdapter {
|
|
13
|
+
/**
|
|
14
|
+
* Tool identifier (implemented by subclasses)
|
|
15
|
+
*/
|
|
16
|
+
abstract readonly toolId: ToolId;
|
|
17
|
+
/**
|
|
18
|
+
* Executable name (implemented by subclasses)
|
|
19
|
+
*/
|
|
20
|
+
abstract readonly executable: string;
|
|
21
|
+
/**
|
|
22
|
+
* Build the command spec for launching the tool
|
|
23
|
+
*/
|
|
24
|
+
abstract buildCommandSpec(payload: {
|
|
25
|
+
yolo?: boolean;
|
|
26
|
+
resume?: boolean;
|
|
27
|
+
continue?: boolean;
|
|
28
|
+
}): LaunchCommandSpec;
|
|
29
|
+
/**
|
|
30
|
+
* Default availability check (subclasses may override)
|
|
31
|
+
*/
|
|
32
|
+
validateAvailability(): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Default version check (subclasses may override)
|
|
35
|
+
*/
|
|
36
|
+
getVersion(): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { BaseLaunchAdapter as t };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { t as BaseLaunchAdapter } from "./base-
|
|
1
|
+
import { t as BaseLaunchAdapter } from "./base-CRTwHcps.js";
|
|
2
2
|
|
|
3
3
|
//#region src/services/launch/adapters/claude.ts
|
|
4
4
|
/**
|
|
5
|
-
* Claude Code
|
|
5
|
+
* Claude Code launch adapter
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Claude
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Continue 模式: -c (继续最后一个对话)
|
|
8
|
+
* Applies Claude-specific flags:
|
|
9
|
+
* - Yolo mode: --dangerously-skip-permissions
|
|
10
|
+
* - Resume picker: -r
|
|
11
|
+
* - Continue last conversation: -c
|
|
13
12
|
*/
|
|
14
13
|
var ClaudeLaunchAdapter = class extends BaseLaunchAdapter {
|
|
15
14
|
toolId = "claude";
|
|
@@ -27,5 +26,4 @@ var ClaudeLaunchAdapter = class extends BaseLaunchAdapter {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
//#endregion
|
|
30
|
-
export { ClaudeLaunchAdapter as t };
|
|
31
|
-
//# sourceMappingURL=claude-BsdlWM7z.js.map
|
|
29
|
+
export { ClaudeLaunchAdapter as t };
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as resolveEditorCommand, t as openInEditor } from "./editor-
|
|
3
|
-
import { t as formatDiff } from "./format-
|
|
4
|
-
import { c as writeJSON, i as getFileInfo, n as ensureDir, s as resolveHome } from "./fsStore-
|
|
5
|
-
import { t as BaseAdapter } from "./base-
|
|
6
|
-
import { t as CLAUDE_SETTINGS_TEMPLATE } from "./claudeDefault-
|
|
1
|
+
import { c as InvalidScopeError, u as SettingsVariantNotFoundError } from "./errors-pXKbCKbL.js";
|
|
2
|
+
import { n as resolveEditorCommand, t as openInEditor } from "./editor-CUiekAEb.js";
|
|
3
|
+
import { t as formatDiff } from "./format-GMs1vKBL.js";
|
|
4
|
+
import { c as writeJSON, i as getFileInfo, n as ensureDir, s as resolveHome } from "./fsStore-MvYlG65t.js";
|
|
5
|
+
import { t as BaseAdapter } from "./base-BDWlyPnr.js";
|
|
6
|
+
import { t as CLAUDE_SETTINGS_TEMPLATE } from "./claudeDefault-E3SAE4Ef.js";
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as path from "path";
|
|
9
9
|
|
|
10
10
|
//#region src/services/settings/adapters/claude.ts
|
|
11
11
|
/**
|
|
12
|
-
* Claude Code
|
|
12
|
+
* Claude Code settings adapter
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* 配置文件路径:
|
|
15
|
+
* Resolves the following config locations:
|
|
18
16
|
* - user: ~/.claude/settings.json
|
|
19
17
|
* - project: <cwd>/.claude/settings.json
|
|
20
18
|
* - local: <cwd>/.claude/settings.local.json
|
|
@@ -22,7 +20,7 @@ import * as path from "path";
|
|
|
22
20
|
var ClaudeAdapter = class extends BaseAdapter {
|
|
23
21
|
toolId = "claude";
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
23
|
+
* List every settings.*.json file in the scope directory
|
|
26
24
|
*/
|
|
27
25
|
async list(scope) {
|
|
28
26
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -46,7 +44,7 @@ var ClaudeAdapter = class extends BaseAdapter {
|
|
|
46
44
|
};
|
|
47
45
|
}
|
|
48
46
|
/**
|
|
49
|
-
*
|
|
47
|
+
* Resolve the config path for a scope
|
|
50
48
|
*/
|
|
51
49
|
resolvePath(scope) {
|
|
52
50
|
switch (scope) {
|
|
@@ -57,7 +55,7 @@ var ClaudeAdapter = class extends BaseAdapter {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
/**
|
|
60
|
-
*
|
|
58
|
+
* Validate supported scopes
|
|
61
59
|
*/
|
|
62
60
|
validateScope(scope) {
|
|
63
61
|
return [
|
|
@@ -67,7 +65,7 @@ var ClaudeAdapter = class extends BaseAdapter {
|
|
|
67
65
|
].includes(scope);
|
|
68
66
|
}
|
|
69
67
|
/**
|
|
70
|
-
*
|
|
68
|
+
* Replace the active settings file with the selected variant
|
|
71
69
|
*/
|
|
72
70
|
async switchProfile(scope, profile, options) {
|
|
73
71
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -205,5 +203,4 @@ var ClaudeAdapter = class extends BaseAdapter {
|
|
|
205
203
|
};
|
|
206
204
|
|
|
207
205
|
//#endregion
|
|
208
|
-
export { ClaudeAdapter as t };
|
|
209
|
-
//# sourceMappingURL=claude-D7KdpYHQ.js.map
|
|
206
|
+
export { ClaudeAdapter as t };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as writeTOML, o as readTOML } from "./fsStore-
|
|
3
|
-
import { t as BaseAdapter } from "./base-
|
|
1
|
+
import { c as InvalidScopeError, l as ProfileNotFoundError } from "./errors-pXKbCKbL.js";
|
|
2
|
+
import { l as writeTOML, o as readTOML } from "./fsStore-MvYlG65t.js";
|
|
3
|
+
import { t as BaseAdapter } from "./base-BDWlyPnr.js";
|
|
4
4
|
|
|
5
5
|
//#region src/services/settings/adapters/codex.ts
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* 配置文件路径:
|
|
10
|
-
* - user: ~/.codex/config.toml
|
|
11
|
-
*
|
|
12
|
-
* 支持 profile 切换
|
|
7
|
+
* Resolves ~/.codex/config.toml (user scope) and supports profile switching
|
|
13
8
|
*/
|
|
14
9
|
var CodexAdapter = class extends BaseAdapter {
|
|
15
10
|
toolId = "codex";
|
|
16
11
|
/**
|
|
17
|
-
*
|
|
12
|
+
* Custom list implementation that focuses on model_providers
|
|
18
13
|
*/
|
|
19
14
|
async list(scope) {
|
|
20
15
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -27,7 +22,7 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
27
22
|
};
|
|
28
23
|
}
|
|
29
24
|
/**
|
|
30
|
-
*
|
|
25
|
+
* Resolve the config path
|
|
31
26
|
*/
|
|
32
27
|
resolvePath(scope) {
|
|
33
28
|
switch (scope) {
|
|
@@ -36,13 +31,13 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
/**
|
|
39
|
-
*
|
|
34
|
+
* Validate the supported scope
|
|
40
35
|
*/
|
|
41
36
|
validateScope(scope) {
|
|
42
37
|
return scope === "user";
|
|
43
38
|
}
|
|
44
39
|
/**
|
|
45
|
-
*
|
|
40
|
+
* Switch to a different Codex profile
|
|
46
41
|
*/
|
|
47
42
|
async switchProfile(scope, profile, _options) {
|
|
48
43
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
@@ -62,13 +57,13 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
62
57
|
};
|
|
63
58
|
}
|
|
64
59
|
/**
|
|
65
|
-
*
|
|
60
|
+
* Read the TOML configuration
|
|
66
61
|
*/
|
|
67
62
|
readConfig(path) {
|
|
68
63
|
return readTOML(path);
|
|
69
64
|
}
|
|
70
65
|
/**
|
|
71
|
-
*
|
|
66
|
+
* Write the TOML configuration
|
|
72
67
|
*/
|
|
73
68
|
writeConfig(path, data) {
|
|
74
69
|
writeTOML(path, data);
|
|
@@ -81,5 +76,4 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
81
76
|
};
|
|
82
77
|
|
|
83
78
|
//#endregion
|
|
84
|
-
export { CodexAdapter as t };
|
|
85
|
-
//# sourceMappingURL=codex-UJ2PYHA6.js.map
|
|
79
|
+
export { CodexAdapter as t };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { t as BaseLaunchAdapter } from "./base-
|
|
1
|
+
import { t as BaseLaunchAdapter } from "./base-CRTwHcps.js";
|
|
2
2
|
|
|
3
3
|
//#region src/services/launch/adapters/codex.ts
|
|
4
4
|
/**
|
|
5
|
-
* Codex
|
|
5
|
+
* Codex launch adapter
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Codex
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* 启动交互式会话: codex --dangerously-bypass-approvals-and-sandbox
|
|
8
|
+
* Applies Codex-specific behavior:
|
|
9
|
+
* - Yolo mode: --dangerously-bypass-approvals-and-sandbox
|
|
10
|
+
* - Resume picker: `codex resume`
|
|
11
|
+
* - Continue last session: `codex resume --last`
|
|
12
|
+
* - Default interactive session: `codex`
|
|
14
13
|
*/
|
|
15
14
|
var CodexLaunchAdapter = class extends BaseLaunchAdapter {
|
|
16
15
|
toolId = "codex";
|
|
@@ -28,5 +27,4 @@ var CodexLaunchAdapter = class extends BaseLaunchAdapter {
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
//#endregion
|
|
31
|
-
export { CodexLaunchAdapter as t };
|
|
32
|
-
//# sourceMappingURL=codex-Crifr9cw.js.map
|
|
30
|
+
export { CodexLaunchAdapter as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/git/index.d.ts
|
|
4
|
+
|
|
5
|
+
declare class Git extends Command {
|
|
6
|
+
static summary: string;
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Git as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/git/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* git command (main entry point)
|
|
6
|
+
* Provides utilities for git workflow (PR management, worktrees)
|
|
7
|
+
*/
|
|
8
|
+
var Git = class extends Command {
|
|
9
|
+
static summary = "Git workflow utilities";
|
|
10
|
+
static description = `
|
|
11
|
+
Git workflow tools for PR management and worktrees.
|
|
12
|
+
Supports PR checkout with gh/git fallback, browser PR viewing, and worktree operations.
|
|
13
|
+
`;
|
|
14
|
+
static examples = [
|
|
15
|
+
"<%= config.bin %> <%= command.id %>:prc --web",
|
|
16
|
+
"<%= config.bin %> <%= command.id %>:prr 123",
|
|
17
|
+
"<%= config.bin %> <%= command.id %>:worktree --list",
|
|
18
|
+
"<%= config.bin %> <%= command.id %>:prv 456 --browser safari"
|
|
19
|
+
];
|
|
20
|
+
async run() {
|
|
21
|
+
this.log("Git workflow utilities for xling\n");
|
|
22
|
+
this.log("Available subcommands:");
|
|
23
|
+
this.log(" prc - Create PR with optional browser preview");
|
|
24
|
+
this.log(" prr - Checkout PR branch (PR Read/Retrieve)");
|
|
25
|
+
this.log(" prv - Open PR in web browser (PR View)");
|
|
26
|
+
this.log(" worktree - Manage git worktrees (list, add, remove, prune)\n");
|
|
27
|
+
this.log("Use --help with any subcommand for details");
|
|
28
|
+
this.log("\nExamples:");
|
|
29
|
+
this.log(" xling git:prc --web --browser chrome");
|
|
30
|
+
this.log(" xling git:prr 123");
|
|
31
|
+
this.log(" xling git:prv 456 --browser safari");
|
|
32
|
+
this.log(" xling git:worktree --list");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Git as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/git/prc.d.ts
|
|
4
|
+
|
|
5
|
+
declare class Prc extends Command {
|
|
6
|
+
static summary: string;
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: Command.Example[];
|
|
9
|
+
static flags: Interfaces.FlagInput;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Prc as default };
|