@iruidong/code 0.1.3 → 0.1.5

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,7 +10,7 @@ ruidong --version
10
10
  Expected output:
11
11
 
12
12
  ```bash
13
- Ruidong Code v0.1.3
13
+ Ruidong Code v0.1.5
14
14
  ```
15
15
 
16
16
  ## 2. Initialize provider config
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ruidong v0.1.3 (built from source)
2
+ // ruidong v0.1.5 (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,7 +81,7 @@ 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.3";
84
+ PUBLIC_CLI_VERSION = "0.1.5";
85
85
  BUILD_TIME = "2026-04-01T06:00:31.912Z";
86
86
  API_COMPAT_VERSION = "2.1.88";
87
87
  API_COMPAT_VERSION_BASE = API_COMPAT_VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/)?.[0];
@@ -13083,15 +13083,15 @@ function setEnvIfUnset(key, value) {
13083
13083
  }
13084
13084
  process.env[key] = value;
13085
13085
  }
13086
- function applyProviderFlags(providerId) {
13087
- const providerFlagKeys = [
13088
- "CLAUDE_CODE_USE_BEDROCK",
13089
- "CLAUDE_CODE_USE_VERTEX",
13090
- "CLAUDE_CODE_USE_FOUNDRY"
13091
- ];
13092
- if (providerFlagKeys.some((key) => process.env[key] !== void 0)) {
13086
+ function setManagedEnv(key, value) {
13087
+ const normalizedValue = value?.trim();
13088
+ if (!normalizedValue) {
13089
+ delete process.env[key];
13093
13090
  return;
13094
13091
  }
13092
+ process.env[key] = normalizedValue;
13093
+ }
13094
+ function applyProviderFlags(providerId) {
13095
13095
  switch (providerId) {
13096
13096
  case "bedrock":
13097
13097
  process.env.CLAUDE_CODE_USE_BEDROCK = "1";
@@ -13115,6 +13115,39 @@ function applyProviderFlags(providerId) {
13115
13115
  break;
13116
13116
  }
13117
13117
  }
13118
+ function selectConfiguredCredential(provider) {
13119
+ const hasConfiguredApiKey = provider.apiKey !== void 0;
13120
+ const hasConfiguredAuthToken = provider.authToken !== void 0;
13121
+ if (!hasConfiguredApiKey && !hasConfiguredAuthToken) {
13122
+ return null;
13123
+ }
13124
+ const authMode = provider.authMode ?? "auto";
13125
+ if (authMode === "api-key") {
13126
+ return "api-key";
13127
+ }
13128
+ if (authMode === "bearer") {
13129
+ return "bearer";
13130
+ }
13131
+ if (hasConfiguredAuthToken) {
13132
+ return "bearer";
13133
+ }
13134
+ return "api-key";
13135
+ }
13136
+ function applyProviderCredentialEnv(provider) {
13137
+ const selectedCredential = selectConfiguredCredential(provider);
13138
+ if (!selectedCredential) {
13139
+ return;
13140
+ }
13141
+ const resolvedApiKey = resolveSecretValue(provider.apiKey);
13142
+ const resolvedAuthToken = resolveSecretValue(provider.authToken);
13143
+ if (selectedCredential === "api-key") {
13144
+ setManagedEnv("ANTHROPIC_API_KEY", resolvedApiKey ?? resolvedAuthToken);
13145
+ delete process.env.ANTHROPIC_AUTH_TOKEN;
13146
+ return;
13147
+ }
13148
+ setManagedEnv("ANTHROPIC_AUTH_TOKEN", resolvedAuthToken ?? resolvedApiKey);
13149
+ delete process.env.ANTHROPIC_API_KEY;
13150
+ }
13118
13151
  function applyOfficialMarketplaceConfig(official) {
13119
13152
  if (!official) {
13120
13153
  return;
@@ -13156,11 +13189,16 @@ function applyRuidongRuntimeConfig() {
13156
13189
  const provider = config2.provider;
13157
13190
  if (provider) {
13158
13191
  applyProviderFlags(provider.id);
13159
- setEnvIfUnset("ANTHROPIC_BASE_URL", provider.baseUrl);
13160
- setEnvIfUnset("ANTHROPIC_API_KEY", resolveSecretValue(provider.apiKey));
13161
- setEnvIfUnset("ANTHROPIC_AUTH_TOKEN", resolveSecretValue(provider.authToken));
13162
- setEnvIfUnset("ANTHROPIC_AUTH_MODE", provider.authMode ?? "auto");
13163
- setEnvIfUnset("ANTHROPIC_MODEL", provider.defaultModel);
13192
+ if (provider.baseUrl !== void 0) {
13193
+ setManagedEnv("ANTHROPIC_BASE_URL", provider.baseUrl);
13194
+ }
13195
+ applyProviderCredentialEnv(provider);
13196
+ if (provider.authMode !== void 0) {
13197
+ setManagedEnv("ANTHROPIC_AUTH_MODE", provider.authMode);
13198
+ }
13199
+ if (provider.defaultModel !== void 0) {
13200
+ setManagedEnv("ANTHROPIC_MODEL", provider.defaultModel);
13201
+ }
13164
13202
  }
13165
13203
  applyOfficialMarketplaceConfig(config2.marketplace?.official);
13166
13204
  setEnvIfUnset(
@@ -75104,7 +75142,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
75104
75142
  {
75105
75143
  name: "ruidong-code",
75106
75144
  title: "ruidong",
75107
- version: "0.1.3",
75145
+ version: "0.1.5",
75108
75146
  description: "Ruidong Code agentic coding tool",
75109
75147
  websiteUrl: PRODUCT_URL
75110
75148
  },
@@ -75527,7 +75565,7 @@ var init_client3 = __esm({
75527
75565
  {
75528
75566
  name: "ruidong-code",
75529
75567
  title: "ruidong",
75530
- version: "0.1.3",
75568
+ version: "0.1.5",
75531
75569
  description: "Ruidong Code agentic coding tool",
75532
75570
  websiteUrl: PRODUCT_URL
75533
75571
  },
@@ -87226,7 +87264,7 @@ async function installGlobalPackage(specificVersion) {
87226
87264
  );
87227
87265
  logEvent("tengu_auto_updater_lock_contention", {
87228
87266
  pid: process.pid,
87229
- currentVersion: "0.1.3"
87267
+ currentVersion: "0.1.5"
87230
87268
  });
87231
87269
  return "in_progress";
87232
87270
  }
@@ -87235,7 +87273,7 @@ async function installGlobalPackage(specificVersion) {
87235
87273
  if (!env.isRunningWithBun() && env.isNpmFromWindowsPath()) {
87236
87274
  logError(new Error("Windows NPM detected in WSL environment"));
87237
87275
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
87238
- currentVersion: "0.1.3"
87276
+ currentVersion: "0.1.5"
87239
87277
  });
87240
87278
  console.error(`
87241
87279
  Error: Windows NPM detected in WSL
@@ -87902,7 +87940,7 @@ function detectLinuxGlobPatternWarnings() {
87902
87940
  }
87903
87941
  async function getDoctorDiagnostic() {
87904
87942
  const installationType = await getCurrentInstallationType();
87905
- const version2 = typeof MACRO !== "undefined" && "0.1.3" ? "0.1.3" : "unknown";
87943
+ const version2 = typeof MACRO !== "undefined" && "0.1.5" ? "0.1.5" : "unknown";
87906
87944
  const installationPath = await getInstallationPath();
87907
87945
  const invokedBinary = getInvokedBinary();
87908
87946
  const multipleInstallations = await detectMultipleInstallations();
@@ -88982,7 +89020,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
88982
89020
  version2 = maxVersion;
88983
89021
  }
88984
89022
  }
88985
- if (!forceReinstall && version2 === "0.1.3" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
89023
+ if (!forceReinstall && version2 === "0.1.5" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
88986
89024
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
88987
89025
  logEvent("tengu_native_update_complete", {
88988
89026
  latency_ms: Date.now() - startTime,
@@ -185165,6 +185203,10 @@ function useTextInput({
185165
185203
  }
185166
185204
  return cursor.del();
185167
185205
  }
185206
+ function submitCurrentValue() {
185207
+ onSubmit?.(originalValue);
185208
+ return cursor;
185209
+ }
185168
185210
  function killToLineEnd() {
185169
185211
  const { cursor: newCursor, killed } = cursor.deleteToLineEnd();
185170
185212
  pushToKillRing(killed, "append");
@@ -185211,7 +185253,11 @@ function useTextInput({
185211
185253
  ["e", () => cursor.endOfLine()],
185212
185254
  ["f", () => cursor.right()],
185213
185255
  ["h", () => cursor.deleteTokenBefore() ?? cursor.backspace()],
185256
+ // Some terminal/IME combinations swallow plain Enter in raw mode.
185257
+ // Keep Ctrl+J / Ctrl+M as reliable submit fallbacks.
185258
+ ["j", submitCurrentValue],
185214
185259
  ["k", killToLineEnd],
185260
+ ["m", submitCurrentValue],
185215
185261
  ["n", () => downOrHistoryDown()],
185216
185262
  ["p", () => upOrHistoryUp()],
185217
185263
  ["u", killToLineStart],
@@ -187834,7 +187880,7 @@ ${sanitizedDescription}
187834
187880
  **Environment Info**
187835
187881
  - Platform: ${env.platform}
187836
187882
  - Terminal: ${env.terminal}
187837
- - Version: ${"0.1.3"}
187883
+ - Version: ${"0.1.5"}
187838
187884
  - Feedback ID: ${feedbackId}
187839
187885
 
187840
187886
  **Errors**
@@ -218411,6 +218457,11 @@ function extractConversationText(messages) {
218411
218457
  const text = parts.join("\n");
218412
218458
  return text.length > MAX_CONVERSATION_TEXT ? text.slice(-MAX_CONVERSATION_TEXT) : text;
218413
218459
  }
218460
+ function normalizeJsonLikeResponse(text) {
218461
+ const trimmed = text.trim();
218462
+ const fencedMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
218463
+ return fencedMatch?.[1]?.trim() || trimmed;
218464
+ }
218414
218465
  async function generateSessionTitle(description, signal) {
218415
218466
  const trimmed = description.trim();
218416
218467
  if (!trimmed) return null;
@@ -218442,7 +218493,8 @@ async function generateSessionTitle(description, signal) {
218442
218493
  }
218443
218494
  });
218444
218495
  const text = extractTextContent(result.message.content);
218445
- const parsed = titleSchema().safeParse(safeParseJSON(text));
218496
+ const normalizedText = normalizeJsonLikeResponse(text);
218497
+ const parsed = titleSchema().safeParse(safeParseJSON(normalizedText));
218446
218498
  const title = parsed.success ? parsed.data.title.trim() || null : null;
218447
218499
  logEvent("tengu_session_title_generated", { success: title !== null });
218448
218500
  return title;
@@ -254142,7 +254194,7 @@ function generateHtmlReport(data, insights) {
254142
254194
  </html>`;
254143
254195
  }
254144
254196
  function buildExportData(data, insights, facets, remoteStats) {
254145
- const version2 = typeof MACRO !== "undefined" ? "0.1.3" : "unknown";
254197
+ const version2 = typeof MACRO !== "undefined" ? "0.1.5" : "unknown";
254146
254198
  const remote_hosts_collected = remoteStats?.hosts.filter((h) => h.sessionCount > 0).map((h) => h.name);
254147
254199
  const facets_summary = {
254148
254200
  total: facets.size,
@@ -257906,7 +257958,7 @@ var init_sessionStorage = __esm({
257906
257958
  init_settings2();
257907
257959
  init_slowOperations();
257908
257960
  init_uuid();
257909
- VERSION2 = typeof MACRO !== "undefined" ? "0.1.3" : "unknown";
257961
+ VERSION2 = typeof MACRO !== "undefined" ? "0.1.5" : "unknown";
257910
257962
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
257911
257963
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
257912
257964
  EPHEMERAL_PROGRESS_TYPES = /* @__PURE__ */ new Set([
@@ -305523,7 +305575,7 @@ async function _temp199() {
305523
305575
  logForDebugging("Showing marketplace installation success notification");
305524
305576
  notifs.push({
305525
305577
  key: "marketplace-installed",
305526
- jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "success", children: "\u2713 Anthropic marketplace installed \xB7 /plugin to see available plugins" }),
305578
+ jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "success", children: "\u2713 Ruidong marketplace installed \xB7 /plugin to see available plugins" }),
305527
305579
  priority: "immediate",
305528
305580
  timeoutMs: 7e3
305529
305581
  });
@@ -305532,7 +305584,7 @@ async function _temp199() {
305532
305584
  logForDebugging("Showing marketplace installation failure notification");
305533
305585
  notifs.push({
305534
305586
  key: "marketplace-install-failed",
305535
- jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "warning", children: "Failed to install Anthropic marketplace \xB7 Will retry on next startup" }),
305587
+ jsx: /* @__PURE__ */ jsx444(ThemedText, { color: "warning", children: "Failed to install Ruidong marketplace \xB7 Will retry on next startup" }),
305536
305588
  priority: "immediate",
305537
305589
  timeoutMs: 8e3
305538
305590
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iruidong/code",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Ruidong Code CLI for anthropic-compatible coding workflows",
5
5
  "type": "module",
6
6
  "private": false,