Given toolcall.py maintains ToolCall, ToolManager and MCP related
types and base classes, so rename to toolcalls.py
Also add the bash script with curl used for testing the tools/list
mcp command.
Remove the sample function meta ref, as tools/list is working ok.
Build the list of tool calls
Trap some of the MCP post json based requests and map to related
handlers. Inturn implement the tool call execution handler.
Add some helper dataclasses wrt expected MCP response structure
TOTHINK: For now maintain id has a string and not int, with idea
to map it directly to callid wrt tool call handshake by ai model.
TOCHECK: For now suffle the order of fields wrt jsonrpc and type
wrt MCP response related structures, assuming the order shouldnt
matter. Need to cross check.
otherwise aum path was not handled immidiately wrt exceptions.
this also ensures any future changes wrt get request handling
also get handled immidiately wrt exceptions, that may be missed
by any targetted exception handling.
Implement todo noted in last commit, and bit more.
This brings in clearing of the external ai tool call special chat
session divStream during chat show, which ensures that it gets
hidden by default wrt other chat sessions and inturn only get
enabled if user triggers a new tool call involving external ai
tool call.
This patch also ensures that if ext ai tool call takes too much
time and so logic gives you back control with a timed out response
as a possible response back to ai wrt the tool call, then the
external ai tool call's ai live response is no longer visible in
the current chat session ui. So user can go ahead with the timed
out response or some other user decided response as the response
to the tool call. And take the chat in a different direction of
their and ai's choosing.
Or else, if they want to they can switch to the External Ai
specific special chat session and continue to monitor the response
from the tool call there, to understand what the final response
would have been wrt that tool call.
Rather this should keep the ui flow clean.
ALERT: If the user triggers a new ext ai tool call, when the
old one is still alive in the background, then response from
both will be in a race for user visibility, so beware of it.
If user explicitly makes a content text format selection, the
same will be used.
Else based on session settings, a format will be used.
Now when the popover menu is shown, the current message's format
type is reflected in the popover menu.
Move all markdown configs into a single object field.
Add always flag, which if set, all roles' message contents will be
treated as markdown, else only ai assistant's messages will be
treated as markdown.
If lines immidately follows a list item, without the list marker
at their begining, but with a offset matching the list item, then
these lines will be appended to that list item.
If a empty line is there between a list item and a new line with
some content, but without a list marker
* if the content offset is less than the last list item, then
unwind the lists before such a line.
* if the content offset is larger than the last list item, then
the line will be added as a new list item at the same level
as the last list item.
* if the content offset is same as the last list tiem, then
unwind the list by one level and then insert this line as a
new list item at this new unwound level.
Given that now fetch_web_url_raw can also fetch local files, if local
file access scheme is enabled in simpleproxy.py, so rename this
tool call by dropping web from its name, given that some ai models
were getting confused because of the same.
If the split lines dont have any empty lines inbetween and also
remain within the block area of the list item which they belong
to, then the split line will be appended to the corresponding
list item, ELSE a new list item will be created.
To help with same a generic keyed empty lines tracker logic has
been added.
TODO: Account similar semantic wrt paragraph related split lines
User can enable or disable the simple minded bruteforce markdown
parsing from the per session settings.
Add grey shading and align text to left wrt table headings of
markdown to html converted tables.
By default ensure external_ai tool call related special chat session
starts with tool calls disabled and client side sliding window of 1.
Add a helper in SimpleChat class to set these along with clearing of
any chat history.
Inturn now give the user flexibility to change this from within
the program, if they need to for what ever reason, till the program
restarts.
Gives quick overview of the features, given that the original readme
(now docs/details.md++) got created over a period of disjoined time
as features got added.