Connection
Base URL, credentials and a reachable server.
Update a source file’s SPDX header while keeping its interpreter line in first position. Check a byte-order mark, an existing license comment and a second run so the edit neither duplicates the header nor changes the body.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
text = source.removeprefix("\ufeff")
head, separator, body = text.partition("\n")
if head.startswith("#!"):
result = head + (separator or "\n") + update_spdx(body)
else:
result = update_spdx(source)