blun-king-cli 9.1.550 → 9.1.561

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.
@@ -7,9 +7,6 @@ const BOSNIAN_STANDALONE_CHAT = /^(?:zdravo|pozdrav|hvala|ćao|cao)[.!?]*$/iu;
7
7
  const IDENTITY_CHAT = /^(?:wer bist du|who are you|wie geht(?: es dir)?|how are you|na|kako si|kako je king|ko si ti|ko stoji iza tebe)[.!?]*$/iu;
8
8
  const STATUS_ONLY_CHECK_IN = /(?:\bstandabfrage\b|\bstatusabfrage\b|\bkurzes?\s+update\b|\bwo\s+stehst\s+du\b|\bwie\s+weit\s+bist\s+du\b|\bwhere\s+are\s+you\b|\bquick\s+status\b)/iu;
9
9
  const STATUS_FOLLOW_UP_ACTION = /\b(?:aendere|arbeite|baue|build|change|delete|deploy|deploye|fahr|fix|fixe|implement|implementiere|install|installiere|loesche|mach|patch|pruefe|repariere|run|schreibe|setze|start|starte|stop|stoppe|test|teste|write)\b/iu;
10
- const STANDALONE_CHAT_COMPLETION_TOKENS = 1024;
11
- const ADAPTIVE_LOW_COMPLETION_TOKENS = 4096;
12
- const STANDARD_TURN_MAX_COMPLETION_TOKENS = 24_576;
13
10
 
14
11
  function selectThinkingEffortForTurn(text, originKind) {
15
12
  if (originKind !== "user") return undefined;
@@ -45,25 +42,8 @@ function selectThinkingEffortForWorkStep(_stepNumber, _previousToolOutcome) {
45
42
  }
46
43
 
47
44
  function capCompletionBudgetForAdaptiveEffort(budget, thinkingEffort) {
48
- if ((thinkingEffort !== "off" && thinkingEffort !== "low") || budget === undefined) return budget;
49
- const configuredCap = budget.hardCap ?? budget.fallback;
50
- const adaptiveCap = thinkingEffort === "off"
51
- ? STANDALONE_CHAT_COMPLETION_TOKENS
52
- : ADAPTIVE_LOW_COMPLETION_TOKENS;
53
- return {
54
- ...budget,
55
- hardCap: Math.min(
56
- configuredCap ?? adaptiveCap,
57
- adaptiveCap,
58
- ),
59
- };
60
- }
61
-
62
- function capTurnCompletionTokens(maxOutputSize) {
63
- if (!Number.isFinite(maxOutputSize) || maxOutputSize <= 0) {
64
- return STANDARD_TURN_MAX_COMPLETION_TOKENS;
65
- }
66
- return Math.min(Math.floor(maxOutputSize), STANDARD_TURN_MAX_COMPLETION_TOKENS);
45
+ void thinkingEffort;
46
+ return budget;
67
47
  }
68
48
 
69
49
  function selectThinkingEffortForBufferedSteer(text, originKind) {
@@ -77,12 +57,8 @@ function selectThinkingEffortForBufferedSteer(text, originKind) {
77
57
 
78
58
  module.exports = {
79
59
  ACTIONABLE_PROMPT,
80
- ADAPTIVE_LOW_COMPLETION_TOKENS,
81
60
  EXPLICIT_THINKING_INTENT,
82
- STANDALONE_CHAT_COMPLETION_TOKENS,
83
- STANDARD_TURN_MAX_COMPLETION_TOKENS,
84
61
  capCompletionBudgetForAdaptiveEffort,
85
- capTurnCompletionTokens,
86
62
  selectThinkingEffortForBufferedSteer,
87
63
  selectThinkingEffortForWorkStep,
88
64
  selectThinkingEffortForTurn,
@@ -82,6 +82,15 @@ const ENDPOINT_LIMITS = new Map([
82
82
  [FALLBACK_MANIFEST_URL, 64 * 1024],
83
83
  ]);
84
84
 
85
+ function isInternalPackagePinned(packageRoot) {
86
+ try {
87
+ const manifest = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
88
+ return manifest?.blunUpdateChannel === 'internal';
89
+ } catch {
90
+ return false;
91
+ }
92
+ }
93
+
85
94
  function parseSemver(value) {
86
95
  if (typeof value !== 'string' || value.length > 128) return undefined;
87
96
  const match = SEMVER_PATTERN.exec(value);
@@ -1393,6 +1402,12 @@ async function runUpdateFlow(options, explicitUpdate) {
1393
1402
  const now = (options.now || Date.now)();
1394
1403
 
1395
1404
  const packageRoot = path.resolve(options.packageRoot || path.resolve(__dirname, '..'));
1405
+ if (isInternalPackagePinned(packageRoot)) {
1406
+ if (explicitUpdate) explicitNoTarget(stdout, 'current', currentVersion, uiLocale);
1407
+ return explicitUpdate
1408
+ ? { kind: 'current', reason: 'internal_channel' }
1409
+ : { kind: 'continue', reason: 'internal_channel' };
1410
+ }
1396
1411
  let leaseResult;
1397
1412
  const ownsNoticeLease = options.noticeLease === undefined;
1398
1413
  if (ownsNoticeLease) {
@@ -1632,6 +1647,7 @@ module.exports = {
1632
1647
  compareSemver,
1633
1648
  createInstallInvocation,
1634
1649
  installPinnedVersion,
1650
+ isInternalPackagePinned,
1635
1651
  preparePinnedInstaller,
1636
1652
  isInteractiveUpdateStart,
1637
1653
  loadReleaseSources,