@contenthero/mcp 0.4.11 → 0.4.13

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/server.d.ts CHANGED
@@ -79,6 +79,57 @@ import { type GeneratedAttachment } from './format.js';
79
79
  * unlocks this, and it is its own piece of work rather than a prerequisite for rendering.
80
80
  */
81
81
  export declare function attachmentsFor(gen: Generation): Promise<GeneratedAttachment[]>;
82
+ /**
83
+ * ⭐⭐⭐ **WHY AN IMAGE WAS NOT ATTACHED, AS A VALUE RATHER THAN AS SILENCE.**
84
+ *
85
+ * `fetchImageBytes` returned `null` for five genuinely different reasons and the summary line reported one
86
+ * number: "0 image(s) attached below". That cost a week. Two separate defects were live at once (a rewrite
87
+ * rule that had stopped firing, and masters that outgrew every budget) and the result could not distinguish
88
+ * them from a network blip, so every theory was equally consistent with the evidence.
89
+ *
90
+ * ⛔ **A COUNT IS NOT A DIAGNOSIS.** Whatever replaces this must keep naming the cause. The rule the codebase
91
+ * keeps relearning: a sentinel that collapses distinct failures into one value moves the defect into every
92
+ * caller, and here the caller was a person reading a transcript.
93
+ */
94
+ type ImageSkipReason = 'host-not-allowed' | 'fetch-failed' | 'not-ok' | 'not-an-image'
95
+ /** Bigger than the whole per-result allowance: it would never have fit, at any position in the call. */
96
+ | 'over-budget'
97
+ /**
98
+ * Small enough on its own, but the earlier items in this call had already spent the shared allowance.
99
+ *
100
+ * ⭐ DISTINCT FROM `over-budget` BECAUSE THE FIX IS DIFFERENT AND THE READER CAN ACT ON IT. "Too large"
101
+ * invites resizing an asset that is already small; "ask for fewer items" is the actual remedy, and it is
102
+ * the reading that tells you the tail of a long batch was truncated rather than broken.
103
+ */
104
+ | 'budget-spent';
105
+ /**
106
+ * ⭐⭐⭐ **THE ONE PLACE THAT DECIDES HOW MUCH OF A RESULT MAY BE BYTES.**
107
+ *
108
+ * Two call sites needed this and each had its own answer, which is how the same defect appeared twice at
109
+ * different levels: `attachmentsFor` capped PER ITEM while the host's ceiling is per RESULT, and `get_media`
110
+ * fetched up to TEN images in parallel with no cap at all (10 x 840 KB is 8 MB against a 1 MB limit).
111
+ *
112
+ * ⛔ SEQUENTIAL, DELIBERATELY. The budget is shared state, so a parallel fetch cannot know what the others
113
+ * already spent and every one of them would pass a check the set as a whole fails. Most calls carry one to
114
+ * three items, so the latency is small and the alternative is a ceiling that holds only by luck.
115
+ *
116
+ * Returns one entry per input, positionally aligned with what was asked for. An entry that did not attach
117
+ * carries WHY, because the count alone is not diagnosable: see `ImageSkipReason`.
118
+ */
119
+ export interface InlinedImage {
120
+ image: {
121
+ data: string;
122
+ mimeType: string;
123
+ } | null;
124
+ /** Set only when `image` is null. Short enough to print in a result line. */
125
+ skipped?: string;
126
+ /**
127
+ * The machine-readable cause, so a formatter can decide what to SAY about a set of them without parsing
128
+ * the sentence it is about to print. "Ask for fewer items" is advice about the whole call, so it belongs
129
+ * once at the end rather than repeated per item.
130
+ */
131
+ reason?: ImageSkipReason;
132
+ }
82
133
  /**
83
134
  * ⛔⛔ **THE DISPLAY NAME IS NO LONGER RESOLVED HERE. `Generation.modelDisplayName` CARRIES IT.**
84
135
  *
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAenE,OAAO,EACL,WAAW,EAcX,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAazB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,EAEL,KAAK,kBAAkB,EASxB,MAAM,aAAa,CAAA;AACpB,OAAO,EAeL,KAAK,mBAAmB,EA8DzB,MAAM,aAAa,CAAA;AAgLpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,cAAc,CAAC,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