@ngosangns/ns-bridge 0.1.8 → 0.1.10
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/dist/refresh-entry.js +23 -33
- package/package.json +1 -1
package/dist/refresh-entry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @ngosangns/ns-bridge 0.1.
|
|
1
|
+
// @ngosangns/ns-bridge 0.1.10 — catalog refresh bundle.
|
|
2
2
|
import { createRequire as __nsBridgeCreateRequire } from 'node:module';
|
|
3
3
|
const require = __nsBridgeCreateRequire(import.meta.url);
|
|
4
4
|
var __create = Object.create;
|
|
@@ -92431,7 +92431,7 @@ __export(kiro_cli_exports, {
|
|
|
92431
92431
|
saveKiroCliCredentials: () => saveKiroCliCredentials,
|
|
92432
92432
|
tryKiroCliToken: () => tryKiroCliToken
|
|
92433
92433
|
});
|
|
92434
|
-
import {
|
|
92434
|
+
import { execFile as execFile3, execSync } from "node:child_process";
|
|
92435
92435
|
import { existsSync as existsSync3 } from "node:fs";
|
|
92436
92436
|
import { createRequire } from "node:module";
|
|
92437
92437
|
import { homedir as homedir7, platform } from "node:os";
|
|
@@ -92669,14 +92669,20 @@ function saveKiroCliCredentials(creds) {
|
|
|
92669
92669
|
}
|
|
92670
92670
|
}
|
|
92671
92671
|
}
|
|
92672
|
-
function
|
|
92672
|
+
function runKiroCli(args, timeout) {
|
|
92673
|
+
return new Promise((resolve2, reject) => {
|
|
92674
|
+
execFile3("kiro-cli", args, { encoding: "utf-8", timeout }, (error, stdout) => {
|
|
92675
|
+
if (error)
|
|
92676
|
+
reject(error);
|
|
92677
|
+
else
|
|
92678
|
+
resolve2(stdout);
|
|
92679
|
+
});
|
|
92680
|
+
});
|
|
92681
|
+
}
|
|
92682
|
+
async function getKiroCliModelRates() {
|
|
92673
92683
|
let raw;
|
|
92674
92684
|
try {
|
|
92675
|
-
raw =
|
|
92676
|
-
encoding: "utf-8",
|
|
92677
|
-
timeout: 1e4,
|
|
92678
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
92679
|
-
});
|
|
92685
|
+
raw = await runKiroCli(["chat", "--list-models", "--format", "json"], 1e4);
|
|
92680
92686
|
} catch (error) {
|
|
92681
92687
|
debugLog("models.rates", { source: "kiro-cli", error: formatSafeError(error) });
|
|
92682
92688
|
return void 0;
|
|
@@ -92704,12 +92710,9 @@ function getKiroCliModelRates() {
|
|
|
92704
92710
|
return void 0;
|
|
92705
92711
|
}
|
|
92706
92712
|
}
|
|
92707
|
-
function refreshViaKiroCli() {
|
|
92713
|
+
async function refreshViaKiroCli() {
|
|
92708
92714
|
try {
|
|
92709
|
-
|
|
92710
|
-
timeout: 15e3,
|
|
92711
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
92712
|
-
});
|
|
92715
|
+
await runKiroCli(["debug", "refresh-auth-token"], 15e3);
|
|
92713
92716
|
return getKiroCliCredentials();
|
|
92714
92717
|
} catch (error) {
|
|
92715
92718
|
console.warn(`[kiro-core] kiro-cli refresh failed: ${formatSafeError(error)}`);
|
|
@@ -96426,7 +96429,6 @@ var GROK_BOOTSTRAP_MODEL_IDS = ["grok-4.7", "grok-4.7-build-fast", "grok-4.6", "
|
|
|
96426
96429
|
var GROK_DEFAULT_CONTEXT_WINDOW = 5e5;
|
|
96427
96430
|
var GROK_DEFAULT_MAX_TOKENS = 128e3;
|
|
96428
96431
|
var GROK_CATALOG_PROVIDER_ID = "grok";
|
|
96429
|
-
var GROK_DEFAULT_MODEL_ID = "grok-4.5";
|
|
96430
96432
|
var GROK_CATALOG_FILE = `${GROK_CATALOG_PROVIDER_ID}.models.json`;
|
|
96431
96433
|
function grokBootstrapModels() {
|
|
96432
96434
|
return GROK_BOOTSTRAP_MODEL_IDS.map((id) => ({
|
|
@@ -96590,13 +96592,13 @@ function getDefaultCatalogCache(options) {
|
|
|
96590
96592
|
return defaultCache;
|
|
96591
96593
|
}
|
|
96592
96594
|
|
|
96593
|
-
// ../grok-core/dist/
|
|
96595
|
+
// ../grok-core/dist/cli/binary.js
|
|
96594
96596
|
import { execFile } from "node:child_process";
|
|
96595
96597
|
import { accessSync, constants } from "node:fs";
|
|
96596
96598
|
import { homedir as homedir4 } from "node:os";
|
|
96597
96599
|
import { join as join4 } from "node:path";
|
|
96598
96600
|
var CANDIDATE_NAMES = ["agent", "grok"];
|
|
96599
|
-
var BINARY_ENV_NAMES = ["GROK_AGENT_BIN", "GROK_BIN"
|
|
96601
|
+
var BINARY_ENV_NAMES = ["GROK_AGENT_BIN", "GROK_BIN"];
|
|
96600
96602
|
function isExecutable(path6) {
|
|
96601
96603
|
try {
|
|
96602
96604
|
accessSync(path6, constants.X_OK);
|
|
@@ -96623,7 +96625,7 @@ async function resolveGrokBinary(env3 = process.env) {
|
|
|
96623
96625
|
const explicit = BINARY_ENV_NAMES.map((name) => env3[name]?.trim()).find(Boolean);
|
|
96624
96626
|
if (explicit) {
|
|
96625
96627
|
if (!isExecutable(explicit)) {
|
|
96626
|
-
throw new Error(`Configured Grok
|
|
96628
|
+
throw new Error(`Configured Grok binary is not executable: ${explicit}. Check ${BINARY_ENV_NAMES.join(" / ")}.`);
|
|
96627
96629
|
}
|
|
96628
96630
|
return explicit;
|
|
96629
96631
|
}
|
|
@@ -96638,10 +96640,10 @@ async function resolveGrokBinary(env3 = process.env) {
|
|
|
96638
96640
|
if (isExecutable(candidate))
|
|
96639
96641
|
return candidate;
|
|
96640
96642
|
}
|
|
96641
|
-
throw new Error("Grok
|
|
96643
|
+
throw new Error("Grok CLI not found. Install/authenticate the xAI Grok CLI (`agent` or `grok` on PATH, or ~/.grok/bin). Then run: agent --version");
|
|
96642
96644
|
}
|
|
96643
96645
|
|
|
96644
|
-
// ../grok-core/dist/
|
|
96646
|
+
// ../grok-core/dist/cli/models.js
|
|
96645
96647
|
import { execFile as execFile2 } from "node:child_process";
|
|
96646
96648
|
function grokContextWindowsFromCache(raw) {
|
|
96647
96649
|
const windows = /* @__PURE__ */ new Map();
|
|
@@ -96720,7 +96722,6 @@ async function discoverGrokModels(binary, contextWindows) {
|
|
|
96720
96722
|
}
|
|
96721
96723
|
|
|
96722
96724
|
// ../pi-provider/src/grok/config.ts
|
|
96723
|
-
var DEFAULT_MODEL_ID = GROK_DEFAULT_MODEL_ID;
|
|
96724
96725
|
var THINKING_LEVEL_MAP = {
|
|
96725
96726
|
off: "none",
|
|
96726
96727
|
minimal: "minimal",
|
|
@@ -96761,18 +96762,7 @@ function toProviderModel(d) {
|
|
|
96761
96762
|
};
|
|
96762
96763
|
}
|
|
96763
96764
|
function toProviderModels(descriptors) {
|
|
96764
|
-
|
|
96765
|
-
const hasDefault = models.some((m2) => m2.id === DEFAULT_MODEL_ID);
|
|
96766
|
-
const hasLegacyAlias = models.some((m2) => m2.id === "grok-4.5-agent");
|
|
96767
|
-
if (hasDefault && !hasLegacyAlias) {
|
|
96768
|
-
const base = models.find((m2) => m2.id === DEFAULT_MODEL_ID);
|
|
96769
|
-
models.push({
|
|
96770
|
-
...base,
|
|
96771
|
-
id: "grok-4.5-agent",
|
|
96772
|
-
name: `${base.name} (legacy alias)`
|
|
96773
|
-
});
|
|
96774
|
-
}
|
|
96775
|
-
return models;
|
|
96765
|
+
return descriptors.map(toProviderModel);
|
|
96776
96766
|
}
|
|
96777
96767
|
|
|
96778
96768
|
// ../../node_modules/.pnpm/@earendil-works+pi-ai@1.1.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signatur_b86043277c99936d7a9ffd4d41485846/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js
|
|
@@ -99191,7 +99181,7 @@ async function updateKiroModelsCache(accessToken, region, profileArn) {
|
|
|
99191
99181
|
const { fetchKiroModelCatalog: fetchKiroModelCatalog2 } = await Promise.resolve().then(() => (init_management(), management_exports));
|
|
99192
99182
|
const { getKiroCliModelRates: getKiroCliModelRates2 } = await Promise.resolve().then(() => (init_kiro_cli(), kiro_cli_exports));
|
|
99193
99183
|
const response = await fetchKiroModelCatalog2({ accessToken, region }, profileArn);
|
|
99194
|
-
const models = mapKiroCatalogModels(response.models, region, getKiroCliModelRates2());
|
|
99184
|
+
const models = mapKiroCatalogModels(response.models, region, await getKiroCliModelRates2());
|
|
99195
99185
|
const cache = readManagementCache() ?? {
|
|
99196
99186
|
version: KIRO_MANAGEMENT_CACHE_VERSION,
|
|
99197
99187
|
source: KIRO_MANAGEMENT_CACHE_SOURCE,
|