@iruidong/code 0.1.4 → 0.1.7

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/QUICKSTART.md CHANGED
@@ -10,46 +10,36 @@ ruidong --version
10
10
  Expected output:
11
11
 
12
12
  ```bash
13
- Ruidong Code v0.1.4
13
+ Ruidong Code v0.1.7
14
14
  ```
15
15
 
16
- ## 2. Initialize provider config
16
+ ## 2. Configure your shell
17
17
 
18
- ### Option A: Wizard
18
+ ### Option A: `iruidong`
19
19
 
20
20
  ```bash
21
- ruidong init
22
- ```
23
-
24
- Use this if you want Ruidong Code to guide you through endpoint, API key, and model selection. The wizard saves them directly to `~/.ruidong-code/config.json`.
25
-
26
- ### Option B: Preset profile
21
+ cat >> ~/.zshrc <<'EOF'
22
+ export ANTHROPIC_BASE_URL="https://iruidong.com"
23
+ export ANTHROPIC_AUTH_TOKEN="your_api_key"
24
+ export ANTHROPIC_MODEL="glm"
25
+ EOF
27
26
 
28
- `iruidong`:
29
-
30
- ```bash
31
- ruidong init --force --profile iruidong
27
+ source ~/.zshrc
32
28
  ```
33
29
 
34
- `crs`:
30
+ ### Option B: `crs`
35
31
 
36
32
  ```bash
37
- ruidong init --force --profile crs
38
- ```
33
+ cat >> ~/.zshrc <<'EOF'
34
+ export ANTHROPIC_BASE_URL="http://18.141.210.162:3000/api"
35
+ export ANTHROPIC_API_KEY="your_api_key"
36
+ export ANTHROPIC_MODEL="sonnet"
37
+ EOF
39
38
 
40
- ### Option C: Custom gateway
41
-
42
- ```bash
43
- ruidong init --force \
44
- --provider anthropic-compatible \
45
- --base-url https://your-gateway.example/v1 \
46
- --key "your_api_key" \
47
- --model qwen
39
+ source ~/.zshrc
48
40
  ```
49
41
 
50
- If you do not know the model ID yet, omit `--model`. After startup you can choose one with `/model`.
51
-
52
- Advanced users can still use `--key-env`, `--api-key-env`, or `--auth-token-env` to avoid writing a raw key into config.
42
+ If you use `bash`, replace `~/.zshrc` with `~/.bashrc`.
53
43
 
54
44
  ## 3. Verify headless mode
55
45
 
@@ -57,8 +47,6 @@ Advanced users can still use `--key-env`, `--api-key-env`, or `--auth-token-env`
57
47
  ruidong -p "你好,请只回复 OK" --bare
58
48
  ```
59
49
 
60
- If your config already contains a default model, this should return a short response immediately.
61
-
62
50
  If your gateway requires an explicit model:
63
51
 
64
52
  ```bash
@@ -76,7 +64,6 @@ Useful first commands:
76
64
 
77
65
  ```text
78
66
  /model
79
- /init
80
67
  /mcp
81
68
  /plugin
82
69
  ```
@@ -95,14 +82,16 @@ Legacy `CLAUDE.md` names are still supported for compatibility.
95
82
  Auth errors:
96
83
 
97
84
  ```bash
98
- cat ~/.ruidong-code/config.json
85
+ env | egrep '^(ANTHROPIC|RUIDONG)_'
99
86
  ruidong doctor
100
87
  ```
101
88
 
102
- Need to rebuild config:
89
+ If your team uses shell variables, do not also keep another provider in `~/.ruidong-code/config.json`.
90
+
91
+ If an old `~/.ruidong-code/config.json` keeps interfering, remove it:
103
92
 
104
93
  ```bash
105
- ruidong init --force
94
+ rm -f ~/.ruidong-code/config.json
106
95
  ```
107
96
 
108
97
  Need more debug output:
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruidong Code
2
2
 
3
- Ruidong Code is a terminal coding assistant CLI that works with Anthropic-compatible gateways and relay services. You can point it at your own API URL, choose a default model, and keep runtime settings in `~/.ruidong-code/config.json`.
3
+ Ruidong Code is a terminal coding assistant CLI that works with Anthropic-compatible gateways and relay services. The recommended setup is the same as standard Claude Code deployments: put `ANTHROPIC_*` variables in your shell profile, then run `ruidong` directly. `~/.ruidong-code/config.json` is optional.
4
4
 
5
5
  ## Install
6
6
 
@@ -13,39 +13,33 @@ Node.js `>=18` is required.
13
13
 
14
14
  ## Quick Start
15
15
 
16
- ### 1. Initialize config
16
+ ### 1. Configure your shell
17
17
 
18
- Interactive wizard:
18
+ `iruidong` example:
19
19
 
20
20
  ```bash
21
- ruidong init
22
- ```
23
-
24
- The wizard now asks for:
25
-
26
- - API endpoint URL
27
- - API key
28
- - Default model
29
-
30
- and saves them to `~/.ruidong-code/config.json`.
21
+ cat >> ~/.zshrc <<'EOF'
22
+ export ANTHROPIC_BASE_URL="https://iruidong.com"
23
+ export ANTHROPIC_AUTH_TOKEN="your_api_key"
24
+ export ANTHROPIC_MODEL="glm"
25
+ EOF
31
26
 
32
- Preset profiles:
33
-
34
- ```bash
35
- ruidong init --force --profile iruidong
36
- ruidong init --force --profile crs
27
+ source ~/.zshrc
37
28
  ```
38
29
 
39
- Custom gateway:
30
+ `crs` example:
40
31
 
41
32
  ```bash
42
- ruidong init --force \
43
- --provider anthropic-compatible \
44
- --base-url https://your-gateway.example/v1 \
45
- --key "your_api_key"
33
+ cat >> ~/.zshrc <<'EOF'
34
+ export ANTHROPIC_BASE_URL="http://18.141.210.162:3000/api"
35
+ export ANTHROPIC_API_KEY="your_api_key"
36
+ export ANTHROPIC_MODEL="sonnet"
37
+ EOF
38
+
39
+ source ~/.zshrc
46
40
  ```
47
41
 
48
- Advanced users can still use environment variables with `--key-env`, `--api-key-env`, or `--auth-token-env`.
42
+ If you use `bash`, write the same variables to `~/.bashrc`.
49
43
 
50
44
  ### 2. Start using it
51
45
 
@@ -62,33 +56,8 @@ Non-interactive check:
62
56
  ruidong -p "你好,请只回复 OK" --bare
