Type checkers can now infer the return type based on return_list
and return_tagobj arguments, eliminating the need for manual
type annotations at call sites.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AttributeProperty is now Generic[T], with overloaded __init__, __get__,
and __set__ signatures so type checkers can infer the value type from the
default argument. NAttributeProperty inherits the same generic behavior.
This is a purely additive typing change — zero runtime behavior change.
Usage:
class Character(DefaultCharacter):
name = AttributeProperty(default="") # inferred str
count = AttributeProperty(default=0) # inferred int
tags = AttributeProperty(default=list) # callable default -> inferred list
obj.name.upper() # type checker knows this is str
obj.count + 1 # type checker knows this is int
greet(obj.name) # passes to fn(name: str) without complaint
The existing manual annotation workaround (my_attr: str = AttributeProperty(...))
was already a type error before this change and is now unnecessary. Users should
drop the annotation and let the descriptor infer the type, or annotate with the
descriptor type if they prefer being explicit:
name = AttributeProperty(default="") # preferred
name: AttributeProperty[str] = AttributeProperty(default="") # also valid
name: str = AttributeProperty(default="") # type error (was already broken)
When no default is provided, AttributeProperty() types as AttributeProperty[Any]
for backwards compatibility.
The at_get/at_set hook signatures are unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The desktop notifications plugin's onText handler takes (args, kwargs)
but the requestPermission callback references a bare `text` identifier
that isn't defined anywhere in scope, throwing:
Uncaught ReferenceError: text is not defined
at notifications.js:43
This fires the first time a text message arrives while the webclient
window is unfocused, but only for users who have notification_popup
enabled and have granted notification permission — which is likely why
it's gone unnoticed since the file was last touched in 2021.
Read the message body from args[0] to match the convention every other
text-handling plugin uses (default_out.js, text2html.js, html.js,
goldenlayout.js).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fourteen hook methods on DefaultObject, DefaultScript, ScriptBase,
DefaultChannel, DefaultAccount, and ServerSession returned a bare
`True` literal, causing type checkers to infer Literal[True] rather
than bool. Userland subclasses that return False to abort behavior
(the documented contract) would be flagged as incompatible overrides.
Adds explicit `-> bool` annotations; no runtime behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces SERVER_RELOAD_INITIATE_MSG, SERVER_RESET_MSG, and
SERVER_RESTART_MSG settings so games can override the hardcoded
restart/reload strings without patching core. Defaults preserve
the existing messages exactly.
The tag/search command failed to find objects when searching by
category alone (e.g. `tag/search :cityhall`) due to two issues:
1. Leading whitespace from command parsing was not stripped, causing
the tag key to contain a space
2. An empty tag key was passed as "" instead of None, which searched
for tags with an empty string key rather than matching all keys
in the given category
Strip self.args and convert empty tag to None so category-only
searches work correctly. Added tests for both cases.
The CmdSet fingerprint now includes command-to-object bindings and the cmdset's own object owner. This prevents the merge cache from incorrectly returning a cached result when identical-looking cmdsets are merged from different source objects.
Also ensures the cached fingerprint is invalidated during command deduplication and switches to using frozensets in the fingerprint for more robust comparisons.