@chibitek/chibi 0.1.211 → 0.1.213
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/{TerminalPanel-Dro3aeVy.js → TerminalPanel-mkQO42zG.js} +1 -1
- package/dist/assets/{abnfDiagram-O67JEVCF-kzAr7vQ8.js → abnfDiagram-O67JEVCF-D_YvZb12.js} +1 -1
- package/dist/assets/{arc-DKMhcYud.js → arc-u7NcCAzn.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-_XDnZ7Jz.js → architectureDiagram-NJMV4G6O-CvoIt_0y.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-D5MoWro9.js → blockDiagram-BEXU5L5S-B0Ry3uOJ.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-CGvTMpGE.js → c4Diagram-YGBWAQC7-DQQBHqDt.js} +1 -1
- package/dist/assets/channel-BG3AR6Y6.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-pjTwr5y0.js → chunk-2Q5K7J3B-B4IxGiPz.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-BR6zkd-l.js → chunk-3FUC2YCW-BxR5i6Mq.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-CfVFFBeH.js → chunk-5VM5RSS4-CqmFQLrB.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-TIoAkccw.js → chunk-GTNCS2PH-C9lKwjYE.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-BNFBgzbt.js → chunk-GWA4HPMP-DKAnucqk.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-B_3QFchU.js → chunk-JWPE2WC7-CE4DRhto.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-Cj9q80P-.js → chunk-NETBCI7D-UziBzgi9.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-DFZPGo9K.js → chunk-WEXAMYUT-DVo_P12S.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-CekDrT9T.js → chunk-XXDRQBXY-CBwStBk5.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-C3R6Z4Qe.js → classDiagram-v2-NBCMYWYE-D4xfjrAt.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-C1CKyj0L.js → cose-bilkent-JH36ORCC-DNpZWduJ.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-Deh9QGb0.js → cynefin-OW5HDTMX-CMegK4fD.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-BIlWyG_M.js → cynefinDiagram-VND7K2PF-BBRJHq6u.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-Dx4bWOog.js → dagre-6A5THRUB-BwneJkAI.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-DPxb-FUO.js → diagram-22UHCM2B-p4tq7l1f.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-BLPCNc4m.js → diagram-3UASUU5V-C8BCnB5c.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-DOCbp2Dw.js → diagram-ATOU4E4O-Da-Fc2pA.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-62uSG-tn.js → diagram-CDSNMT55-CH7l4Als.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-De1ZAWVZ.js → diagram-MLGK6HIB-xO-efOVl.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-CIGX9tku.js → diagram-MPIPVDR6-CjWQ4FpH.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-CegjStdk.js → ebnfDiagram-ZINNZB2B-DbyEj47I.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-ClI52Pqm.js → elk-276RUBZZ-B0uak8Gs.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-BQuzjt2-.js → erDiagram-OPXOYQCR-DHYzl46p.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-D1xbKgbB.js → flowDiagram-KWPJA3E3-CjUIIif9.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-CH1jGSZz.js → ganttDiagram-FUAMR5RP-CPjVOkNO.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-BvAUPEmQ.js → gitGraphDiagram-X574FWY7-DnI_xNjh.js} +1 -1
- package/dist/assets/{index-BcXDfnlQ.js → index-C8wABnWu.js} +131 -131
- package/dist/assets/{index-DbkR_erP.js → index-kYL6p_po.js} +1 -1
- package/dist/assets/{infoDiagram-VRGFBTTK-CyMmMbMv.js → infoDiagram-VRGFBTTK-SXQSkFFT.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-Uw-hE1tO.js → ishikawaDiagram-OU5B5YK6-DF3AQU1D.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-ClEDnNRB.js → journeyDiagram-ZHPQQLJL-IWRv1Evh.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-erx0BEal.js → kanban-definition-PNTS6WVX-BKpuGZmD.js} +1 -1
- package/dist/assets/{linear-CSSxpyL0.js → linear-S9gqQWWc.js} +1 -1
- package/dist/assets/{mermaid.core-n13K6vlC.js → mermaid.core-BHRIdye5.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-BcTEIqpD.js → mindmap-definition-NLK3R4M7-BTD52Pxv.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-CJdsm3en.js → pegDiagram-GJSIUBJH-C91CNvYA.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-C7rk-ash.js → pieDiagram-5QR66LMP-0aP3PVSg.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-BSXOYov0.js → quadrantDiagram-O4NWA36T-CN-CB1dj.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-Cmg_FtZY.js → railroadDiagram-XR7U4H2S-DUwKNVqn.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-B_9aE6Mg.js → requirementDiagram-PLB6GJNP-BwiKCqXR.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-DyxaQPy3.js → sankeyDiagram-IPEJSGJF-DK2nk983.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-D5CJeESq.js → sequenceDiagram-PO4LG4MO-DGQaL2CK.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-9-Q4eosQ.js → sizeCapture-INFHLROL-DjxAs07q.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-jgsHnEQl.js → stateDiagram-v2-GCMORJYK-DfhvmAHx.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-MIVacUbv.js → swimlanes-2SLR337P-g4YraApj.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BnxrvDBt.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-Ch8ins-D.js → timeline-definition-EJHVYXUP-Bh6Ow15M.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-BDwBIuhZ.js → usecaseDiagram-POWQR4AR-wRtBj8_e.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-BiiDxcHO.js → vennDiagram-UO4OBE2U-D4QR4Odj.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-D79CK2__.js → wardleyDiagram-VNRHLVJA-DthL_SDi.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-CI7S0o-6.js → xychartDiagram-PMCCYNJV-CK-QrbHO.js} +1 -1
- package/dist/handbook/atomic-handbook.html +1 -1
- package/dist/index.html +1 -1
- package/dist-server/container-mcp.js +81 -81
- package/dist-server/drivers/agents-proxy.js +83 -84
- package/dist-server/index.js +730 -701
- package/dist-server/openmausbot.js +687 -659
- package/dist-server/pair-cli.js +687 -659
- package/dist-server/server/agents-token-file.js +26 -0
- package/dist-server/server/drivers/acp/core.js +4 -6
- package/dist-server/server/drivers/agents-catalog.js +2 -2
- package/dist-server/server/drivers/chat-mcp-tools.js +1 -21
- package/dist-server/server/drivers/claude.js +69 -66
- package/dist-server/server/drivers/codex.js +4 -3
- package/dist-server/server/drivers/openai-chat.js +1 -1
- package/dist-server/server/drivers/session-allow-key.js +22 -5
- package/dist-server/server/engine-tiers.js +3 -7
- package/dist-server/server/index.js +37 -40
- package/dist-server/server/new-bot-defaults.js +3 -1
- package/dist-server/server/routes/thread-stop.js +15 -2
- package/dist-server/server/surface.js +1 -1
- package/dist-server/vps-container-mcp.js +81 -81
- package/package.json +1 -1
- package/dist/assets/channel-YcZdlysP.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-Dekwo1KL.js +0 -8
|
@@ -136,7 +136,6 @@ import { computerKindForResource, ManagedDesktopPolicy } from "./managed-policy.
|
|
|
136
136
|
import { hostedModelPolicy, HOSTED_MODEL_POLICY_HEADER, HOSTED_PROVIDER_SETTINGS_ERROR } from "./hosted-models.js";
|
|
137
137
|
import { newEventId } from "./contracts.js";
|
|
138
138
|
import { canTitle, routedThreadTitle } from "./thread-title.js";
|
|
139
|
-
import { freeTurnNexusRefusal, guardFreeTurn } from "./free-turn-guard.js";
|
|
140
139
|
import { createSummaryScheduler } from "./bot-summary.js";
|
|
141
140
|
import { BOT_SUMMARY_MAX, sanitizeBotSummary } from "../shared/bot-summary.js";
|
|
142
141
|
import { selectDefaultModelSelection, withNewBotEffort } from "./default-model-selection.js";
|
|
@@ -304,7 +303,7 @@ import { createEngineTierRoutes } from "./routes/engine-tiers.js";
|
|
|
304
303
|
import { createModelGatewayRoutes } from "./model-gateway/route.js";
|
|
305
304
|
import { applyChibiDefaults, chibiDefaultSelection } from "./chibi-defaults.js";
|
|
306
305
|
import { createPrimaryBotRoutes } from "./routes/primary-bot.js";
|
|
307
|
-
import { EngineSnapshotCache, botTier, canDriveComputer, classLadder, engineAccount, engineHealth, engineLabel, engineTierClasses, engineTierLadders, failoverClassOrder, engineTiersIncludeFree, generateLadders,
|
|
306
|
+
import { EngineSnapshotCache, botTier, canDriveComputer, classLadder, engineAccount, engineHealth, engineLabel, engineTierClasses, engineTierLadders, failoverClassOrder, engineTiersIncludeFree, generateLadders, ladderForClass, keyBased, needsDelegation, needsWiderWalk, resolveFailover, takeWider, resolveLadder } from "./engine-tiers.js";
|
|
308
307
|
import { PRIMARY_BOT_THREAD_TITLE, PRIMARY_BOT_TRIGGER, PrimaryBotStore, routesAsSweep, PrimaryBotSweeper } from "./primary-bot.js";
|
|
309
308
|
import { PRIMARY_BOT_LOCKED, primaryBotChoiceField, isPrimaryBot } from "../shared/primary-bot.js";
|
|
310
309
|
import { moveIntoChibi } from "./move-into-chibi.js";
|
|
@@ -3115,7 +3114,7 @@ function ladderTurnEngineChoice(profile, projected, threadId, needs, runOn, subs
|
|
|
3115
3114
|
const { ladder } = plan;
|
|
3116
3115
|
const computer = turnComputer(projected, threadId, runOn);
|
|
3117
3116
|
const context = { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting: engineResting, own: profile.modelSelection.instanceId,
|
|
3118
|
-
keyBandPaused: subscriptionsOnly || keyBandPausedFor(threadId), includeFree: engineTiersIncludeFree(cfg.engineTiers)
|
|
3117
|
+
keyBandPaused: subscriptionsOnly || keyBandPausedFor(threadId), includeFree: engineTiersIncludeFree(cfg.engineTiers) };
|
|
3119
3118
|
const local = (resolution) => localModeTurn(resolution, { tier, context, needs, prefer: [projected.modelSelection.instanceId] });
|
|
3120
3119
|
const wider = (tried, modelClass) => resolveFailover({
|
|
3121
3120
|
ladder, classLadder: (cls) => classLadder(classedModels(), cls), failed: projected.modelSelection, context, tried,
|
|
@@ -3881,7 +3880,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
|
|
|
3881
3880
|
classLadder: (modelClass) => classLadder(classedModels(), modelClass),
|
|
3882
3881
|
failed: attempt.selection,
|
|
3883
3882
|
context: { candidates, needsDelegation: needsDelegation(tier, profile), computer, refuse: engineTierRefusal(projected), resting, own: profile.modelSelection.instanceId,
|
|
3884
|
-
keyBandPaused: keyBandPausedFor(turn.threadId), includeFree: engineTiersIncludeFree(cfg.engineTiers)
|
|
3883
|
+
keyBandPaused: keyBandPausedFor(turn.threadId), includeFree: engineTiersIncludeFree(cfg.engineTiers) },
|
|
3885
3884
|
tried,
|
|
3886
3885
|
modelClass: neededClass,
|
|
3887
3886
|
mayDrop: true,
|
|
@@ -7553,7 +7552,7 @@ function continueComputerSelection(threadId, generation, succeeded) {
|
|
|
7553
7552
|
// machine's record, so a later Works on change may sweep it.
|
|
7554
7553
|
store.patchTask(bot.id, threadId, { surface, surfaceSource: "auto" });
|
|
7555
7554
|
const text = `The computer selection is now ${surfaceLabel(surface)}. Continue the user's original request using the tools mounted for this turn; verify the result before claiming success.\n\n${selection.text}`;
|
|
7556
|
-
void startTurn(bot.id, text, { threadId, userMessage: selection.source, computerSelectionContinuation:
|
|
7555
|
+
void startTurn(bot.id, text, { threadId, userMessage: selection.source, computerSelectionContinuation: selection.text }).catch(error => {
|
|
7557
7556
|
if (store.taskByThread(bot.id, threadId))
|
|
7558
7557
|
store.appendMessage(threadId, { role: "bot", kind: "activity",
|
|
7559
7558
|
tool: { name: `Could not continue on ${surfaceLabel(surface)}: ${error instanceof Error ? error.message : String(error)}`, ok: false } });
|
|
@@ -9922,11 +9921,11 @@ async function startTurn(botId, text, opts) {
|
|
|
9922
9921
|
directTurnDispatchClaims.set(threadId, { id: dispatchClaimId, botId, threadId, phase: "setup" });
|
|
9923
9922
|
directTurnBots.set(threadId, bot);
|
|
9924
9923
|
beginInternalCapabilityGeneration(threadId, dispatchClaimId);
|
|
9925
|
-
if (!opts?.
|
|
9924
|
+
if (!opts?.cardContinuation && !opts?.automationSource && !opts?.unattended &&
|
|
9926
9925
|
!opts?.commsDepth && !opts?.coordination && !inheritedTeamComputer(bot) && bot.computer !== "off" && agentsMounted) {
|
|
9927
9926
|
const source = store.activePath(threadId).findLast(message => message.id === userMessage?.id && message.role === "user" && !message.peerAsk);
|
|
9928
9927
|
if (source)
|
|
9929
|
-
computerSelectionTurns.set(threadId, { generation: dispatchClaimId, botId: bot.id, source, text });
|
|
9928
|
+
computerSelectionTurns.set(threadId, { generation: dispatchClaimId, botId: bot.id, source, text: opts?.computerSelectionContinuation ?? text });
|
|
9930
9929
|
}
|
|
9931
9930
|
store.setTaskActivity(bot.id, threadId, "working");
|
|
9932
9931
|
// A closed thread that gets a new turn is open again: the person (or the
|
|
@@ -10749,16 +10748,15 @@ async function startTurn(botId, text, opts) {
|
|
|
10749
10748
|
}
|
|
10750
10749
|
}
|
|
10751
10750
|
const addons = turnAddons(liveBot ?? bot, instance.driverKind, { local: opts?.runOn !== "cloud", fileTools: worksInWorkspace });
|
|
10752
|
-
const blockedPaths = guardFreeTurn(threadId, providerConfigs()[instance.instanceId]?.account, integrations, [paw.root, resolveIcmPath(cfg)]);
|
|
10753
10751
|
// What Nexus already knows for this person: read once per session and
|
|
10754
10752
|
// cached, bounded in size and time, never holding the turn up. A Team
|
|
10755
10753
|
// Room turn reads it only when its owner shares memories in that room.
|
|
10756
|
-
const nexusContext =
|
|
10754
|
+
const nexusContext = nexusOwnerThread(threadId) && (!roomTurn || roomTurn.share.memories)
|
|
10757
10755
|
? await nexusMemory.readBack({ bot: liveBot ?? bot, threadId, query: providerText })
|
|
10758
10756
|
: "";
|
|
10759
10757
|
const prompt = buildSystemPrompt(persona, liveBot?.soul ?? bot.soul ?? "", roomPromptSections(roomTurn, [
|
|
10760
10758
|
{ id: "personal-goal", label: "Active goal", text: personalGoals.goals.get(threadId)?.status === "working" ? personalGoalInstructions(personalGoals.goals.get(threadId)) : "" },
|
|
10761
|
-
{ id: "user-profile", label: "About the user", text:
|
|
10759
|
+
{ id: "user-profile", label: "About the user", text: userProfileSystemPrompt(cfg.profile) },
|
|
10762
10760
|
// the ICM folder is on this machine; a cloud run cannot reach it
|
|
10763
10761
|
// first after the soul: the block names agent tools, so it only goes
|
|
10764
10762
|
// to a turn whose engine actually mounted them (setupMode is already
|
|
@@ -10766,8 +10764,8 @@ async function startTurn(botId, text, opts) {
|
|
|
10766
10764
|
{ id: "setup", label: "Setup", text: setupSystemPrompt(setupMode, { skills: skillAuthoring, cwd: liveBot?.cwd ?? bot.cwd }) },
|
|
10767
10765
|
// after setup (which must follow the soul): PAW (Personal AI Workspace)
|
|
10768
10766
|
// first, then a legacy ICM folder; a cloud run cannot reach either
|
|
10769
|
-
{ id: "paw", label: "Shared context (PAW)", text:
|
|
10770
|
-
{ id: "icm", label: "Shared context (ICM)", text:
|
|
10767
|
+
{ id: "paw", label: "Shared context (PAW)", text: pawPrompt(liveBot ?? bot, text, opts?.runOn) },
|
|
10768
|
+
{ id: "icm", label: "Shared context (ICM)", text: opts?.runOn !== "cloud" ? icmSystemPrompt(cfg) : "" },
|
|
10771
10769
|
{ id: "private-bot", label: "Private Bot", text: isPersonalBot(liveBot ?? bot) ? privateBotPrompt(privateChibiLinkActive()) : chibiLinkPromptFor(liveBot ?? bot, threadId) },
|
|
10772
10770
|
{ id: "files", label: "File locations", text: worksInWorkspace && opts?.runOn !== "cloud" ? workspaceLocationsPrompt(bot.id, cwd, liveBot?.cwd ?? bot.cwd) : "" },
|
|
10773
10771
|
{ id: "repos", label: "Linked repos", text: repoPlan ? repoPromptSection(repoPlan, repoPlace(opts?.runOn, computerKind), cwd) : "" },
|
|
@@ -10842,7 +10840,7 @@ async function startTurn(botId, text, opts) {
|
|
|
10842
10840
|
systemStable: prompt.stable,
|
|
10843
10841
|
systemVolatile: prompt.volatile,
|
|
10844
10842
|
systemVolatileSections: prompt.volatileSections,
|
|
10845
|
-
integrations,
|
|
10843
|
+
integrations,
|
|
10846
10844
|
...userMcpForTurn(liveBot ?? bot, instance),
|
|
10847
10845
|
...(addons.pluginDirs.length ? { pluginDirs: addons.pluginDirs } : {}),
|
|
10848
10846
|
...(addons.rtk ? { rtk: addons.rtk } : {}),
|
|
@@ -12223,7 +12221,6 @@ failover) {
|
|
|
12223
12221
|
if (Object.keys(custom).length)
|
|
12224
12222
|
integrations.custom = custom;
|
|
12225
12223
|
}
|
|
12226
|
-
const blockedPaths = guardFreeTurn(threadId, providerConfigs()[instance.instanceId]?.account, integrations, [paw.root, resolveIcmPath(cfg)]);
|
|
12227
12224
|
// Turn setup can yield before a provider owns the bot. An interrupt
|
|
12228
12225
|
// during that setup window must still stop the queued
|
|
12229
12226
|
// room operation before it starts a process.
|
|
@@ -12618,13 +12615,13 @@ failover) {
|
|
|
12618
12615
|
}
|
|
12619
12616
|
}
|
|
12620
12617
|
const roomAddons = turnAddons(readyBot, instance.driverKind, { local: true, fileTools: worksInWorkspace });
|
|
12621
|
-
const roomNexusContext =
|
|
12618
|
+
const roomNexusContext = nexusOwnerThread(threadId)
|
|
12622
12619
|
? await nexusMemory.readBack({ bot, threadId, query: addressedRequest?.text ?? "" })
|
|
12623
12620
|
: "";
|
|
12624
12621
|
const roomSystem = buildSystemPrompt(system, store.bot(bot.id)?.soul ?? bot.soul ?? "", [
|
|
12625
|
-
{ id: "user-profile", label: "About the user", text:
|
|
12626
|
-
{ id: "paw", label: "Shared context (PAW)", text:
|
|
12627
|
-
{ id: "icm", label: "Shared context (ICM)", text:
|
|
12622
|
+
{ id: "user-profile", label: "About the user", text: userProfileSystemPrompt(cfg.profile) },
|
|
12623
|
+
{ id: "paw", label: "Shared context (PAW)", text: pawPrompt(bot, "") },
|
|
12624
|
+
{ id: "icm", label: "Shared context (ICM)", text: icmSystemPrompt(cfg) },
|
|
12628
12625
|
{ id: "private-bot", label: "Private Bot", text: isPersonalBot(bot) ? privateBotPrompt(false) : "" },
|
|
12629
12626
|
{ id: "files", label: "File locations", text: workspace ? workspaceLocationsPrompt(bot.id, cwd, readyBot.cwd) : "" },
|
|
12630
12627
|
{ id: "repos", label: "Linked repos", text: repoPlan ? repoPromptSection(repoPlan, repoPlace(undefined, roomTeamComputer || roomComputerKind === "box" ? "box" : roomVmMounted ? "vm" : roomComputerKind), cwd) : "" },
|
|
@@ -12788,7 +12785,7 @@ failover) {
|
|
|
12788
12785
|
systemVolatileSections: roomSystem.volatileSections,
|
|
12789
12786
|
cwd,
|
|
12790
12787
|
additionalDirs: turnAdditionalDirs(repoPlan, cwd),
|
|
12791
|
-
integrations,
|
|
12788
|
+
integrations,
|
|
12792
12789
|
...userMcpForTurn(readyBot, instance),
|
|
12793
12790
|
...(roomAddons.pluginDirs.length ? { pluginDirs: roomAddons.pluginDirs } : {}),
|
|
12794
12791
|
...(roomAddons.rtk ? { rtk: roomAddons.rtk } : {}),
|
|
@@ -16192,6 +16189,20 @@ ROUTES.push(createThreadStopRoutes({
|
|
|
16192
16189
|
working: (botId, threadId) => threadBusy(botId, threadId) || Boolean(roomHandoffs.activeDirect(threadId)) ||
|
|
16193
16190
|
routines?.activeBotRunForBot(botId)?.threadId === threadId,
|
|
16194
16191
|
stop: stopBotThread,
|
|
16192
|
+
hold: async (botId, threadId) => {
|
|
16193
|
+
const bot = store.bot(botId);
|
|
16194
|
+
if (!bot)
|
|
16195
|
+
return "unavailable";
|
|
16196
|
+
const instance = registry.get((botForThread(botId, threadId) ?? bot).modelSelection.instanceId);
|
|
16197
|
+
return (await instance?.adapter.holdTurn?.(threadId)) ?? "unavailable";
|
|
16198
|
+
},
|
|
16199
|
+
resume: async (botId, threadId) => {
|
|
16200
|
+
const bot = store.bot(botId);
|
|
16201
|
+
if (!bot)
|
|
16202
|
+
return "unavailable";
|
|
16203
|
+
const instance = registry.get((botForThread(botId, threadId) ?? bot).modelSelection.instanceId);
|
|
16204
|
+
return (await instance?.adapter.resumeTurn?.(threadId)) ?? "unavailable";
|
|
16205
|
+
},
|
|
16195
16206
|
}));
|
|
16196
16207
|
const sharedDeliverables = new SharedDeliverables(DATA_DIR);
|
|
16197
16208
|
const deliverableAccess = (senderId, auth) => sharedDeliverableAccess(sharedDeliverables, {
|
|
@@ -16202,8 +16213,6 @@ const deliverableAccess = (senderId, auth) => sharedDeliverableAccess(sharedDeli
|
|
|
16202
16213
|
ROUTES.push(createSharedDeliverablesRoutes(sharedDeliverables, () => deliverableAccess(undefined).sharedBlockedRoots ?? []));
|
|
16203
16214
|
ROUTES.push(createMessageFileRoutes({ store, attachments: ATTACHMENTS_DIR, workspaceDir, access: deliverableAccess }), createModelGatewayRoutes({ withinBudget: () => assertWithinBudget(cfg, DATA_DIR), book: bookTurnUsage }));
|
|
16204
16215
|
ROUTES.push(createPinOrderRoutes({ store, visible: (auth) => visibleTo(viewerFor(auth)), personalHidden: personalBotHidden, fromBot: (req) => authorizedInternalCapability(req.headers.authorization) !== null }));
|
|
16205
|
-
// Linked repos: Settings > Repos, per-thread links and worktrees. See
|
|
16206
|
-
// server/routes/repos.ts for the routes and docs/chibitek/README.md.
|
|
16207
16216
|
ROUTES.push(createRepoRoutes({
|
|
16208
16217
|
registry: repoRegistry,
|
|
16209
16218
|
github: new GitHubRepos(repoRegistry),
|
|
@@ -16283,10 +16292,7 @@ const handleRequest = async (req, res) => {
|
|
|
16283
16292
|
if (refusal)
|
|
16284
16293
|
return json(res, 403, { error: refusal, code: "managed_policy" });
|
|
16285
16294
|
}
|
|
16286
|
-
//
|
|
16287
|
-
// Two public routes come first: what this server is, and turning a pairing
|
|
16288
|
-
// code into a session. Everything else needs the loopback owner or a
|
|
16289
|
-
// paired session with the right scope.
|
|
16295
|
+
// Auth (server/request-auth.ts): /meta and /pair are public; everything else needs a session.
|
|
16290
16296
|
if (method === "GET" && !path.startsWith("/api/") && !path.startsWith("/.well-known/") && serveStatic(res, path))
|
|
16291
16297
|
return;
|
|
16292
16298
|
if (method === "GET" && path === "/.well-known/openmausbot/environment") {
|
|
@@ -16298,9 +16304,7 @@ const handleRequest = async (req, res) => {
|
|
|
16298
16304
|
const challenge = customDomainVerifier.challenge(domainCheck[1]);
|
|
16299
16305
|
return json(res, challenge ? 200 : 404, challenge ?? { error: "No active domain check." });
|
|
16300
16306
|
}
|
|
16301
|
-
//
|
|
16302
|
-
// /api/auth/pair, JSON-only for the same reason, and counted against the
|
|
16303
|
-
// same per-source lockout so a code cannot be guessed.
|
|
16307
|
+
// Emailed sign-in code (server/account-signin.ts): public, JSON-only, same lockout as /pair.
|
|
16304
16308
|
if (method === "POST" && (path === "/api/auth/email/start" || path === "/api/auth/email/verify")) {
|
|
16305
16309
|
if (!/^application\/json\b/i.test(String(req.headers["content-type"] ?? ""))) {
|
|
16306
16310
|
return json(res, 415, { error: "send the sign-in request as JSON (content-type: application/json)" });
|
|
@@ -16339,9 +16343,7 @@ const handleRequest = async (req, res) => {
|
|
|
16339
16343
|
return json(res, 200, { session: issued.session, environment });
|
|
16340
16344
|
}
|
|
16341
16345
|
if (method === "POST" && path === "/api/auth/pair") {
|
|
16342
|
-
// JSON only
|
|
16343
|
-
// without a preflight, so a stray unused code cannot be planted as a
|
|
16344
|
-
// session in someone else's browser.
|
|
16346
|
+
// JSON only, so a cross-site form cannot plant a session without a preflight.
|
|
16345
16347
|
if (!/^application\/json\b/i.test(String(req.headers["content-type"] ?? ""))) {
|
|
16346
16348
|
return json(res, 415, { error: "send the pairing code as JSON (content-type: application/json)" });
|
|
16347
16349
|
}
|
|
@@ -16890,7 +16892,7 @@ const handleRequest = async (req, res) => {
|
|
|
16890
16892
|
return json(res, 403, { error: "Computer selection belongs to a direct bot conversation." });
|
|
16891
16893
|
const requested = method === "POST" ? (await readInternalBody()).surface : undefined;
|
|
16892
16894
|
if (method === "POST" && !canSelect)
|
|
16893
|
-
return json(res, 403, { error: "Computer selection
|
|
16895
|
+
return json(res, 403, { error: "Computer selection requires an active direct user request with computer access enabled." });
|
|
16894
16896
|
if (method === "POST" && requested !== "auto" && !parseSurface(requested)) {
|
|
16895
16897
|
return json(res, 400, { error: "surface must be auto, cloud, vm, local, or browser" });
|
|
16896
16898
|
}
|
|
@@ -16963,9 +16965,8 @@ const handleRequest = async (req, res) => {
|
|
|
16963
16965
|
// only work items), and only when the person on the thread is the one
|
|
16964
16966
|
// signed in to Nexus here.
|
|
16965
16967
|
if (method === "POST" && (path === "/api/internal/nexus/recall" || path === "/api/internal/nexus/file")) {
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
return json(res, 403, { error: refusal });
|
|
16968
|
+
if (!nexusOwnerThread(internalCapability.threadId))
|
|
16969
|
+
return json(res, 403, { error: "This conversation is with someone other than the person signed in to Nexus here, so their Nexus is not shared into it." });
|
|
16969
16970
|
const body = await readInternalBody();
|
|
16970
16971
|
const bot = { id: internalSender.id, name: internalSender.name, ...(internalSender.personal ? { personal: true } : {}) };
|
|
16971
16972
|
try {
|
|
@@ -20578,7 +20579,7 @@ const handleRequest = async (req, res) => {
|
|
|
20578
20579
|
// computer, MCP servers, skills, routines): a plain bot, set up by the person.
|
|
20579
20580
|
if (auth.kind === "assistant")
|
|
20580
20581
|
body = { ...body, useDefaults: false };
|
|
20581
|
-
const template = resolveBotCreationDefaults(cfg.newBotDefaults, body);
|
|
20582
|
+
const template = resolveBotCreationDefaults(cfg.newBotDefaults, body, auth.kind !== "assistant");
|
|
20582
20583
|
const settings = template.profile;
|
|
20583
20584
|
if (auth.kind === "session" && !auth.scopes.includes("admin")) {
|
|
20584
20585
|
const field = clientBotPatchViolation(settings);
|
|
@@ -22624,8 +22625,6 @@ const handleRequest = async (req, res) => {
|
|
|
22624
22625
|
if (expectedThreadId !== undefined && (typeof expectedThreadId !== "string" || !/^[\w-]+$/.test(expectedThreadId))) {
|
|
22625
22626
|
return json(res, 400, { error: "threadId must be a task id" });
|
|
22626
22627
|
}
|
|
22627
|
-
// Explicit thread targets never fall through to another routine or
|
|
22628
|
-
// channel just because it belongs to the same bot.
|
|
22629
22628
|
if (typeof expectedThreadId === "string" && store.taskByThread(bot.id, expectedThreadId)) {
|
|
22630
22629
|
await stopBotThread(bot.id, expectedThreadId);
|
|
22631
22630
|
return json(res, 200, { ok: true });
|
|
@@ -22644,8 +22643,6 @@ const handleRequest = async (req, res) => {
|
|
|
22644
22643
|
return json(res, 200, { ok: true });
|
|
22645
22644
|
}
|
|
22646
22645
|
const instance = registry.get((botForThread(bot.id, expectedThreadId ?? bot.threadId) ?? bot).modelSelection.instanceId);
|
|
22647
|
-
// a bot busy in a ROOM is running on the room's thread — stopping it
|
|
22648
|
-
// from its own chat must reach that turn, not just the 1:1 thread
|
|
22649
22646
|
const busyGroup = activeGroupTurnForBot(bot.id);
|
|
22650
22647
|
if (busyGroup) {
|
|
22651
22648
|
if (expectedThreadId !== undefined && busyGroup.threadId !== expectedThreadId) {
|
|
@@ -91,7 +91,7 @@ export const newBotDefaultsSchema = z.object({
|
|
|
91
91
|
}).strict().refine(value => Buffer.byteLength(JSON.stringify(value), "utf8") <= 900_000, "Bot defaults must fit within 900 KB");
|
|
92
92
|
/** Explicit values (including empty values) win. A resolved renderer draft
|
|
93
93
|
* opts out so deleted fields and template extras are not restored on POST. */
|
|
94
|
-
export function resolveBotCreationDefaults(saved, body) {
|
|
94
|
+
export function resolveBotCreationDefaults(saved, body, ownerCreated = true) {
|
|
95
95
|
if (body.useDefaults !== undefined && typeof body.useDefaults !== "boolean") {
|
|
96
96
|
throw Object.assign(new Error("useDefaults must be true or false"), { status: 400 });
|
|
97
97
|
}
|
|
@@ -105,6 +105,8 @@ export function resolveBotCreationDefaults(saved, body) {
|
|
|
105
105
|
if (Object.hasOwn(body, key))
|
|
106
106
|
Object.assign(profile, { [key]: key === "section" && body[key] === null ? "" : body[key] });
|
|
107
107
|
}
|
|
108
|
+
// Review by default; local computer automation retains its consent flow.
|
|
109
|
+
profile.approvalMode ??= ownerCreated && profile.computer !== "local" ? "auto" : "ask";
|
|
108
110
|
const resolved = botDefaultsProfileSchema.safeParse(profile);
|
|
109
111
|
if (!resolved.success)
|
|
110
112
|
throw Object.assign(new Error(resolved.error.message), { status: 400 });
|
|
@@ -8,10 +8,15 @@
|
|
|
8
8
|
// conversations that assistant can already write to with
|
|
9
9
|
// POST /api/bots/:id/messages.
|
|
10
10
|
import { PASS } from "./table.js";
|
|
11
|
-
const
|
|
11
|
+
const STOP = /^\/api\/bots\/([\w-]+)\/threads\/([\w-]+)\/stop$/;
|
|
12
|
+
const PAUSE = /^\/api\/bots\/([\w-]+)\/threads\/([\w-]+)\/pause$/;
|
|
13
|
+
const RESUME = /^\/api\/bots\/([\w-]+)\/threads\/([\w-]+)\/resume$/;
|
|
12
14
|
export function createThreadStopRoutes(deps) {
|
|
13
15
|
return async ({ res, path, method, json }) => {
|
|
14
|
-
const
|
|
16
|
+
const stop = STOP.exec(path);
|
|
17
|
+
const pause = PAUSE.exec(path);
|
|
18
|
+
const resume = RESUME.exec(path);
|
|
19
|
+
const m = stop ?? pause ?? resume;
|
|
15
20
|
if (!m)
|
|
16
21
|
return PASS;
|
|
17
22
|
if (method !== "POST")
|
|
@@ -19,6 +24,14 @@ export function createThreadStopRoutes(deps) {
|
|
|
19
24
|
const [, botId, threadId] = m;
|
|
20
25
|
if (!deps.owns(botId, threadId))
|
|
21
26
|
return json(res, 404, { error: "no such conversation for this bot" });
|
|
27
|
+
if (pause) {
|
|
28
|
+
const outcome = await deps.hold(botId, threadId);
|
|
29
|
+
return json(res, 200, { ok: true, outcome });
|
|
30
|
+
}
|
|
31
|
+
if (resume) {
|
|
32
|
+
const outcome = await deps.resume(botId, threadId);
|
|
33
|
+
return json(res, 200, { ok: true, outcome });
|
|
34
|
+
}
|
|
22
35
|
// Nothing running: a no-op, so a late Stop never marks a finished
|
|
23
36
|
// request as cancelled.
|
|
24
37
|
if (!deps.working(botId, threadId))
|
|
@@ -131,7 +131,7 @@ export function surfacePrompt(mounted, opts = {}) {
|
|
|
131
131
|
text += ` This conversation is pinned to ${surfaceLabel(opts.pinned)}; changing places requires ${opts.canSelect ? "select_computer or " : ""}the conversation's computer selector, not a different tool name.`;
|
|
132
132
|
}
|
|
133
133
|
if (opts.canSelect)
|
|
134
|
-
text += " For a screen task, use select_computer with no arguments when you need to inspect the actual available targets. Choose the requested place from its result; if the user left the place open, use a suitable available target or surface auto instead of asking them to operate the menu. Browser-only work can stay in Browser; when it needs desktop apps or capabilities the current Browser lacks, select an available Local VM without asking the user to switch it manually. Choose before taking actions, and do not repeat actions already completed if the task must continue elsewhere. Atomic can start an existing configured computer and highlight the selected target. If the right tools are already mounted, use them directly. On a pending switch, end this turn: the original request resumes automatically with the new tools, and then you must carry out the task. Only ask for input for a genuine blocker, such as missing setup, required sign-in or an approval. Never silently replace an explicitly requested VM with the host desktop.";
|
|
134
|
+
text += " For a screen task, use select_computer with no arguments when you need to inspect the actual available targets. Choose the requested place from its result; if the user left the place open, use a suitable available target or surface auto instead of asking them to operate the menu. Browser-only work can stay in Browser; when it needs desktop apps or capabilities the current Browser lacks, select an available Local VM without asking the user to switch it manually. Choose before taking actions, and do not repeat actions already completed if the task must continue elsewhere. Atomic can start an existing configured computer and highlight the selected target. If the right tools are already mounted, use them directly. On a pending switch, end this turn: the original request resumes automatically with the new tools, and then you must carry out the task. After reconnecting, you may select another available surface when the same authorized task requires it; retain completed work and do not repeat unsuccessful selections without a changed condition. Only ask for input for a genuine blocker, such as missing setup, required sign-in or an approval. Never silently replace an explicitly requested VM with the host desktop.";
|
|
135
135
|
if (opts.canSelect)
|
|
136
136
|
text += " If no suitable computer is running but its provider is configured, select_computer can provision one for this computer task; reuse existing resources first. Do not provision merely for ordinary chat or inspection.";
|
|
137
137
|
if (opts.canSelect && !computer && !mounted.browser)
|