xling 0.4.1 → 0.5.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 +29 -199
- package/dist/{base-C-NPqEhs.d.ts → base-4RgBKYUc.d.ts} +4 -4
- package/dist/{base-CqP3N9Eo.d.ts → base-B1zqN9dm.d.ts} +2 -2
- package/dist/{base-BDWlyPnr.js → base-DtcPVpvU.js} +1 -1
- package/dist/{claude-BvlLXKkI.js → claude-BO72_3yh.js} +1 -1
- package/dist/{claude-NvQoYxJY.js → claude-Bagw5C6H.js} +4 -4
- package/dist/client-BQFhUvFV.js +88 -0
- package/dist/{codex-DrigbqRY.js → codex-0_hkyUsd.js} +1 -1
- package/dist/{codex-DX7doGgq.js → codex-CKkfM5YP.js} +9 -5
- package/dist/commands/git/prc.js +2 -2
- package/dist/commands/git/prr.js +2 -2
- package/dist/commands/git/prv.js +2 -2
- package/dist/commands/git/worktree.js +2 -2
- package/dist/commands/git/wta.js +2 -2
- package/dist/commands/git/wtl.js +2 -2
- package/dist/commands/git/wtp.js +2 -2
- package/dist/commands/git/wtr.js +2 -2
- package/dist/commands/git/wts.js +2 -2
- package/dist/commands/p/index.d.ts +39 -0
- package/dist/commands/p/index.js +378 -0
- package/dist/commands/settings/get.js +13 -9
- package/dist/commands/settings/inspect.js +13 -9
- package/dist/commands/settings/list.js +18 -11
- package/dist/commands/settings/set.js +22 -14
- package/dist/commands/settings/switch.js +13 -9
- package/dist/commands/x/index.js +4 -4
- package/dist/config-CWfLGTYD.js +58 -0
- package/dist/config-D4fZ2D5U.d.ts +59 -0
- package/dist/{dispatcher-RcoXqvot.js → dispatcher-B5xKfkb3.js} +5 -3
- package/dist/{dispatcher-DXa91-tV.js → dispatcher-CZLTbaGH.js} +11 -9
- package/dist/{dispatcher-C0-p8F1o.js → dispatcher-D4bEJonH.js} +7 -10
- package/dist/domain/git.d.ts +2 -2
- package/dist/domain/interfaces.d.ts +2 -2
- package/dist/domain/types.d.ts +2 -2
- package/dist/domain/validators.d.ts +5 -19
- package/dist/domain/validators.js +15 -18
- package/dist/domain/xling/config.d.ts +2 -0
- package/dist/domain/xling/config.js +3 -0
- package/dist/domain/xling/template.d.ts +18 -0
- package/dist/domain/xling/template.js +3 -0
- package/dist/{format-GMs1vKBL.js → format-a_tYXjv9.js} +1 -0
- package/dist/{fsStore-MvYlG65t.js → fsStore-S8RslR8L.js} +3 -2
- package/dist/{gemini-DuEXfwHS.js → gemini-DH25nZbZ.js} +1 -1
- package/dist/{git-C_Qfadu_.d.ts → git-Y9bg19_q.d.ts} +39 -10
- package/dist/{interfaces-CbUR78_2.d.ts → interfaces-Db5DCCHW.d.ts} +1 -1
- package/dist/providerRegistry-BJtRV16l.d.ts +89 -0
- package/dist/providerRegistry-CBosLXE_.js +151 -0
- package/dist/router-DrIzAivm.js +177 -0
- package/dist/services/git/create.d.ts +1 -1
- package/dist/services/git/dispatcher.d.ts +1 -1
- package/dist/services/git/dispatcher.js +2 -2
- package/dist/services/git/pr.d.ts +1 -1
- package/dist/services/git/view.d.ts +1 -1
- package/dist/services/git/worktree.d.ts +1 -1
- package/dist/services/git/worktree.js +1 -1
- package/dist/services/launch/adapters/base.d.ts +3 -3
- package/dist/services/launch/adapters/base.js +1 -1
- package/dist/services/launch/adapters/claude.d.ts +3 -3
- package/dist/services/launch/adapters/claude.js +2 -2
- package/dist/services/launch/adapters/codex.d.ts +3 -3
- package/dist/services/launch/adapters/codex.js +2 -2
- package/dist/services/launch/dispatcher.d.ts +2 -2
- package/dist/services/launch/dispatcher.js +4 -4
- package/dist/services/prompt/client.d.ts +29 -0
- package/dist/services/prompt/client.js +3 -0
- package/dist/services/prompt/providerRegistry.d.ts +3 -0
- package/dist/services/prompt/providerRegistry.js +10 -0
- package/dist/services/prompt/router.d.ts +80 -0
- package/dist/services/prompt/router.js +13 -0
- package/dist/services/prompt/types.d.ts +2 -0
- package/dist/services/prompt/types.js +3 -0
- package/dist/services/settings/adapters/base.d.ts +3 -3
- package/dist/services/settings/adapters/base.js +2 -2
- package/dist/services/settings/adapters/claude.d.ts +3 -3
- package/dist/services/settings/adapters/claude.js +5 -5
- package/dist/services/settings/adapters/codex.d.ts +5 -5
- package/dist/services/settings/adapters/codex.js +3 -3
- package/dist/services/settings/adapters/gemini.d.ts +3 -3
- package/dist/services/settings/adapters/gemini.js +3 -3
- package/dist/services/settings/adapters/xling.d.ts +66 -0
- package/dist/services/settings/adapters/xling.js +9 -0
- package/dist/services/settings/dispatcher.d.ts +2 -2
- package/dist/services/settings/dispatcher.js +11 -8
- package/dist/services/settings/fsStore.d.ts +7 -8
- package/dist/services/settings/fsStore.js +1 -1
- package/dist/services/settings/templates/claudeDefault.d.ts +3 -16
- package/dist/services/settings/templates/claudeDefault.js +1 -1
- package/dist/template-DPd-DP7B.js +81 -0
- package/dist/types-99-EmVXg.js +25 -0
- package/dist/{types-h3oFUAyV.d.ts → types-B6AS7UBa.d.ts} +11 -7
- package/dist/types-CgqejboB.d.ts +60 -0
- package/dist/utils/format.d.ts +4 -4
- package/dist/utils/format.js +1 -1
- package/dist/utils/logger.d.ts +5 -4
- package/dist/utils/logger.js +0 -3
- package/dist/utils/runner.d.ts +1 -1
- package/dist/{worktree-CYc33agA.js → worktree-BuIXmI0X.js} +15 -12
- package/dist/xling-mWifjE2r.js +222 -0
- package/package.json +4 -2
- /package/dist/{base-CRTwHcps.js → base-DkYAPGeT.js} +0 -0
- /package/dist/{claudeDefault-E3SAE4Ef.js → claudeDefault-ewrEKzlX.js} +0 -0
package/README.md
CHANGED
|
@@ -47,217 +47,47 @@ npm link
|
|
|
47
47
|
|
|
48
48
|
## Usage
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
`xling` bundles a quick launcher, configuration helpers, and git productivity
|
|
51
|
+
commands. Detailed usage, flag tables, and examples live in
|
|
52
|
+
[`docs/README.md`](./docs/README.md) and the per-command Markdown files under
|
|
53
|
+
`docs/`. The summary below mirrors the docs so you can skim everything in one
|
|
54
|
+
place.
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
### Command Overview
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
- `x`: Launch Claude Code or Codex with resume flags, yolo toggle, and passthrough args.
|
|
59
|
+
- `settings:list|get|set|switch|inspect`: Inspect, edit, and switch Claude, Codex, or Gemini configs across scopes.
|
|
60
|
+
- `git:prc|prr|prv`: Create, checkout, and view GitHub pull requests with automatic gh/git fallbacks.
|
|
61
|
+
- `git:wta|wtl|wtp|wtr|wts`: Manage git worktrees (add/list/prune/remove/switch) with guard rails and subshell support.
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
# Fastest way - Start Claude Code instantly
|
|
58
|
-
xling x
|
|
59
|
-
|
|
60
|
-
# Continue last conversation/session
|
|
61
|
-
xling x -c
|
|
62
|
-
|
|
63
|
-
# Resume from conversation/session list
|
|
64
|
-
xling x -r
|
|
65
|
-
|
|
66
|
-
# Pass arguments to Claude
|
|
67
|
-
xling x -- chat "Hello, how are you?"
|
|
68
|
-
|
|
69
|
-
# Start without yolo mode
|
|
70
|
-
xling x --no-yolo
|
|
71
|
-
|
|
72
|
-
# Start Codex instead
|
|
73
|
-
xling x --tool codex
|
|
74
|
-
# or use the short flag
|
|
75
|
-
xling x -t codex
|
|
76
|
-
|
|
77
|
-
# Continue last Codex session
|
|
78
|
-
xling x -t codex -c
|
|
79
|
-
|
|
80
|
-
# Start Codex in a specific directory
|
|
81
|
-
xling x -t codex -C /path/to/project
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Resume Options:**
|
|
85
|
-
- `-c` or `--continue`: Continue the last conversation/session
|
|
86
|
-
- Claude Code: `claude -c`
|
|
87
|
-
- Codex: `codex resume --last`
|
|
88
|
-
- `-r` or `--resume`: Show a list to choose from
|
|
89
|
-
- Claude Code: `claude -r`
|
|
90
|
-
- Codex: `codex resume`
|
|
91
|
-
|
|
92
|
-
**Yolo mode flags:**
|
|
93
|
-
- Claude Code: `--dangerously-skip-permissions`
|
|
94
|
-
- Codex: `--dangerously-bypass-approvals-and-sandbox`
|
|
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
|
|
63
|
+
### Command Documentation (inline excerpt)
|
|
121
64
|
|
|
122
|
-
|
|
123
|
-
xling git:prc --draft --title "WIP: Feature Y"
|
|
65
|
+
#### Launching AI tools
|
|
124
66
|
|
|
125
|
-
|
|
126
|
-
xling git:prc --reviewer user1 --reviewer user2 --label bug
|
|
67
|
+
- [`x` – quick launcher](docs/x.md): fire up Claude Code or Codex with resume/yolo controls and passthrough args.
|
|
127
68
|
|
|
128
|
-
|
|
129
|
-
xling git:prv 123
|
|
69
|
+
#### Settings management
|
|
130
70
|
|
|
131
|
-
#
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
71
|
+
- [`settings:list`](docs/settings.md#settingslist): summarize which config files exist per tool/scope (JSON or table view).
|
|
72
|
+
- [`settings:get`](docs/settings.md#settingsget): print the raw config (or a specific Claude variant) for auditing and backups.
|
|
73
|
+
- [`settings:set`](docs/settings.md#settingsset): open the target config in your editor of choice; handles variant creation.
|
|
74
|
+
- [`settings:switch`](docs/settings.md#settingsswitch): flip active profiles (Codex) or Claude variants with safety checks.
|
|
75
|
+
- [`settings:inspect`](docs/settings.md#settingsinspect): deep-dive into parsed settings with validation output.
|
|
135
76
|
|
|
136
|
-
|
|
137
|
-
xling git:wtl
|
|
77
|
+
#### Git worktree helpers
|
|
138
78
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
79
|
+
- [`git:wta` – add worktree](docs/git-wta.md): create detached or branch-bound worktrees with auto paths and guards.
|
|
80
|
+
- [`git:wtl` – list worktrees](docs/git-wtl.md): display human-readable worktree inventory (branch + path).
|
|
81
|
+
- [`git:wtp` – prune worktrees](docs/git-wtp.md): clean stale git metadata left behind after manual deletions.
|
|
82
|
+
- [`git:wtr` – remove worktree](docs/git-wtr.md): remove a worktree safely by branch, dir, or absolute path.
|
|
83
|
+
- [`git:wts` – switch to worktree](docs/git-wts.md): jump into an existing worktree or just print its path for scripting.
|
|
143
84
|
|
|
144
|
-
|
|
145
|
-
xling git:wts # Switch to main
|
|
146
|
-
xling git:wts -b feature/login # Switch to specific branch
|
|
85
|
+
#### Pull request helpers
|
|
147
86
|
|
|
148
|
-
|
|
149
|
-
|
|
87
|
+
- [`git:prc` – create PR](docs/git-prc.md): wrap `gh pr create` with reviewers, labels, draft, and browser launch options.
|
|
88
|
+
- [`git:prr` – checkout PR](docs/git-prr.md): fetch/checkout PRs with a smart `gh`/git fallback and custom branch names.
|
|
89
|
+
- [`git:prv` – view PR](docs/git-prv.md): open a PR in your preferred browser directly from the terminal.
|
|
150
90
|
|
|
151
|
-
# Remove worktree
|
|
152
|
-
xling git:wtr -b main # By branch name
|
|
153
|
-
xling git:wtr -b xling-feature # By directory name
|
|
154
|
-
xling git:wtr -p ../repo-feature # By path
|
|
155
|
-
|
|
156
|
-
# Prune stale worktrees
|
|
157
|
-
xling git:wtp
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**PR Checkout Strategies:**
|
|
161
|
-
- **gh strategy**: Uses `gh pr checkout <id>` (preferred, requires GitHub CLI)
|
|
162
|
-
- **git fallback**: Uses `git fetch origin pull/<id>/head:<branch>` + `git switch <branch>`
|
|
163
|
-
- Automatic detection: gh CLI availability is checked automatically
|
|
164
|
-
- Manual override: Use `--no-gh` to force git strategy
|
|
165
|
-
|
|
166
|
-
**PR Creation Features:**
|
|
167
|
-
- Interactive mode: Run without flags for guided PR creation
|
|
168
|
-
- Direct mode: Specify title, body, and other options via flags
|
|
169
|
-
- Draft PRs: Use `--draft` flag for work-in-progress PRs
|
|
170
|
-
- Reviewers & Labels: Add multiple reviewers and labels
|
|
171
|
-
- Browser preview: Use `--web` to open PR in browser after creation
|
|
172
|
-
- Custom browser: Combine `--web --browser <name>` for specific browser
|
|
173
|
-
|
|
174
|
-
**Worktree Features:**
|
|
175
|
-
- **Focused commands**: Separate commands for each action (`wtl`, `wta`, `wts`, `wtr`, `wtp`)
|
|
176
|
-
- **Smart switching**: `wts` drops you into a subshell inside the worktree (use `--path-only` for scripts)
|
|
177
|
-
- **Auto-path generation**: Auto-generates path as `../repo-name-branch-name` when adding
|
|
178
|
-
- **Smart naming**: Branch names with `/` are converted to `-` (e.g., `feature/login` → `xling-feature-login`)
|
|
179
|
-
- **Intelligent matching**: Remove/switch by branch name, directory name, or full path
|
|
180
|
-
- **Default branch**: Defaults to `main` branch for `wta` and `wts`
|
|
181
|
-
- **Branch occupation check**: Prevents creating worktree for branch already in use
|
|
182
|
-
|
|
183
|
-
**Browser Support:**
|
|
184
|
-
- macOS: chrome, safari, firefox, arc, edge, dia
|
|
185
|
-
- Linux: chrome, firefox, edge, dia (via `google-chrome`, `firefox`, `microsoft-edge`, `dia`)
|
|
186
|
-
- Windows: chrome, firefox, arc, edge, dia
|
|
187
|
-
- Default: chrome
|
|
188
|
-
- Note: Safari only available on macOS; Arc has limited Linux support
|
|
189
|
-
|
|
190
|
-
### List Settings
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
# List all settings for Claude Code (user scope)
|
|
194
|
-
xling settings:list --tool claude --scope user
|
|
195
|
-
|
|
196
|
-
# List Codex settings in table format
|
|
197
|
-
xling settings:list --tool codex --table
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
> Claude-specific: `settings:list --tool claude` now enumerates every
|
|
201
|
-
> `settings*.json` file (for example `settings.hxi.json`) in the selected scope
|
|
202
|
-
> so you can quickly discover switchable variants.
|
|
203
|
-
>
|
|
204
|
-
> Codex-specific: `settings:list --tool codex` surfaces only the `model_providers`
|
|
205
|
-
> block from `~/.codex/config.toml`, helping you audit provider names, base URLs,
|
|
206
|
-
> and env key bindings at a glance.
|
|
207
|
-
|
|
208
|
-
`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`.
|
|
209
|
-
|
|
210
|
-
### Get Settings File
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# Show Claude user settings (plain text default)
|
|
214
|
-
xling settings:get --tool claude --scope user
|
|
215
|
-
|
|
216
|
-
# Inspect a Claude variant (settings.hxi.json)
|
|
217
|
-
xling settings:get hxi --tool claude --scope user
|
|
218
|
-
|
|
219
|
-
# Show Codex config (plain text)
|
|
220
|
-
xling settings:get --tool codex
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Edit Settings (Claude)
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# Create/edit settings.hxi.json in VS Code (default)
|
|
227
|
-
xling settings:set --tool claude --scope user --name hxi
|
|
228
|
-
|
|
229
|
-
# Open default settings in Cursor
|
|
230
|
-
xling settings:set --tool claude --scope project --name default --ide cursor --no-json
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
`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`).
|
|
234
|
-
|
|
235
|
-
> Note: Every `settings:*` command relies solely on flags such as `--tool`, `--scope`, and `--name`; key-level overrides like `developerShortcuts.runCommand` are no longer supported.
|
|
236
|
-
|
|
237
|
-
### Switch Profiles or Claude Variants
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
# Switch to a different profile
|
|
241
|
-
xling settings:switch oss --tool codex
|
|
242
|
-
|
|
243
|
-
# Activate settings.hxi.json for Claude user scope
|
|
244
|
-
xling settings:switch hxi --tool claude --scope user
|
|
245
|
-
|
|
246
|
-
# Apply without prompt (Claude)
|
|
247
|
-
xling settings:switch hxi --tool claude --scope user --force
|
|
248
|
-
|
|
249
|
-
# Force and keep a .bak backup
|
|
250
|
-
xling settings:switch hxi --tool claude --scope user --force --backup
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
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.
|
|
254
|
-
|
|
255
|
-
### Inspect Configuration
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
# View configuration file information
|
|
259
|
-
xling settings:inspect --tool claude --scope user
|
|
260
|
-
```
|
|
261
91
|
|
|
262
92
|
## Supported Tools
|
|
263
93
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { n as SettingsAdapter } from "./interfaces-
|
|
1
|
+
import { f as SettingsListData, g as ToolId, h as SwitchOptions, i as InspectResult, l as Scope, m as SettingsResult, r as EditOptions, t as ConfigObject } from "./types-B6AS7UBa.js";
|
|
2
|
+
import { n as SettingsAdapter } from "./interfaces-Db5DCCHW.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/settings/adapters/base.d.ts
|
|
5
5
|
|
|
@@ -32,11 +32,11 @@ declare abstract class BaseAdapter implements SettingsAdapter {
|
|
|
32
32
|
/**
|
|
33
33
|
* Read the configuration file (subclasses may override)
|
|
34
34
|
*/
|
|
35
|
-
protected readConfig(path: string):
|
|
35
|
+
protected readConfig(path: string): ConfigObject;
|
|
36
36
|
/**
|
|
37
37
|
* Write the configuration file (subclasses may override)
|
|
38
38
|
*/
|
|
39
|
-
protected writeConfig(path: string, data:
|
|
39
|
+
protected writeConfig(path: string, data: ConfigObject, backup?: boolean): void;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
export { BaseAdapter as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as LaunchAdapter } from "./interfaces-
|
|
1
|
+
import { a as LaunchCommandSpec, g as ToolId } from "./types-B6AS7UBa.js";
|
|
2
|
+
import { t as LaunchAdapter } from "./interfaces-Db5DCCHW.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/launch/adapters/base.d.ts
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { a as readJSON, c as writeJSON, i as getFileInfo, r as fileExists } from "./fsStore-S8RslR8L.js";
|
|
3
3
|
|
|
4
4
|
//#region src/services/settings/adapters/base.ts
|
|
5
5
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as InvalidScopeError, u as SettingsVariantNotFoundError } from "./errors-pXKbCKbL.js";
|
|
2
2
|
import { n as resolveEditorCommand, t as openInEditor } from "./editor-CUiekAEb.js";
|
|
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-
|
|
3
|
+
import { t as formatDiff } from "./format-a_tYXjv9.js";
|
|
4
|
+
import { c as writeJSON, i as getFileInfo, n as ensureDir, s as resolveHome } from "./fsStore-S8RslR8L.js";
|
|
5
|
+
import { t as BaseAdapter } from "./base-DtcPVpvU.js";
|
|
6
|
+
import { t as CLAUDE_SETTINGS_TEMPLATE } from "./claudeDefault-ewrEKzlX.js";
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as path from "path";
|
|
9
9
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
|
2
|
+
import { generateText, streamText } from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/services/prompt/client.ts
|
|
5
|
+
/**
|
|
6
|
+
* OpenAI Compatible Client Wrapper
|
|
7
|
+
* Wraps @ai-sdk/openai-compatible for each provider
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Client for a single provider using AI SDK
|
|
11
|
+
*/
|
|
12
|
+
var PromptClient = class {
|
|
13
|
+
provider;
|
|
14
|
+
config;
|
|
15
|
+
constructor(config) {
|
|
16
|
+
this.config = config;
|
|
17
|
+
this.provider = createOpenAICompatible({
|
|
18
|
+
name: config.name,
|
|
19
|
+
baseURL: config.baseUrl,
|
|
20
|
+
apiKey: config.apiKey,
|
|
21
|
+
headers: config.headers
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Convert AI SDK v2 usage to our internal format
|
|
26
|
+
*/
|
|
27
|
+
convertUsage(usage) {
|
|
28
|
+
if (!usage) return;
|
|
29
|
+
return {
|
|
30
|
+
promptTokens: usage.inputTokens ?? 0,
|
|
31
|
+
completionTokens: usage.outputTokens ?? 0,
|
|
32
|
+
totalTokens: usage.totalTokens ?? 0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate text (non-streaming)
|
|
37
|
+
*/
|
|
38
|
+
async generate(request) {
|
|
39
|
+
const baseParams = {
|
|
40
|
+
model: this.provider(request.model || ""),
|
|
41
|
+
temperature: request.temperature,
|
|
42
|
+
maxOutputTokens: request.maxTokens,
|
|
43
|
+
maxRetries: 2,
|
|
44
|
+
abortSignal: request.abortSignal
|
|
45
|
+
};
|
|
46
|
+
const result = await generateText(request.messages && request.messages.length > 0 ? {
|
|
47
|
+
...baseParams,
|
|
48
|
+
messages: request.messages
|
|
49
|
+
} : {
|
|
50
|
+
...baseParams,
|
|
51
|
+
prompt: request.prompt || "",
|
|
52
|
+
system: request.system
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
content: result.text,
|
|
56
|
+
model: request.model || "",
|
|
57
|
+
provider: this.config.name,
|
|
58
|
+
usage: this.convertUsage(result.usage),
|
|
59
|
+
finishReason: result.finishReason
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Stream text
|
|
64
|
+
*/
|
|
65
|
+
async stream(request) {
|
|
66
|
+
const baseParams = {
|
|
67
|
+
model: this.provider(request.model || ""),
|
|
68
|
+
temperature: request.temperature,
|
|
69
|
+
maxOutputTokens: request.maxTokens,
|
|
70
|
+
maxRetries: 2,
|
|
71
|
+
abortSignal: request.abortSignal
|
|
72
|
+
};
|
|
73
|
+
return await streamText(request.messages && request.messages.length > 0 ? {
|
|
74
|
+
...baseParams,
|
|
75
|
+
messages: request.messages
|
|
76
|
+
} : {
|
|
77
|
+
...baseParams,
|
|
78
|
+
prompt: request.prompt || "",
|
|
79
|
+
system: request.system
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getProviderName() {
|
|
83
|
+
return this.config.name;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { PromptClient as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as InvalidScopeError, l as ProfileNotFoundError } from "./errors-pXKbCKbL.js";
|
|
2
|
-
import { l as writeTOML, o as readTOML } from "./fsStore-
|
|
3
|
-
import { t as BaseAdapter } from "./base-
|
|
2
|
+
import { l as writeTOML, o as readTOML } from "./fsStore-S8RslR8L.js";
|
|
3
|
+
import { t as BaseAdapter } from "./base-DtcPVpvU.js";
|
|
4
4
|
|
|
5
5
|
//#region src/services/settings/adapters/codex.ts
|
|
6
6
|
/**
|
|
@@ -43,9 +43,12 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
43
43
|
if (!this.validateScope(scope)) throw new InvalidScopeError(scope);
|
|
44
44
|
const path = this.resolvePath(scope);
|
|
45
45
|
const config = this.readConfig(path);
|
|
46
|
-
const
|
|
46
|
+
const profilesValue = config.profiles;
|
|
47
|
+
const profiles = isConfigObject(profilesValue) ? profilesValue : void 0;
|
|
47
48
|
if (!profiles || !(profile in profiles)) throw new ProfileNotFoundError(profile);
|
|
48
|
-
const
|
|
49
|
+
const profileValue = profiles[profile];
|
|
50
|
+
if (!isConfigObject(profileValue)) throw new ProfileNotFoundError(profile);
|
|
51
|
+
const profileConfig = profileValue;
|
|
49
52
|
const newConfig = { ...config };
|
|
50
53
|
for (const [key, value] of Object.entries(profileConfig)) newConfig[key] = value;
|
|
51
54
|
newConfig.current_profile = profile;
|
|
@@ -70,10 +73,11 @@ var CodexAdapter = class extends BaseAdapter {
|
|
|
70
73
|
}
|
|
71
74
|
extractProviders(config) {
|
|
72
75
|
const providers = config.model_providers;
|
|
73
|
-
if (
|
|
76
|
+
if (isConfigObject(providers)) return providers;
|
|
74
77
|
return {};
|
|
75
78
|
}
|
|
76
79
|
};
|
|
80
|
+
const isConfigObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date);
|
|
77
81
|
|
|
78
82
|
//#endregion
|
|
79
83
|
export { CodexAdapter as t };
|
package/dist/commands/git/prc.js
CHANGED
|
@@ -4,9 +4,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
4
4
|
import "../../utils-DDnNMPIq.js";
|
|
5
5
|
import "../../pr-DjdO-vJk.js";
|
|
6
6
|
import "../../view-JZaEEspp.js";
|
|
7
|
-
import "../../worktree-
|
|
7
|
+
import "../../worktree-BuIXmI0X.js";
|
|
8
8
|
import "../../create-CKUHliul.js";
|
|
9
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
9
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
10
10
|
import { Command, Flags } from "@oclif/core";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/git/prc.ts
|
package/dist/commands/git/prr.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Args, Command, Flags } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/prr.ts
|
package/dist/commands/git/prv.js
CHANGED
|
@@ -4,9 +4,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
4
4
|
import "../../utils-DDnNMPIq.js";
|
|
5
5
|
import "../../pr-DjdO-vJk.js";
|
|
6
6
|
import "../../view-JZaEEspp.js";
|
|
7
|
-
import "../../worktree-
|
|
7
|
+
import "../../worktree-BuIXmI0X.js";
|
|
8
8
|
import "../../create-CKUHliul.js";
|
|
9
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
9
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
10
10
|
import { Args, Command, Flags } from "@oclif/core";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/git/prv.ts
|
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command, Flags } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/worktree.ts
|
package/dist/commands/git/wta.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command, Flags } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/wta.ts
|
package/dist/commands/git/wtl.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/wtl.ts
|
package/dist/commands/git/wtp.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/wtp.ts
|
package/dist/commands/git/wtr.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command, Flags } from "@oclif/core";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git/wtr.ts
|
package/dist/commands/git/wts.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../../runner-DYk4q6mP.js";
|
|
|
3
3
|
import "../../utils-DDnNMPIq.js";
|
|
4
4
|
import "../../pr-DjdO-vJk.js";
|
|
5
5
|
import "../../view-JZaEEspp.js";
|
|
6
|
-
import "../../worktree-
|
|
6
|
+
import "../../worktree-BuIXmI0X.js";
|
|
7
7
|
import "../../create-CKUHliul.js";
|
|
8
|
-
import { t as GitDispatcher } from "../../dispatcher-
|
|
8
|
+
import { t as GitDispatcher } from "../../dispatcher-D4bEJonH.js";
|
|
9
9
|
import { Command, Flags } from "@oclif/core";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
11
11
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/p/index.d.ts
|
|
4
|
+
|
|
5
|
+
declare class PCommand extends Command {
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: Command.Example[];
|
|
8
|
+
static flags: Interfaces.FlagInput;
|
|
9
|
+
static args: Interfaces.ArgInput;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Determine if should enter interactive mode
|
|
13
|
+
*/
|
|
14
|
+
private shouldEnterInteractive;
|
|
15
|
+
/**
|
|
16
|
+
* Ask user if they want to continue conversation
|
|
17
|
+
* Uses /dev/tty to read from terminal even when stdin is piped
|
|
18
|
+
*/
|
|
19
|
+
private askContinueConversation;
|
|
20
|
+
/**
|
|
21
|
+
* Enter interactive REPL mode
|
|
22
|
+
* Uses /dev/tty for proper terminal behavior when stdin is piped
|
|
23
|
+
*/
|
|
24
|
+
private enterInteractiveMode;
|
|
25
|
+
/**
|
|
26
|
+
* Display streaming output and return full text
|
|
27
|
+
*/
|
|
28
|
+
private displayStream;
|
|
29
|
+
/**
|
|
30
|
+
* Build prompt from various sources
|
|
31
|
+
*/
|
|
32
|
+
private buildPrompt;
|
|
33
|
+
/**
|
|
34
|
+
* Read from stdin
|
|
35
|
+
*/
|
|
36
|
+
private readStdin;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PCommand as default };
|