Skip to content

Spells 2#2254

Open
alexgleason wants to merge 3 commits intonostr-protocol:masterfrom
alexgleason:spells
Open

Spells 2#2254
alexgleason wants to merge 3 commits intonostr-protocol:masterfrom
alexgleason:spells

Conversation

@alexgleason
Copy link
Copy Markdown
Member

A stab at #2244 with user-defined variables (not limited to just $contacts)

purrgrammer and others added 2 commits February 27, 2026 12:52
Make $me the only runtime variable. All other variables (like $contacts)
must now be defined within the spell using a new 'variable' tag that
specifies a Nostr filter to execute and a field to extract from results.
@alexgleason alexgleason mentioned this pull request Mar 5, 2026
Remove restriction limiting variables to only authors and tag filter
values. Use REQ filter field names (kinds, authors, ids) for variable
filter keys, and allow repeating the same key to specify multiple values.
@derekross
Copy link
Copy Markdown

I think this is the dream right here.

@purrgrammer
Copy link
Copy Markdown
Contributor

I have an alternative proposal since this opens a can of worms. Explained my design and reasoning in the original PR.

@arthurfranca
Copy link
Copy Markdown
Contributor

arthurfranca commented Mar 12, 2026

This is interesting too. Having more than two steps may be useful and clients could cap the max number of steps if it is an untrusted spell. This could be a high level way of representing a series of queries.

I wonder if improving it further would make it too complex, like the variable could have the whole events and be later accessed as $var.#t.1 for example.

Maybe at the end both spells1 and 2 aren't that useful/powerful for sharing complex series of queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants