@chibitek/chibi 0.1.177 → 0.1.179
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/assets/{abnfDiagram-O67JEVCF-D66KKLXq.js → abnfDiagram-O67JEVCF-BFpvXOmW.js} +1 -1
- package/dist/assets/{arc-Chl6g0yq.js → arc-0cz8QAA9.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-ChT8017v.js → architectureDiagram-NJMV4G6O-DxG1U8Tf.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-DSOAtPXh.js → blockDiagram-BEXU5L5S-DdpIUUid.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-CAyzcis4.js → c4Diagram-YGBWAQC7-CNB5U3O1.js} +1 -1
- package/dist/assets/channel-DktfdxuU.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-DG7zWvl1.js → chunk-2Q5K7J3B-DixTESOo.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-CNQ37WCV.js → chunk-3FUC2YCW-9KbkQg_1.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-Dvv3U9Ci.js → chunk-5VM5RSS4-DMNRleww.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-DyQrY0Ij.js → chunk-GTNCS2PH-kxGMXg9R.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-BLgrTe-Y.js → chunk-GWA4HPMP-B7sa9Us9.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-Bi7RU6mT.js → chunk-JWPE2WC7-BF65Wqy-.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-bBBVBfAd.js → chunk-NETBCI7D-Du36YO_k.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-CE_h60fU.js → chunk-WEXAMYUT-BMTNPIkJ.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-f6P9rCRq.js → chunk-XXDRQBXY-BqdQPY5v.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-6Uq3JzmJ.js → classDiagram-v2-NBCMYWYE-DYSOprmY.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-BxvkL31E.js → cose-bilkent-JH36ORCC-DXKY6FnT.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-Dlcwlw2F.js → cynefin-OW5HDTMX-DamnOWMn.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-D3NOeWUy.js → cynefinDiagram-VND7K2PF-Bb-wuGye.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-IGmT7nsP.js → dagre-6A5THRUB-DVMvGhu7.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-D0K8tG3k.js → diagram-22UHCM2B-BX4_NJ2M.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-CSkDkOvw.js → diagram-3UASUU5V-4J3gjVZn.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-CX5EXBJ_.js → diagram-ATOU4E4O-Bbune_ll.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-D0FQ7x1J.js → diagram-CDSNMT55-EEDiwifm.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-BymN_w7h.js → diagram-MLGK6HIB-D5lseSZO.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-ugKqp8yy.js → diagram-MPIPVDR6-isxlwvOO.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-DROFb0r3.js → ebnfDiagram-ZINNZB2B-DXhf0QK8.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-CNVCU2l7.js → elk-276RUBZZ-rR6aJBHM.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-BQj5bZ7y.js → erDiagram-OPXOYQCR-DRIV4t6Y.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-C3cBXKRL.js → flowDiagram-KWPJA3E3-BT3z2JmZ.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-CdNdC_Vp.js → ganttDiagram-FUAMR5RP-CR0drs2s.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-v_LM9fGO.js → gitGraphDiagram-X574FWY7-BrjfMmlB.js} +1 -1
- package/dist/assets/{index-fnHp_1ly.js → index-BISPpSBx.js} +1 -1
- package/dist/assets/index-CI0vGAif.css +1 -0
- package/dist/assets/{index-UICHeO5x.js → index-DAGHO7rw.js} +197 -195
- package/dist/assets/{infoDiagram-VRGFBTTK-0fzWO21Z.js → infoDiagram-VRGFBTTK-fIajbwUK.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-BmqyKWCK.js → ishikawaDiagram-OU5B5YK6-DlOC_sEC.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-BSihTjOI.js → journeyDiagram-ZHPQQLJL-BY4NF3Iq.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-LAP03jiI.js → kanban-definition-PNTS6WVX-CjcD7Qp-.js} +1 -1
- package/dist/assets/{linear-BoSfZT4X.js → linear-D2XvBjOb.js} +1 -1
- package/dist/assets/{mermaid.core-KciMRs_R.js → mermaid.core-DbXyvZNy.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-CEGLBEfc.js → mindmap-definition-NLK3R4M7-rjla1J-s.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-DLwMHvoR.js → pegDiagram-GJSIUBJH-hvEPNypQ.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-DHnlu96s.js → pieDiagram-5QR66LMP-D-jjzmff.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-C_aIseXA.js → quadrantDiagram-O4NWA36T-DJsTKR54.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-DOXDQ14n.js → railroadDiagram-XR7U4H2S-CgA8NcMY.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-C49u1hle.js → requirementDiagram-PLB6GJNP-D5BkeVLA.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-TO8i3aYk.js → sankeyDiagram-IPEJSGJF-lEfgZleC.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-CqByM3om.js → sequenceDiagram-PO4LG4MO-iDpAQv2z.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-BVsTiKjg.js → sizeCapture-INFHLROL-hEJsAOhI.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-0AUlHnV-.js → stateDiagram-v2-GCMORJYK-CKDZvZXj.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-D_wUrvq4.js → swimlanes-2SLR337P-_dOmzve2.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BROCOsEt.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-qf2wxQef.js → timeline-definition-EJHVYXUP-9GwS2a9Y.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-Blqc8FjE.js → usecaseDiagram-POWQR4AR-CqJl0zf1.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-Df3HJl0f.js → vennDiagram-UO4OBE2U-CGQiSSZm.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-B-QhMirM.js → wardleyDiagram-VNRHLVJA-D4KBo3Q_.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-DsZdyUlm.js → xychartDiagram-PMCCYNJV-BgvRJLNL.js} +1 -1
- package/dist/index.html +2 -2
- package/dist-server/drivers/agents-proxy.js +3 -2
- package/dist-server/index.js +1843 -1624
- package/dist-server/openmausbot.js +652 -491
- package/dist-server/pair-cli.js +652 -491
- package/dist-server/server/drivers/acp/core.js +10 -37
- package/dist-server/server/drivers/acp/droid.js +1 -0
- package/dist-server/server/drivers/acp/gemini.js +10 -0
- package/dist-server/server/drivers/acp/kimi.js +1 -0
- package/dist-server/server/drivers/acp/mode-readback.js +72 -0
- package/dist-server/server/drivers/acp/qwen.js +12 -0
- package/dist-server/server/drivers/acp/tool-log.js +40 -0
- package/dist-server/server/drivers/acp/vibe.js +14 -1
- package/dist-server/server/drivers/agents-catalog.js +2 -2
- package/dist-server/server/drivers/chat-mcp-tools.js +21 -1
- package/dist-server/server/drivers/openai-chat.js +1 -1
- package/dist-server/server/engine-failover.js +15 -0
- package/dist-server/server/engine-failure.js +1 -1
- package/dist-server/server/engine-tiers.js +1 -1
- package/dist-server/server/free-turn-guard.js +32 -0
- package/dist-server/server/incidents.js +9 -2
- package/dist-server/server/index.js +46 -26
- package/dist-server/server/mcp-secrets.js +33 -5
- package/dist-server/server/routes/engine-tiers.js +3 -1
- package/dist-server/server/vault/routes.js +1 -1
- package/dist-server/server/vault/store.js +1 -1
- package/dist-server/shared/approval-readback.js +52 -0
- package/dist-server/shared/provider-accounts.js +4 -4
- package/dist-server/shared/vault-csv.js +32 -10
- package/package.json +1 -1
- package/dist/assets/channel-DGEfaLnD.js +0 -1
- package/dist/assets/index-D17LLrYN.css +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-HihkzjzX.js +0 -8
|
@@ -115,7 +115,7 @@ import { exchangeChannel, mirrorActivity, mirrorExchange, mirrorReply } from "./
|
|
|
115
115
|
import { findMessageInThreads, readMessageText, recallMessages, recentMessages, searchMessages, closeMessageDb, chatFollowups, cancelledChatFollowup, settleChatFollowups, threadsReferencing, readCommandReceipt, withCommandReceipt } from "./message-db.js";
|
|
116
116
|
import { briefCrossingLabel, claimRecallCrossings, recallCrossingLabel } from "./recall-disclosure.js";
|
|
117
117
|
import { parseSince, parseUntil, recentWork, recentWorkPrompt, turnOutcomeLine } from "./recent-work.js";
|
|
118
|
-
import { chiefForBot, INCIDENTS_THREAD_TITLE, IncidentLedger, incidentChip, incidentText } from "./incidents.js";
|
|
118
|
+
import { chiefForBot, INCIDENTS_THREAD_TITLE, IncidentLedger, incidentChip, incidentText, runWentOn } from "./incidents.js";
|
|
119
119
|
/** A session_read answer competes with the transcript for the context
|
|
120
120
|
* window; a computer-use turn's output can run to hundreds of KB. */
|
|
121
121
|
const SESSION_READ_MAX_CHARS = 8_000;
|
|
@@ -131,6 +131,7 @@ import { computerKindForResource, ManagedDesktopPolicy } from "./managed-policy.
|
|
|
131
131
|
import { hostedModelPolicy, HOSTED_MODEL_POLICY_HEADER, HOSTED_PROVIDER_SETTINGS_ERROR } from "./hosted-models.js";
|
|
132
132
|
import { newEventId } from "./contracts.js";
|
|
133
133
|
import { canTitle, routedThreadTitle } from "./thread-title.js";
|
|
134
|
+
import { freeTurnNexusRefusal, guardFreeTurn } from "./free-turn-guard.js";
|
|
134
135
|
import { createSummaryScheduler } from "./bot-summary.js";
|
|
135
136
|
import { BOT_SUMMARY_MAX, sanitizeBotSummary } from "../shared/bot-summary.js";
|
|
136
137
|
import { selectDefaultModelSelection, withNewBotEffort } from "./default-model-selection.js";
|
|
@@ -288,7 +289,7 @@ import { cleanMarketplaceQuery, marketplaceCard, marketplaceCardText, marketplac
|
|
|
288
289
|
import { createModelLevels } from "./model-levels/index.js";
|
|
289
290
|
import { compareWithinClass } from "./model-levels/classes.js";
|
|
290
291
|
import { HISTORY_RECEIPT_KIND, historyAttachmentStore } from "./harness-import/history.js";
|
|
291
|
-
import { chooseEngine, engineIntent, harnessForName, localModel, newBotSelection, paidCandidate, perTokenModel } from "./harness-import/engine-policy.js";
|
|
292
|
+
import { chooseEngine, engineIntent, freeCandidate, harnessForName, localModel, newBotSelection, paidCandidate, perTokenModel } from "./harness-import/engine-policy.js";
|
|
292
293
|
import { createEngineTierRoutes } from "./routes/engine-tiers.js";
|
|
293
294
|
import { createPrimaryBotRoutes } from "./routes/primary-bot.js";
|
|
294
295
|
import { EngineSnapshotCache, botTier, canDriveComputer, classLadder, engineAccount, engineHealth, engineLabel, engineTierClasses, engineTierLadders, engineTiersIncludeFree, generateLadders, handlesClientData, ladderForClass, keyBased, needsDelegation, resolveFailover, resolveLadder } from "./engine-tiers.js";
|
|
@@ -317,7 +318,7 @@ import { createNexusMemoryRoutes } from "./routes/nexus-memory.js";
|
|
|
317
318
|
import { createBoardRoutes } from "./routes/board.js";
|
|
318
319
|
import { readBoardFromNexus } from "./board/nexus-board.js";
|
|
319
320
|
import { LocalModelInventory, localModePlacement, machineMemory } from "./local-models-mode.js";
|
|
320
|
-
import { eventBase, restTime, FailoverGate, MAX_ENGINES_PER_TURN, continuationNote, restingLine } from "./engine-failover.js";
|
|
321
|
+
import { eventBase, restTime, FailoverGate, MAX_ENGINES_PER_TURN, continuationNote, restingLine, restingOnRoute, sameRoute } from "./engine-failover.js";
|
|
321
322
|
import { enterSessionFallback, onSessionFallback, ownOrFallback, sessionFallbackSpentLine, withoutSubscription } from "./session-fallback.js";
|
|
322
323
|
import { TURN_ERROR_CATEGORIES } from "../shared/runtime-events.js";
|
|
323
324
|
import { EngineProbes, PROBE_PROMPT, isProbeThread, probeThreadId } from "./engine-probe.js";
|
|
@@ -3454,8 +3455,8 @@ const engineProbes = new EngineProbes({
|
|
|
3454
3455
|
onResult: (entry, outcome) => console.error(`[omb-engine-probe] ${entry.instanceId}${entry.scope ? ` (${entry.scope})` : ""}: ${outcome}`),
|
|
3455
3456
|
});
|
|
3456
3457
|
engineProbes.start();
|
|
3457
|
-
|
|
3458
|
-
|
|
3458
|
+
const engineResting = (candidate, model) => restingOnRoute(candidate, model, engineSnapshots.current() ?? [], // twins: sameRoute
|
|
3459
|
+
(entry) => engineRests.resting(entry.instanceId, engineAccount(entry), restScope(entry, model), injectedModel(model))); // restScope: an `ollama::` model on Claude rests alone
|
|
3459
3460
|
/** A model's class, when a source or a person's override grades it (a local
|
|
3460
3461
|
* Ollama model is Añejo); undefined otherwise (server/model-levels). */
|
|
3461
3462
|
function modelClassOf(driverKind, model) {
|
|
@@ -3729,10 +3730,11 @@ function engineFailover(turn, completion) {
|
|
|
3729
3730
|
});
|
|
3730
3731
|
}
|
|
3731
3732
|
retireFailedAttempt(turn.botId, turn.threadId, turn.generation, failedOwner, completion);
|
|
3732
|
-
|
|
3733
|
+
const signIn = failure.kind === "auth_failed" ? `${engineLabel(candidates, moved)} needs signing in again in Settings > Engines` : undefined;
|
|
3734
|
+
if (!reportFreeFallback(profile, turn.threadId, choice.selection, signIn ?? `${engineLabel(candidates, moved)} failed (${failure.kind})`) && signIn)
|
|
3733
3735
|
reportIncident({
|
|
3734
3736
|
kind: "engine-fallback", bot: profile, threadId: turn.threadId, notifyChief: true,
|
|
3735
|
-
detail: `${
|
|
3737
|
+
detail: `${signIn}; the turn continued on ${engineLabel(candidates, choice.selection)}`,
|
|
3736
3738
|
});
|
|
3737
3739
|
console.error(`[omb-failover] thread=${turn.threadId} ${failure.kind}: ${moved.instanceId} -> ${choice.selection.instanceId} (attempt ${attempt})`);
|
|
3738
3740
|
// No turnId: the failed provider turn is retired, and its id would hide
|
|
@@ -3804,7 +3806,7 @@ function roomEngineFailover(turn, completion, room, profile, candidates, failedC
|
|
|
3804
3806
|
const failedLabel = engineLabel(candidates, room.selection);
|
|
3805
3807
|
const replacementLabel = engineLabel(candidates, choice.selection);
|
|
3806
3808
|
console.error(`[omb-failover] room thread=${turn.threadId} ${failure.kind}: ${room.selection.instanceId} -> ${choice.selection.instanceId} (attempt ${attempt})`);
|
|
3807
|
-
if (!failure.permanent) {
|
|
3809
|
+
if (!reportFreeFallback(profile, turn.threadId, choice.selection, `${failedLabel} failed (${failure.kind})`) && !failure.permanent) {
|
|
3808
3810
|
reportIncident({
|
|
3809
3811
|
kind: "engine-fallback", bot: profile, threadId: turn.threadId,
|
|
3810
3812
|
detail: `${failedLabel} failed (${failure.kind}); the room turn continued on ${replacementLabel}`,
|
|
@@ -3861,11 +3863,12 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
|
|
|
3861
3863
|
return { line: personalMove.line };
|
|
3862
3864
|
// Every bot, pinned or not and of any tier, falls to the next subscription
|
|
3863
3865
|
// the person has, in any class, before a pay-per-use key (resolveFailover).
|
|
3866
|
+
const resting = (candidate, model) => engineResting(candidate, model) || (model === attempt.selection.model && !!failedCandidate && sameRoute(candidate, failedCandidate));
|
|
3864
3867
|
const resolution = personalMove || tried.size >= MAX_ENGINES_PER_TURN || !projected ? { skipped: [] } : resolveFailover({
|
|
3865
3868
|
ladder: plan.ladder,
|
|
3866
3869
|
classLadder: (modelClass) => classLadder(classedModels(), modelClass),
|
|
3867
3870
|
failed: attempt.selection,
|
|
3868
|
-
context: { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting
|
|
3871
|
+
context: { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting,
|
|
3869
3872
|
keyBandPaused: Boolean(fallback) || keyBandPausedFor(turn.threadId), includeFree: engineTiersIncludeFree(cfg.engineTiers), clientData: handlesClientData(profile) },
|
|
3870
3873
|
tried,
|
|
3871
3874
|
modelClass: neededClass,
|
|
@@ -3879,7 +3882,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
|
|
|
3879
3882
|
modelClass: modelClassOf(personalMove.choice.candidate.driverKind, personalMove.choice.selection.model) ?? neededClass, dropped: false } }
|
|
3880
3883
|
: projected ? localModeTurn(resolution, { tier, tried, needs: { tools: true, vision: attempt.vision },
|
|
3881
3884
|
prefer: [attempt.selection.instanceId],
|
|
3882
|
-
context: { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting
|
|
3885
|
+
context: { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting } })
|
|
3883
3886
|
: { ...resolution, local: false };
|
|
3884
3887
|
const choice = placed.choice && placed.local ? { ...placed.choice, modelClass: "Añejo" } : placed.choice;
|
|
3885
3888
|
if (!choice && fallback)
|
|
@@ -8592,13 +8595,23 @@ function incidentContext(threadId) {
|
|
|
8592
8595
|
lastReply: messages.find((message) => message.role === "bot" && message.kind === "text" && message.text)?.text ?? null,
|
|
8593
8596
|
};
|
|
8594
8597
|
}
|
|
8598
|
+
/** A turn on a free-tier engine is a Team incident (docs/specs/free-models-in-auto); true when filed. */
|
|
8599
|
+
function reportFreeFallback(bot, threadId, selection, why) {
|
|
8600
|
+
const candidates = engineSnapshots.current() ?? [];
|
|
8601
|
+
const candidate = candidates.find((entry) => entry.instanceId === selection.instanceId);
|
|
8602
|
+
if (!candidate || !freeCandidate(candidate))
|
|
8603
|
+
return false;
|
|
8604
|
+
reportIncident({ kind: "free-fallback", bot, threadId, notifyChief: true,
|
|
8605
|
+
detail: `${why ? `${why}; ` : ""}the turn ran on ${engineLabel(candidates, selection)}` });
|
|
8606
|
+
return true;
|
|
8607
|
+
}
|
|
8595
8608
|
function reportIncident(input) {
|
|
8596
8609
|
const { bot, threadId } = input;
|
|
8597
8610
|
// A fallback, or a turn that ran on without a broken tool server, is a run that went on, not a broken one.
|
|
8598
|
-
const quiet = input.kind
|
|
8611
|
+
const quiet = runWentOn(input.kind);
|
|
8599
8612
|
// The Primary Bot's pre-check reads broken runs from here (a failed
|
|
8600
8613
|
// routine has its own run record, so it is not noted twice).
|
|
8601
|
-
if (input.kind !== "routine-failed" && input.kind
|
|
8614
|
+
if (input.kind !== "routine-failed" && !runWentOn(input.kind)) {
|
|
8602
8615
|
primaryBotStore.noteFailure({ botId: bot.id, threadId, kind: input.kind, detail: redactSecretsInText(input.detail).slice(0, 300), at: Date.now() });
|
|
8603
8616
|
}
|
|
8604
8617
|
const task = store.taskByThread(bot.id, threadId);
|
|
@@ -9817,6 +9830,9 @@ async function startTurn(botId, text, opts) {
|
|
|
9817
9830
|
// thread, so this is the one moment the ledger's "who asked" may change.
|
|
9818
9831
|
if (opts?.trigger)
|
|
9819
9832
|
turnTriggers.set(threadId, opts.trigger);
|
|
9833
|
+
// A failover files its own report (engineFailover); a hand-picked engine is no fallback.
|
|
9834
|
+
if (engineChoice && !failover && !opts?.engine)
|
|
9835
|
+
reportFreeFallback(bot, threadId, engineChoice.selection);
|
|
9820
9836
|
const expectedModel = modelExpectation(threadId);
|
|
9821
9837
|
// The engine the ladder chose becomes the thread's model, as a person's
|
|
9822
9838
|
// switch would; the thread stays tier-managed for its next turn.
|
|
@@ -10724,15 +10740,16 @@ async function startTurn(botId, text, opts) {
|
|
|
10724
10740
|
}
|
|
10725
10741
|
}
|
|
10726
10742
|
const addons = turnAddons(liveBot ?? bot, instance.driverKind, { local: opts?.runOn !== "cloud", fileTools: worksInWorkspace });
|
|
10743
|
+
const blockedPaths = guardFreeTurn(threadId, providerConfigs()[instance.instanceId]?.account, integrations, [paw.root, resolveIcmPath(cfg)]);
|
|
10727
10744
|
// What Nexus already knows for this person: read once per session and
|
|
10728
10745
|
// cached, bounded in size and time, never holding the turn up. A Team
|
|
10729
10746
|
// Room turn reads it only when its owner shares memories in that room.
|
|
10730
|
-
const nexusContext = nexusOwnerThread(threadId) && (!roomTurn || roomTurn.share.memories)
|
|
10747
|
+
const nexusContext = !blockedPaths && nexusOwnerThread(threadId) && (!roomTurn || roomTurn.share.memories)
|
|
10731
10748
|
? await nexusMemory.readBack({ bot: liveBot ?? bot, threadId, query: providerText })
|
|
10732
10749
|
: "";
|
|
10733
10750
|
const prompt = buildSystemPrompt(persona, liveBot?.soul ?? bot.soul ?? "", roomPromptSections(roomTurn, [
|
|
10734
10751
|
{ id: "personal-goal", label: "Active goal", text: personalGoals.goals.get(threadId)?.status === "working" ? personalGoalInstructions(personalGoals.goals.get(threadId)) : "" },
|
|
10735
|
-
{ id: "user-profile", label: "About the user", text: userProfileSystemPrompt(cfg.profile) },
|
|
10752
|
+
{ id: "user-profile", label: "About the user", text: blockedPaths ? "" : userProfileSystemPrompt(cfg.profile) },
|
|
10736
10753
|
// the ICM folder is on this machine; a cloud run cannot reach it
|
|
10737
10754
|
// first after the soul: the block names agent tools, so it only goes
|
|
10738
10755
|
// to a turn whose engine actually mounted them (setupMode is already
|
|
@@ -10740,8 +10757,8 @@ async function startTurn(botId, text, opts) {
|
|
|
10740
10757
|
{ id: "setup", label: "Setup", text: setupSystemPrompt(setupMode, { skills: skillAuthoring, cwd: liveBot?.cwd ?? bot.cwd }) },
|
|
10741
10758
|
// after setup (which must follow the soul): PAW (Personal AI Workspace)
|
|
10742
10759
|
// first, then a legacy ICM folder; a cloud run cannot reach either
|
|
10743
|
-
{ id: "paw", label: "Shared context (PAW)", text: pawPrompt(liveBot ?? bot, text, opts?.runOn) },
|
|
10744
|
-
{ id: "icm", label: "Shared context (ICM)", text: opts?.runOn !== "cloud" ? icmSystemPrompt(cfg) : "" },
|
|
10760
|
+
{ id: "paw", label: "Shared context (PAW)", text: blockedPaths ? "" : pawPrompt(liveBot ?? bot, text, opts?.runOn) },
|
|
10761
|
+
{ id: "icm", label: "Shared context (ICM)", text: !blockedPaths && opts?.runOn !== "cloud" ? icmSystemPrompt(cfg) : "" },
|
|
10745
10762
|
{ id: "private-bot", label: "Private Bot", text: isPersonalBot(liveBot ?? bot) ? privateBotPrompt(privateChibiLinkActive()) : chibiLinkPromptFor(liveBot ?? bot, threadId) },
|
|
10746
10763
|
{ id: "files", label: "File locations", text: worksInWorkspace && opts?.runOn !== "cloud" ? workspaceLocationsPrompt(bot.id, cwd, liveBot?.cwd ?? bot.cwd) : "" },
|
|
10747
10764
|
{ id: "repos", label: "Linked repos", text: repoPlan ? repoPromptSection(repoPlan, repoPlace(opts?.runOn, computerKind), cwd) : "" },
|
|
@@ -10816,7 +10833,7 @@ async function startTurn(botId, text, opts) {
|
|
|
10816
10833
|
systemStable: prompt.stable,
|
|
10817
10834
|
systemVolatile: prompt.volatile,
|
|
10818
10835
|
systemVolatileSections: prompt.volatileSections,
|
|
10819
|
-
integrations,
|
|
10836
|
+
integrations, blockedPaths,
|
|
10820
10837
|
...userMcpForTurn(liveBot ?? bot, instance),
|
|
10821
10838
|
...(addons.pluginDirs.length ? { pluginDirs: addons.pluginDirs } : {}),
|
|
10822
10839
|
...(addons.rtk ? { rtk: addons.rtk } : {}),
|
|
@@ -12117,6 +12134,8 @@ failover) {
|
|
|
12117
12134
|
onDispatchError?.(message);
|
|
12118
12135
|
return true;
|
|
12119
12136
|
}
|
|
12137
|
+
if (roomEngine && !failover)
|
|
12138
|
+
reportFreeFallback(bot, threadId, roomEngine.selection);
|
|
12120
12139
|
const internalGeneration = beginInternalCapabilityGeneration(threadId);
|
|
12121
12140
|
const resourceOwner = { threadId, generation: internalGeneration };
|
|
12122
12141
|
turnResourceOwners.set(threadId, resourceOwner);
|
|
@@ -12195,6 +12214,7 @@ failover) {
|
|
|
12195
12214
|
if (Object.keys(custom).length)
|
|
12196
12215
|
integrations.custom = custom;
|
|
12197
12216
|
}
|
|
12217
|
+
const blockedPaths = guardFreeTurn(threadId, providerConfigs()[instance.instanceId]?.account, integrations, [paw.root, resolveIcmPath(cfg)]);
|
|
12198
12218
|
// Turn setup can yield before a provider owns the bot. An interrupt
|
|
12199
12219
|
// during that setup window must still stop the queued
|
|
12200
12220
|
// room operation before it starts a process.
|
|
@@ -12589,13 +12609,13 @@ failover) {
|
|
|
12589
12609
|
}
|
|
12590
12610
|
}
|
|
12591
12611
|
const roomAddons = turnAddons(readyBot, instance.driverKind, { local: true, fileTools: worksInWorkspace });
|
|
12592
|
-
const roomNexusContext = nexusOwnerThread(threadId)
|
|
12612
|
+
const roomNexusContext = !blockedPaths && nexusOwnerThread(threadId)
|
|
12593
12613
|
? await nexusMemory.readBack({ bot, threadId, query: addressedRequest?.text ?? "" })
|
|
12594
12614
|
: "";
|
|
12595
12615
|
const roomSystem = buildSystemPrompt(system, store.bot(bot.id)?.soul ?? bot.soul ?? "", [
|
|
12596
|
-
{ id: "user-profile", label: "About the user", text: userProfileSystemPrompt(cfg.profile) },
|
|
12597
|
-
{ id: "paw", label: "Shared context (PAW)", text: pawPrompt(bot, "") },
|
|
12598
|
-
{ id: "icm", label: "Shared context (ICM)", text: icmSystemPrompt(cfg) },
|
|
12616
|
+
{ id: "user-profile", label: "About the user", text: blockedPaths ? "" : userProfileSystemPrompt(cfg.profile) },
|
|
12617
|
+
{ id: "paw", label: "Shared context (PAW)", text: blockedPaths ? "" : pawPrompt(bot, "") },
|
|
12618
|
+
{ id: "icm", label: "Shared context (ICM)", text: blockedPaths ? "" : icmSystemPrompt(cfg) },
|
|
12599
12619
|
{ id: "private-bot", label: "Private Bot", text: isPersonalBot(bot) ? privateBotPrompt(false) : "" },
|
|
12600
12620
|
{ id: "files", label: "File locations", text: workspace ? workspaceLocationsPrompt(bot.id, cwd, readyBot.cwd) : "" },
|
|
12601
12621
|
{ id: "repos", label: "Linked repos", text: repoPlan ? repoPromptSection(repoPlan, repoPlace(undefined, roomTeamComputer || roomComputerKind === "box" ? "box" : roomVmMounted ? "vm" : roomComputerKind), cwd) : "" },
|
|
@@ -12759,7 +12779,7 @@ failover) {
|
|
|
12759
12779
|
systemVolatileSections: roomSystem.volatileSections,
|
|
12760
12780
|
cwd,
|
|
12761
12781
|
additionalDirs: turnAdditionalDirs(repoPlan, cwd),
|
|
12762
|
-
integrations,
|
|
12782
|
+
integrations, blockedPaths,
|
|
12763
12783
|
...userMcpForTurn(readyBot, instance),
|
|
12764
12784
|
...(roomAddons.pluginDirs.length ? { pluginDirs: roomAddons.pluginDirs } : {}),
|
|
12765
12785
|
...(roomAddons.rtk ? { rtk: roomAddons.rtk } : {}),
|
|
@@ -14785,7 +14805,7 @@ function engineMcpServers(bot) {
|
|
|
14785
14805
|
* refuses leaves both the file and this process as they were. */
|
|
14786
14806
|
async function persistMcpServers(next, forceSecure) {
|
|
14787
14807
|
try {
|
|
14788
|
-
await storeMcpServerSecrets(next, forceSecure);
|
|
14808
|
+
await storeMcpServerSecrets(next, forceSecure, cfg.mcpServers ?? {});
|
|
14789
14809
|
}
|
|
14790
14810
|
catch (error) {
|
|
14791
14811
|
throw Object.assign(error instanceof Error ? error : new Error(String(error)), { status: error?.status ?? 503 });
|
|
@@ -16927,9 +16947,9 @@ const handleRequest = async (req, res) => {
|
|
|
16927
16947
|
// only work items), and only when the person on the thread is the one
|
|
16928
16948
|
// signed in to Nexus here.
|
|
16929
16949
|
if (method === "POST" && (path === "/api/internal/nexus/recall" || path === "/api/internal/nexus/file")) {
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16950
|
+
const refusal = nexusOwnerThread(internalCapability.threadId) ? freeTurnNexusRefusal(internalCapability.threadId) : "This conversation is with someone other than the person signed in to Nexus here, so their Nexus is not shared into it.";
|
|
16951
|
+
if (refusal)
|
|
16952
|
+
return json(res, 403, { error: refusal });
|
|
16933
16953
|
const body = await readInternalBody();
|
|
16934
16954
|
const bot = { id: internalSender.id, name: internalSender.name, ...(internalSender.personal ? { personal: true } : {}) };
|
|
16935
16955
|
try {
|
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
// start a server whose placeholder has nothing behind it, or whose command
|
|
9
9
|
// line still holds a parked token, does not start (launchBlocker)
|
|
10
10
|
//
|
|
11
|
-
// Without the desktop shell (a development or headless server
|
|
12
|
-
//
|
|
13
|
-
//
|
|
11
|
+
// Without the desktop shell (a development or headless server) there is no
|
|
12
|
+
// secure store: entries are kept in config.json as they always were, and
|
|
13
|
+
// Settings says so. When the desktop shell IS there but found no real store
|
|
14
|
+
// (Linux with no keyring: "insecure"), secrets already in config.json stay
|
|
15
|
+
// where they are, but a save that adds or changes one is refused: Atomic
|
|
16
|
+
// does not fall back to writing new secrets into a plain file.
|
|
14
17
|
import { randomUUID } from "node:crypto";
|
|
15
18
|
import { MCP_SECRET_PLACEHOLDER, MCP_SECRET_STORE_ENV, MCP_SECRETS_ENV, MCP_SECRETS_SAVE, MCP_SECRETS_SAVE_RESULT, hydrateMcpServerSecrets, mcpArgPlaceholderId, sanitizeMcpSecrets, splitMcpServerSecrets, } from "../electron/mcp-secrets.mjs";
|
|
16
19
|
export { MCP_SECRET_PLACEHOLDER, mcpArgPlaceholderId };
|
|
@@ -37,7 +40,7 @@ export function mcpSecretState(env = process.env) {
|
|
|
37
40
|
secrets = {};
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
|
-
const kind = claimed === "os" || claimed === "unavailable" ? claimed : "plaintext";
|
|
43
|
+
const kind = claimed === "os" || claimed === "unavailable" || claimed === "insecure" ? claimed : "plaintext";
|
|
41
44
|
state = { kind, secrets };
|
|
42
45
|
return state;
|
|
43
46
|
}
|
|
@@ -127,10 +130,16 @@ export function mcpServersForDisk(servers) {
|
|
|
127
130
|
}
|
|
128
131
|
/** Seal the secrets of the next `mcpServers` before config.json is written.
|
|
129
132
|
* Resolves once they are durable (or there is nothing to seal). */
|
|
130
|
-
export async function storeMcpServerSecrets(next, forceSecure = {}) {
|
|
133
|
+
export async function storeMcpServerSecrets(next, forceSecure = {}, onDisk = {}) {
|
|
131
134
|
const current = mcpSecretState();
|
|
132
135
|
if (current.kind === "plaintext")
|
|
133
136
|
return;
|
|
137
|
+
if (current.kind === "insecure") {
|
|
138
|
+
if (Object.keys(forceSecure).length || addsPlaintextSecret(next, onDisk)) {
|
|
139
|
+
throw Object.assign(new Error(INSECURE_STORE_REFUSAL), { status: 409 });
|
|
140
|
+
}
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
134
143
|
// `forceSecure`: values that must be stored whatever their name, merged
|
|
135
144
|
// in as though already stored (the quick fix's named variable)
|
|
136
145
|
const previous = structuredClone(current.secrets);
|
|
@@ -146,6 +155,25 @@ export async function storeMcpServerSecrets(next, forceSecure = {}) {
|
|
|
146
155
|
await sendToDesktop(split.secrets);
|
|
147
156
|
current.secrets = split.secrets;
|
|
148
157
|
}
|
|
158
|
+
/** What a refused save on a computer with no real secure store says. */
|
|
159
|
+
export const INSECURE_STORE_REFUSAL = "This computer has no unlocked keyring (such as GNOME Keyring or KWallet), so Atomic did not save this MCP server's secret. Atomic does not keep new secrets in a plain file. Install or unlock a keyring, then quit and reopen Atomic and try again.";
|
|
160
|
+
/** True when `next` holds a secret env or header value that `onDisk` (what
|
|
161
|
+
* config.json has now) does not already hold under the same server and key.
|
|
162
|
+
* Unchanged plaintext from before is allowed through untouched; anything new
|
|
163
|
+
* or edited is not. */
|
|
164
|
+
export function addsPlaintextSecret(next, onDisk) {
|
|
165
|
+
const after = splitMcpServerSecrets(next, {}).secrets;
|
|
166
|
+
const before = splitMcpServerSecrets(onDisk, {}).secrets;
|
|
167
|
+
for (const [name, slot] of Object.entries(after)) {
|
|
168
|
+
for (const part of ["env", "headers"]) {
|
|
169
|
+
for (const [key, value] of Object.entries(slot[part] ?? {})) {
|
|
170
|
+
if (before[name]?.[part]?.[key] !== value)
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
149
177
|
/** Why a configured server must not start, or null. */
|
|
150
178
|
export function mcpLaunchBlocker(raw) {
|
|
151
179
|
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
@@ -95,7 +95,9 @@ export function createEngineTierRoutes(deps) {
|
|
|
95
95
|
const value = body && typeof body === "object" && !Array.isArray(body) && Object.keys(body).length === 1 ? body.includeFree : undefined;
|
|
96
96
|
if (typeof value !== "boolean")
|
|
97
97
|
return json(res, 400, { error: "send { includeFree: boolean }" });
|
|
98
|
-
|
|
98
|
+
// Off drops the key: config.json holds JSON values only, so undefined is refused.
|
|
99
|
+
const { includeFree: _was, ...rest } = deps.engineTiers() ?? { ladders: {} };
|
|
100
|
+
deps.saveEngineTiers(value ? { ...rest, includeFree: true } : rest);
|
|
99
101
|
return json(res, 200, await view());
|
|
100
102
|
}
|
|
101
103
|
if (path === "/api/engine-tiers/rebalance" && method === "GET") {
|
|
@@ -23,7 +23,7 @@ export function createVaultRoutes(deps) {
|
|
|
23
23
|
if (typeof body?.csv !== "string")
|
|
24
24
|
return json(res, 400, { error: "Choose a CSV file exported from your password manager." });
|
|
25
25
|
try {
|
|
26
|
-
const { logins, skipped } = vaultLoginsFromCsv(body.csv);
|
|
26
|
+
const { logins, skipped } = vaultLoginsFromCsv(body.csv, typeof body.group === "string" && body.group ? body.group : undefined);
|
|
27
27
|
return json(res, 200, { ...store.importLogins(ownerId, logins), skipped });
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
import { vaultInputSchema, vaultMetadata } from "../../shared/vault.js";
|
|
9
9
|
import { writeFileAtomic } from "../atomic.js";
|
|
10
10
|
const MAX_BYTES = 16 * 1024 * 1024;
|
|
11
|
-
const MAX_ITEMS =
|
|
11
|
+
const MAX_ITEMS = 3000;
|
|
12
12
|
const AAD = Buffer.from("atomic-native-vault:v1");
|
|
13
13
|
const identity = z.string().uuid();
|
|
14
14
|
const metadataSchema = z.object({
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Did the engine actually run with the approval mode Atomic asked for?
|
|
2
|
+
//
|
|
3
|
+
// Atomic tells each engine how much it may do on its own (for the ACP
|
|
4
|
+
// engines, a session mode). An engine that
|
|
5
|
+
// silently runs LOOSER than that (an old CLI that ignores a flag, a session
|
|
6
|
+
// saved in yolo, a settings file that pins a mode) would act without the
|
|
7
|
+
// approval card the person chose. This module is the one comparison every
|
|
8
|
+
// driver uses: plain lookup tables, no model.
|
|
9
|
+
//
|
|
10
|
+
// ok reported is the same as, or stricter than, what was asked
|
|
11
|
+
// looser reported lets the engine do more on its own: stop the turn
|
|
12
|
+
// unverified the engine did not say, or said something this table does
|
|
13
|
+
// not know: the caller logs it
|
|
14
|
+
/** Higher is stricter. Ids each engine documents (see its driver). Several
|
|
15
|
+
* spellings are listed where CLIs disagree (Gemini says autoEdit, Qwen
|
|
16
|
+
* auto-edit, the Gemini flag auto_edit). */
|
|
17
|
+
export const MODE_LADDERS = {
|
|
18
|
+
kimiAgent: { plan: 4, default: 3, yolo: 1, auto: 0 },
|
|
19
|
+
droidAgent: { spec: 4, normal: 3, "auto-low": 2, "auto-medium": 1, "auto-high": 0 },
|
|
20
|
+
vibeAgent: { plan: 4, ask: 3, "accept-edits": 2, "smart-approve": 1, "auto-approve": 0 },
|
|
21
|
+
qwenAgent: { plan: 4, default: 3, "auto-edit": 2, autoEdit: 2, auto: 1, yolo: 0 },
|
|
22
|
+
geminiAgent: { plan: 4, default: 3, autoEdit: 2, auto_edit: 2, "auto-edit": 2, yolo: 0 },
|
|
23
|
+
};
|
|
24
|
+
const text = (value) => (typeof value === "string" && value.trim() ? value.trim() : null);
|
|
25
|
+
/** Compare one requested mode with what the engine reported. */
|
|
26
|
+
export function compareEffectiveMode(ladder, requested, reported) {
|
|
27
|
+
const want = text(requested);
|
|
28
|
+
const got = text(reported);
|
|
29
|
+
const ranks = MODE_LADDERS[ladder];
|
|
30
|
+
if (want === null || got === null)
|
|
31
|
+
return { status: "unverified", requested: want, reported: got };
|
|
32
|
+
const wantRank = ranks?.[want];
|
|
33
|
+
const gotRank = ranks?.[got];
|
|
34
|
+
if (wantRank === undefined || gotRank === undefined) {
|
|
35
|
+
// An exact echo is a confirmation even for an id the table does not rank.
|
|
36
|
+
return { status: want === got ? "ok" : "unverified", requested: want, reported: got };
|
|
37
|
+
}
|
|
38
|
+
return { status: gotRank < wantRank ? "looser" : "ok", requested: want, reported: got };
|
|
39
|
+
}
|
|
40
|
+
/** The sentence a stopped turn shows. */
|
|
41
|
+
export function looserModeMessage(engine, readback) {
|
|
42
|
+
return `${engine} ran with looser permissions than requested (asked for "${readback.requested}", it reported "${readback.reported}"), so Atomic stopped the turn before it could act. Update ${engine}, check its own settings for a pinned mode, then try again.`;
|
|
43
|
+
}
|
|
44
|
+
/** Throws when the engine reported a looser mode. Returns the readback so
|
|
45
|
+
* the caller can log an unverified one. */
|
|
46
|
+
export function assertEffectiveModeNotLooser(engine, ladder, requested, reported) {
|
|
47
|
+
const readback = compareEffectiveMode(ladder, requested, reported);
|
|
48
|
+
if (readback.status === "looser") {
|
|
49
|
+
throw Object.assign(new Error(looserModeMessage(engine, readback)), { code: "APPROVAL_MODE_LOOSER", readback });
|
|
50
|
+
}
|
|
51
|
+
return readback;
|
|
52
|
+
}
|
|
@@ -75,22 +75,22 @@ export const ACCOUNT_PROVIDERS = [
|
|
|
75
75
|
{
|
|
76
76
|
id: "googleAiStudioFree", kind: "apiKey", label: "Google AI Studio (free tier)", billing: "free", driver: "openai-compat", envVar: "GOOGLE_AI_STUDIO_FREE_API_KEY", icon: "google",
|
|
77
77
|
config: { url: "https://generativelanguage.googleapis.com/v1beta/openai", apiKeyEnv: "GOOGLE_AI_STUDIO_FREE_API_KEY", model: "", provider: "" },
|
|
78
|
-
keyTest: { provider: "openaiCompat", url: "https://generativelanguage.googleapis.com/v1beta/openai" }, keyUrl: "https://aistudio.google.com/apikey",
|
|
78
|
+
keyTest: { provider: "openaiCompat", url: "https://generativelanguage.googleapis.com/v1beta/openai" }, keyUrl: "https://aistudio.google.com/apikey", signupUrl: "https://aistudio.google.com/",
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: "groqFree", kind: "apiKey", label: "Groq (free tier)", billing: "free", driver: "openai-compat", envVar: "GROQ_FREE_API_KEY",
|
|
82
82
|
config: { url: "https://api.groq.com/openai/v1", apiKeyEnv: "GROQ_FREE_API_KEY", model: "", provider: "" },
|
|
83
|
-
keyTest: { provider: "openaiCompat", url: "https://api.groq.com/openai/v1" }, keyUrl: "https://console.groq.com/keys",
|
|
83
|
+
keyTest: { provider: "openaiCompat", url: "https://api.groq.com/openai/v1" }, keyUrl: "https://console.groq.com/keys", signupUrl: "https://console.groq.com/",
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
id: "cerebrasFree", kind: "apiKey", label: "Cerebras (free tier)", billing: "free", driver: "openai-compat", envVar: "CEREBRAS_FREE_API_KEY",
|
|
87
87
|
config: { url: "https://api.cerebras.ai/v1", apiKeyEnv: "CEREBRAS_FREE_API_KEY", model: "", provider: "" },
|
|
88
|
-
keyTest: { provider: "openaiCompat", url: "https://api.cerebras.ai/v1" }, keyUrl: "https://cloud.cerebras.ai/platform/apikeys",
|
|
88
|
+
keyTest: { provider: "openaiCompat", url: "https://api.cerebras.ai/v1" }, keyUrl: "https://cloud.cerebras.ai/platform/apikeys", signupUrl: "https://cloud.cerebras.ai/",
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
id: "nvidiaFree", kind: "apiKey", label: "NVIDIA NIM (free tier)", billing: "free", driver: "openai-compat", envVar: "NVIDIA_FREE_API_KEY",
|
|
92
92
|
config: { url: "https://integrate.api.nvidia.com/v1", apiKeyEnv: "NVIDIA_FREE_API_KEY", model: "", provider: "" },
|
|
93
|
-
keyTest: { provider: "openaiCompat", url: "https://integrate.api.nvidia.com/v1" }, keyUrl: "https://build.nvidia.com/settings/api-keys",
|
|
93
|
+
keyTest: { provider: "openaiCompat", url: "https://integrate.api.nvidia.com/v1" }, keyUrl: "https://build.nvidia.com/settings/api-keys", signupUrl: "https://build.nvidia.com/",
|
|
94
94
|
},
|
|
95
95
|
];
|
|
96
96
|
export function accountProvider(id) {
|
|
@@ -52,24 +52,19 @@ const COLUMNS = {
|
|
|
52
52
|
password: ["password", "login_password", "pwd", "pass"],
|
|
53
53
|
name: ["name", "title", "account"],
|
|
54
54
|
type: ["type"],
|
|
55
|
+
// The vault, folder or tag a row was filed under, so an import can take one.
|
|
56
|
+
group: ["vault", "folder", "grouping", "collections", "collection", "category", "tags"],
|
|
55
57
|
};
|
|
56
58
|
/** Logins from a password manager's CSV export. Notes, TOTP seeds and custom
|
|
57
59
|
* fields are dropped: they can hold secrets and hints are not secret. Rows
|
|
58
60
|
* without a website, username and password, or that are not logins, are
|
|
59
61
|
* counted in `skipped`. Imported items are private to the person (no bots). */
|
|
60
|
-
export function vaultLoginsFromCsv(text) {
|
|
62
|
+
export function vaultLoginsFromCsv(text, group) {
|
|
61
63
|
const [header, ...rows] = parseCsv(text);
|
|
62
64
|
if (!header)
|
|
63
65
|
return { logins: [], skipped: 0 };
|
|
64
|
-
const
|
|
65
|
-
const col = (key) =>
|
|
66
|
-
for (const name of COLUMNS[key]) {
|
|
67
|
-
const index = names.indexOf(name);
|
|
68
|
-
if (index >= 0)
|
|
69
|
-
return index;
|
|
70
|
-
}
|
|
71
|
-
return -1;
|
|
72
|
-
};
|
|
66
|
+
const groupAt = columnIndex(header, "group");
|
|
67
|
+
const col = (key) => columnIndex(header, key);
|
|
73
68
|
const at = { url: col("url"), username: col("username"), password: col("password"), name: col("name"), type: col("type") };
|
|
74
69
|
if (at.url < 0 || at.password < 0 || at.username < 0)
|
|
75
70
|
throw new VaultCsvError("This CSV has no website, username and password columns.");
|
|
@@ -77,6 +72,8 @@ export function vaultLoginsFromCsv(text) {
|
|
|
77
72
|
let skipped = 0;
|
|
78
73
|
for (const row of rows) {
|
|
79
74
|
const cell = (index) => (index >= 0 ? row[index] ?? "" : "").trim();
|
|
75
|
+
if (group && !groupsOf(cell(groupAt)).includes(group))
|
|
76
|
+
continue;
|
|
80
77
|
const type = cell(at.type).toLowerCase();
|
|
81
78
|
const raw = cell(at.url).split(/[\s,]+/)[0] ?? "";
|
|
82
79
|
// Old entries saved as http:// or a bare domain are filled over HTTPS.
|
|
@@ -92,3 +89,28 @@ export function vaultLoginsFromCsv(text) {
|
|
|
92
89
|
}
|
|
93
90
|
return { logins, skipped };
|
|
94
91
|
}
|
|
92
|
+
function columnIndex(header, key) {
|
|
93
|
+
const names = header.map((cell) => cell.trim().toLowerCase());
|
|
94
|
+
for (const name of COLUMNS[key]) {
|
|
95
|
+
const index = names.indexOf(name);
|
|
96
|
+
if (index >= 0)
|
|
97
|
+
return index;
|
|
98
|
+
}
|
|
99
|
+
return -1;
|
|
100
|
+
}
|
|
101
|
+
// Tags arrive as "a, b" or "a;b"; a vault or folder name is one value.
|
|
102
|
+
const groupsOf = (cell) => cell.split(/[,;]/).map((part) => part.trim()).filter(Boolean);
|
|
103
|
+
/** Vaults, folders or tags in the export with their row counts, so the
|
|
104
|
+
* person can import one instead of everything. Empty when there is no
|
|
105
|
+
* such column. Runs on the device that picked the file. */
|
|
106
|
+
export function vaultCsvGroups(text) {
|
|
107
|
+
const [header, ...rows] = parseCsv(text);
|
|
108
|
+
const at = header ? columnIndex(header, "group") : -1;
|
|
109
|
+
if (at < 0)
|
|
110
|
+
return [];
|
|
111
|
+
const counts = new Map();
|
|
112
|
+
for (const row of rows)
|
|
113
|
+
for (const name of groupsOf(row[at] ?? ""))
|
|
114
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
115
|
+
return [...counts].map(([name, count]) => ({ name, count })).sort((a, b) => a.name.localeCompare(b.name));
|
|
116
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-KciMRs_R.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|