pwn 0.5.756 → 0.5.757
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/documentation/pwn-ai-Agent.md +2 -2
- data/etc/default_skills/pwn/ai/anthropic/SKILL.md +1 -0
- data/etc/default_skills/pwn/ai/gemini/SKILL.md +1 -0
- data/etc/default_skills/pwn/ai/grok/SKILL.md +1 -0
- data/etc/default_skills/pwn/ai/model_catalog/SKILL.md +52 -0
- data/etc/default_skills/pwn/ai/ollama/SKILL.md +1 -0
- data/etc/default_skills/pwn/ai/open_ai/SKILL.md +1 -0
- data/etc/default_skills/pwn/ai/open_web_ui/SKILL.md +1 -0
- data/etc/default_skills/pwn/plugins/repl/ai_console_usage/SKILL.md +1 -1
- data/lib/pwn/ai/anthropic.rb +31 -0
- data/lib/pwn/ai/gemini.rb +32 -0
- data/lib/pwn/ai/grok.rb +31 -0
- data/lib/pwn/ai/model_catalog.rb +113 -0
- data/lib/pwn/ai/ollama.rb +33 -0
- data/lib/pwn/ai/open_ai.rb +33 -0
- data/lib/pwn/ai/open_web_ui.rb +37 -0
- data/lib/pwn/ai.rb +1 -0
- data/lib/pwn/plugins/repl/ai_console.rb +58 -30
- data/lib/pwn/plugins/repl/ai_console_usage.rb +196 -10
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/ai/grok_spec.rb +8 -0
- data/spec/lib/pwn/ai/model_catalog_spec.rb +26 -0
- data/spec/lib/pwn/ai/model_lookup_spec.rb +27 -0
- data/spec/lib/pwn/plugins/repl/ai_console_spec.rb +46 -2
- data/spec/lib/pwn/plugins/repl/ai_console_usage_spec.rb +49 -0
- data/third_party/pwn_rdoc.jsonl +32 -0
- metadata +7 -3
|
@@ -11,6 +11,7 @@ describe PWN::Plugins::REPL::AIConsoleUsage do
|
|
|
11
11
|
expect(priced[:cached_tokens]).to eq(100)
|
|
12
12
|
expect(priced[:total_tokens]).to eq(1_001_000)
|
|
13
13
|
expect(priced[:estimated_cost_usd]).to be_within(0.001).of((2 * 0.9999) + 0.0001 + 0.008)
|
|
14
|
+
allow(PWN::AI::OpenAI).to receive(:get_model).and_return(id: 'unknown')
|
|
14
15
|
tracker.record(engine: :openai, model: 'unknown', usage: { prompt_tokens: 10, completion_tokens: 5 })
|
|
15
16
|
mixed = tracker.snapshot
|
|
16
17
|
expect(mixed[:calls]).to eq(2)
|
|
@@ -18,6 +19,54 @@ describe PWN::Plugins::REPL::AIConsoleUsage do
|
|
|
18
19
|
expect(described_class.estimate(usage: { input_tokens: 5 }, rates: nil)).to be_nil
|
|
19
20
|
end
|
|
20
21
|
|
|
22
|
+
it 'prices tokens from each provider model record and does not invent a missing price' do
|
|
23
|
+
described_class.send(:catalog_cache).clear
|
|
24
|
+
allow(PWN::AI::Grok).to receive(:get_model).and_return(
|
|
25
|
+
id: 'grok-4.7',
|
|
26
|
+
prompt_text_token_price: 20_000,
|
|
27
|
+
completion_text_token_price: 60_000,
|
|
28
|
+
cached_prompt_text_token_price: 5_000,
|
|
29
|
+
prompt_text_token_price_long_context: 40_000,
|
|
30
|
+
completion_text_token_price_long_context: 120_000,
|
|
31
|
+
long_context_threshold: 200_000
|
|
32
|
+
)
|
|
33
|
+
usage = { input_tokens: 100_000, output_tokens: 1_000, input_tokens_details: { cached_tokens: 10_000 } }
|
|
34
|
+
grok = described_class.estimate(engine: :grok, model: 'grok-4.7', usage: usage)
|
|
35
|
+
expect(grok).to be_within(0.0001).of(0.18 + 0.005 + 0.006)
|
|
36
|
+
long = described_class.estimate(engine: :grok, model: 'grok-4.7', usage: { input_tokens: 200_000, output_tokens: 0 })
|
|
37
|
+
expect(long).to be_within(0.0001).of(0.8)
|
|
38
|
+
expect(PWN::AI::Grok).to have_received(:get_model).once.with(hash_including(name: 'grok-4.7', timeout: 8, fallback: false, non_interactive: true))
|
|
39
|
+
|
|
40
|
+
allow(PWN::AI::Grok).to receive(:get_model).and_return(id: 'unpublished', prompt_text_token_price: 0, completion_text_token_price: 0)
|
|
41
|
+
expect(described_class.estimate(engine: :grok, model: 'unpublished', usage: { input_tokens: 10, output_tokens: 1 })).to be_nil
|
|
42
|
+
|
|
43
|
+
allow(PWN::AI::OpenAI).to receive(:get_model).and_return(slug: 'gpt-5.5', pricing: { input: 5, output: 30, cached_input: 0.5 })
|
|
44
|
+
expect(described_class.estimate(engine: :openai, model: 'gpt-5.5', usage: { input_tokens: 2_000_000, output_tokens: 0 })).to be_within(0.0001).of(10)
|
|
45
|
+
|
|
46
|
+
allow(PWN::AI::OpenWebUI).to receive(:get_model).and_return(
|
|
47
|
+
id: 'proxy-model',
|
|
48
|
+
info: { meta: { pricing: { input_cost_per_token: 0.000002, output_cost_per_token: 0.000008 } } }
|
|
49
|
+
)
|
|
50
|
+
webui = described_class.estimate(engine: :openwebui, model: 'proxy-model', usage: { prompt_tokens: 1_000_000, completion_tokens: 1_000 })
|
|
51
|
+
expect(webui).to be_within(0.0001).of(2.008)
|
|
52
|
+
|
|
53
|
+
allow(PWN::AI::Ollama).to receive(:get_model).and_return(name: 'llama3.2', details: { family: 'llama' })
|
|
54
|
+
expect(described_class.estimate(engine: :ollama, model: 'llama3.2', usage: { input_tokens: 10, output_tokens: 2 })).to be_nil
|
|
55
|
+
|
|
56
|
+
allow(PWN::AI::Gemini).to receive(:get_model).and_return(name: 'models/gemini-2.5-pro', inputTokenLimit: 1_000_000)
|
|
57
|
+
expect(described_class.estimate(engine: :gemini, model: 'gemini-2.5-pro', usage: { input_tokens: 8, output_tokens: 1 })).to be_nil
|
|
58
|
+
|
|
59
|
+
allow(PWN::AI::Anthropic).to receive(:get_model).and_return(id: 'claude-mythos-5', display_name: 'Mythos')
|
|
60
|
+
stub_const('PWN::Env', { ai: { anthropic: { pricing: { 'claude-mythos-5' => { input_per_million: 10, output_per_million: 50 } } } } })
|
|
61
|
+
fallback = described_class.estimate(engine: :anthropic, model: 'claude-mythos-5', usage: { input_tokens: 1_000_000, output_tokens: 0 })
|
|
62
|
+
expect(fallback).to be_within(0.0001).of(10)
|
|
63
|
+
|
|
64
|
+
tracker = described_class::Tracker.new
|
|
65
|
+
tracker.record(engine: :grok, model: 'grok-4.7', usage: usage)
|
|
66
|
+
expect(tracker.snapshot[:cost_status]).to include('provider model pricing')
|
|
67
|
+
expect(tracker.snapshot[:estimated_cost_usd]).to be_within(0.0001).of(0.191)
|
|
68
|
+
end
|
|
69
|
+
|
|
21
70
|
it 'receives one Loop completion even when provider config is frozen' do
|
|
22
71
|
tracker = described_class::Tracker.new
|
|
23
72
|
Thread.current[:pwn_usage_observer] = tracker.method(:record)
|
data/third_party/pwn_rdoc.jsonl
CHANGED
|
@@ -1066,6 +1066,8 @@
|
|
|
1066
1066
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.authors Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
|
|
1067
1067
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.chat Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.chat`: Supported Method Parameters\n\nresponse = PWN::AI::Anthropic.chat(\n\nrequest: 'required - message to Anthropic',\nmodel: 'optional - model to use for text generation (defaults to PWN::Env[:ai][:anthropic][:model])',\ntemp: 'optional - creative response float (defaults to PWN::Env[:ai][:anthropic][:temp])',\nsystem_role_content: 'optional - context to set up the model behavior for conversation (Default: PWN::Env[:ai][:anthropic][:system_role_content])',\nresponse_history: 'optional - pass response back in to have a conversation',\nspeak_answer: 'optional speak answer using PWN::Plugins::Voice.text_to_speech (Default: nil)',\ntimeout: 'optional timeout in seconds (defaults to 900)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1068
1068
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.chat_with_tools Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.chat_with_tools`: Supported Method Parameters\n\nresponse = PWN::AI::Anthropic.chat_with_tools(\n\nmessages: 'required - OpenAI-format messages array (system/user/assistant/tool)',\ntools: 'optional - OpenAI tools array [{type:\"function\", function:{...}}]',\ntool_choice: 'optional - \"auto\" | \"none\" | \"required\" | {type:\"function\", function:{name:..}}',\nmodel: 'optional - overrides PWN::Env[:ai][:anthropic][:model]',\ntemp: 'optional - temperature (defaults to PWN::Env[:ai][:anthropic][:temp] || 1)',\nmax_tokens: 'optional - defaults to PWN::Env[:ai][:anthropic][:max_tokens] || 128_000',\ntimeout: 'optional - seconds (default 900)',\nspinner: 'optional - display spinner (default false)'\n\n)\n"}]}
|
|
1069
|
+
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.forced_tool_choice? Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.forced_tool_choice?`: "}]}
|
|
1070
|
+
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.get_model Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::Anthropic.get_model(name: ‘required - model id’)\n\nThe Models API lists id and capabilities. Pricing, when Anthropic includes it on that record, is passed through unchanged. A missing price field is not filled from a public price table.\n"}]}
|
|
1069
1071
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.get_models Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.get_models`: Supported Method Parameters\n\nmodels = PWN::AI::Anthropic.get_models\n"}]}
|
|
1070
1072
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.help Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.help`: "}]}
|
|
1071
1073
|
{"messages":[{"role":"user","content":"PWN::AI::Anthropic.json_copy Usage"},{"role":"assistant","content":"`PWN::AI::Anthropic.json_copy`: "}]}
|
|
@@ -1108,12 +1110,14 @@
|
|
|
1108
1110
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.gemini_resp_to_oa Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.gemini_resp_to_oa`: "}]}
|
|
1109
1111
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.gemini_rest_call Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.gemini_rest_call`: Supported Method Parameters\n\ngemini_rest_call(\n\nhttp_method: 'optional HTTP method (defaults to GET)',\nrest_call: 'required rest call to make per the schema',\nparams: 'optional params passed in the URI or HTTP Headers',\nhttp_body: 'optional HTTP body sent in HTTP methods that support it e.g. POST',\ntimeout: 'optional timeout in seconds (defaults to 900)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1110
1112
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.gemini_tool_config Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.gemini_tool_config`: "}]}
|
|
1113
|
+
{"messages":[{"role":"user","content":"PWN::AI::Gemini.get_model Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::Gemini.get_model(name: ‘required - model id or models/<id>’)\n\nGemini names models as models/<id> and usually publishes token limits, not USD rates. A pricing object on the record is kept; none is invented.\n"}]}
|
|
1111
1114
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.get_models Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.get_models`: Supported Method Parameters\n\nmodels = PWN::AI::Gemini.get_models\n"}]}
|
|
1112
1115
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.help Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.help`: "}]}
|
|
1113
1116
|
{"messages":[{"role":"user","content":"PWN::AI::Gemini.oa_messages_to_gemini Usage"},{"role":"assistant","content":"`PWN::AI::Gemini.oa_messages_to_gemini`: "}]}
|
|
1114
1117
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.authors Usage"},{"role":"assistant","content":"`PWN::AI::Grok.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
|
|
1115
1118
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.chat Usage"},{"role":"assistant","content":"`PWN::AI::Grok.chat`: Supported Method Parameters\n\nresponse = PWN::AI::Grok.chat(\n\nrequest: 'required - message to Grok'\nmodel: 'optional - model to use for text generation (defaults to PWN::Env[:ai][:grok][:model])',\ntemp: 'optional - creative response float (deafults to PWN::Env[:ai][:grok][:temp])',\nsystem_role_content: 'optional - context to set up the model behavior for conversation (Default: PWN::Env[:ai][:grok][:system_role_content])',\nresponse_history: 'optional - pass response back in to have a conversation',\nspeak_answer: 'optional speak answer using PWN::Plugins::Voice.text_to_speech (Default: nil)',\ntimeout: 'optional timeout in seconds (defaults to 900)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1116
1119
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.chat_with_tools Usage"},{"role":"assistant","content":"`PWN::AI::Grok.chat_with_tools`: Supported Method Parameters\n\nresponse = PWN::AI::Grok.chat_with_tools(\n\nmessages: 'required - full OpenAI-format messages array (system/user/assistant/tool)',\ntools: 'optional - OpenAI tools array [{type:\"function\", function:{...}}]',\ntool_choice: 'optional - \"auto\" | \"none\" | \"required\" | {type:\"function\", function:{name:..}}',\nmodel: 'optional - overrides PWN::Env[:ai][:grok][:model]',\ntemp: 'optional - temperature (defaults to PWN::Env[:ai][:grok][:temp] || 1)',\ntimeout: 'optional - seconds (default 180)',\nspinner: 'optional - display spinner (default false)'\n\n)\n\nReturns the raw chat/completions response Hash with :choices intact (including :message) — used by PWN::AI::Agent::Loop. xAI’s API is OpenAI-compatible for tool calling, so the request and response shapes are identical to PWN::AI::OpenAI.chat_with_tools.\n"}]}
|
|
1120
|
+
{"messages":[{"role":"user","content":"PWN::AI::Grok.get_model Usage"},{"role":"assistant","content":"`PWN::AI::Grok.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::Grok.get_model(name: ‘required - model id’)\n\nxAI prices are integer USD cents per 100 million tokens on the model record itself (prompt/completion/cached). Zero means that component is unpublished, not free.\n"}]}
|
|
1117
1121
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.get_models Usage"},{"role":"assistant","content":"`PWN::AI::Grok.get_models`: Supported Method Parameters\n\nmodels = PWN::AI::Grok.get_models\n"}]}
|
|
1118
1122
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.grok_rest_call Usage"},{"role":"assistant","content":"`PWN::AI::Grok.grok_rest_call`: Supported Method Parameters\n\ngrok_ai_rest_call(\n\ntoken: 'required - grok_ai bearer token',\nhttp_method: 'optional HTTP method (defaults to GET)\nbase_uri: 'optional base grok api URI (defaults to https://api.x.ai/v1)',\nrest_call: 'required rest call to make per the schema',\nparams: 'optional params passed in the URI or HTTP Headers',\nhttp_body: 'optional HTTP body sent in HTTP methods that support it e.g. POST',\ntimeout: 'optional timeout in seconds (defaults to 180; 5 attempts)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1119
1123
|
{"messages":[{"role":"user","content":"PWN::AI::Grok.help Usage"},{"role":"assistant","content":"`PWN::AI::Grok.help`: "}]}
|
|
@@ -1181,12 +1185,20 @@
|
|
|
1181
1185
|
{"messages":[{"role":"user","content":"PWN::AI::MCP::ComboNation.session! Usage"},{"role":"assistant","content":"`PWN::AI::MCP::ComboNation.session!`: "}]}
|
|
1182
1186
|
{"messages":[{"role":"user","content":"PWN::AI::MCP::ComboNation.stringify Usage"},{"role":"assistant","content":"`PWN::AI::MCP::ComboNation.stringify`: "}]}
|
|
1183
1187
|
{"messages":[{"role":"user","content":"PWN::AI::MCP::ComboNation.write_line Usage"},{"role":"assistant","content":"`PWN::AI::MCP::ComboNation.write_line`: "}]}
|
|
1188
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.authors Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.authors`: "}]}
|
|
1189
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.catalog_rows Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.catalog_rows`: "}]}
|
|
1190
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.find_row Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.find_row`: "}]}
|
|
1191
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.help Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.help`: "}]}
|
|
1192
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.lookup_opts Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.lookup_opts`: "}]}
|
|
1193
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.model_row? Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.model_row?`: "}]}
|
|
1194
|
+
{"messages":[{"role":"user","content":"PWN::AI::ModelCatalog.parse_row Usage"},{"role":"assistant","content":"`PWN::AI::ModelCatalog.parse_row`: "}]}
|
|
1184
1195
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.assemble_native_chat_stream Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.assemble_native_chat_stream`: "}]}
|
|
1185
1196
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.assemble_ollama_stream Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.assemble_ollama_stream`: "}]}
|
|
1186
1197
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.assemble_openai_compat_stream Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.assemble_openai_compat_stream`: "}]}
|
|
1187
1198
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.authors Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
|
|
1188
1199
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.chat Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.chat`: Supported Method Parameters\n\nresponse = PWN::AI::Ollama.chat(\n\nrequest: 'required - message to Ollama'\nmodel: 'optional - model to use for text generation (defaults to PWN::Env[:ai][:ollama][:model])',\ntemp: 'optional - creative response float (defaults to PWN::Env[:ai][:ollama][:temp])',\nsystem_role_content: 'optional - context to set up the model behavior for conversation (Default: PWN::Env[:ai][:ollama][:system_role_content])',\nresponse_history: 'optional - pass response back in to have a conversation',\nspeak_answer: 'optional speak answer using PWN::Plugins::Voice.text_to_speech (Default: nil)',\ntimeout: 'optional timeout in seconds (defaults to 900)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1189
1200
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.chat_with_tools Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.chat_with_tools`: Supported Method Parameters\n\nresponse = PWN::AI::Ollama.chat_with_tools(\n\nmessages: 'required - full OpenAI-format messages array (system/user/assistant/tool)',\ntools: 'optional - OpenAI tools array [{type:\"function\", function:{...}}]',\ntool_choice: 'optional - \"auto\" | \"none\" | {type:\"function\", function:{name:..}}',\nmodel: 'optional - overrides PWN::Env[:ai][:ollama][:model]',\ntemp: 'optional - temperature (defaults to PWN::Env[:ai][:ollama][:temp] || 1)',\ntimeout: 'optional - seconds (default 900)',\nspinner: 'optional - display spinner (default false)'\n\n)\n\nHits Ollama NATIVE POST /api/chat so options.num_ctx / num_predict / keep_alive take effect. Streaming is ON; ollama_rest_call assembles NDJSON chunks back into a single response.\n"}]}
|
|
1201
|
+
{"messages":[{"role":"user","content":"PWN::AI::Ollama.get_model Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::Ollama.get_model(name: ‘required - tag name’)\n\nLocal tags have size and family, not token prices. get_model reads /api/show for that tag and returns it. Missing pricing stays missing.\n"}]}
|
|
1190
1202
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.get_models Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.get_models`: Supported Method Parameters\n\nresponse = PWN::AI::Ollama.get_models\n"}]}
|
|
1191
1203
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.help Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.help`: "}]}
|
|
1192
1204
|
{"messages":[{"role":"user","content":"PWN::AI::Ollama.normalize_messages_for_ollama Usage"},{"role":"assistant","content":"`PWN::AI::Ollama.normalize_messages_for_ollama`: "}]}
|
|
@@ -1207,6 +1219,7 @@
|
|
|
1207
1219
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.get_file Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.get_file`: Supported Method Parameters\n\nresponse = PWN::AI::OpenAI.get_file(\n\nfile: 'required - file to delete',\ntimeout: 'optional - timeout in seconds (defaults to 900)'\n\n)\n"}]}
|
|
1208
1220
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.get_fine_tune_events Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.get_fine_tune_events`: Supported Method Parameters\n\nresponse = PWN::AI::OpenAI.get_fine_tune_events(\n\nfine_tune_id: 'required - respective :id value returned from #list_fine_tunes',\ntimeout: 'optional - timeout in seconds (defaults to 900)'\n\n)\n"}]}
|
|
1209
1221
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.get_fine_tune_status Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.get_fine_tune_status`: Supported Method Parameters\n\nresponse = PWN::AI::OpenAI.get_fine_tune_status(\n\nfine_tune_id: 'required - respective :id value returned from #list_fine_tunes',\ntimeout: 'optional - timeout in seconds (defaults to 900)'\n\n)\n"}]}
|
|
1222
|
+
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.get_model Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::OpenAI.get_model(name: ‘required - model id or slug’)\n\nPlatform catalogs use data[].id. ChatGPT/Codex catalogs use models[].slug and may nest pricing under a different key. get_model returns that one row; it does not invent a USD rate the catalog omitted.\n"}]}
|
|
1210
1223
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.get_models Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.get_models`: Supported Method Parameters\n\nmodels = PWN::AI::OpenAI.get_models\n"}]}
|
|
1211
1224
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.help Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.help`: "}]}
|
|
1212
1225
|
{"messages":[{"role":"user","content":"PWN::AI::OpenAI.img_gen Usage"},{"role":"assistant","content":"`PWN::AI::OpenAI.img_gen`: Supported Method Parameters\n\nresponse = PWN::AI::OpenAI.img_gen(\n\nrequest: 'required - message to ChatGPT',\nn: 'optional - number of images to generate (defaults to 1)',\nsize: 'optional - size of image (defaults to \"1024x1024\")',\ntimeout: 'optional - timeout in seconds (defaults to 900)'\n\n)\n"}]}
|
|
@@ -1236,6 +1249,7 @@
|
|
|
1236
1249
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.authors Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
|
|
1237
1250
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.chat Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.chat`: Supported Method Parameters\n\nresponse = PWN::AI::OpenWebUI.chat(\n\nrequest: 'required - message to Open WebUI'\nmodel: 'optional - model to use for text generation (defaults to PWN::Env[:ai][:openwebui][:model])',\ntemp: 'optional - creative response float (deafults to PWN::Env[:ai][:openwebui][:temp])',\nsystem_role_content: 'optional - context to set up the model behavior for conversation (Default: PWN::Env[:ai][:openwebui][:system_role_content])',\nresponse_history: 'optional - pass response back in to have a conversation',\nspeak_answer: 'optional speak answer using PWN::Plugins::Voice.text_to_speech (Default: nil)',\ntimeout: 'optional timeout in seconds (defaults to 900)',\nspinner: 'optional - display spinner (defaults to false)'\n\n)\n"}]}
|
|
1238
1251
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.chat_with_tools Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.chat_with_tools`: Supported Method Parameters\n\nresponse = PWN::AI::OpenWebUI.chat_with_tools(\n\nmessages: 'required - full OpenAI-format messages array (system/user/assistant/tool)',\ntools: 'optional - OpenAI tools array [{type:\"function\", function:{...}}]',\ntool_choice: 'optional - \"auto\" | \"none\" | {type:\"function\", function:{name:..}}',\nmodel: 'optional - overrides PWN::Env[:ai][:openwebui][:model]',\ntemp: 'optional - temperature (defaults to PWN::Env[:ai][:openwebui][:temp] || 1)',\ntimeout: 'optional - seconds (default 900)',\nspinner: 'optional - display spinner (default false)'\n\n)\n\nHits Open WebUI’s PROXIED Ollama POST /ollama/api/chat so options.num_ctx / num_predict / keep_alive take effect. Streaming is ON; openwebui_rest_call assembles NDJSON chunks back into a single response. Bare POST /api/chat is not an API route on stock Open WebUI (405).\n"}]}
|
|
1252
|
+
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.get_model Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.get_model`: Supported Method Parameters\n\nmodel = PWN::AI::OpenWebUI.get_model(name: ‘required - model id’)\n\nOpen WebUI mixes OpenAI-compat rows and proxied Ollama tags. A direct model route is tried first; otherwise the already-fetched catalog row is returned. Local tags without a price stay unpriced.\n"}]}
|
|
1239
1253
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.get_models Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.get_models`: Supported Method Parameters\n\nresponse = PWN::AI::OpenWebUI.get_models\n"}]}
|
|
1240
1254
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.help Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.help`: "}]}
|
|
1241
1255
|
{"messages":[{"role":"user","content":"PWN::AI::OpenWebUI.normalize_messages_for_ollama Usage"},{"role":"assistant","content":"`PWN::AI::OpenWebUI.normalize_messages_for_ollama`: "}]}
|
|
@@ -3315,6 +3329,8 @@
|
|
|
3315
3329
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.execute_swarm_action Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.execute_swarm_action`: "}]}
|
|
3316
3330
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.finish_request_metrics Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.finish_request_metrics`: "}]}
|
|
3317
3331
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.fit Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.fit`: "}]}
|
|
3332
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.footer_lines Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.footer_lines`: "}]}
|
|
3333
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.footer_text Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.footer_text`: "}]}
|
|
3318
3334
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle`: "}]}
|
|
3319
3335
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle_details Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle_details`: "}]}
|
|
3320
3336
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle_model_prompt Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle_model_prompt`: "}]}
|
|
@@ -3322,8 +3338,10 @@
|
|
|
3322
3338
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle_swarm Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle_swarm`: "}]}
|
|
3323
3339
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle_swarm_prompt Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle_swarm_prompt`: "}]}
|
|
3324
3340
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.handle_system_role Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.handle_system_role`: "}]}
|
|
3341
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.header_content_limit Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.header_content_limit`: "}]}
|
|
3325
3342
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.header_layout Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.header_layout`: "}]}
|
|
3326
3343
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.header_lines Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.header_lines`: "}]}
|
|
3344
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.layout_chrome Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.layout_chrome`: "}]}
|
|
3327
3345
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.mark_active Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.mark_active`: "}]}
|
|
3328
3346
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.move_role_cursor Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.move_role_cursor`: "}]}
|
|
3329
3347
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsole::Console.open_swarm Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsole::Console.open_swarm`: "}]}
|
|
@@ -3402,13 +3420,27 @@
|
|
|
3402
3420
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleCommands.skills Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleCommands.skills`: "}]}
|
|
3403
3421
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleCommands.swarm Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleCommands.swarm`: "}]}
|
|
3404
3422
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleCommands.tool_names Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleCommands.tool_names`: "}]}
|
|
3423
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.apply_long_context Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.apply_long_context`: "}]}
|
|
3405
3424
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.authors`: "}]}
|
|
3425
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.catalog_cache Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.catalog_cache`: "}]}
|
|
3426
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.catalog_lock Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.catalog_lock`: "}]}
|
|
3427
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.catalog_rates Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.catalog_rates`: "}]}
|
|
3428
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.configured_rates Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.configured_rates`: "}]}
|
|
3406
3429
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.estimate Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.estimate`: "}]}
|
|
3430
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.extract_rates Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.extract_rates`: "}]}
|
|
3407
3431
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.help Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.help`: "}]}
|
|
3408
3432
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.integer Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.integer`: "}]}
|
|
3433
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.model_record Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.model_record`: "}]}
|
|
3434
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.money_per_million Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.money_per_million`: "}]}
|
|
3409
3435
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.normalize Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.normalize`: "}]}
|
|
3436
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.numeric_value Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.numeric_value`: "}]}
|
|
3437
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.pick_rate Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.pick_rate`: "}]}
|
|
3438
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.pricing_hashes Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.pricing_hashes`: "}]}
|
|
3439
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.provider_class Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.provider_class`: "}]}
|
|
3410
3440
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.rate? Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.rate?`: "}]}
|
|
3411
3441
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.rates_for Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.rates_for`: "}]}
|
|
3442
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.xai_rates Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.xai_rates`: "}]}
|
|
3443
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage.xai_usd Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage.xai_usd`: "}]}
|
|
3412
3444
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage::Tracker.new Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage::Tracker.new`: "}]}
|
|
3413
3445
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage::Tracker.record Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage::Tracker.record`: "}]}
|
|
3414
3446
|
{"messages":[{"role":"user","content":"PWN::Plugins::REPL::AIConsoleUsage::Tracker.snapshot Usage"},{"role":"assistant","content":"`PWN::Plugins::REPL::AIConsoleUsage::Tracker.snapshot`: "}]}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pwn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.757
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -113,14 +113,14 @@ dependencies:
|
|
|
113
113
|
requirements:
|
|
114
114
|
- - '='
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: 8.0
|
|
116
|
+
version: 8.1.0
|
|
117
117
|
type: :runtime
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - '='
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 8.0
|
|
123
|
+
version: 8.1.0
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
125
|
name: bson
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -5026,6 +5026,7 @@ files:
|
|
|
5026
5026
|
- etc/default_skills/pwn/ai/http_retry/references/urls.md
|
|
5027
5027
|
- etc/default_skills/pwn/ai/mcp/SKILL.md
|
|
5028
5028
|
- etc/default_skills/pwn/ai/mcp/combo_nation/SKILL.md
|
|
5029
|
+
- etc/default_skills/pwn/ai/model_catalog/SKILL.md
|
|
5029
5030
|
- etc/default_skills/pwn/ai/ollama/SKILL.md
|
|
5030
5031
|
- etc/default_skills/pwn/ai/ollama/references/urls.md
|
|
5031
5032
|
- etc/default_skills/pwn/ai/open_ai/SKILL.md
|
|
@@ -6074,6 +6075,7 @@ files:
|
|
|
6074
6075
|
- lib/pwn/ai/http_retry.rb
|
|
6075
6076
|
- lib/pwn/ai/mcp.rb
|
|
6076
6077
|
- lib/pwn/ai/mcp/combo_nation.rb
|
|
6078
|
+
- lib/pwn/ai/model_catalog.rb
|
|
6077
6079
|
- lib/pwn/ai/ollama.rb
|
|
6078
6080
|
- lib/pwn/ai/open_ai.rb
|
|
6079
6081
|
- lib/pwn/ai/open_web_ui.rb
|
|
@@ -6749,6 +6751,8 @@ files:
|
|
|
6749
6751
|
- spec/lib/pwn/ai/http_retry_spec.rb
|
|
6750
6752
|
- spec/lib/pwn/ai/mcp/combo_nation_spec.rb
|
|
6751
6753
|
- spec/lib/pwn/ai/mcp_spec.rb
|
|
6754
|
+
- spec/lib/pwn/ai/model_catalog_spec.rb
|
|
6755
|
+
- spec/lib/pwn/ai/model_lookup_spec.rb
|
|
6752
6756
|
- spec/lib/pwn/ai/ollama_spec.rb
|
|
6753
6757
|
- spec/lib/pwn/ai/open_ai_oauth_transport_spec.rb
|
|
6754
6758
|
- spec/lib/pwn/ai/open_ai_spec.rb
|