@contenthero/mcp 0.4.2 → 0.4.4

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/format.d.ts CHANGED
@@ -4,12 +4,21 @@
4
4
  * a readable message instead of a transport failure.
5
5
  */
6
6
  import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
- import type { Avatar, AvatarSummary, Balance, BrandKit, BrandKitSummary, BrandKitSectionRecord, BrandKnowledgeItem, BrandKnowledgeDetail, BrandKnowledgeListResult, BrandKnowledgeMatch, ConnectedAccount, CostEstimate, Element, Generation, GenerateResult, EditAudioResult, MediaItem, MediaSummary, SearchMediaResult, Folder, DerivedFolder, FolderItem, MediaBatchResult, CreateMediaUploadResult, ImportedMedia, UploadedMedia, ModelInfo, PlatformSummary, PlatformSchema, Stage, Space, CardAsset, Post, CardDetail, CardListResult, CardSummary, Tag, PublishResult, TrackedAccount, ContentDetail, ContentListResult, AccountDetail, Transcription, Voice, VoiceSummary, ApplyEditorOpsResult, ProjectSummary, ProjectDetail, LiveContextResult, LayerTypeCatalog, TimelineTypeCatalog, TranscriptResult, ExportJob, ExportFormatCatalog, ExtractionOutcome } from '@contenthero/sdk';
7
+ import type { Avatar, AvatarSummary, Balance, BrandKit, BrandKitSummary, BrandKitSectionRecord, BrandKnowledgeItem, BrandKnowledgeDetail, BrandKnowledgeListResult, BrandKnowledgeMatch, ConnectedAccount, CostEstimate, CreateAvatarResult, Element, Generation, GenerateResult, EditAudioResult, MediaItem, MediaSummary, SearchMediaResult, Folder, DerivedFolder, FolderItem, MediaBatchResult, CreateMediaUploadResult, ImportedMedia, UploadedMedia, ModelInfo, PlatformSummary, PlatformSchema, Stage, Space, CardAsset, Post, CardDetail, CardListResult, StageListResult, CardSummary, Tag, PublishResult, TrackedAccount, ContentDetail, ContentListResult, AccountDetail, Transcription, Voice, VoiceSummary, ApplyEditorOpsResult, ProjectSummary, ProjectDetail, LiveContextResult, LayerTypeCatalog, TimelineTypeCatalog, TranscriptResult, ExportJob, ExportFormatCatalog, ExtractionOutcome } from '@contenthero/sdk';
8
8
  export declare function text(body: string, isError?: boolean): CallToolResult;
9
9
  /** A finished image/video generation: list the asset URLs, plus the placement outcome when placed on a project. */
10
10
  export declare function completedResult(gen: Generation): CallToolResult;
11
11
  /** Suggested seconds to wait before re-polling a job, by content type. */
12
12
  export declare function pollAfterSecondsFor(contentType: string): number;
13
+ /**
14
+ * How to call `get_generation_status`, written as the call itself.
15
+ *
16
+ * ⚠️ THE ARGUMENT IS `outputIds` AND IT IS AN ARRAY, ALWAYS, even for one job. Every handoff here used to
17
+ * say "call get_generation_status with this outputId", which names a parameter that does not exist: an agent
18
+ * following the sentence literally sends `{ outputId }` and the schema rejects it. Naming the shape in prose
19
+ * is what drifted, so these messages now print the call instead, and every site shares this one function.
20
+ */
21
+ export declare function getStatusCall(outputIds: readonly string[]): string;
13
22
  /** A slow job that did not finish within the smart-wait window. */
14
23
  export declare function pendingResult(outputId: string, pollAfterSeconds?: number): CallToolResult;
15
24
  /** Synchronous audio result (already complete on submit). */
@@ -24,7 +33,19 @@ export declare function audioResult(result: GenerateResult | EditAudioResult): C
24
33
  export declare function enhanceClipsResult(result: EditAudioResult): CallToolResult;
25
34
  /** Result of a get_cost preflight: the estimate, with nothing generated or charged. */
26
35
  export declare function costResult(est: CostEstimate): CallToolResult;
27
- /** One generation's status. Used directly for a single id, and per-row by the batch form below. */
36
+ /**
37
+ * One generation's status. Used directly for a single id, and per-row by the batch form below.
38
+ *
39
+ * ⭐ A STILL-RUNNING GENERATION REPORTS THE URLS IT ALREADY HAS. `outputUrls` fills in slot by slot,
40
+ * so a 4-image batch can have three finished assets while `status` is still 'processing'. Reporting
41
+ * only "still processing" threw those away and made every caller block on the SLOWEST slot, even
42
+ * though the finished ones are already visible in the app's own grid. The caller can start reviewing
43
+ * immediately and re-poll only for the remainder.
44
+ *
45
+ * ⚠️ THE PARTIAL LIST IS NOT A FINAL ONE, so it never uses `completedResult`'s "Done." header. A
46
+ * caller that stopped at a partial result believing it was complete would silently lose images,
47
+ * which is the failure this is meant to prevent, not cause.
48
+ */
28
49
  export declare function generationStatusResult(gen: Generation): CallToolResult;
29
50
  /** One or more generations (snapshot or post-wait). Falls through to the single form for one id. */
30
51
  export declare function generationBatchResult(gens: Generation[]): CallToolResult;
@@ -34,6 +55,18 @@ export declare function transcriptResult(t: Transcription): CallToolResult;
34
55
  export declare function avatarListResult(avatars: AvatarSummary[]): CallToolResult;
35
56
  /** One avatar's full detail, including its looks. */
36
57
  export declare function avatarResult(a: Avatar): CallToolResult;
58
+ /**
59
+ * A just-created avatar, which is NOT READY.
60
+ *
61
+ * ⚠️ THE POINT OF A SEPARATE FORMATTER IS THE WAIT. `avatarResult` describes a finished avatar, and
62
+ * using it here would show an avatar with `image: none` and no looks, which reads as "created, and
63
+ * empty" rather than "created, and still generating". A model that reads it that way goes on to
64
+ * generate a look into an avatar whose own first look is still in flight, or reports success to the
65
+ * user for something they cannot yet see.
66
+ *
67
+ * Says the poll call explicitly, the same way `pendingResult` does for a generation.
68
+ */
69
+ export declare function avatarPendingResult(created: CreateAvatarResult): CallToolResult;
37
70
  /** List of saved voices. */
38
71
  export declare function voiceListResult(voices: VoiceSummary[]): CallToolResult;
39
72
  /** One voice's full detail. */
@@ -126,7 +159,16 @@ export declare function platformListResult(platforms: PlatformSummary[]): CallTo
126
159
  export declare function platformResult(p: PlatformSchema): CallToolResult;
127
160
  /** List of posts with pagination context. */
128
161
  export declare function cardListResult(result: CardListResult): CallToolResult;
129
- /** A single post summary line (create / update / schedule / archive results). */
162
+ /**
163
+ * A single post summary line (create / update / schedule / archive results).
164
+ *
165
+ * ⚠️ THIS USED TO PRINT `p.status`, AND A CARD NO LONGER HAS ONE. The field was almost always `draft`
166
+ * regardless of the card's real state, so it told the agent nothing while looking like it did. What it
167
+ * prints now is what is true: where the card sits, when it publishes, and whether it is archived.
168
+ *
169
+ * ⭐ ARCHIVE IS SHOWN ONLY WHEN TRUE. A live card saying "not archived" is noise on every line, and
170
+ * `spaceListResult` below already made this call for spaces.
171
+ */
130
172
  export declare function postSummaryResult(p: CardSummary, prefix?: string): CallToolResult;
131
173
  /** One card in full, with its posts and assets. */
132
174
  export declare function cardResult(p: CardDetail): CallToolResult;
@@ -142,7 +184,11 @@ export declare function spaceListResult(spaces: Space[]): CallToolResult;
142
184
  export declare function spaceDeletedResult(id: string): CallToolResult;
143
185
  /** One space. */
144
186
  export declare function spaceResult(s: Space): CallToolResult;
145
- export declare function stageListResult(stages: Stage[]): CallToolResult;
187
+ export declare function stageListResult(result: StageListResult): CallToolResult;
188
+ /** One created or updated stage. */
189
+ export declare function stageResult(s: Stage, respaced?: boolean): CallToolResult;
190
+ /** A deleted stage, and the board that is left. */
191
+ export declare function stageDeletedResult(id: string, movedCards: number, stages: Stage[]): CallToolResult;
146
192
  /** A created or updated post. */
147
193
  export declare function postResult(d: Post): CallToolResult;
148
194
  /** An attached asset. */
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,OAAO,EACP,QAAQ,EACR,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,UAAU,EACV,gBAAgB,EAEhB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,KAAK,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,UAAU,EACV,cAAc,EACd,WAAW,EACX,GAAG,EACH,aAAa,EACb,cAAc,EAEd,a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0B1E;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,mBAAmB,GAAG,cAAc,CAU5E"}
package/dist/format.js CHANGED
@@ -30,9 +30,20 @@ export function completedResult(gen) {
30
30
  export function pollAfterSecondsFor(contentType) {
31
31
  return contentType === 'image' ? 5 : 15;
32
32
  }
33
+ /**
34
+ * How to call `get_generation_status`, written as the call itself.
35
+ *
36
+ * ⚠️ THE ARGUMENT IS `outputIds` AND IT IS AN ARRAY, ALWAYS, even for one job. Every handoff here used to
37
+ * say "call get_generation_status with this outputId", which names a parameter that does not exist: an agent
38
+ * following the sentence literally sends `{ outputId }` and the schema rejects it. Naming the shape in prose
39
+ * is what drifted, so these messages now print the call instead, and every site shares this one function.
40
+ */
41
+ export function getStatusCall(outputIds) {
42
+ return `get_generation_status { outputIds: [${outputIds.map((id) => `"${id}"`).join(', ')}] }`;
43
+ }
33
44
  /** A slow job that did not finish within the smart-wait window. */
34
45
  export function pendingResult(outputId, pollAfterSeconds = 15) {
35
- return text(`Still rendering (outputId ${outputId}). This is normal for video. Call get_generation_status with this outputId in ~${pollAfterSeconds}s [poll_after_seconds: ${pollAfterSeconds}] to get the final URLs.`);
46
+ return text(`Still rendering (outputId ${outputId}). This is normal for video. Call ${getStatusCall([outputId])} in ~${pollAfterSeconds}s [poll_after_seconds: ${pollAfterSeconds}] to get the final URLs.`);
36
47
  }
37
48
  /** Synchronous audio result (already complete on submit). */
38
49
  export function audioResult(result) {
@@ -54,9 +65,10 @@ export function enhanceClipsResult(result) {
54
65
  }
55
66
  const lines = jobs.map((j, i) => `${i + 1}. outputId ${j.outputId} covers ${j.clipIds.length} clip${j.clipIds.length === 1 ? '' : 's'}` +
56
67
  ` from one source (${j.windows} window${j.windows === 1 ? '' : 's'})`);
68
+ const poll = `Poll with ${getStatusCall(jobs.map((j) => j.outputId))}`;
57
69
  const header = jobs.length === 1
58
- ? 'Enhancing 1 source. Poll its outputId with get_generation_status:'
59
- : `Enhancing ${jobs.length} sources as separate jobs, because a noise profile is estimated per recording. Poll EVERY outputId:`;
70
+ ? `Enhancing 1 source. ${poll}:`
71
+ : `Enhancing ${jobs.length} sources as separate jobs, because a noise profile is estimated per recording. ${poll} (EVERY id, in one call):`;
60
72
  const footer = [
61
73
  'The enhanced audio is applied to the clips automatically when each job lands, so no placement call is needed.',
62
74
  result.silencedClipsExcluded
@@ -71,7 +83,19 @@ export function costResult(est) {
71
83
  const credits = `${est.creditsEstimate} credit${est.creditsEstimate === 1 ? '' : 's'}`;
72
84
  return text(`Estimated cost: ${credits} for ${what}. No generation ran and nothing was charged.`);
73
85
  }
74
- /** One generation's status. Used directly for a single id, and per-row by the batch form below. */
86
+ /**
87
+ * One generation's status. Used directly for a single id, and per-row by the batch form below.
88
+ *
89
+ * ⭐ A STILL-RUNNING GENERATION REPORTS THE URLS IT ALREADY HAS. `outputUrls` fills in slot by slot,
90
+ * so a 4-image batch can have three finished assets while `status` is still 'processing'. Reporting
91
+ * only "still processing" threw those away and made every caller block on the SLOWEST slot, even
92
+ * though the finished ones are already visible in the app's own grid. The caller can start reviewing
93
+ * immediately and re-poll only for the remainder.
94
+ *
95
+ * ⚠️ THE PARTIAL LIST IS NOT A FINAL ONE, so it never uses `completedResult`'s "Done." header. A
96
+ * caller that stopped at a partial result believing it was complete would silently lose images,
97
+ * which is the failure this is meant to prevent, not cause.
98
+ */
75
99
  export function generationStatusResult(gen) {
76
100
  if (gen.status === 'completed')
77
101
  return completedResult(gen);
@@ -79,7 +103,17 @@ export function generationStatusResult(gen) {
79
103
  return text(`Generation ${gen.outputId} failed: ${gen.error ?? 'unknown error'}`, true);
80
104
  }
81
105
  const secs = pollAfterSecondsFor(gen.contentType);
82
- return text(`Generation ${gen.outputId} is still ${gen.status}. Call get_generation_status again in ~${secs}s [poll_after_seconds: ${secs}].`);
106
+ const ready = gen.outputUrls ?? [];
107
+ const poll = `Call get_generation_status again in ~${secs}s [poll_after_seconds: ${secs}]`;
108
+ if (ready.length === 0) {
109
+ return text(`Generation ${gen.outputId} is still ${gen.status}. ${poll}.`);
110
+ }
111
+ const noun = ready.length === 1 ? gen.contentType : `${gen.contentType}s`;
112
+ return text([
113
+ `Partial. ${ready.length} ${noun} ready from ${gen.modelId} (outputId ${gen.outputId}), more still ${gen.status}:`,
114
+ ...ready.map((u, i) => `${i + 1}. ${u}`),
115
+ `NOT the full set. ${poll} for the rest.`,
116
+ ].join('\n'));
83
117
  }
84
118
  /** One or more generations (snapshot or post-wait). Falls through to the single form for one id. */
85
119
  export function generationBatchResult(gens) {
@@ -94,6 +128,13 @@ export function generationBatchResult(gens) {
94
128
  return `- ${gen.outputId}: failed | ${gen.error ?? 'unknown error'}`;
95
129
  }
96
130
  const secs = pollAfterSecondsFor(gen.contentType);
131
+ // Same rule as the single form: surface the slots that already landed rather than making the
132
+ // caller block on the slowest one. The count says the set is incomplete, so a row can never be
133
+ // mistaken for a finished generation.
134
+ const ready = gen.outputUrls ?? [];
135
+ if (ready.length > 0) {
136
+ return `- ${gen.outputId}: ${gen.status}, ${ready.length} ready so far | ${ready.join(', ')} [poll_after_seconds: ${secs}]`;
137
+ }
97
138
  return `- ${gen.outputId}: ${gen.status} [poll_after_seconds: ${secs}]`;
98
139
  });
99
140
  return text([`${gens.length} generation(s):`, ...rows].join('\n'));
@@ -131,6 +172,29 @@ export function avatarResult(a) {
131
172
  ...a.looks.map((l) => ` - ${l.name ?? l.lookType ?? 'look'} (id ${l.id})${l.isDefault ? ' [default]' : ''}${l.isFavorited ? ' [favorite]' : ''}${l.isArchived ? ' [archived]' : ''}: ${l.imageUrl ?? 'none'}`),
132
173
  ]));
