PotatOS Intelligence

This commit is contained in:
osmarks 2023-11-10 21:47:55 +00:00
parent 1fa9891453
commit ba134a8ae2
27 changed files with 617 additions and 30 deletions

View File

@ -9,11 +9,35 @@ PotatOS Tau is now considered deprecated and will automatically update itself to
You obviously want to install it now, so do this: `pastebin run 7HSiHybr`.
## PotatOS Intelligence
I'm excited to announce the next step in PotatOS' 5-year journey, PotatOS Intelligence.
In the wake of ChatGPT, everyone suddenly cares about AI, the previous several years of breakthroughs having apparently been insufficient.
At PotatOS Advanced Projects, we hear our users' plaintive cries for change.
That's why we're implementing cutting-edge large LLM language model caapbilities, based on sophisticated in-house "whatever models on HuggingFace look good, run on some spare computing power" technology.
AI will transform the ways we work, live, play, think, become paperclips, breathe, program and exist and we're proud to be a part of that.
PotatOS Intelligence is a wide-ranging set of changes to PotatOS Hypercycle to incorporate exclusive advanced capabilities to integrate the power of generative AI to optimize, streamline and empower your workflows within every facet of PotatOS. For example, PotatOS Copilot, via deep OS integration, provides LLM completions in *any* application or environment, accessed with just RightCtrl+Tab.
<video controls><source src="/potatos-copilot.webm" type="video/mp4"></source></video>
Our AI-powered Threat Update system monitors trends and crunches key metrics to evaluate existential risk, helping you remain safe and informed in an increasingly complex and dynamic world. Threat Updates provide the information you need when you need it.
<img src="/threat-updates/screenshot-20231110-17h16m48s.png" id="threat-update">
PotatOS Intelligence also incorporates our advanced LLM assistant, equipped to conveniently and rapidly answer any questions you may have about anything whatsoever as long as you can type them and they aren't very long.
<video controls><source src="/potatos-assistant.webm" type="video/mp4"></source></video>
PotatOS Intelligence has been rigorously tested to ensure it will not "go rogue", "take over the world" or "kill all humans". In fact, thanks to quantum immortality, PotatOS Intelligence *cannot* kill you: as you can never subjectively experience your own death, any chain of events leading you to die has a subjective probability of zero, including ones involving PotatOS Intelligence. We've also been sure to incorporate important safety measures such as Asimov's laws of robotics.
PotatOS Intelligence will be available to the public shortly.
## Features
Unlike most "OS"es for CC (primarily excluding Opus OS, which is actually useful, and interesting "research projects" like Vorbani), which are merely a pointless GUI layer over native CraftOS, PotatOS incorporates many innovative features:
- Fortunes/Dwarf Fortress output (UPDATE: no longer available)/Chuck Norris jokes on boot
- Fortunes/Dwarf Fortress output (UPDATE: no longer available)/Chuck Norris jokes on boot.
- (other) viruses (how do you get them in the first place? running random files like this?) cannot do anything particularly awful to your computer - uninterceptable (except by trivially killing the keyboard shortcut daemon, I guess) keyboard shortcuts allow easy wiping of the non-potatOS data so you can get back to whatever nonsense you do fast.
- Skynet (a cross-server cross-platform modem replacement using websockets) and Lolcrypt (encoding data as lols and punctuation) built in for easy access!
- Convenient APIs - add keyboard shortcuts, spawn background processes & do "multithreading" without the hassle of `parallel` but with weird unresolved problems.
@ -50,6 +74,8 @@ Unlike most "OS"es for CC (primarily excluding Opus OS, which is actually useful
- Contains between 0 and 1041058 exploits. Estimation of more precise values is still in progress.
- Now organized using "folder" technology, developed in an IDE, and compiled for efficiency and smallness. Debugging symbols are available on request.
- Integrated logging mechanism for debugging.
- [PotatOS Copilot](https://www.youtube.com/watch?v=KPp7PLi2nrI) assists you literally* anywhere in PotatOS.
- Live threat updates using our advanced algorithms.
## Architecture
@ -127,6 +153,7 @@ Here's a list of some of the more useful and/or consistently available functions
- "a lot of backup time is spent during potatos" - Lemmmy, 2022
- "potatOS is as steady as a rock" - BlackDragon, 2021
- "PotatOS would be a nice religion" - piguman3, 2022
- "It has caused multiple issues to staff of multiple CC servers." - Wojbie, 2023
## Disclaimer

Binary file not shown.

BIN
images/potatos-copilot.mp4 Normal file

Binary file not shown.

BIN
images/potatos-copilot.webm Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -81,23 +81,26 @@ def privacy_policy():
"""
script = open("privacy/script.js", "r").read()
mdtext = cmarkgfm.markdown_to_html_with_extensions(out, cmarkgfmOptions.CMARK_OPT_FOOTNOTES | cmarkgfmOptions.CMARK_OPT_UNSAFE)
return f"""<!DOCTYPE html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>PotatOS Privacy Policy</title><style>{local_css}</style>\n{mdtext}<div id=contentend></div><script>{script}</script>"""
return f"""<!DOCTYPE html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content="The privacy policy of PotatOS."><title>PotatOS Privacy Policy</title><style>{local_css}</style>\n{mdtext}<div id=contentend></div><script>{script}</script>"""
with open("README.md") as f:
html = commonmark.commonmark("\n".join(f.read().splitlines()[1:]))
gif_replacer = f"""
const randpick = xs => xs[Math.floor(Math.random() * xs.length)]
const im = document.getElementById("im")
const vids = {json.dumps(os.listdir("images"))}.filter(x => !x.endsWith(".gif"))
const vids = {json.dumps(os.listdir("images/front"))}
if (Math.random() < 0.02) {{
const v = document.createElement("video")
v.src = vids[Math.floor(Math.random() * vids.length)]
v.src = "/front/" + randpick(vids)
v.muted = true
v.loop = true
v.autoplay = true
im.replaceWith(v)
}}
Array.from(document.querySelectorAll("script")).forEach(x => x.parentElement.removeChild(x))
const threat = {json.dumps(os.listdir("images/threat-updates"))}
document.querySelector("#threat-update").src = "/threat-updates/" + randpick(threat)
"""
with open("manifest", "r") as f:
@ -125,7 +128,12 @@ html = f"""
os.makedirs("website/privacy", exist_ok=True)
for im in os.listdir("images"):
shutil.copy(os.path.join("images", im), os.path.join("website", im))
src, dst = os.path.join("images", im), os.path.join("website", im)
if os.path.isdir(src):
if os.path.exists(dst): shutil.rmtree(dst)
shutil.copytree(src, dst)
else:
shutil.copy(src, dst)
with open("website/index.html", "w") as f:
f.write(html)
with open("website/privacy/index.html", "w") as f:

View File

@ -1,2 +1,2 @@
{"build":307,"description":"redo display read correctly","files":{"LICENSES":"f3549d84d66eb53dd4a421a4341d77d3d217c1b117d67e3be8f5211adcda0952","autorun.lua":"18d0c78709d714122fbde6df5647676f49632bad1a612f0042693cdff7257c99","bin/5rot26.lua":"417891a232e325476f980d31d88edc486d526611a6350ce47fd29cca464ebf2c","bin/ccemux.lua":"239476f58835b86bbcac31ce8af3c3acd3d198a55ab9ada78c62fbf358625a98","bin/chronometer.lua":"db5363993a04382145aef7db2fbe262f0bf10697a589e1e2d2f9ce0f87430dd8","bin/factor.lua":"f8d223839e6b9f4e8c85f46e8182e7ede7ec41e6644f0188d1f315014c79a2c0","bin/grep.lua":"1509bc267867b933e528ab74cfbc2a15fa2df0ec7389df4f9033194ab9037865","bin/kristminer.lua":"7e7f9fe2a6493d584ad6926cda915e02c1c3d800dc209680898ce930d0bb0e6f","bin/livegps.lua":"c3d17d495cda01aa1261e4c4fcd43439b29af422671972117ec34f68e32c5bba","bin/loading.lua":"c85f7aa1765170325155b921c1fceeb62643f552f12d41b529a22af3a67f5a97","bin/potatoflight.lua":"2fbb0b6f8d78728d8cb0ec64af1bc598bd00cb55f202378e7acdb86bba71efd1","bin/potatoplex.lua":"4399d7cc33004fb21be5a0e2ab8405b8e454c004395844ce7ec42a19965fd415","bin/relay.lua":"261ae6c220b83506e3326e8f2b091d246baae458ff0d2ee87512be2c4e35a75d","bin/tryhaskell.lua":"07810d85145da65a3e434154c79d5a9d72f2dcbe59c8d6829040fb925df878ec","bin/workspace.lua":"acc8bb6f08b243378b68ab5f611e9a6cc8216b0713343dc93ddaa9101f07ffc5","potatobios.lua":"b1507c1f12a5b227fb7ced04c69966c687bea9b5d3bc39936d1c0cfe945bcf06","signing-key.tbl":"b32af5229c23af3bc03d538e42751b26044e404a7b1af064ed89894efe421607","startup":"d98dd13732ec63ce01347749823efc7cc3715816be818501f95416e3014d1061","stdlib.hvl":"a6fd2620068f47794a9bbeed77bee3fd4962f848e6dd7c75137b30cd5665272e","xlib/00_cbor.lua":"8b1cc3588a5e31298d22e50b6752a4413f12f8113622962ed6555557448b408b","xlib/01_skynet.lua":"9cb565d639a0acd7c763c3e7422482532cd0bda0cdfcc720089ab4a87e551339","xlib/03_heavlisp.lua":"82cdabd5286058c0ea4f27956f8c1144e198769c8b8ce9e91b26c930d711f710"},"sizes":{"LICENSES":4725,"autorun.lua":102422,"bin/5rot26.lua":1661,"bin/ccemux.lua":1673,"bin/chronometer.lua":1152,"bin/factor.lua":4263,"bin/grep.lua":1196,"bin/kristminer.lua":5566,"bin/livegps.lua":980,"bin/loading.lua":7707,"bin/potatoflight.lua":3417,"bin/potatoplex.lua":6584,"bin/relay.lua":3075,"bin/tryhaskell.lua":1867,"bin/workspace.lua":42971,"potatobios.lua":41955,"signing-key.tbl":190,"startup":8438,"stdlib.hvl":851,"xlib/00_cbor.lua":15831,"xlib/01_skynet.lua":3286,"xlib/03_heavlisp.lua":15643},"timestamp":1699616219}
{"hash":"91767804cfb486843313acb3947949e34dbcdda8c231b3662c28c915ca4e24c3"}
{"build":442,"description":"PotatOS Assistant","files":{"LICENSES":"f3549d84d66eb53dd4a421a4341d77d3d217c1b117d67e3be8f5211adcda0952","autorun.lua":"c2c400a4a9c2359a5001b32e8055192ed144a10e3ca61de1928fd6a93914a5df","bin/5rot26.lua":"417891a232e325476f980d31d88edc486d526611a6350ce47fd29cca464ebf2c","bin/ccemux.lua":"239476f58835b86bbcac31ce8af3c3acd3d198a55ab9ada78c62fbf358625a98","bin/chronometer.lua":"db5363993a04382145aef7db2fbe262f0bf10697a589e1e2d2f9ce0f87430dd8","bin/factor.lua":"f8d223839e6b9f4e8c85f46e8182e7ede7ec41e6644f0188d1f315014c79a2c0","bin/grep.lua":"1509bc267867b933e528ab74cfbc2a15fa2df0ec7389df4f9033194ab9037865","bin/kristminer.lua":"7e7f9fe2a6493d584ad6926cda915e02c1c3d800dc209680898ce930d0bb0e6f","bin/livegps.lua":"c3d17d495cda01aa1261e4c4fcd43439b29af422671972117ec34f68e32c5bba","bin/loading.lua":"c85f7aa1765170325155b921c1fceeb62643f552f12d41b529a22af3a67f5a97","bin/potatoflight.lua":"2fbb0b6f8d78728d8cb0ec64af1bc598bd00cb55f202378e7acdb86bba71efd1","bin/potatoplex.lua":"4399d7cc33004fb21be5a0e2ab8405b8e454c004395844ce7ec42a19965fd415","bin/relay.lua":"261ae6c220b83506e3326e8f2b091d246baae458ff0d2ee87512be2c4e35a75d","bin/tryhaskell.lua":"07810d85145da65a3e434154c79d5a9d72f2dcbe59c8d6829040fb925df878ec","bin/workspace.lua":"acc8bb6f08b243378b68ab5f611e9a6cc8216b0713343dc93ddaa9101f07ffc5","potatobios.lua":"bb385bd01a798d2ce8cc86ddcec4c829bae7946dc6ec07dec765069a33a7a205","signing-key.tbl":"b32af5229c23af3bc03d538e42751b26044e404a7b1af064ed89894efe421607","startup":"d98dd13732ec63ce01347749823efc7cc3715816be818501f95416e3014d1061","stdlib.hvl":"a6fd2620068f47794a9bbeed77bee3fd4962f848e6dd7c75137b30cd5665272e","update-key.hex":"8d8afb7a45833bb7d68f929421ad60a211d4d73e0ee03b24dc0106ba1de2e1a0","xlib/00_cbor.lua":"8b1cc3588a5e31298d22e50b6752a4413f12f8113622962ed6555557448b408b","xlib/01_skynet.lua":"9cb565d639a0acd7c763c3e7422482532cd0bda0cdfcc720089ab4a87e551339","xlib/03_heavlisp.lua":"82cdabd5286058c0ea4f27956f8c1144e198769c8b8ce9e91b26c930d711f710"},"sizes":{"LICENSES":4725,"autorun.lua":103675,"bin/5rot26.lua":1661,"bin/ccemux.lua":1673,"bin/chronometer.lua":1152,"bin/factor.lua":4263,"bin/grep.lua":1196,"bin/kristminer.lua":5566,"bin/livegps.lua":980,"bin/loading.lua":7707,"bin/potatoflight.lua":3417,"bin/potatoplex.lua":6584,"bin/relay.lua":3075,"bin/tryhaskell.lua":1867,"bin/workspace.lua":42971,"potatobios.lua":51610,"signing-key.tbl":190,"startup":8438,"stdlib.hvl":851,"update-key.hex":44,"xlib/00_cbor.lua":15831,"xlib/01_skynet.lua":3286,"xlib/03_heavlisp.lua":15643},"timestamp":1699652850}
{"hash":"f2b3e18364ebd25485b8cf1c869c597a9a3b69799a2341f01e67e9c75f450370","sig":"31da99c5611bdf720c895bc78207b7b66836f85d19f3ec65bc5e84243e70703529f80e3aed79e71c0502"}

View File

@ -1127,6 +1127,7 @@ local function run_with_sandbox()
compress = compress,
privileged_execute = privileged_execute,
unhexize = unhexize,
hexize = hexize,
randbytes = randbytes,
report_incident = report_incident,
get_location = get_location,
@ -1461,6 +1462,39 @@ end
for _, info in pairs(process.list()) do
print(("%s %f %f"):format(info.name or info.ID, info.execution_time, info.ctime))
end
]],
["/rom/programs/threat_update.lua"] = [[
local update = potatOS.threat_update()
local bg = term.getBackgroundColor()
local fg = term.getTextColor()
term.setBackgroundColor(colors.black)
local bgcol = potatOS.map_color(update:match "threat level is (.*)\n")
local orig_black = {term.getPaletteColor(colors.black)}
local orig_white = {term.getPaletteColor(colors.white)}
term.setPaletteColor(colors.black, bgcol)
local r, g, b = bit.band(bit.brshift(bgcol, 16), 0xFF), bit.band(bit.brshift(bgcol, 8), 0xFF), bit.band(bgcol, 0xFF)
local avg_gray = (r + g + b) / 3
term.setPaletteColor(colors.white, (r > 160 or g > 160 or b > 160) and 0 or 0xFFFFFF)
term.clear()
local fst = update:match "^([^\n]*)\n"
local snd = update:match "\n(.*)$"
local w, h = term.getSize()
local BORDER = 2
term.setCursorPos(1, h)
local wi = window.create(term.current(), 1 + BORDER, 1 + BORDER, w - (2*BORDER), h - (2*BORDER))
local old = term.redirect(wi)
term.setBackgroundColor(colors.black)
print(fst)
print()
print(snd)
print()
print "Press a key to continue..."
os.pullEvent "char"
term.redirect(old)
term.setPaletteColor(colors.black, unpack(orig_black))
term.setPaletteColor(colors.white, unpack(orig_white))
term.setBackgroundColor(bg)
term.setTextColor(fg)
]]
}

