mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-19 10:36:42 +01:00
nip90: improve autogeneration, replace ag and awk with rg.
This commit is contained in:
@@ -12,18 +12,19 @@ generate: dvm_repo
|
|||||||
}
|
}
|
||||||
' > kinds.go
|
' > kinds.go
|
||||||
for kindf in (ls data-vending-machines/kinds)
|
for kindf in (ls data-vending-machines/kinds)
|
||||||
|
echo "> $kindf"
|
||||||
set file "data-vending-machines/kinds/$kindf"
|
set file "data-vending-machines/kinds/$kindf"
|
||||||
|
|
||||||
set kind (echo $kindf | ag -o '\d+')
|
set kind (echo $kindf | rg -o '\d+')
|
||||||
set okind (echo $kind | jq -r '. + 1000')
|
set okind (echo $kind | jq -r '. + 1000')
|
||||||
set title (ag '^title:' $file | awk '{$1=""; sub(/^ +/, "", $0); print}' | string collect | string trim)
|
set title (rg --replace '$1' '^title: *(.*)$' $file | string trim)
|
||||||
set desc (ag '^description:' $file | awk '{$1=""; sub(/^ +/, "", $0); print}' | string collect | string trim)
|
set desc (rg --replace '$1' '^description: *(.*)$' $file | string trim)
|
||||||
set inputtype (cat $file | ag -o '\["i",[^]]*]' | jq -r '.[2]')
|
set inputtype (rg --replace '$1' '(\[ *"i".*\])[^]]*$' $file | jq -nr 'input // [0, 0, ""] | .[2]')
|
||||||
|
|
||||||
echo "var Job$kind = Job{
|
echo "var Job$kind = Job{
|
||||||
InputKind: $kind,
|
InputKind: $kind,
|
||||||
OutputKind: $okind,
|
OutputKind: $okind,
|
||||||
Name: \"$name\",
|
Name: \"$title\",
|
||||||
Description: \"$desc\",
|
Description: \"$desc\",
|
||||||
InputType: \"$inputtype\",
|
InputType: \"$inputtype\",
|
||||||
Params: []string{" >> kinds.go
|
Params: []string{" >> kinds.go
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ type Job struct {
|
|||||||
var Job5000 = Job{
|
var Job5000 = Job{
|
||||||
InputKind: 5000,
|
InputKind: 5000,
|
||||||
OutputKind: 6000,
|
OutputKind: 6000,
|
||||||
Name: "",
|
Name: "Text extraction",
|
||||||
Description: "Job request to extract text from some kind of input.",
|
Description: "Job request to extract text from some kind of input.",
|
||||||
InputType: "",
|
InputType: "url",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"alignment",
|
"alignment",
|
||||||
"range",
|
"range",
|
||||||
@@ -27,9 +27,9 @@ var Job5000 = Job{
|
|||||||
var Job5001 = Job{
|
var Job5001 = Job{
|
||||||
InputKind: 5001,
|
InputKind: 5001,
|
||||||
OutputKind: 6001,
|
OutputKind: 6001,
|
||||||
Name: "",
|
Name: "Summarization",
|
||||||
Description: "Summarize input(s)",
|
Description: "Summarize input(s)",
|
||||||
InputType: "",
|
InputType: "event",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"length",
|
"length",
|
||||||
"paragraphs",
|
"paragraphs",
|
||||||
@@ -40,18 +40,18 @@ var Job5001 = Job{
|
|||||||
var Job5002 = Job{
|
var Job5002 = Job{
|
||||||
InputKind: 5002,
|
InputKind: 5002,
|
||||||
OutputKind: 6002,
|
OutputKind: 6002,
|
||||||
Name: "",
|
Name: "Translation",
|
||||||
Description: "Translate input(s)",
|
Description: "Translate input(s)",
|
||||||
InputType: "",
|
InputType: "event",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5050 = Job{
|
var Job5050 = Job{
|
||||||
InputKind: 5050,
|
InputKind: 5050,
|
||||||
OutputKind: 6050,
|
OutputKind: 6050,
|
||||||
Name: "",
|
Name: "Text Generation",
|
||||||
Description: "Job request to generate text using AI models.",
|
Description: "Job request to generate text using AI models.",
|
||||||
InputType: "",
|
InputType: "prompt",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"frequency_penalty",
|
"frequency_penalty",
|
||||||
"max_tokens",
|
"max_tokens",
|
||||||
@@ -65,9 +65,9 @@ var Job5050 = Job{
|
|||||||
var Job5100 = Job{
|
var Job5100 = Job{
|
||||||
InputKind: 5100,
|
InputKind: 5100,
|
||||||
OutputKind: 6100,
|
OutputKind: 6100,
|
||||||
Name: "",
|
Name: "Image Generation",
|
||||||
Description: "Job request to generate Images using AI models.",
|
Description: "Job request to generate Images using AI models.",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"${width}x${height}",
|
"${width}x${height}",
|
||||||
"1024x768",
|
"1024x768",
|
||||||
@@ -83,18 +83,18 @@ var Job5100 = Job{
|
|||||||
var Job5200 = Job{
|
var Job5200 = Job{
|
||||||
InputKind: 5200,
|
InputKind: 5200,
|
||||||
OutputKind: 6200,
|
OutputKind: 6200,
|
||||||
Name: "",
|
Name: "Video Conversion",
|
||||||
Description: "Job request to convert a Video to another Format.",
|
Description: "Job request to convert a Video to another Format.",
|
||||||
InputType: "",
|
InputType: "url",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5201 = Job{
|
var Job5201 = Job{
|
||||||
InputKind: 5201,
|
InputKind: 5201,
|
||||||
OutputKind: 6201,
|
OutputKind: 6201,
|
||||||
Name: "",
|
Name: "Video Translation",
|
||||||
Description: "Job request to translate video audio content into target language with or without subtitles.",
|
Description: "Job request to translate video audio content into target language with or without subtitles.",
|
||||||
InputType: "",
|
InputType: "url",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"format",
|
"format",
|
||||||
"language",
|
"language",
|
||||||
@@ -106,34 +106,34 @@ var Job5201 = Job{
|
|||||||
var Job5202 = Job{
|
var Job5202 = Job{
|
||||||
InputKind: 5202,
|
InputKind: 5202,
|
||||||
OutputKind: 6202,
|
OutputKind: 6202,
|
||||||
Name: "",
|
Name: "Image-to-Video Conversion",
|
||||||
Description: "Job request to convert a static Image to a a short animated video clip",
|
Description: "Job request to convert a static Image to a a short animated video clip",
|
||||||
InputType: "",
|
InputType: "url",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5250 = Job{
|
var Job5250 = Job{
|
||||||
InputKind: 5250,
|
InputKind: 5250,
|
||||||
OutputKind: 6250,
|
OutputKind: 6250,
|
||||||
Name: "",
|
Name: "Text-to-Speech Generation",
|
||||||
Description: "Job request to convert text input to an audio file.",
|
Description: "Job request to convert text input to an audio file.",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5300 = Job{
|
var Job5300 = Job{
|
||||||
InputKind: 5300,
|
InputKind: 5300,
|
||||||
OutputKind: 6300,
|
OutputKind: 6300,
|
||||||
Name: "",
|
Name: "Nostr Content Discovery",
|
||||||
Description: "Job request to discover nostr-native content",
|
Description: "Job request to discover nostr-native content",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5301 = Job{
|
var Job5301 = Job{
|
||||||
InputKind: 5301,
|
InputKind: 5301,
|
||||||
OutputKind: 6301,
|
OutputKind: 6301,
|
||||||
Name: "",
|
Name: "Nostr People Discovery",
|
||||||
Description: "Job request to discover nostr pubkeys",
|
Description: "Job request to discover nostr pubkeys",
|
||||||
InputType: "",
|
InputType: "",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
@@ -142,9 +142,9 @@ var Job5301 = Job{
|
|||||||
var Job5302 = Job{
|
var Job5302 = Job{
|
||||||
InputKind: 5302,
|
InputKind: 5302,
|
||||||
OutputKind: 6302,
|
OutputKind: 6302,
|
||||||
Name: "",
|
Name: "Nostr Content Search",
|
||||||
Description: "Job to search for notes based on a prompt",
|
Description: "Job to search for notes based on a prompt",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
"max_results",
|
"max_results",
|
||||||
"since",
|
"since",
|
||||||
@@ -156,16 +156,16 @@ var Job5302 = Job{
|
|||||||
var Job5303 = Job{
|
var Job5303 = Job{
|
||||||
InputKind: 5303,
|
InputKind: 5303,
|
||||||
OutputKind: 6303,
|
OutputKind: 6303,
|
||||||
Name: "",
|
Name: "Nostr People Search",
|
||||||
Description: "Job to search for profiles based on a prompt",
|
Description: "Job to search for profiles based on a prompt",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5400 = Job{
|
var Job5400 = Job{
|
||||||
InputKind: 5400,
|
InputKind: 5400,
|
||||||
OutputKind: 6400,
|
OutputKind: 6400,
|
||||||
Name: "",
|
Name: "Nostr Event Count",
|
||||||
Description: "Job request to count matching events",
|
Description: "Job request to count matching events",
|
||||||
InputType: "",
|
InputType: "",
|
||||||
Params: []string{
|
Params: []string{
|
||||||
@@ -181,25 +181,25 @@ var Job5400 = Job{
|
|||||||
var Job5500 = Job{
|
var Job5500 = Job{
|
||||||
InputKind: 5500,
|
InputKind: 5500,
|
||||||
OutputKind: 6500,
|
OutputKind: 6500,
|
||||||
Name: "",
|
Name: "Malware Scanning",
|
||||||
Description: "Job request to perform a Malware Scan on files.",
|
Description: "Job request to perform a Malware Scan on files.",
|
||||||
InputType: "url",
|
InputType: "",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5900 = Job{
|
var Job5900 = Job{
|
||||||
InputKind: 5900,
|
InputKind: 5900,
|
||||||
OutputKind: 6900,
|
OutputKind: 6900,
|
||||||
Name: "",
|
Name: "Nostr Event Time Stamping",
|
||||||
Description: "NIP-03 Timestamping of nostr events",
|
Description: "NIP-03 Timestamping of nostr events",
|
||||||
InputType: "",
|
InputType: "event",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5901 = Job{
|
var Job5901 = Job{
|
||||||
InputKind: 5901,
|
InputKind: 5901,
|
||||||
OutputKind: 6901,
|
OutputKind: 6901,
|
||||||
Name: "",
|
Name: "OP_RETURN Creation",
|
||||||
Description: "Create a bitcoin transaction with an OP_RETURN",
|
Description: "Create a bitcoin transaction with an OP_RETURN",
|
||||||
InputType: "text",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
@@ -208,17 +208,17 @@ var Job5901 = Job{
|
|||||||
var Job5905 = Job{
|
var Job5905 = Job{
|
||||||
InputKind: 5905,
|
InputKind: 5905,
|
||||||
OutputKind: 6905,
|
OutputKind: 6905,
|
||||||
Name: "",
|
Name: "Nostr Event Publish Schedule",
|
||||||
Description: "Schedule nostr events for future publishing",
|
Description: "Schedule nostr events for future publishing",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Job5970 = Job{
|
var Job5970 = Job{
|
||||||
InputKind: 5970,
|
InputKind: 5970,
|
||||||
OutputKind: 6970,
|
OutputKind: 6970,
|
||||||
Name: "",
|
Name: "Event PoW Delegation",
|
||||||
Description: "Delegate PoW of an event to a provider.",
|
Description: "Delegate PoW of an event to a provider.",
|
||||||
InputType: "",
|
InputType: "text",
|
||||||
Params: []string{},
|
Params: []string{},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user