133
174
  }
175
+ /**
176
+ * A just-created avatar, which is NOT READY.
177
+ *
178
+ * ⚠️ THE POINT OF A SEPARATE FORMATTER IS THE WAIT. `avatarResult` describes a finished avatar, and
179
+ * using it here would show an avatar with `image: none` and no looks, which reads as "created, and
180
+ * empty" rather than "created, and still generating". A model that reads it that way goes on to
181
+ * generate a look into an avatar whose own first look is still in flight, or reports success to the
182
+ * user for something they cannot yet see.
183
+ *
184
+ * Says the poll call explicitly, the same way `pendingResult` does for a generation.
185
+ */
186
+ export function avatarPendingResult(created) {
187
+ const a = created.avatar;
188
+ return text(lines([
189
+ `Created "${a.name}" (id ${a.id}).`,
190
+ '',
191
+ `⚠️ NOT READY YET: status is ${created.status}. The avatar has no image until its first look`,
192
+ 'finishes generating, which is also when its default look and profile photo are set.',
193
+ `Poll with: get_avatar { "avatarId": "${a.id}" } until status is "completed" (usually 1-4 minutes).`,
194
+ '',
195
+ 'Credits are charged when that look completes, not now, so a failed generation is not charged.',
196
+ ]));
197
+ }
134
198
  /** List of saved voices. */
