commit b57787589e133904d3fd3c872350ea956815df6f Author: Interitio Date: Fri Aug 1 03:02:48 2025 +1000 Initial commit. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..cb6498e --- /dev/null +++ b/__init__.py @@ -0,0 +1,13 @@ +import logging + +logger = logging.getLogger(__name__) + + +async def discord_setup(bot): + ... + +async def twitch_setup(bot): + ... + +async def web_setup(routes): + ... diff --git a/data.py b/data.py new file mode 100644 index 0000000..e69de29 diff --git a/data/schema.sql b/data/schema.sql new file mode 100644 index 0000000..30afb80 --- /dev/null +++ b/data/schema.sql @@ -0,0 +1,35 @@ +-- Tasklist data {{{ + +INSERT INTO version_history (component, from_version, to_version, author) VALUES ('TASKLIST', 0, 1, 'Initial Creation'); + +CREATE TABLE tasklist( + taskid INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, + profileid INTEGER NOT NULL REFERENCES user_profiles(profileid) ON DELETE CASCADE ON UPDATE CASCADE, + content TEXT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + deleted_at TIMESTAMPTZ, + duration INTEGER NOT NULL DEFAULT 0, + started_at TIMESTAMPTZ, + completed_at TIMESTAMPTZ, + _timestamp TIMESTAMPTZ DEFAILT NOW() +); +CREATE TRIGGER tasklist_timestamp BEFORE UPDATE ON tasklist + FOR EACH ROW EXECUTE FUNCTION update_timestamp_column(); + + +CREATE TABLE nowlist( + taskid INTEGER PRIMARY KEY REFERENCES tasklist(taskid) ON DELETE CASCADE ON UPDATE CASCADE, + last_started TIMESTAMPTZ NOT NULL +); + +CREATE TABLE taskplan( + taskid INTEGER PRIMARY KEY REFERENCES tasklist(taskid) ON DELETE CASCADE ON UPDATE CASCADE, + order_idx INTEGER NOT NULL +); + +CREATE TABLE task_profiles( + profileid INTEGER PRIMARY KEY REFERENCES user_profiles(profileid) ON DELETE CASCADE ON UPDATE CASCADE +); + + +-- }}} diff --git a/discord/__init__.py b/discord/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..ef02401 --- /dev/null +++ b/notes.md @@ -0,0 +1,106 @@ +# Intended command usage + +Still focusing on the 'nowlist', but we can have a backlog of tasks, and a plan for how to complete them. + +To see completion times and durations, we still save task history for up to some time, probably a week.. + +On Discord, multi-tasks may be shown in an md or ansi formatted codeblock? Or the old way in a task embed with some extra buttons maybe? + +!now +!now task +!now 1 + +!plan 2, 5, 3 +!plan abcd, defg, hijk +=> Creates the tasks in the tasklist, adds them to the plan at the end, same as !later +Note that !later moves the current task, but !plan shows the current plan.= + +!replan 2, 5, 3 +=> Unsets the plan and makes it anew + + +!plan +=> shows current plan + +!unplan task, taskid, ... +=> Removes these tasks from the plan. Does not create. + +!clearplan + +!next +=> Moves to the next task on the tasklist +!next blah +=> Completes current task, assigns next task.. + +Does !now add something to the plan? Or does it change whether it is on the plan? +!now 1, 5, 3 +Should probably make a plan of 1, 5, 3.. +Probably adds them to the plan if they weren't already there? + + + +!later/!notnow/!pause/!soon +Operates on given task if provided, or current task +Adds these to the plan + +!clear/!delete deletes the current task entirely +!push +!pop +!sidequest + + + +!done Marks the current task as done, does not remove it from now. + +Is head of the plan always the current task? Does the plan keep completed tasks? +Okay plan can keep completed tasks but.. +Head of the plan is not always the current task. +Current task may be empty for example. + + +!check +=> Currently working on 'blah' for 'blah'. 10 tasks waiting in the !plan, 35 more tasks left on the !tasklist. + + +Most people want to just do !now abc, def, jhi. Then + + +- Reply to '!done next' with please just use '!next' to complete your task and move to the next one instead. +- + +!done +Good job completing 'blah', it took you blah! You have completed 'blah' tasks today and have blah left on your plan! Type !next to start working on '...' +Similar mentions for !now + +Maybe a brief mode configuration? + +?task for task help, as usual ++ task, task, task acts like !add or !soon? + +Actually !add + +!resume? + +I think !add should add the first task straight onto the tasklist if there isn't anything there. !soon probably shouldn't though. + +Does !soon schedule a current task if there isn't one set? Probably not.. + + +Okay, I want all these things, but I think a lot of these are a step too far right now. Let's focus on: +- Refactor tasklist into the first of these multi-pronged modules, with abstract interface used by the commands. +- Make the tasklist backed by data which keeps track of how many tasks are complete for task statistics, and probably report them to stream as well. +- Add profile ids to the tasklist if possible +- Write the web interface.. which will actually involve me writing an entire web client. + - Move the websocket to query by community id? Maybe not now.. +- Make sure to move out any dependencies on the tasklist system, e.g. the !tag command and the little tag in the pomo timers. I'm not sure anyone actually uses that anyway. + + + + +# Data structure + +# Web routes + +# Discord notes + +# Twitch notes diff --git a/taskclient.py b/taskclient.py new file mode 100644 index 0000000..e69de29 diff --git a/twitch/__init__.py b/twitch/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/web/__init__.py b/web/__init__.py new file mode 100644 index 0000000..e69de29