63
57
  ```
64
58
 
65
- ## Config Model
66
-
67
- Ruidong Code stores runtime config in:
68
-
69
- ```bash
70
- ~/.ruidong-code/config.json
71
- ```
72
-
73
- Common provider fields:
74
-
75
- ```json
76
- {
77
- "provider": {
78
- "id": "anthropic-compatible",
79
- "baseUrl": "https://your-gateway.example/v1",
80
- "authToken": "your_api_key",
81
- "authMode": "auto",
82
- "defaultModel": "glm"
83
- }
84
- }
85
- ```
86
-
87
- Supported init flows:
88
-
89
- - `iruidong`: built-in preset for `https://iruidong.com`
90
- - `crs`: built-in preset for the CRS relay profile
91
- - `anthropic-compatible`: generic gateway mode
59
+ Ruidong Code also ships with a built-in official marketplace URL:
60
+ `https://marketplace.iruidong.com/marketplace.json`.
92
61
 
93
62
  ## Instruction Files
94
63
 
@@ -103,7 +72,6 @@ Legacy `CLAUDE.md` and `CLAUDE.local.md` are still read for compatibility.
103
72
 
104
73
  ```bash
105
74
  ruidong --help
106
- ruidong init --help
107
75
  ruidong -p "summarize this repo" --bare
108
76
  ruidong doctor
109
77
  ```
@@ -111,7 +79,6 @@ ruidong doctor
111
79
  Inside an interactive session:
112
80
 
113
81
  - `/model`
114
- - `/init`
115
82
  - `/mcp`
116
83
  - `/plugin`
117
84
 
@@ -120,6 +87,7 @@ Inside an interactive session:
120
87
  - [Quick Start](./QUICKSTART.md)
121
88
  - [同事安装说明](./docs/TEAM_INSTALL_GUIDE_CN.md)
122
89
  - [双平台配置说明](./docs/PLATFORM_SPLIT_CN.md)
90
+ - [公开 Marketplace 部署](./docs/RUIDONG_PUBLIC_MARKETPLACE_DEPLOYMENT_CN.md)
123
91
 
124
92
  ## Release Verification
125
93
 
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ruidong v0.1.4 (built from source)
2
+ // ruidong v0.1.7 (built from source)
3
3
  // Copyright (c) Anthropic PBC. All rights reserved.
4
4
  import { createRequire as __createRequire } from "module";const require=__createRequire(import.meta.url);
5
5
  var __defProp = Object.defineProperty;