135
199
  export function voiceListResult(voices) {
136
200
  if (!voices.length)
@@ -635,28 +699,54 @@ function cardLine(p) {
635
699
  : p.scheduledAt
636
700
  ? ` | scheduled ${p.scheduledAt}`
637
701
  : '';
638
- return `- ${p.title || '(untitled)'} (id ${p.id}) | ${p.status} | ${where}${when}`;
702
+ // `[archived]` rather than a status. The list excludes archived cards unless asked for, so when one
703
+ // appears here the agent asked for it and the flag confirms the filter did what it said.
704
+ return `- ${p.title || '(untitled)'} (id ${p.id})${p.isArchived ? ' [archived]' : ''} | ${where}${when}`;
639
705
  }
640
706
  /** List of posts with pagination context. */
641
707
  export function cardListResult(result) {
708
+ /**
709
+ * ⭐⭐⭐ NAME THE SCOPE, INCLUDING WHEN THE LIST IS EMPTY.
710
+ *
711
+ * This read covers ONE space and falls back to the default when none is named, so "No cards found" and
712
+ * "9 card(s)" are both answers about a board the caller may not have meant. Measured 2026-09-14: a call
713
+ * passing `space_id`, where the tool declares `spaceId`, had the key dropped, listed the default space,
714
+ * and read as proof that the tool ignored its filters.
715
+ *
716
+ * ⚠️ THE EMPTY CASE IS THE ONE THAT MATTERS MOST. A wrong-scope list of cards at least looks unfamiliar;
717
+ * a wrong-scope EMPTY list looks like the thing you asked for does not exist.
718
+ */
719
+ const where = result.space ? ` in ${result.space.name}` : '';
642
720
  if (!result.cards.length)
643
- return text('No cards found.');
721
+ return text(`No cards found${where}.`);
644
722
  const more = result.hasMore ? ` (showing ${result.cards.length} of ${result.total}; raise limit/offset for more)` : '';
645
- return text([`${result.total} card(s)${more}:`, ...result.cards.map(cardLine)].join('\n'));
723
+ return text([`${result.total} card(s)${where}${more}:`, ...result.cards.map(cardLine)].join('\n'));
646
724
  }
647
- /** A single post summary line (create / update / schedule / archive results). */
725
+ /**
726
+ * A single post summary line (create / update / schedule / archive results).
727
+ *
728
+ * ⚠️ THIS USED TO PRINT `p.status`, AND A CARD NO LONGER HAS ONE. The field was almost always `draft`
729
+ * regardless of the card's real state, so it told the agent nothing while looking like it did. What it
730
+ * prints now is what is true: where the card sits, when it publishes, and whether it is archived.
731
+ *
732
+ * ⭐ ARCHIVE IS SHOWN ONLY WHEN TRUE. A live card saying "not archived" is noise on every line, and
733
+ * `spaceListResult` below already made this call for spaces.
734
+ */
648
735
  export function postSummaryResult(p, prefix = 'Post') {
649
736
  const stage = p.stageId ? ` | stage ${p.stageId}` : '';
650
737
  // The schedule is surfaced here because scheduling is now part of update_card rather than its own tool.
651
738
  // Without it a caller who just set a publish time gets no confirmation of what time was actually stored.
652
739
  const scheduled = p.scheduledAt ? ` | Scheduled: ${p.scheduledAt}` : '';
653
- return text(`${prefix}: ${p.title || '(untitled)'} (id ${p.id}) | ${p.status}${stage}${scheduled}`);
740
+ const archived = p.isArchived ? ' | ARCHIVED' : '';
741
+ return text(`${prefix}: ${p.title || '(untitled)'} (id ${p.id})${stage}${scheduled}${archived}`);
654
742
  }
655
743
  /** One card in full, with its posts and assets. */
656
744
  export function cardResult(p) {
657
745
  return text(lines([
658
- `${p.title || '(untitled)'} (id ${p.id}) | ${p.status} | platform: ${p.platform ?? 'general'}`,
746
+ `${p.title || '(untitled)'} (id ${p.id}) | platform: ${p.platform ?? 'general'}`,
659
747
  p.stageId ? `stage: ${p.stageId}` : null,
748
+ // Stated only when archived, and it says WHEN, because "archived" with no date is half a fact.
749
+ p.archivedAt ? `archived: ${p.archivedAt}` : null,
660
750
  p.scheduledAt ? `scheduled: ${p.scheduledAt}` : null,
661
751
  p.publishedAt ? `published: ${p.publishedAt}` : null,
662
752
  p.publishUrl ? `publish url: ${p.publishUrl}` : null,
@@ -708,11 +798,45 @@ export function spaceResult(s) {
708
798
  ];
709
799
  return text(lines.join('\n'));
710
800
  }
711
- export function stageListResult(stages) {
712
- if (!stages.length)
713
- return text('No stages found.');
714
- const rows = stages.map((s) => `- ${s.name} (id ${s.id}${s.slug ? `, slug ${s.slug}` : ''})${s.isDefault ? ' [default]' : ''}`);
715
- return text([`${stages.length} stage(s) (in order):`, ...rows].join('\n'));
801
+ export function stageListResult(result) {
802
+ /**
803
+ * ⭐⭐⭐ NAME THE SCOPE, EMPTY CASE INCLUDED, matching `cardListResult` word for word.
804
+ *
805
+ * Stages are per-space and this read falls back to the default space when none is named, so a list of
806
+ * unfamiliar column names and "No stages found." are both answers about a board the caller may not have
807
+ * meant. The old signature took a bare `Stage[]` and had nothing to say it with.
808
+ */
809
+ const where = result.space ? ` in ${result.space.name}` : '';
810
+ if (!result.stages.length)
811
+ return text(`No stages found${where}.`);
812
+ const rows = result.stages.map((s) => `- ${s.name} (id ${s.id}${s.slug ? `, slug ${s.slug}` : ''})`);
813
+ return text([`${result.stages.length} stage(s)${where} (in order):`, ...rows].join('\n'));
814
+ }
815
+ /** One created or updated stage. */
816
+ export function stageResult(s, respaced = false) {
817
+ const lines = [
818
+ `Stage ${s.name} (id ${s.id})`,
819
+ s.slug ? `Slug: ${s.slug}` : null,
820
+ s.color ? `Color: ${s.color}` : null,
821
+ `Position: ${s.sortOrder}`,
822
+ ].filter(Boolean);
823
+ /*
824
+ ⚠️ SAID OUT LOUD, because it is the one answer the caller cannot derive. A move with no room between
825
+ two columns renumbers the WHOLE board, so every other stage the agent is holding is stale and a
826
+ renumbered key looks like any other number.
827
+ */
828
+ if (respaced) {
829
+ lines.push('The whole board was renumbered to make room. Call list_stages again: every other stage position you are holding is now stale.');
830
+ }
831
+ return text(lines.join('\n'));
832
+ }
833
+ /** A deleted stage, and the board that is left. */
834
+ export function stageDeletedResult(id, movedCards, stages) {
835
+ const moved = movedCards > 0
836
+ ? `${movedCards} ${movedCards === 1 ? 'card' : 'cards'} moved to the target stage.`
837
+ : 'It held no cards.';
838
+ const rows = stages.map((s) => `- ${s.name} (id ${s.id})`);
839
+ return text([`Deleted stage ${id}. ${moved}`, '', `${stages.length} stage(s) remaining:`, ...rows].join('\n'));
716
840
  }
717
841
  /** The non-empty keys of a post's platformSettings, for a compact summary. */
718
842
  function settingsKeys(settings) {