@songsid/agend 2.1.8-beta.11 → 2.1.8-beta.12
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/fleet-manager.d.ts
CHANGED
|
@@ -1234,6 +1234,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
1234
1234
|
* An empty emoji removes that status's override.
|
|
1235
1235
|
*/
|
|
1236
1236
|
setPersonaEmoji(instanceName: string, args: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1237
|
+
/** A ClassicBot instance: it may see (list/preview) emojis, never set a per-instance stamp. */
|
|
1238
|
+
private isClassicPersonaTarget;
|
|
1237
1239
|
private personaEmojiMissing;
|
|
1238
1240
|
/** What the instructions tell `instanceName` not to react with (its own status set). */
|
|
1239
1241
|
statusEmojiAvoidList(instanceName: string): string[];
|
package/dist/fleet-manager.js
CHANGED
|
@@ -7269,19 +7269,26 @@ export class FleetManager {
|
|
|
7269
7269
|
* Settings picker (#1005/#1021), so an agent and an operator see one truth.
|
|
7270
7270
|
*/
|
|
7271
7271
|
async listEmojisFor(instanceName, refresh = false) {
|
|
7272
|
-
|
|
7273
|
-
|
|
7272
|
+
// Seeing is not setting: a ClassicBot instance has no per-instance stamp,
|
|
7273
|
+
// but it reacts in its own channel like any bot and must be able to see
|
|
7274
|
+
// the emojis it can use (only set_persona_emoji refuses it).
|
|
7275
|
+
// Own entries only: an inherited name (constructor, __proto__, toString…)
|
|
7276
|
+
// is not a fleet instance, as set_persona_emoji already holds.
|
|
7277
|
+
const self = this.ownInstanceConfig(instanceName);
|
|
7278
|
+
const classic = !self && this.isClassicPersonaTarget(instanceName);
|
|
7279
|
+
if (!self && !classic)
|
|
7274
7280
|
return { error: this.personaEmojiMissing(instanceName) };
|
|
7275
7281
|
const worldId = this.getInstanceAdapterId(instanceName);
|
|
7276
7282
|
const { platform } = this.resolveStatusEmojisFor(instanceName);
|
|
7277
7283
|
const channel = (worldId ? this.worlds.get(worldId)?.channelConfig : undefined) ?? this.getChannelConfig(worldId ?? undefined);
|
|
7278
|
-
const current = previewStatusEmojis({ platform, platformConfig: channel?.options?.status_emojis, instanceConfig: self
|
|
7284
|
+
const current = previewStatusEmojis({ platform, platformConfig: channel?.options?.status_emojis, instanceConfig: self?.status_emojis });
|
|
7279
7285
|
const out = {
|
|
7280
7286
|
platform: platform ?? null,
|
|
7281
7287
|
statuses: current.entries.map(e => ({ status: e.key, value: e.value, source: e.source })),
|
|
7282
7288
|
standard: platform === "telegram"
|
|
7283
7289
|
? { reactions: [...TELEGRAM_REACTION_EMOJIS], note: "Telegram reacts only with these; progress_prefix may be any single emoji" }
|
|
7284
7290
|
: { suggestions: STATUS_EMOJI_SUGGESTIONS, note: "any single emoji works" },
|
|
7291
|
+
...(classic ? { note: "ClassicBot instances have no per-instance status emojis: the statuses above are the connection's, which an operator sets in Settings. You can still use any emoji listed here in your own reactions." } : {}),
|
|
7285
7292
|
};
|
|
7286
7293
|
if (platform === "discord" && worldId) {
|
|
7287
7294
|
const listed = await this.listGuildEmojis(worldId, refresh);
|
|
@@ -7312,9 +7319,10 @@ export class FleetManager {
|
|
|
7312
7319
|
* from that listed emoji's numeric id. Static PNG, size-capped, cached by id.
|
|
7313
7320
|
*/
|
|
7314
7321
|
async previewEmojis(instanceName, args) {
|
|
7315
|
-
|
|
7316
|
-
if (!
|
|
7322
|
+
// Seeing, like list_emojis: ClassicBot instances may preview too.
|
|
7323
|
+
if (!this.ownInstanceConfig(instanceName) && !this.isClassicPersonaTarget(instanceName)) {
|
|
7317
7324
|
return { error: this.personaEmojiMissing(instanceName) };
|
|
7325
|
+
}
|
|
7318
7326
|
const wanted = args.emojis;
|
|
7319
7327
|
if (!Array.isArray(wanted) || wanted.length === 0 || wanted.some(e => typeof e !== "string")) {
|
|
7320
7328
|
return { error: "emojis is required: a list of <:name:id> values from list_emojis" };
|
|
@@ -7473,6 +7481,10 @@ export class FleetManager {
|
|
|
7473
7481
|
const resolved = this.resolveStatusEmojisFor(instanceName);
|
|
7474
7482
|
return { status, value: value ?? null, now: resolved[status], status_emojis: current.status_emojis ?? null };
|
|
7475
7483
|
}
|
|
7484
|
+
/** A ClassicBot instance: it may see (list/preview) emojis, never set a per-instance stamp. */
|
|
7485
|
+
isClassicPersonaTarget(instanceName) {
|
|
7486
|
+
return this.classicChannels?.getAll().some(c => c.instanceName === instanceName) ?? false;
|
|
7487
|
+
}
|
|
7476
7488
|
personaEmojiMissing(instanceName) {
|
|
7477
7489
|
return this.classicChannels?.getAll().some(c => c.instanceName === instanceName)
|
|
7478
7490
|
? "ClassicBot instances have no per-instance status emojis; an operator sets the connection's in Settings"
|