@link-assistant/hive-mind 2.11.13 → 2.12.1
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/CHANGELOG.md +18 -0
- package/package.json +4 -1
- package/src/agent-command.lib.mjs +74 -0
- package/src/agent.lib.mjs +59 -34
- package/src/agentic-cli-updater.lib.mjs +241 -0
- package/src/claude.connection.lib.mjs +209 -0
- package/src/claude.lib.mjs +6 -202
- package/src/codex.lib.mjs +0 -128
- package/src/formal-ai-isolation.lib.mjs +62 -0
- package/src/formal-ai-maintenance.lib.mjs +106 -0
- package/src/formal-ai-model.lib.mjs +25 -0
- package/src/formal-ai-runtime.lib.mjs +10 -0
- package/src/formal-ai-sidecar.lib.mjs +565 -0
- package/src/formal-ai-updater.lib.mjs +294 -0
- package/src/formal-ai-version.lib.mjs +100 -0
- package/src/formal-ai.lib.mjs +11 -16
- package/src/github-rate-limit.lib.mjs +3 -0
- package/src/github-url-parser.lib.mjs +255 -0
- package/src/github.lib.mjs +22 -343
- package/src/hive.mjs +0 -152
- package/src/interactive-mode.lib.mjs +0 -43
- package/src/isolation-runner.lib.mjs +44 -173
- package/src/limits.lib.mjs +0 -89
- package/src/model-args.lib.mjs +32 -0
- package/src/models/index.mjs +5 -19
- package/src/session-monitor.lib.mjs +14 -172
- package/src/solve.auto-merge.lib.mjs +70 -164
- package/src/solve.mjs +31 -193
- package/src/solve.repository.lib.mjs +0 -83
- package/src/solve.results.lib.mjs +2 -92
- package/src/solve.session.lib.mjs +52 -19
- package/src/solve.tool-uncommitted.lib.mjs +22 -0
- package/src/state-lock.lib.mjs +82 -0
- package/src/telegram-bot.mjs +17 -65
- package/src/telegram-fix-command.lib.mjs +1 -8
- package/src/telegram-merge-queue.lib.mjs +3 -155
- package/src/telegram-solve-queue.lib.mjs +9 -168
- package/src/telegram-task-command.lib.mjs +1 -8
- package/src/use-m-bootstrap.lib.mjs +6 -5
- package/src/use-with-retry.lib.mjs +128 -2
- package/src/working-session-summary.lib.mjs +47 -1
package/src/models/index.mjs
CHANGED
|
@@ -23,13 +23,16 @@ if (typeof globalThis.use === 'undefined') {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
import { log } from '../lib.mjs';
|
|
26
|
+
import { FORMAL_AI_MODEL_ALIAS, FORMAL_AI_PROVIDER_MODEL_ID, isFormalAiModel } from '../formal-ai-model.lib.mjs';
|
|
26
27
|
|
|
27
28
|
const execFileAsync = promisify(execFile);
|
|
28
29
|
|
|
29
30
|
// ─── MODEL DATA ──────────────────────────────────────────────────────────────
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
// Defined in a leaf module so callers that only need the identity check (the
|
|
33
|
+
// Formal AI sidecar lifecycle, issue #2146) do not have to import this catalogue
|
|
34
|
+
// and its `use-m` bootstrap. Re-exported here so the public surface is unchanged.
|
|
35
|
+
export { FORMAL_AI_MODEL_ALIAS, FORMAL_AI_PROVIDER_MODEL_ID, isFormalAiModel } from '../formal-ai-model.lib.mjs';
|
|
33
36
|
|
|
34
37
|
const formalAiNativeModelAliases = {
|
|
35
38
|
[FORMAL_AI_MODEL_ALIAS]: FORMAL_AI_MODEL_ALIAS,
|
|
@@ -40,9 +43,6 @@ const formalAiProviderModelAliases = {
|
|
|
40
43
|
[FORMAL_AI_MODEL_ALIAS]: FORMAL_AI_PROVIDER_MODEL_ID,
|
|
41
44
|
[FORMAL_AI_PROVIDER_MODEL_ID]: FORMAL_AI_PROVIDER_MODEL_ID,
|
|
42
45
|
};
|
|
43
|
-
|
|
44
|
-
export const isFormalAiModel = model => model === FORMAL_AI_MODEL_ALIAS || model === FORMAL_AI_PROVIDER_MODEL_ID;
|
|
45
|
-
|
|
46
46
|
// Claude models (Anthropic API)
|
|
47
47
|
// Updated for Opus 4.5/4.6/4.7/4.8/5, Sonnet 4.6/5, and Fable 5 / Mythos 5 support
|
|
48
48
|
// (Issue #1221, Issue #1238, Issue #1329, Issue #1433, Issue #1620, Issue #1832, Issue #1875, Issue #2003, Issue #2096)
|
|
@@ -197,7 +197,6 @@ export const getLatestCodexGenerationAliases = (models = codexModels) => {
|
|
|
197
197
|
|
|
198
198
|
return latestCompleteGeneration?.[1] || {};
|
|
199
199
|
};
|
|
200
|
-
|
|
201
200
|
const getCodexModelVariants = () => {
|
|
202
201
|
const bareModels = [...new Set(Object.values(codexModels).map(modelId => modelId.replace(OPENAI_MODEL_PREFIX_PATTERN, '')))];
|
|
203
202
|
const aliases = getLatestCodexGenerationAliases();
|
|
@@ -310,7 +309,6 @@ export const freeToBaseModelMap = {
|
|
|
310
309
|
// These extend the base maps with full model ID identity entries for validation
|
|
311
310
|
// (e.g., 'claude-sonnet-4-5-20250929' → 'claude-sonnet-4-5-20250929')
|
|
312
311
|
// so that full model IDs are also accepted as valid inputs
|
|
313
|
-
|
|
314
312
|
export const CLAUDE_MODELS = {
|
|
315
313
|
...claudeModels,
|
|
316
314
|
'claude-fable-5': 'claude-fable-5', // Fable 5 full ID (Issue #1875)
|
|
@@ -431,7 +429,6 @@ export const getModelMapForTool = tool => {
|
|
|
431
429
|
export const getDefaultModelForTool = tool => {
|
|
432
430
|
return defaultModels[tool] || defaultModels.claude;
|
|
433
431
|
};
|
|
434
|
-
|
|
435
432
|
let cachedInstalledCodexModelsPromise = null;
|
|
436
433
|
// Issue #2027: With gpt-5.6-sol as the preferred default, the fallback chain is only
|
|
437
434
|
// consulted when Sol is absent from the local catalog. Issue #2037 (review): order by
|
|
@@ -505,7 +502,6 @@ export const mapModelForTool = (tool, model) => {
|
|
|
505
502
|
return model;
|
|
506
503
|
}
|
|
507
504
|
};
|
|
508
|
-
|
|
509
505
|
/**
|
|
510
506
|
* Validate if a model is compatible with a tool
|
|
511
507
|
* @param {string} tool - The tool name (claude, agent, opencode, codex, qwen, gemini)
|
|
@@ -606,7 +602,6 @@ export const validateToolModelCompatibility = (tool, model) => {
|
|
|
606
602
|
};
|
|
607
603
|
|
|
608
604
|
// ─── MODEL VALIDATION FUNCTIONS ──────────────────────────────────────────────
|
|
609
|
-
|
|
610
605
|
/**
|
|
611
606
|
* Get the model map for a given tool (validation-extended version with full ID entries)
|
|
612
607
|
* @param {string} tool - The tool name ('claude', 'opencode', 'codex', 'agent', 'qwen', 'gemini')
|
|
@@ -712,7 +707,6 @@ export const findSimilarModels = (input, validModels, maxSuggestions = 3, maxDis
|
|
|
712
707
|
.sort((a, b) => a.distance - b.distance)
|
|
713
708
|
.slice(0, maxSuggestions)
|
|
714
709
|
.map(({ model }) => model);
|
|
715
|
-
|
|
716
710
|
return suggestions;
|
|
717
711
|
};
|
|
718
712
|
|
|
@@ -766,7 +760,6 @@ export const supports1mContext = (model, tool = 'claude') => {
|
|
|
766
760
|
|
|
767
761
|
return false;
|
|
768
762
|
};
|
|
769
|
-
|
|
770
763
|
/**
|
|
771
764
|
* Validate a model name against the available models for a tool
|
|
772
765
|
* Supports [1m] suffix for 1 million token context (Issue #1221)
|
|
@@ -826,7 +819,6 @@ export const validateModelName = (model, tool = 'claude') => {
|
|
|
826
819
|
if (suggestions.length > 0) {
|
|
827
820
|
message += `\n Did you mean: ${suggestions.map(s => `"${s}"`).join(', ')}?`;
|
|
828
821
|
}
|
|
829
|
-
|
|
830
822
|
message += `\n Available models for ${tool}: ${shortNames.join(', ')}`;
|
|
831
823
|
|
|
832
824
|
if (tool === 'claude') {
|
|
@@ -885,7 +877,6 @@ export const validateClaudeSubAgentModelName = model => {
|
|
|
885
877
|
mappedModel: normalized,
|
|
886
878
|
};
|
|
887
879
|
}
|
|
888
|
-
|
|
889
880
|
return validation;
|
|
890
881
|
};
|
|
891
882
|
|
|
@@ -949,7 +940,6 @@ export const validateAndExitOnInvalidClaudeSubAgentModel = async (model, tool =
|
|
|
949
940
|
|
|
950
941
|
if (!result.valid) {
|
|
951
942
|
await log(`❌ Invalid --sub-agent-model: ${result.message}`, { level: 'error' });
|
|
952
|
-
|
|
953
943
|
if (exitFn) {
|
|
954
944
|
await exitFn(1, 'Invalid sub-agent model name');
|
|
955
945
|
} else {
|
|
@@ -1048,7 +1038,6 @@ export const fetchModelInfoForComment = async modelId => {
|
|
|
1048
1038
|
if (!apiData) return null;
|
|
1049
1039
|
|
|
1050
1040
|
const lookupId = modelId.includes('/') ? modelId.split('/').pop() : modelId;
|
|
1051
|
-
|
|
1052
1041
|
if (apiData.anthropic?.models?.[lookupId]) {
|
|
1053
1042
|
const modelInfo = { ...apiData.anthropic.models[lookupId] };
|
|
1054
1043
|
modelInfo.provider = apiData.anthropic.name || 'Anthropic';
|
|
@@ -1152,7 +1141,6 @@ export const buildModelInfoString = ({ requestedModel = null, tool = null, prici
|
|
|
1152
1141
|
if (!hasRequested && !hasModelsUsed && !hasModelInfo && !hasPricingModel) return '';
|
|
1153
1142
|
|
|
1154
1143
|
let info = '\n\n### \uD83E\uDD16 **Models used:**';
|
|
1155
|
-
|
|
1156
1144
|
if (tool) {
|
|
1157
1145
|
info += `\n- Tool: ${getToolDisplayName(tool)}`;
|
|
1158
1146
|
}
|
|
@@ -1239,7 +1227,6 @@ export const buildModelInfoString = ({ requestedModel = null, tool = null, prici
|
|
|
1239
1227
|
|
|
1240
1228
|
return info;
|
|
1241
1229
|
};
|
|
1242
|
-
|
|
1243
1230
|
/**
|
|
1244
1231
|
* Resolve the full model ID from a user-provided alias using the model mapping.
|
|
1245
1232
|
* @param {string|null} requestedModel - The model alias (e.g., "opus", "sonnet")
|
|
@@ -1340,7 +1327,6 @@ export const getModelInfoForComment = async ({ requestedModel = null, tool = nul
|
|
|
1340
1327
|
}
|
|
1341
1328
|
|
|
1342
1329
|
const firstModelInfo = modelsUsed.length > 0 ? modelsUsed[0].modelInfo : null;
|
|
1343
|
-
|
|
1344
1330
|
return buildModelInfoString({
|
|
1345
1331
|
requestedModel,
|
|
1346
1332
|
tool,
|