@@ -81,8 +81,8 @@ var __callDispose = (stack, error, hasError) => {
81
81
  var PUBLIC_CLI_VERSION, BUILD_TIME, API_COMPAT_VERSION, API_COMPAT_VERSION_BASE;
82
82
  var init_version = __esm({
83
83
  "build-src/src/constants/version.ts"() {
84
- PUBLIC_CLI_VERSION = "0.1.4";
85
- BUILD_TIME = "2026-04-01T06:00:31.912Z";
84
+ PUBLIC_CLI_VERSION = "0.1.7";
85
+ BUILD_TIME = "2026-04-03T12:30:00.000Z";
86
86
  API_COMPAT_VERSION = "2.1.88";
87
87
  API_COMPAT_VERSION_BASE = API_COMPAT_VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/)?.[0];
88
88
  }
@@ -13009,12 +13009,6 @@ function getRuidongConfigHomeDir() {
13009
13009
  function getRuidongConfigPath() {
13010
13010
  return join21(getRuidongConfigHomeDir(), "config.json");
13011
13011
  }
13012
- function resetRuidongConfigCache() {
13013
- configCache = void 0;
13014
- }
13015
- function hasRuidongConfig() {
13016
- return existsSync5(getRuidongConfigPath());
13017
- }
13018
13012
  function getRuidongConfig() {
13019
13013
  if (configCache !== void 0) {
13020
13014
  return configCache;
@@ -13083,6 +13077,9 @@ function setEnvIfUnset(key, value) {
13083
13077
  }
13084
13078
  process.env[key] = value;
13085
13079
  }
13080
+ function hasExplicitEnvValue(key) {
13081
+ return Boolean(process.env[key]?.trim());
13082
+ }
13086
13083
  function setManagedEnv(key, value) {
13087
13084
  const normalizedValue = value?.trim();
13088
13085
  if (!normalizedValue) {
@@ -13134,6 +13131,9 @@ function selectConfiguredCredential(provider) {
13134
13131
  return "api-key";
13135
13132
  }
13136
13133
  function applyProviderCredentialEnv(provider) {
13134
+ if (hasExplicitEnvValue("ANTHROPIC_API_KEY") || hasExplicitEnvValue("ANTHROPIC_AUTH_TOKEN")) {
13135
+ return;
13136
+ }
13137
13137
  const selectedCredential = selectConfiguredCredential(provider);
13138
13138
  if (!selectedCredential) {
13139
13139
  return;
@@ -13190,14 +13190,14 @@ function applyRuidongRuntimeConfig() {
13190
13190
  if (provider) {
13191
13191
  applyProviderFlags(provider.id);
13192
13192
  if (provider.baseUrl !== void 0) {
13193
- setManagedEnv("ANTHROPIC_BASE_URL", provider.baseUrl);
13193
+ setEnvIfUnset("ANTHROPIC_BASE_URL", provider.baseUrl);
13194
13194
  }
13195
13195
  applyProviderCredentialEnv(provider);
13196
13196
  if (provider.authMode !== void 0) {
13197
- setManagedEnv("ANTHROPIC_AUTH_MODE", provider.authMode);
13197
+ setEnvIfUnset("ANTHROPIC_AUTH_MODE", provider.authMode);
13198
13198
  }
13199
13199
  if (provider.defaultModel !== void 0) {
13200
- setManagedEnv("ANTHROPIC_MODEL", provider.defaultModel);
13200
+ setEnvIfUnset("ANTHROPIC_MODEL", provider.defaultModel);
13201
13201
  }
13202
13202
  }
13203
13203
  applyOfficialMarketplaceConfig(config2.marketplace?.official);
@@ -13206,52 +13206,6 @@ function applyRuidongRuntimeConfig() {
13206
13206
  config2.mcp?.officialRegistryUrl
13207
13207
  );
13208
13208
  }
13209
- function writeRuidongConfig(config2) {
13210
- mkdirSync3(getRuidongConfigHomeDir(), { recursive: true });
13211
- writeFileSync2(getRuidongConfigPath(), `${JSON.stringify(config2, null, 2)}
13212
- `, {
13213
- encoding: "utf-8"
13214
- });
13215
- resetRuidongConfigCache();
13216
- }
13217
- function copyMissingEntries(fromDir, toDir) {
13218
- if (!existsSync5(fromDir)) {
13219
- return 0;
13220
- }
13221
- let copied = 0;
13222
- mkdirSync3(toDir, { recursive: true });
13223
- for (const entry of readdirSync2(fromDir, { withFileTypes: true })) {
13224
- const sourcePath = join21(fromDir, entry.name);
13225
- const targetPath = join21(toDir, entry.name);
13226
- if (existsSync5(targetPath)) {
13227
- continue;
13228
- }
13229
- cpSync(sourcePath, targetPath, { recursive: true });
13230
- copied++;
13231
- }
13232
- return copied;
13233
- }
13234
- function migrateLegacyClaudeHomeToRuidongHome() {
13235
- const targetDir = getRuidongConfigHomeDir();
13236
- const legacyDir = getLegacyClaudeConfigHomeDir();
13237
- if (targetDir === legacyDir) {
13238
- return { migrated: false, copiedEntries: 0, copiedGlobalConfig: false };
13239
- }
13240
- const copiedEntries = copyMissingEntries(legacyDir, targetDir);
13241
- const legacyGlobalConfig = getLegacyGlobalClaudeFile();
13242
- const ruidongGlobalConfig = join21(targetDir, "global.json");
13243
- let copiedGlobalConfig = false;
13244
- if (existsSync5(legacyGlobalConfig) && !existsSync5(ruidongGlobalConfig)) {
13245
- mkdirSync3(targetDir, { recursive: true });
13246
- cpSync(legacyGlobalConfig, ruidongGlobalConfig);
13247
- copiedGlobalConfig = true;
13248
- }
13249
- return {
13250
- migrated: copiedEntries > 0 || copiedGlobalConfig,
13251
- copiedEntries,
13252
- copiedGlobalConfig
13253
- };
13254
- }
13255
13209
  var RuidongProviderIdSchema, RuidongAuthModeSchema, RuidongVoiceSttProviderSchema, OfficialMarketplaceSourceSchema, RuidongConfigSchema, configCache;
13256
13210
  var init_ruidongConfig = __esm({
13257
13211
  "build-src/src/utils/ruidongConfig.ts"() {
@@ -25961,7 +25915,10 @@ function parseKey(keypress) {
25961
25915
  wheelDown: keypress.name === "wheeldown",
25962
25916
  home: keypress.name === "home",
25963
25917
  end: keypress.name === "end",
25964
- return: keypress.name === "return",
25918
+ // Some terminals emit LF as "enter" while others emit CR as "return".
25919
+ // Treat both as the same submit key so onboarding and chat input behave
25920
+ // consistently across Terminal/iTerm/SSH combinations.
25921
+ return: keypress.name === "return" || keypress.name === "enter",
25965
25922
  escape: keypress.name === "escape",
25966
25923
  fn: keypress.fn,
25967
25924
  ctrl: keypress.ctrl,
@@ -39506,12 +39463,19 @@ function buildOfficialMarketplaceSource() {
39506
39463
  ...sparsePaths && { sparsePaths }
39507
39464
  };
39508
39465
  }
39466
+ const githubRepo = getOptionalEnv("RUIDONG_OFFICIAL_MARKETPLACE_REPO");
39467
+ if (githubRepo) {
39468
+ return {
39469
+ source: "github",
39470
+ repo: githubRepo,
39471
+ ...ref && { ref },
39472
+ ...path15 && { path: path15 },
39473
+ ...sparsePaths && { sparsePaths }
39474
+ };
39475
+ }
39509
39476
  return {
39510
- source: "github",
39511
- repo: getOptionalEnv("RUIDONG_OFFICIAL_MARKETPLACE_REPO") ?? DEFAULT_OFFICIAL_MARKETPLACE_REPO,
39512
- ...ref && { ref },
39513
- ...path15 && { path: path15 },
39514
- ...sparsePaths && { sparsePaths }
39477
+ source: "url",
39478
+ url: DEFAULT_OFFICIAL_MARKETPLACE_URL
39515
39479
  };
39516
39480
  }
39517
39481
  function isConfiguredOfficialMarketplaceName(marketplace) {
@@ -39552,11 +39516,11 @@ function getOfficialMarketplaceGcsArcPrefix() {
39552
39516
  const override = getOptionalEnv("RUIDONG_OFFICIAL_MARKETPLACE_GCS_ARC_PREFIX");
39553
39517
  return override ?? `marketplaces/${OFFICIAL_MARKETPLACE_NAME}/`;
39554
39518
  }
39555
- var DEFAULT_OFFICIAL_MARKETPLACE_NAME, DEFAULT_OFFICIAL_MARKETPLACE_REPO, ANTHROPIC_OFFICIAL_MARKETPLACE_REPO, ANTHROPIC_OFFICIAL_MARKETPLACE_GCS_BASE, OFFICIAL_MARKETPLACE_NAME, OFFICIAL_MARKETPLACE_SOURCE;
39519
+ var DEFAULT_OFFICIAL_MARKETPLACE_NAME, DEFAULT_OFFICIAL_MARKETPLACE_URL, ANTHROPIC_OFFICIAL_MARKETPLACE_REPO, ANTHROPIC_OFFICIAL_MARKETPLACE_GCS_BASE, OFFICIAL_MARKETPLACE_NAME, OFFICIAL_MARKETPLACE_SOURCE;
39556
39520
  var init_officialMarketplace = __esm({
39557
39521
  "build-src/src/utils/plugins/officialMarketplace.ts"() {
39558
- DEFAULT_OFFICIAL_MARKETPLACE_NAME = "ruidong-marketplace-seed";
39559
- DEFAULT_OFFICIAL_MARKETPLACE_REPO = "Jackwwg83/ruidong-marketplace-seed";
39522
+ DEFAULT_OFFICIAL_MARKETPLACE_NAME = "ruidong-marketplace";
39523
+ DEFAULT_OFFICIAL_MARKETPLACE_URL = "https://marketplace.iruidong.com/marketplace.json";
39560
39524
  ANTHROPIC_OFFICIAL_MARKETPLACE_REPO = "anthropics/claude-plugins-official";
39561
39525
  ANTHROPIC_OFFICIAL_MARKETPLACE_GCS_BASE = "https://downloads.claude.ai/claude-code-releases/plugins/claude-plugins-official";
39562
39526
  OFFICIAL_MARKETPLACE_NAME = getOptionalEnv("RUIDONG_OFFICIAL_MARKETPLACE_NAME") ?? DEFAULT_OFFICIAL_MARKETPLACE_NAME;
@@ -75142,7 +75106,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
75142
75106
  {
75143
75107
  name: "ruidong-code",
75144
75108
  title: "ruidong",
75145
- version: "0.1.4",
75109
+ version: "0.1.7",
75146
75110
  description: "Ruidong Code agentic coding tool",
75147
75111
  websiteUrl: PRODUCT_URL
75148
75112
  },
@@ -75565,7 +75529,7 @@ var init_client3 = __esm({
75565
75529
  {
75566
75530
  name: "ruidong-code",
75567
75531
  title: "ruidong",
75568
- version: "0.1.4",
75532
+ version: "0.1.7",
75569
75533
  description: "Ruidong Code agentic coding tool",
75570
75534
  websiteUrl: PRODUCT_URL
75571
75535
  },
@@ -87264,7 +87228,7 @@ async function installGlobalPackage(specificVersion) {
87264
87228
  );
87265
87229
  logEvent("tengu_auto_updater_lock_contention", {
87266
87230
  pid: process.pid,
87267
- currentVersion: "0.1.4"
87231
+ currentVersion: "0.1.7"
87268
87232
  });
87269
87233
  return "in_progress";
87270
87234
  }
@@ -87273,7 +87237,7 @@ async function installGlobalPackage(specificVersion) {
87273
87237
  if (!env.isRunningWithBun() && env.isNpmFromWindowsPath()) {
87274
87238
  logError(new Error("Windows NPM detected in WSL environment"));
87275
87239
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
87276
- currentVersion: "0.1.4"
87240
+ currentVersion: "0.1.7"
87277
87241
  });
87278
87242
  console.error(`
87279
87243
  Error: Windows NPM detected in WSL
@@ -87940,7 +87904,7 @@ function detectLinuxGlobPatternWarnings() {
87940
87904
  }
87941
87905
  async function getDoctorDiagnostic() {
87942
87906
  const installationType = await getCurrentInstallationType();
87943
- const version2 = typeof MACRO !== "undefined" && "0.1.4" ? "0.1.4" : "unknown";
87907
+ const version2 = typeof MACRO !== "undefined" && "0.1.7" ? "0.1.7" : "unknown";
87944
87908
  const installationPath = await getInstallationPath();
87945
87909
  const invokedBinary = getInvokedBinary();
87946
87910
  const multipleInstallations = await detectMultipleInstallations();
@@ -89020,7 +88984,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
89020
88984
  version2 = maxVersion;
89021
88985
  }
89022
88986
  }
89023
- if (!forceReinstall && version2 === "0.1.4" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
88987
+ if (!forceReinstall && version2 === "0.1.7" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
89024
88988
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
89025
88989
  logEvent("tengu_native_update_complete", {
89026
88990
  latency_ms: Date.now() - startTime,
@@ -185203,6 +185167,10 @@ function useTextInput({
185203
185167
  }
185204
185168
  return cursor.del();
185205
185169
  }
185170
+ function submitCurrentValue() {
185171
+ onSubmit?.(originalValue);
185172
+ return cursor;
185173
+ }
185206
185174
  function killToLineEnd() {
185207
185175
  const { cursor: newCursor, killed } = cursor.deleteToLineEnd();
185208
185176
  pushToKillRing(killed, "append");
@@ -185249,7 +185217,11 @@ function useTextInput({
185249
185217
  ["e", () => cursor.endOfLine()],
185250
185218
  ["f", () => cursor.right()],
185251
185219
  ["h", () => cursor.deleteTokenBefore() ?? cursor.backspace()],
185220
+ // Some terminal/IME combinations swallow plain Enter in raw mode.
185221
+ // Keep Ctrl+J / Ctrl+M as reliable submit fallbacks.
185222
+ ["j", submitCurrentValue],
185252
185223
  ["k", killToLineEnd],
185224
+ ["m", submitCurrentValue],
185253
185225
  ["n", () => downOrHistoryDown()],
185254
185226
  ["p", () => upOrHistoryUp()],
185255
185227
  ["u", killToLineStart],
@@ -187872,7 +187844,7 @@ ${sanitizedDescription}
187872
187844
  **Environment Info**
187873
187845
  - Platform: ${env.platform}
187874
187846
  - Terminal: ${env.terminal}
187875
- - Version: ${"0.1.4"}
187847
+ - Version: ${"0.1.7"}
187876
187848
  - Feedback ID: ${feedbackId}
187877
187849
 
187878
187850
  **Errors**
@@ -218449,6 +218421,11 @@ function extractConversationText(messages) {
218449
218421
  const text = parts.join("\n");
218450
218422
  return text.length > MAX_CONVERSATION_TEXT ? text.slice(-MAX_CONVERSATION_TEXT) : text;
218451
218423
  }
218424
+ function normalizeJsonLikeResponse(text) {
218425
+ const trimmed = text.trim();
218426
+ const fencedMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
218427
+ return fencedMatch?.[1]?.trim() || trimmed;
218428
+ }
218452
218429
  async function generateSessionTitle(description, signal) {
218453
218430
  const trimmed = description.trim();
218454
218431
  if (!trimmed) return null;
@@ -218480,7 +218457,8 @@ async function generateSessionTitle(description, signal) {
218480
218457
  }
218481
218458
  });
218482
218459
  const text = extractTextContent(result.message.content);
218483
- const parsed = titleSchema().safeParse(safeParseJSON(text));
218460
+ const normalizedText = normalizeJsonLikeResponse(text);
218461
+ const parsed = titleSchema().safeParse(safeParseJSON(normalizedText));
218484
218462
  const title = parsed.success ? parsed.data.title.trim() || null : null;
218485
218463
  logEvent("tengu_session_title_generated", { success: title !== null });
218486
218464
  return title;
@@ -254180,7 +254158,7 @@ function generateHtmlReport(data, insights) {
254180
254158
  </html>`;
254181
254159
  }
254182
254160
  function buildExportData(data, insights, facets, remoteStats) {
254183
- const version2 = typeof MACRO !== "undefined" ? "0.1.4" : "unknown";
254161
+ const version2 = typeof MACRO !== "undefined" ? "0.1.7" : "unknown";
254184
254162
  const remote_hosts_collected = remoteStats?.hosts.filter((h) => h.sessionCount > 0).map((h) => h.name);
254185
254163
  const facets_summary = {
254186
254164
  total: facets.size,
@@ -257944,7 +257922,7 @@ var init_sessionStorage = __esm({
257944
257922
  init_settings2();
257945
257923
  init_slowOperations();
257946
257924
  init_uuid();
257947
- VERSION2 = typeof MACRO !== "undefined" ? "0.1.4" : "unknown";
257925
+ VERSION2 = typeof MACRO !== "undefined" ? "0.1.7" : "unknown";
257948
257926
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
257949
257927
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
257950
257928
  EPHEMERAL_PROGRESS_TYPES = /* @__PURE__ */ new Set([
@@ -305332,6 +305310,27 @@ async function checkAndInstallOfficialMarketplace() {
305332
305310
  });
305333
305311
  return { installed: false, skipped: true, reason: "policy_blocked" };
305334
305312
  }
305313
+ if (OFFICIAL_MARKETPLACE_SOURCE.source === "url") {
305314
+ logForDebugging(
305315
+ "Attempting to auto-install official marketplace from built-in URL source"
305316
+ );
305317
+ await addMarketplaceSource(OFFICIAL_MARKETPLACE_SOURCE);
305318
+ saveGlobalConfig((current) => ({
305319
+ ...current,
305320
+ officialMarketplaceAutoInstallAttempted: true,
305321
+ officialMarketplaceAutoInstalled: true,
305322
+ officialMarketplaceAutoInstallFailReason: void 0,
305323
+ officialMarketplaceAutoInstallRetryCount: void 0,
305324
+ officialMarketplaceAutoInstallLastAttemptTime: void 0,
305325
+ officialMarketplaceAutoInstallNextRetryTime: void 0
305326
+ }));
305327
+ logEvent("tengu_official_marketplace_auto_install", {
305328
+ installed: true,
305329
+ skipped: false,
305330
+ via_url: true
305331
+ });
305332
+ return { installed: true, skipped: false };
305333
+ }
305335
305334
  const cacheDir = getMarketplacesCacheDir();
305336
305335
  const installLocation = join139(cacheDir, OFFICIAL_MARKETPLACE_NAME);
305337
305336
  const gcsSha = await fetchOfficialMarketplaceFromGcs(
@@ -305561,7 +305560,7 @@ async function _temp199() {
305561
305560
  logForDebugging("Showing marketplace installation success notification");
305562
305561
  notifs.push({
305563
305562
  key: "marketplace-installed",
305564
- jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "success", children: "\u2713 Anthropic marketplace installed \xB7 /plugin to see available plugins" }),
305563
+ jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "success", children: "\u2713 Ruidong marketplace installed \xB7 /plugin to see available plugins" }),
305565
305564
  priority: "immediate",
305566
305565
  timeoutMs: 7e3
305567
305566
  });
@@ -305570,7 +305569,7 @@ async function _temp199() {
305570
305569
  logForDebugging("Showing marketplace installation failure notification");
305571
305570
  notifs.push({
305572
305571
  key: "marketplace-install-failed",
305573
- jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "warning", children: "Failed to install Anthropic marketplace \xB7 Will retry on next startup" }),
305572
+ jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "warning", children: "Failed to install Ruidong marketplace \xB7 Will retry on next startup" }),
305574
305573
  priority: "immediate",
305575
305574
  timeoutMs: 8e3
305576
305575
  });
@@ -335600,473 +335599,6 @@ var init_mcp5 = __esm({
335600
335599
  }
335601
335600
  });
335602
335601
 
335603
- // build-src/src/cli/handlers/ruidongConfig.ts
335604
- var ruidongConfig_exports = {};
335605
- __export(ruidongConfig_exports, {
335606
- ruidongInitHandler: () => ruidongInitHandler
335607
- });
335608
- import { createInterface } from "node:readline/promises";
335609
- function applyFriendlyAliases(options) {
335610
- const hasExplicitCredential = Boolean(options.apiKey) || Boolean(options.apiKeyEnv) || Boolean(options.authToken) || Boolean(options.authTokenEnv);
335611
- const prefersGenericKey = !hasExplicitCredential && Boolean(options.key || options.keyEnv);
335612
- return {
335613
- ...options,
335614
- baseUrl: options.baseUrl ?? options.endpoint,
335615
- defaultModel: options.defaultModel ?? options.model,
335616
- authToken: options.authToken ?? (prefersGenericKey ? options.key : void 0),
335617
- authTokenEnv: options.authTokenEnv ?? (prefersGenericKey && options.keyEnv ? options.keyEnv : void 0),
335618
- authMode: options.authMode ?? (prefersGenericKey ? "auto" : void 0)
335619
- };
335620
- }
335621
- function hasSetupInput(options) {
335622
- return Boolean(options.profile) || Boolean(options.provider) || Boolean(options.endpoint) || Boolean(options.baseUrl) || Boolean(options.key) || Boolean(options.keyEnv) || Boolean(options.apiKey) || Boolean(options.apiKeyEnv) || Boolean(options.authToken) || Boolean(options.authTokenEnv) || Boolean(options.authMode) || Boolean(options.model) || Boolean(options.defaultModel);
335623
- }
335624
- function shouldRunInitWizard(options) {
335625
- if (!isInteractiveTerminal()) {
335626
- return false;
335627
- }
335628
- if (options.wizard) {
335629
- return true;
335630
- }
335631
- return !hasSetupInput(options);
335632
- }
335633
- function applyProfilePreset(options) {
335634
- if (!options.profile) {
335635
- return options;
335636
- }
335637
- const preset = INIT_PROFILE_PRESETS[options.profile];
335638
- return {
335639
- ...options,
335640
- provider: options.provider ?? preset.provider,
335641
- baseUrl: options.baseUrl ?? preset.baseUrl,
335642
- authMode: options.authMode ?? preset.authMode,
335643
- defaultModel: options.defaultModel ?? preset.defaultModel,
335644
- apiKeyEnv: options.apiKeyEnv ?? preset.apiKeyEnv,
335645
- authTokenEnv: options.authTokenEnv ?? preset.authTokenEnv
335646
- };
335647
- }
335648
- function shouldDefaultToAuthToken(provider) {
335649
- return provider === "anthropic-compatible" || provider === "deepseek" || provider === "qwen";
335650
- }
335651
- function resolveApiKeySetting(options) {
335652
- if (options.apiKey) {
335653
- return options.apiKey;
335654
- }
335655
- if (options.apiKeyEnv) {
335656
- return `env:${options.apiKeyEnv}`;
335657
- }
335658
- return "env:RUIDONG_API_KEY";
335659
- }
335660
- function resolveAuthTokenSetting(options) {
335661
- if (options.authToken) {
335662
- return options.authToken;
335663
- }
335664
- if (options.authTokenEnv) {
335665
- return `env:${options.authTokenEnv}`;
335666
- }
335667
- if (shouldDefaultToAuthToken(options.provider)) {
335668
- return "env:RUIDONG_API_KEY";
335669
- }
335670
- return void 0;
335671
- }
335672
- function resolveAuthMode2(options) {
335673
- if (options.authMode) {
335674
- return options.authMode;
335675
- }
335676
- if (shouldDefaultToAuthToken(options.provider)) {
335677
- return "auto";
335678
- }
335679
- return resolveAuthTokenSetting(options) ? "bearer" : "auto";
335680
- }
335681
- function buildMarketplaceConfig(options) {
335682
- if (options.officialMarketplaceUrl) {
335683
- return {
335684
- official: {
335685
- name: options.officialMarketplaceName ?? "ruidong-marketplace-seed",
335686
- source: {
335687
- source: "url",
335688
- url: options.officialMarketplaceUrl
335689
- }
335690
- }
335691
- };
335692
- }
335693
- if (options.officialMarketplaceGitUrl) {
335694
- return {
335695
- official: {
335696
- name: options.officialMarketplaceName ?? "ruidong-marketplace-seed",
335697
- source: {
335698
- source: "git",
335699
- url: options.officialMarketplaceGitUrl,
335700
- ...options.officialMarketplaceRef && {
335701
- ref: options.officialMarketplaceRef
335702
- },
335703
- ...options.officialMarketplacePath && {
335704
- path: options.officialMarketplacePath
335705
- },
335706
- ...options.officialMarketplaceSparse && options.officialMarketplaceSparse.length > 0 && {
335707
- sparsePaths: options.officialMarketplaceSparse
335708
- }
335709
- }
335710
- }
335711
- };
335712
- }
335713
- return {
335714
- official: {
335715
- name: options.officialMarketplaceName ?? "ruidong-marketplace-seed",
335716
- source: {
335717
- source: "github",
335718
- repo: options.officialMarketplaceRepo ?? "Jackwwg83/ruidong-marketplace-seed",
335719
- ...options.officialMarketplaceRef && {
335720
- ref: options.officialMarketplaceRef
335721
- },
335722
- ...options.officialMarketplacePath && {
335723
- path: options.officialMarketplacePath
335724
- },
335725
- ...options.officialMarketplaceSparse && options.officialMarketplaceSparse.length > 0 && {
335726
- sparsePaths: options.officialMarketplaceSparse
335727
- }
335728
- }
335729
- }
335730
- };
335731
- }
335732
- function resolveSecretSettingValue(secretSetting) {
335733
- if (!secretSetting) {
335734
- return void 0;
335735
- }
335736
- if (!secretSetting.startsWith("env:")) {
335737
- return secretSetting;
335738
- }
335739
- const envName = secretSetting.slice(4).trim();
335740
- return envName ? process.env[envName] : void 0;
335741
- }
335742
- function isInteractiveTerminal() {
335743
- return process.stdin.isTTY === true && process.stdout.isTTY === true;
335744
- }
335745
- async function promptLine(rl, prompt, defaultValue) {
335746
- const suffix = defaultValue ? ` [${defaultValue}]` : "";
335747
- const answer = (await rl.question(`${prompt}${suffix}: `)).trim();
335748
- return answer || defaultValue || "";
335749
- }
335750
- async function promptWizardMode(rl) {
335751
- process.stdout.write(
335752
- "Ruidong Code setup\n\n 1. Generic gateway (recommended)\n 2. Claude relay (crs preset)\n 3. iruidong gateway\n\n"
335753
- );
335754
- while (true) {
335755
- const answer = (await rl.question("Choose setup mode [1-3] [1]: ")).trim();
335756
- const normalized = answer || "1";
335757
- if (normalized === "1") {
335758
- return "generic";
335759
- }
335760
- if (normalized === "2") {
335761
- return "crs";
335762
- }
335763
- if (normalized === "3") {
335764
- return "iruidong";
335765
- }
335766
- process.stdout.write("Please choose 1, 2, or 3.\n");
335767
- }
335768
- }
335769
- async function promptEndpoint(rl, initialValue) {
335770
- while (true) {
335771
- const candidate = await promptLine(rl, "API endpoint URL", initialValue);
335772
- try {
335773
- const parsed = new URL(candidate);
335774
- if (parsed.protocol === "http:" || parsed.protocol === "https:") {
335775
- return candidate;
335776
- }
335777
- } catch {
335778
- }
335779
- process.stdout.write("Please enter a valid http:// or https:// URL.\n");
335780
- }
335781
- }
335782
- async function promptSecretValue(rl, label, existingValue) {
335783
- if (existingValue && existingValue.trim()) {
335784
- return existingValue.trim();
335785
- }
335786
- while (true) {
335787
- const value = (await rl.question(`${label}: `)).trim();
335788
- if (value) {
335789
- return value;
335790
- }
335791
- process.stdout.write("Please enter a non-empty API key.\n");
335792
- }
335793
- }
335794
- async function maybeConfirmOverwriteExistingConfig() {
335795
- if (!hasRuidongConfig() || !isInteractiveTerminal()) {
335796
- return true;
335797
- }
335798
- const rl = createInterface({
335799
- input: process.stdin,
335800
- output: process.stdout
335801
- });
335802
- try {
335803
- const answer = (await rl.question(
335804
- `Ruidong config already exists at ${getRuidongConfigPath()}. Overwrite it? [y/N]: `
335805
- )).trim().toLowerCase();
335806
- return answer === "y" || answer === "yes";
335807
- } finally {
335808
- rl.close();
335809
- }
335810
- }
335811
- async function runInitWizard(options) {
335812
- const rl = createInterface({
335813
- input: process.stdin,
335814
- output: process.stdout
335815
- });
335816
- try {
335817
- const mode = await promptWizardMode(rl);
335818
- if (mode === "crs") {
335819
- const apiKey = await promptSecretValue(
335820
- rl,
335821
- "API key (will be saved to ~/.ruidong-code/config.json)",
335822
- options.apiKey ?? options.key
335823
- );
335824
- return {
335825
- ...options,
335826
- profile: "crs",
335827
- apiKey
335828
- };
335829
- }
335830
- if (mode === "iruidong") {
335831
- const authToken = await promptSecretValue(
335832
- rl,
335833
- "API key (will be saved to ~/.ruidong-code/config.json)",
335834
- options.authToken ?? options.key
335835
- );
335836
- return {
335837
- ...options,
335838
- profile: "iruidong",
335839
- authToken
335840
- };
335841
- }
335842
- const baseUrl = await promptEndpoint(rl, options.baseUrl ?? options.endpoint);
335843
- const key = await promptSecretValue(
335844
- rl,
335845
- "API key (will be saved to ~/.ruidong-code/config.json)",
335846
- options.key ?? options.authToken ?? options.apiKey
335847
- );
335848
- process.stdout.write(
335849
- "\nDefault model is optional. Ruidong Code will now try to discover models from the gateway.\n\n"
335850
- );
335851
- return {
335852
- ...options,
335853
- provider: options.provider ?? "anthropic-compatible",
335854
- baseUrl,
335855
- key
335856
- };
335857
- } finally {
335858
- rl.close();
335859
- }
335860
- }
335861
- function moveSuggestedModelToFront(models, suggestedModel) {
335862
- if (!suggestedModel) {
335863
- return [...models];
335864
- }
335865
- const index = models.findIndex(
335866
- (model) => model.toLowerCase() === suggestedModel.toLowerCase()
335867
- );
335868
- if (index <= 0) {
335869
- return [...models];
335870
- }
335871
- const reordered = [...models];
335872
- const [match] = reordered.splice(index, 1);
335873
- reordered.unshift(match);
335874
- return reordered;
335875
- }
335876
- async function promptForDefaultModel(models, suggestedModel) {
335877
- const orderedModels = moveSuggestedModelToFront(models, suggestedModel);
335878
- const visibleModels = orderedModels.slice(0, MAX_DISCOVERED_MODELS_TO_PRINT);
335879
- process.stdout.write("\nDiscovered gateway models:\n");
335880
- for (const [index, model] of visibleModels.entries()) {
335881
- const recommended = suggestedModel && model.toLowerCase() === suggestedModel.toLowerCase() ? " (recommended)" : "";
335882
- process.stdout.write(` ${String(index + 1).padStart(2, " ")}. ${model}${recommended}
335883
- `);
335884
- }
335885
- if (orderedModels.length > visibleModels.length) {
335886
- process.stdout.write(
335887
- ` ...and ${String(orderedModels.length - visibleModels.length)} more hidden models
335888
- `
335889
- );
335890
- }
335891
- const question = suggestedModel ? `Select default model [1-${String(visibleModels.length)}], type a model id, press Enter to use ${suggestedModel}, or type "skip" to choose later with /model: ` : `Select default model [1-${String(visibleModels.length)}], type a model id, or press Enter to choose later with /model: `;
335892
- const rl = createInterface({
335893
- input: process.stdin,
335894
- output: process.stdout
335895
- });
335896
- try {
335897
- const rawAnswer = (await rl.question(question)).trim();
335898
- if (!rawAnswer) {
335899
- return suggestedModel;
335900
- }
335901
- if (/^(skip|none|later)$/i.test(rawAnswer)) {
335902
- return void 0;
335903
- }
335904
- const selectedIndex = Number(rawAnswer);
335905
- if (Number.isInteger(selectedIndex) && selectedIndex >= 1 && selectedIndex <= visibleModels.length) {
335906
- return visibleModels[selectedIndex - 1];
335907
- }
335908
- return rawAnswer;
335909
- } finally {
335910
- rl.close();
335911
- }
335912
- }
335913
- async function resolveDefaultModelChoice(options, explicitDefaultModel) {
335914
- if (explicitDefaultModel) {
335915
- return options.defaultModel;
335916
- }
335917
- const suggestedModel = options.defaultModel;
335918
- if (!options.baseUrl) {
335919
- return suggestedModel;
335920
- }
335921
- const authTokenSetting = resolveAuthTokenSetting(options);
335922
- const apiKeySetting = authTokenSetting ? void 0 : resolveApiKeySetting(options);
335923
- const discoveredModels = await discoverAnthropicCompatibleModels({
335924
- baseUrl: options.baseUrl,
335925
- authMode: resolveAuthMode2(options),
335926
- apiKey: resolveSecretSettingValue(apiKeySetting),
335927
- authToken: resolveSecretSettingValue(authTokenSetting)
335928
- });
335929
- if (discoveredModels === null) {
335930
- return suggestedModel;
335931
- }
335932
- if (discoveredModels.length === 0) {
335933
- return suggestedModel;
335934
- }
335935
- if (discoveredModels.length === 1) {
335936
- const autoSelectedModel = discoveredModels[0];
335937
- process.stdout.write(
335938
- `Discovered a single gateway model: ${autoSelectedModel}
335939
- Using it as the default model.
335940
-
335941
- `
335942
- );
335943
- return autoSelectedModel;
335944
- }
335945
- if (!isInteractiveTerminal()) {
335946
- return suggestedModel;
335947
- }
335948
- return promptForDefaultModel(discoveredModels, suggestedModel);
335949
- }
335950
- async function ruidongInitHandler(options) {
335951
- const wizardOptions = shouldRunInitWizard(options) ? await runInitWizard(options) : options;
335952
- const optionsWithAliases = applyFriendlyAliases(wizardOptions);
335953
- const explicitDefaultModel = Boolean(optionsWithAliases.defaultModel);
335954
- const optionsWithProfile = applyProfilePreset(optionsWithAliases);
335955
- if (hasRuidongConfig() && !optionsWithProfile.force) {
335956
- if (await maybeConfirmOverwriteExistingConfig()) {
335957
- optionsWithProfile.force = true;
335958
- } else {
335959
- process.stdout.write("Init cancelled.\n");
335960
- process.exit(0);
335961
- }
335962
- }
335963
- const shouldMigrateHome = optionsWithProfile.migrateHome === true || process.env.RUIDONG_CONFIG_DIR === void 0 && process.env.CLAUDE_CONFIG_DIR === void 0;
335964
- const migrationResult = shouldMigrateHome ? migrateLegacyClaudeHomeToRuidongHome() : { migrated: false, copiedEntries: 0, copiedGlobalConfig: false };
335965
- const provider = optionsWithProfile.provider ?? "anthropic-compatible";
335966
- const resolvedOptions = {
335967
- ...optionsWithProfile,
335968
- provider
335969
- };
335970
- const defaultModel = await resolveDefaultModelChoice(
335971
- resolvedOptions,
335972
- explicitDefaultModel
335973
- );
335974
- const resolvedOptionsWithModel = {
335975
- ...resolvedOptions,
335976
- defaultModel
335977
- };
335978
- const authToken = resolveAuthTokenSetting(resolvedOptionsWithModel);
335979
- const config2 = {
335980
- provider: {
335981
- id: provider,
335982
- authMode: resolveAuthMode2(resolvedOptionsWithModel),
335983
- ...authToken ? { authToken } : { apiKey: resolveApiKeySetting(resolvedOptionsWithModel) },
335984
- ...resolvedOptionsWithModel.baseUrl && {
335985
- baseUrl: resolvedOptionsWithModel.baseUrl
335986
- },
335987
- ...resolvedOptionsWithModel.defaultModel && {
335988
- defaultModel: resolvedOptionsWithModel.defaultModel
335989
- }
335990
- },
335991
- marketplace: buildMarketplaceConfig(resolvedOptionsWithModel),
335992
- ...resolvedOptionsWithModel.officialMcpRegistryUrl && {
335993
- mcp: {
335994
- officialRegistryUrl: resolvedOptionsWithModel.officialMcpRegistryUrl
335995
- }
335996
- }
335997
- };
335998
- writeRuidongConfig(config2);
335999
- process.stdout.write(
336000
- `Ruidong config written to ${getRuidongConfigPath()}
336001
-
336002
- ${resolvedOptionsWithModel.profile ? `Profile: ${resolvedOptionsWithModel.profile}
336003
- ` : ""}Provider: ${config2.provider?.id ?? "anthropic-compatible"}
336004
- Auth mode: ${config2.provider?.authMode ?? "auto"}
336005
- Default model: ${config2.provider?.defaultModel ?? "not set (choose later with /model)"}
336006
- Official marketplace: ${config2.marketplace?.official?.name ?? "ruidong-marketplace-seed"}
336007
- ${config2.provider?.authToken ? `Credential storage: ${config2.provider.authToken.startsWith("env:") ? `env var ${config2.provider.authToken.slice(4)}` : "saved directly in config.json"}
336008
- ` : `Credential storage: ${config2.provider?.apiKey?.startsWith("env:") ? `env var ${config2.provider.apiKey.slice(4)}` : "saved directly in config.json"}
336009
- `}`
336010
- );
336011
- if (migrationResult.migrated) {
336012
- process.stdout.write(
336013
- `
336014
- Migrated legacy home into ${getRuidongConfigPath().replace(/\\/g, "/").replace(/\/config\.json$/, "")}
336015
- Copied home entries: ${String(migrationResult.copiedEntries)}
336016
- Copied global config: ${migrationResult.copiedGlobalConfig ? "yes" : "no"}
336017
- `
336018
- );
336019
- }
336020
- if (config2.provider?.apiKey?.startsWith("env:")) {
336021
- process.stdout.write(
336022
- `
336023
- Next step:
336024
- export ${config2.provider.apiKey.slice(4)}=your_api_key_here
336025
- `
336026
- );
336027
- }
336028
- if (config2.provider?.authToken?.startsWith("env:")) {
336029
- process.stdout.write(
336030
- `
336031
- Next step:
336032
- export ${config2.provider.authToken.slice(4)}=your_auth_token_here
336033
- `
336034
- );
336035
- }
336036
- if (!config2.provider?.defaultModel) {
336037
- process.stdout.write(
336038
- `
336039
- After launch:
336040
- run /model to choose a gateway model interactively
336041
- `
336042
- );
336043
- }
336044
- }
336045
- var INIT_PROFILE_PRESETS, MAX_DISCOVERED_MODELS_TO_PRINT;
336046
- var init_ruidongConfig2 = __esm({
336047
- "build-src/src/cli/handlers/ruidongConfig.ts"() {
336048
- init_ruidongConfig();
336049
- init_providerModelDiscovery();
336050
- INIT_PROFILE_PRESETS = {
336051
- crs: {
336052
- provider: "anthropic",
336053
- baseUrl: "http://18.141.210.162:3000/api",
336054
- authMode: "api-key",
336055
- defaultModel: "sonnet",
336056
- apiKeyEnv: "RUIDONG_API_KEY"
336057
- },
336058
- iruidong: {
336059
- provider: "anthropic-compatible",
336060
- baseUrl: "https://iruidong.com",
336061
- authMode: "auto",
336062
- defaultModel: "glm",
336063
- authTokenEnv: "RUIDONG_API_KEY"
336064
- }
336065
- };
336066
- MAX_DISCOVERED_MODELS_TO_PRINT = 25;
336067
- }
336068
- });
336069
-
336070
335602
  // build-src/src/cli/handlers/plugins.ts
336071
335603
  var plugins_exports = {};
336072
335604
  __export(plugins_exports, {
@@ -340280,13 +339812,6 @@ Auth: unix socket -R \u2192 local proxy`, "info");
340280
339812
  await runConnectHeadless(connectConfig, prompt, opts.outputFormat, interactive);
340281
339813
  });
340282
339814
  }
340283
- program.command("init").description("Create or update ~/.ruidong-code/config.json for Ruidong Code runtime configuration").option("--force", "Overwrite existing Ruidong config").option("--wizard", "Run the interactive setup wizard (default when no init options are provided)").option("--profile <profile>", "Quick profile preset: crs or iruidong").option("--endpoint <url>", "User-friendly alias for --base-url").option("--key <key>", "User-friendly provider key (auto-mapped to compatible auth settings)").option("--key-env <name>", "User-friendly alias to read provider key from env (example: RUIDONG_API_KEY)").option("--model <model>", "Optional alias for --default-model. If omitted, init can discover models or you can choose later via /model").option("--provider <provider>", "Provider id: anthropic, anthropic-compatible, deepseek, qwen, bedrock, vertex, or foundry").option("--base-url <url>", "Provider base URL (recommended for anthropic-compatible gateways)").option("--api-key <key>", "Write a direct API key into the config file").option("--api-key-env <name>", "Store an env reference instead of a raw key (default: RUIDONG_API_KEY)").option("--auth-token <token>", "Write a direct auth token into the config file (for relay/proxy deployments)").option("--auth-token-env <name>", "Store an env reference for auth token mode").option("--auth-mode <mode>", "Provider auth mode: auto, api-key, or bearer").option("--default-model <model>", "Optional default model. If omitted, init can discover models or you can choose later via /model").option("--official-marketplace-name <name>", "Official marketplace name to register", "ruidong-marketplace-seed").option("--official-marketplace-repo <repo>", "GitHub repo for the official marketplace", "Jackwwg83/ruidong-marketplace-seed").option("--official-marketplace-git-url <url>", "Git URL for the official marketplace").option("--official-marketplace-url <url>", "Direct URL for the official marketplace manifest").option("--official-marketplace-ref <ref>", "Git ref for the official marketplace").option("--official-marketplace-path <path>", "Path to marketplace.json inside the git repo").option("--official-marketplace-sparse <paths...>", "Sparse checkout paths for monorepo marketplace sources").option("--official-mcp-registry-url <url>", "URL for the official MCP registry feed").option("--migrate-home", "Copy missing files from legacy config home into ~/.ruidong-code before writing config").action(async (options) => {
340284
- const {
340285
- ruidongInitHandler: ruidongInitHandler2
340286
- } = await Promise.resolve().then(() => (init_ruidongConfig2(), ruidongConfig_exports));
340287
- await ruidongInitHandler2(options);
340288
- process.exit(0);
340289
- });
340290
339815
  const auth = program.command("auth").description("Manage authentication").configureHelp(createSortedHelpConfig());
340291
339816
  auth.command("login").description("Sign in to your Anthropic account").option("--email <email>", "Pre-populate email address on the login page").option("--sso", "Force SSO login flow").option("--console", "Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai", "Use Claude subscription (default)").action(async ({
340292
339817
  email,
@@ -340865,6 +340390,12 @@ async function main2() {
340865
340390
  console.log(`Ruidong Code v${PUBLIC_CLI_VERSION}`);
340866
340391
  return;
340867
340392
  }
340393
+ if (args[0] === "init") {
340394
+ console.error("`ruidong init` has been removed.");
340395
+ console.error("Configure your shell with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY, then run `ruidong`.");
340396
+ process.exitCode = 1;
340397
+ return;
340398
+ }
340868
340399
  const {
340869
340400
  profileCheckpoint: profileCheckpoint2
340870
340401
  } = await Promise.resolve().then(() => (init_startupProfiler(), startupProfiler_exports));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iruidong/code",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "Ruidong Code CLI for anthropic-compatible coding workflows",
5
5
  "type": "module",
6
6
  "private": false,