@moxt-ai/mobius 0.0.178 → 0.0.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/runtime.js CHANGED
@@ -23133,7 +23133,21 @@ var fileUpdateChangeSchema = external_exports.object({
23133
23133
  kind: external_exports.unknown(),
23134
23134
  path: boundedText(4096)
23135
23135
  });
23136
+ var imageGenerationItemSchema = external_exports.object({
23137
+ id: boundedText(256),
23138
+ type: external_exports.literal("imageGeneration"),
23139
+ status: boundedText(80),
23140
+ revisedPrompt: boundedText(32768).nullish(),
23141
+ // The app-server frame is bounded; media validation belongs to the content externalizer.
23142
+ result: external_exports.string(),
23143
+ failure: external_exports.object({
23144
+ type: external_exports.literal("usageLimitExceeded"),
23145
+ limitId: boundedText(256),
23146
+ resetsAt: external_exports.number().nullish()
23147
+ }).nullish()
23148
+ });
23136
23149
  var threadItemSchema = external_exports.discriminatedUnion("type", [
23150
+ imageGenerationItemSchema,
23137
23151
  external_exports.object({
23138
23152
  id: boundedText(256),
23139
23153
  text: boundedText(1e6),
@@ -23599,6 +23613,29 @@ function mcpStatus(status) {
23599
23613
  return status === "inProgress" ? "in_progress" : status === "completed" ? "completed" : "failed";
23600
23614
  }
23601
23615
  function presentToolItem(item) {
23616
+ if (item.type === "imageGeneration") {
23617
+ const failed = item.failure != null || item.status === "failed";
23618
+ const content = [];
23619
+ if (!failed && item.result.length > 0) {
23620
+ content.push({ type: "content", content: { type: "image", data: item.result, mimeType: "image/png" } });
23621
+ }
23622
+ if (failed) {
23623
+ content.push(
23624
+ textContent(
23625
+ item.failure?.type === "usageLimitExceeded" ? "Image generation usage limit reached." : "Image generation failed."
23626
+ )
23627
+ );
23628
+ }
23629
+ return {
23630
+ content,
23631
+ kind: "other",
23632
+ locations: [],
23633
+ rawInput: item.revisedPrompt == null ? null : { prompt: item.revisedPrompt },
23634
+ rawOutput: null,
23635
+ status: failed ? "failed" : item.status === "completed" ? "completed" : "in_progress",
23636
+ title: "Generate image"
23637
+ };
23638
+ }
23602
23639
  if (item.type === "commandExecution") {
23603
23640
  const output2 = item.aggregatedOutput ?? "";
23604
23641
  const content = [];