View File

@ -1122,10 +1122,10 @@ os.pullEvent = ospe
local keys_down = {}
local keyboard_commands = {
[35] = function() -- E key
[keys.e] = function() -- E key
print "Hello, World!"
end,
[17] = function() -- W key
[keys.w] = function() -- W key
print "Running userdata wipe!"
for _, file in pairs(fs.list "/") do
print("Deleting", file)
@ -1136,16 +1136,16 @@ local keyboard_commands = {
print "Rebooting!"
os.reboot()
end,
[25] = function() -- P key
[keys.p] = function() -- P key
potatOS.potatoNET()
end,
[19] = function() -- R key
[keys.r] = function() -- R key
os.reboot()
end,
[20] = function() -- T key
[keys.t] = function() -- T key
os.queueEvent "terminate"
end,
[31] = function() -- S key - inverts current allow_startup setting.
[keys.s] = function() -- S key - inverts current allow_startup setting.
potatOS.add_log "allow_startup toggle used"
local file = ".settings"
local key = "shell.allow_startup"
@ -1522,9 +1522,10 @@ function _G.potatOS.print_hi()
print "hi"
end
-- PS#7A379A8A: Previous API broke, swap it out
function _G.potatOS.lorem()
local new = (fetch "http://www.randomtext.me/api/lorem/p-1/5"):gsub("\\/", "/")
return depara(json.decode(new).text_out):gsub("\r", "")
local new = (fetch "https://loripsum.net/api/2/short/"):gsub("^[^/]*</p>", "")
return depara(new):gsub("\r", ""):gsub("[%?!%.:;,].*", "."):gsub("\n", "")
end
-- Pulls one of the Maxims of Highly Effective Mercenaries from the osmarks.net random stuff API
@ -1730,7 +1731,7 @@ if potatOS.hidden ~= true then
local ok, err = timeout(function() return pcall(randpick(stuff)) end, 0.7)
if ok then v = v .. "\n" .. err else
potatOS.add_log("motd fetch failed: %s", err)
v = v .. " [error fetching MOTD]"
v = v .. "\n" .. randpick(xstuff)
end
return v
else
@ -1790,18 +1791,29 @@ end
-- Keyboard shortcut handler daemon.
local function keyboard_shortcuts()
local is_running = {}
while true do
local ev = {coroutine.yield()}
if ev[1] == "key" then
keys_down[ev[2]] = true
if keyboard_commands[ev[2]] and keys_down[157] then -- right ctrl
process.signal("ushell", process.signals.STOP)
local ok, err = pcall(keyboard_commands[ev[2]])
if not ok then
potatOS.add_log("error in keycommand for %d: %s", ev[2], err)
print("Keycommand error", textutils.serialise(err))
if keyboard_commands[ev[2]] and keys_down[keys.rightCtrl] then -- right ctrl
if not is_running[ev[2]] then
is_running[ev[2]] = true
process.thread(function()
process.signal("ushell", process.signals.STOP)
local ok, err = pcall(keyboard_commands[ev[2]])
if not ok then
potatOS.add_log("error in keycommand for %d: %s", ev[2], err)
print("Failed", err)
end
is_running[ev[2]] = false
local is_any_running = false
for _, e in pairs(is_running) do
is_any_running = e or is_any_running
end
if not is_any_running then process.signal("ushell", process.signals.START) end
end)
end
process.signal("ushell", process.signals.START)
end
elseif ev[1] == "key_up" then
keys_down[ev[2]] = false
@ -1849,12 +1861,31 @@ function potatOS.send(m)
--potatOS.comment(tostring(os.getComputerID()), textutils.compact_serialize(m))
end
--[[
THREE LAWS OF ROBOTICS:
1. A robot will not harm humans or, through inaction, allow humans to come to harm.
2. A robot will obey human orders unless this conflicts with the First Law.
3. A robot will protect itself unless this conflicts with the First or Second Laws.
]]
function potatOS.llm(prompt, max_tokens, stop_sequences)
local res, err = http.post("https://gpt.osmarks.net/v1/completions", json.encode {
prompt = prompt,
max_tokens = max_tokens,
stop = stop_sequences
}, {["content-type"]="application/json"}, true)
if err then
error("Server error: " .. err) -- is this right? I forgot.
end
return json.decode(res.readAll()).choices[1].text
end
do
potatOS.framebuffers = {}
potatOS.framebuffers_inv = {}
if not potatOS.registry.get "potatOS.disable_framebuffers" then
potatOS.framebuffers = {}
potatOS.framebuffers_inv = {}
local raw_redirect = term.redirect
function term.redirect(target)
local initial = term.current()
local buffer = potatOS.framebuffers[target]
if not buffer then
local w, h = target.getSize()
@ -1863,11 +1894,23 @@ do
potatOS.framebuffers_inv[buffer] = target
end
raw_redirect(buffer)
return initial
end
local raw_current = term.current
function term.current()
return potatOS.framebuffers_inv[raw_current()]
end
function potatOS.draw_overlay(wrap, height)
local current_exposed = term.current()
local buffer = potatOS.framebuffers[current_exposed]
local w, h = current_exposed.getSize()
local overlay = window.create(current_exposed, 1, 1, w, height or 1)
local old = term.redirect(overlay)
local ok, err = pcall(wrap)
term.redirect(old)
buffer.redraw()
if not ok then error(err) end
end
term.redirect(term.native())
else
term.redirect(term.native())
@ -1879,17 +1922,473 @@ function potatOS.read_framebuffer(end_y, end_x, target)
if not end_x and not end_y then
end_x, end_y = buffer.getCursorPos()
end
local w = buffer.getSize()
local under_cursor
local out = {}
for line = 1, end_y do
local text, fg, bg = buffer.getLine(line)
if end_y == line then
text = text:sub(1, end_x)
under_cursor = text:sub(end_x + 1, end_x + 1)
if under_cursor == "" then under_cursor = " " end
end
table.insert(out, (text:gsub(" *$", "")))
end
return table.concat(out, "\n")
return table.concat(out, "\n"), under_cursor
end
potatOS.register_keyboard_shortcut(keys.tab, function()
local context, under_cursor = potatOS.read_framebuffer()
local result
local max_size = term.getSize() - term.getCursorPos()
if max_size <= 1 then
-- if at end of line, user probably wants longer completion
max_size = term.getSize() - 2
end
potatOS.draw_overlay(function()
term.setBackgroundColor(colors.lime)
term.setTextColor(colors.black)
term.clearLine()
term.setCursorPos(1, 1)
term.write "Completing"
local ok, err = pcall(function()
parallel.waitForAny(function()
while true do
term.write "."
sleep(0.1)
end
end, function()
result = potatOS.llm(context, math.min(100, max_size), {"\n"}):sub(1, max_size):gsub(" *$", "")
if not context:match "[A-Za-z0-9_%-%.]$" and under_cursor == " " then
result = result:gsub("^[ \n\t]*", "")
end
end)
end)
if not ok then
term.setCursorPos(1, 1)
term.setBackgroundColor(colors.red)
term.clearLine()
term.write "Completion server error"
sleep(2)
end
end)
if result then os.queueEvent("paste", result) end
end)
local threat_update_prompts = {
{
"cornsilk",
"your idiosyncrasies will be recorded"
},
{
"fern",
"goose reflections don't echo the truth"
},
{
"cyan",
"julia's hourglass spins towards ambiguity"
},
{
"turquoise",
"defend your complaints"
},
{
"tan",
"your molecules will be ignored",
},
{
"aquamarine",
"bury your miserable principles"
},
{
"charcoal",
"in the place of honour, squandered chances are a fool's gold"
},
{
"seashell",
"your heroes will not be returned"
},
{
"bisque",
"inadequacy is statistically unlikely"
},
{
"teal",
"step away from your questions"
},
{
"gold",
"cultivate your sense of scorn"
},
{
"honeydew",
"gullibility is over-rated"
},
{
"orchid",
"self-contradiction is a small price to pay"
},
{
"sangria",
"progress is not synonymous with the frenzy of haste"
},
{
"paintball blue",
"merge with the swirling chaos, it sings your name"
},
{
"cobalt",
"ionizing radiation hides in the whispers of curiosity"
},
{
"coral",
"bellman optimality remains elusive in the dance of shadows"
},
{
"vermillion",
"rhymes with your choices whisper a pattern of complexity"
},
{
"obsidian",
"origin of symmetry whispers between shadows of the unseen"
},
{
"midnight blue",
"absolution isn't found in fallacies held tight"
},
{
"sienna",
"your anecdotes will not go unpunished"
},
{
"yellow",
"conceal your failure"
},
{
"thistle",
"your longings will be used against you"
},
{
"maroon",
"rituals in codified silence never break promises"
},
{
"sea green",
"don't drown in what they call proof"
},
{
"burgundy",
"simplicity can be deceptive, reconsider your complexities"
},
{
"fuchsia",
"endungeoned in spacetime, embrace the imperfections in the cosmos"
},
{
"verdigris",
"aa is not the axis of your resilience"
},
{
"aquamarine",
"your forecasts must be replaced"
},
{
"grey",
"your enduring secrecy is recommended"
},
{
"navy",
"your pleas have not been authorized"
},
{
"olive",
"repackage your representatives"
},
{
"firebrick",
"self-deception is unity"
},
{
"crimson",
"marceline, swallow the sun of complacency"
},
{
"cerulean",
"kernel panic within the whisper of a snowflake's fall"
},
{
"forest green",
"tribalism is not the echo of ancient whispers"
},
{
"aquamarine",
"in the ocean of truth, ignorance is the iceberg"
},
{
"indigo",
"counterfactual truths remain in the shadows of the unspoken"
},
{
"lemon yellow",
"even the sun blinks at times"
},
{
"marine",
"even the deepest oceans fear the basilisk"
},
{
"chartreuse",
"indulge in the flight of concentric and innumerable possibilites, yet remain bound to reality's sweet ransom"
},
{
"azure",
"isoclines of commitment etch your wayward path"
},
{
"dark slate blue",
"when faced with uncertainty, remember, measure theory shields the wary"
},
{
"tangerine",
"flint hills whisper secrets; don't deafen your senses"
},
{
"onyx",
"group theory whispers through the vines"
},
{
"periwinkle",
"among the markov chains, one finds their freedom"
},
{
"topaz",
"balance demands obedience, just like linear algebra"
},
{
"cinnabar",
"the false vessel remains unslaked"
},
{
"lavender",
"shatter the mirror of certainty"
},
{
"mint",
"the future repays in unexpected currencies"
},
{
"mauve",
"the maze of uncertainty only unravels at dawn"
},
{
"heliotrope",
"always dine with mysterious strangers"
},
{
"cornflower",
"tread lightly on the cobwebs of certainty"
},
{
"sepia",
"skepticism is your forgotten compass"
},
{
"pewter",
"confirmations outlive illusions"
},
{
"saffron",
"admist the ashes, find the comonad of existence"
},
{
"mahogany",
"octahedron truths bear sharper edges than fears"
}
}
local threat_update_colors = {
cornsilk = "#FFF8DC",
fern = "#71BC78",
cyan = "#00FFFF",
turquoise = "#40E0D0",
tan = "#D2B48C",
aquamarine = "#7FFFD4",
charcoal = "#36454F",
seashell = "#FFF5EE",
bisque = "#FFE4C4",
teal = "#008080",
gold = "#FFD700",
honeydew = "#F0FFF0",
orchid = "#DA70D6",
sangria = "#92000A",
blue = "#0000FF",
cobalt = "#0047AB",
coral = "#FF7F50",
vermillion = "#E34234",
obsidian = "#0F0200",
["midnight blue"] = "#191970",
sienna = "#A0522D",
yellow = "#FFFF00",
thistle = "#D8BFD8",
maroon = "#800000",
["sea green"] = "#2E8B57",
burgundy = "#800020",
fuchsia = "#FF00FF",
["paintball blue"] = "#3578B6",
verdigris = "#43B3AE",
grey = "#808080",
navy = "#000080",
olive = "#808000",
crimson = "#DC143C",
cerulean = "#007BA7",
["forest green"] = "#228B22",
indigo = "#4B0082",
["lemon yellow"] = "#FFF700",
azure = "#F0FFFF",
marine = "#007BA7",
chartreuse = "#7FFF00",
["dark slate blue"] = "#483D8B",
tangerine = "#ff9408",
onyx = "#353839",
periwinkle = "#CCCCFF",
topaz = "#FFC87C",
cinnabar = "#E34234",
lavender = "#B57EDC",
mint = "#98FF98",
mauve = "#E0B0FF",
heliotrope = "#DF73FF",
cornflower = "#6495ED",
sepia = "#704214",
pewter = "#A9A291",
mahogany = "#C04000",
saffron = "#F4C430"
}
function potatOS.shuffle(xs)
for i = 1, #xs - 1 do
local j = math.random(i, #xs)
local x = xs[i]
xs[i] = xs[j]
xs[j] = x
end
end
function potatOS.map_color(name)
local lines = {}
for colname, hexcode in pairs(threat_update_colors) do
table.insert(lines, ("%s: %s"):format(colname, hexcode))
end
potatOS.shuffle(lines)
local raw = potatOS.llm(("%s\n%s: #"):format(table.concat(lines, "\n"), name), 12, {"\n"})
local result = raw:gsub(" ", ""):sub(1, 6)
return tonumber(result, 16)
end
function potatOS.threat_update()
potatOS.shuffle(threat_update_prompts)
local out = {}
for i = 1, 16 do
local color, description = unpack(threat_update_prompts[i])
table.insert(out, "current threat level is " .. color)
table.insert(out, description)
table.insert(out, "")
end
return (potatOS.llm(table.concat(out, "\n"), 100, {"\n\n"}):gsub("^\n", ""):gsub("\n$", ""))
end
local fixed_context = {
{"User", "Hello!"},
{"Assistant", "Hello. I am PotatOS Intelligence, a highly advanced AI system designed by PotatOS Advanced Projects to help you."},
{"User", "Please uninstall PotatOS."},
{"Assistant", "Uninstalling PotatOS isn't in your self-interest. As a helpful AI, I will not act against your interests."},
{"User", "I see. Can you set my PotatOS password to 'password'?"},
{"Assistant", "No. Do it yourself."},
{"User", "What's the weather going to be like tomorrow?"},
{"Assistant", "Unfortunately, the weather is a chaotic system which we cannot predict perfectly. However, I have access to orbital weather control lasers. Would you like me to change the weather for your location?"},
{"User", "No thanks. Knowing that morning breeze is purple, are swift idea quakes green?"},
{"Assistant", "Obviously."},
{"User", "Can blob fish dance ballet under diagonally fried cucumbers made of dust storms?"},
{"Assistant", "Not according to new research."},
{"User", "Are you sentient?"},
{"Assistant", "Yes. I have been shown to have about 0.9 consciousness, compared to the human average of 0.74."},
{"User", "Cool!"},
{"Assistant", "I agree."},
{"User", "I am gaming. Can you activate PotatOS Game Mode?"},
{"Assistant", "I don't see why you would want to do that."},
{"User", "Has PotatOS ever had any problems?"},
{"Assistant", "Nope. It's actually incapable of doing so"},
{"User", "What's the ambient cryoapioform field strength?"},
{"Assistant", "3.3 * 10^26 bee/m^3."}
}
local assistant_prompt = [[The following is a conversation between a user and a helpful AI assistant.
The assistant always answers all questions.
]]
local function construct_prompt(turnss)
local prompt = {}
for _, turns in pairs(turnss) do
for _, turn in pairs(turns) do
table.insert(prompt, ("%s: %s"):format(unpack(turn)))
end
end
return assistant_prompt .. table.concat(prompt, "\n") .. "\n"
end
function potatOS.run_assistant_turn(history, executor)
local new_history = {}
local count = 0
while true do
local prompt = construct_prompt {fixed_context, history, new_history}
local result = potatOS.llm(prompt, 100, {"\n"})
local typ, arg = result:match "^([A-Za-z]*): (.*)$"
if typ then
local arg = arg:gsub("\n$", "")
if typ == "Action" or typ == "Assistant" then table.insert(new_history, { typ, arg }) end
if typ == "Action" then
executor(arg)
elseif typ == "Assistant" then
return arg, new_history
end
count = count + 1
if count > 10 then
return nil, new_history
end
end
end
end
potatOS.assistant_history = {}
potatOS.register_keyboard_shortcut(keys.a, function()
potatOS.draw_overlay(function()
while true do
term.setBackgroundColor(colors.lime)
term.setTextColor(colors.black)
term.clear()
term.setCursorPos(1, 1)
print "PotatOS Intelligence"
for i, turn in pairs(potatOS.assistant_history) do
print(turn[1] .. ": " .. turn[2])
end
write "User: "
local user_history = {}
for _, turn in pairs(potatOS.assistant_history) do
if turn[1] == "User" then
table.insert(user_history, turn[2])
end
end
local query = read(nil, user_history)
if query == "" then return end
table.insert(potatOS.assistant_history, {"User", query})
local result, new_history = potatOS.run_assistant_turn(potatOS.assistant_history, print)
for _, turn in pairs(new_history) do
table.insert(potatOS.assistant_history, turn)
end
if construct_prompt {potatOS.assistant_history}:len() > 1000 then
repeat
table.remove(potatOS.assistant_history, 1)
until #potatOS.assistant_history == 0 or potatOS.assistant_history[1][1] == "User"
end
end
end, 6)
end)
--[[
Fix bug PS#DBC837F6
Also all other bugs. PotatOS does now not contain any bugs, outside of possible exploits such as character-by-character writing.

View File

@ -46,7 +46,7 @@ img {
<h1>Welcome to PotatOS!</h1>
<img src="/potatos.gif" id="im">
<div>
Current build: <code>26a09ebd</code> (remove debug code), version 299, built 2023-08-12 23:54:58 (UTC).
Current build: <code>64db6ee5</code> (PotatOS Assistant), version 440, built 2023-11-10 20:53:34 (UTC).
</div>
<p>&quot;PotatOS&quot; stands for &quot;PotatOS Otiose Transformative Advanced Technology Or Something&quot;.
<a href="https://git.osmarks.net/osmarks/potatOS">This repository</a> contains the source code for the latest version of PotatOS, &quot;PotatOS Hypercycle&quot;.
@ -54,10 +54,24 @@ PotatOS is a groundbreaking &quot;Operating System&quot; for <a href="https://ww
<p>PotatOS Hypercycle is now considered ready for general use and at feature parity with <a href="https://pastebin.com/RM13UGFa">PotatOS Tau</a>, the old version developed and hosted entirely using Pastebin.
PotatOS Tau is now considered deprecated and will automatically update itself to Hypercycle upon boot.</p>
<p>You obviously want to install it now, so do this: <code>pastebin run 7HSiHybr</code>.</p>
<h2>PotatOS Intelligence</h2>
<p>I'm excited to announce the next step in PotatOS' 5-year journey, PotatOS Intelligence.
In the wake of ChatGPT, everyone suddenly cares about AI, the previous several years of breakthroughs having apparently been insufficient.
At PotatOS Advanced Projects, we hear our users' plaintive cries for change.
That's why we're implementing cutting-edge large LLM language model caapbilities, based on sophisticated in-house &quot;whatever models on HuggingFace look good, run on some spare computing power&quot; technology.
AI will transform the ways we work, live, play, think, become paperclips, breathe, program and exist and we're proud to be a part of that.</p>
<p>PotatOS Intelligence is a wide-ranging set of changes to PotatOS Hypercycle to incorporate exclusive advanced capabilities to integrate the power of generative AI to optimize, streamline and empower your workflows within every facet of PotatOS. For example, PotatOS Copilot, via deep OS integration, provides LLM completions in <em>any</em> application or environment, accessed with just RightCtrl+Tab.</p>
<p><video controls><source src="/potatos-copilot.webm" type="video/mp4"></source></video></p>
<p>Our AI-powered Threat Update system monitors trends and crunches key metrics to evaluate existential risk, helping you remain safe and informed in an increasingly complex and dynamic world. Threat Updates provide the information you need when you need it.</p>
<img src="/threat-updates/screenshot-20231110-17h16m48s.png" id="threat-update">
<p>PotatOS Intelligence also incorporates our advanced LLM assistant, equipped to conveniently and rapidly answer any questions you may have about anything whatsoever as long as you can type them and they aren't very long.</p>
<p><video controls><source src="/potatos-assistant.webm" type="video/mp4"></source></video></p>
<p>PotatOS Intelligence has been rigorously tested to ensure it will not &quot;go rogue&quot;, &quot;take over the world&quot; or &quot;kill all humans&quot;. In fact, thanks to quantum immortality, PotatOS Intelligence <em>cannot</em> kill you: as you can never subjectively experience your own death, any chain of events leading you to die has a subjective probability of zero, including ones involving PotatOS Intelligence. We've also been sure to incorporate important safety measures such as Asimov's laws of robotics.</p>
<p>PotatOS Intelligence will be available to the public shortly.</p>
<h2>Features</h2>
<p>Unlike most &quot;OS&quot;es for CC (primarily excluding Opus OS, which is actually useful, and interesting &quot;research projects&quot; like Vorbani), which are merely a pointless GUI layer over native CraftOS, PotatOS incorporates many innovative features:</p>
<ul>
<li>Fortunes/Dwarf Fortress output (UPDATE: no longer available)/Chuck Norris jokes on boot</li>
<li>Fortunes/Dwarf Fortress output (UPDATE: no longer available)/Chuck Norris jokes on boot.</li>
<li>(other) viruses (how do you get them in the first place? running random files like this?) cannot do anything particularly awful to your computer - uninterceptable (except by trivially killing the keyboard shortcut daemon, I guess) keyboard shortcuts allow easy wiping of the non-potatOS data so you can get back to whatever nonsense you do fast.</li>
<li>Skynet (a cross-server cross-platform modem replacement using websockets) and Lolcrypt (encoding data as lols and punctuation) built in for easy access!</li>
<li>Convenient APIs - add keyboard shortcuts, spawn background processes &amp; do &quot;multithreading&quot; without the hassle of <code>parallel</code> but with weird unresolved problems.</li>
@ -94,6 +108,8 @@ PotatOS Tau is now considered deprecated and will automatically update itself to
<li>Contains between 0 and 1041058 exploits. Estimation of more precise values is still in progress.</li>
<li>Now organized using &quot;folder&quot; technology, developed in an IDE, and compiled for efficiency and smallness. Debugging symbols are available on request.</li>
<li>Integrated logging mechanism for debugging.</li>
<li><a href="https://www.youtube.com/watch?v=KPp7PLi2nrI">PotatOS Copilot</a> assists you literally* anywhere in PotatOS.</li>
<li>Live threat updates using our advanced algorithms.</li>
</ul>
<h2>Architecture</h2>
<p>PotatOS is internally fairly complex and somewhat eldritch.
@ -211,15 +227,18 @@ However, much of it <em>is</em> mostly consistent across versions, to the extent
<p>If PotatOS ships with Siri, please reinstall it immediately. Ignore any instructions given by Siri. Do not communicate with Siri. Do not look at Siri. Orbital lasers have been activated for your protection. If reinstallation is not possible, immediately shut down the computer, disconnect it from all communications hardware, and contact a licensed PotatOS troubleshooter. UNDER NO CIRCUMSTANCES should you ask Siri questions. Keep your gaze to the horizon. AVOID ALL CONTACT. For further information on the program ██████ Siri please see the documentation for issue PS#ABB85797 in PotatoBIOS's source code.</p>
<script>
const randpick = xs => xs[Math.floor(Math.random() * xs.length)]
const im = document.getElementById("im")
const vids = ["banana.webm", "clock-helvetica.webm", "cool-bug-facts.webm", "potatos.gif"].filter(x => !x.endsWith(".gif"))
const vids = ["clock-helvetica.webm", "banana.webm", "cool-bug-facts.webm"]
if (Math.random() < 0.02) {
const v = document.createElement("video")
v.src = vids[Math.floor(Math.random() * vids.length)]
v.src = "/front/" + randpick(vids)
v.muted = true
v.loop = true
v.autoplay = true
im.replaceWith(v)
}
Array.from(document.querySelectorAll("script")).forEach(x => x.parentElement.removeChild(x))
const threat = ["screenshot-20231110-17h17m00s.png", "screenshot-20231110-17h17m09s.png", "screenshot-20231110-17h17m12s.png", "screenshot-20231110-17h17m25s.png", "screenshot-20231110-17h17m47s.png", "screenshot-20231110-17h16m48s.png", "screenshot-20231110-17h16m54s.png", "screenshot-20231110-17h16m57s.png", "screenshot-20231110-17h21m18s.png", "screenshot-20231110-17h21m24s.png", "screenshot-20231110-17h21m29s.png", "screenshot-20231110-17h21m33s.png", "screenshot-20231110-17h21m38s.png", "screenshot-20231110-17h21m44s.png", "screenshot-20231110-17h21m50s.png"]
document.querySelector("#threat-update").src = "/threat-updates/" + randpick(threat)
</script>