@audiofool/moondog 0.3.0-beta.10 → 0.3.0-beta.11

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.
@@ -24,6 +24,8 @@ import { getPublicPiModelCatalog } from "../../runtime/pi/public-model-catalog.m
24
24
  import { serviceKeyProviders, supportedAuthProviderIds } from "../../runtime/pi/authentication.mjs";
25
25
  import { EFFORT_LEVELS, EFFORT_SCALE } from "../../runtime/pi/runtime-settings.mjs";
26
26
  import { runtimeBehindSelection } from "../../runtime/pi/runtime-selection.mjs";
27
+ import { MODEL_ROLE_WORDS } from "./model-roles-command.mjs";
28
+ import { imagesFromText } from "../../runtime/pi/image-input.mjs";
27
29
  import {
28
30
  formatLocalResult,
29
31
  helpText,
@@ -209,6 +211,7 @@ export async function runMoondogTui({
209
211
  runProfile,
210
212
  runProfileAction,
211
213
  runWeb,
214
+ runModelRoles,
212
215
  checkUpdates,
213
216
  runUpdate,
214
217
  lyrics,
@@ -1440,7 +1443,7 @@ export async function runMoondogTui({
1440
1443
  // The window's endpoints reach /model here; an agent on an endpoint that changed is rebuilt, since its
1441
1444
  // address or key may have. The window's menu list and its per-conversation choices don't move this one.
1442
1445
  const stopWatchingModel = watchModelSettings?.((selection, changed) => {
1443
- if (changed === "models") return;
1446
+ if (changed === "models" || changed === "roles") return;
1444
1447
  if (changed === "endpoints") void refreshEndpoints?.();
1445
1448
  const onEndpoint = changed === "endpoints" && String(runtimeStatus.provider ?? "").startsWith("endpoint-");
1446
1449
  if (!onEndpoint && !runtimeBehindSelection(runtimeStatus, selection)) return;
@@ -2550,6 +2553,13 @@ export async function runMoondogTui({
2550
2553
  return;
2551
2554
  }
2552
2555
  if (command === "model") {
2556
+ // /model roles, vision, web and audio set what other models are for; the rest pick the chat model.
2557
+ if (args[0] && Object.hasOwn(MODEL_ROLE_WORDS, args[0].toLowerCase())) {
2558
+ if (typeof runModelRoles !== "function") throw new Error(tr("Model roles aren't available when Moondog is started this way."));
2559
+ addMoondogMessage(await runModelRoles(args));
2560
+ setFooter(tr("Done."), success);
2561
+ return;
2562
+ }
2553
2563
  await selectModel(args);
2554
2564
  return;
2555
2565
  }
@@ -2827,8 +2837,12 @@ export async function runMoondogTui({
2827
2837
  };
2828
2838
 
2829
2839
  try {
2840
+ // An image path in the message goes with it, as Hermes Agent's terminal does; the words stay.
2841
+ const images = await imagesFromText(value);
2842
+ if (images.length) setFooter(tr("Looking at the attached images... Ctrl+C cancels."));
2830
2843
  const result = await activeRuntime.prompt(value, {
2831
2844
  ...(profileSeed ? { profileSeed } : {}),
2845
+ ...(images.length ? { images } : {}),
2832
2846
  onTextDelta: (delta) => {
2833
2847
  if (cleanedUp) return;
2834
2848
  work.quiet();