Commit Graph

779 Commits

Author SHA1 Message Date
hanishkvc c68316bf07 SimpleChatTCRV:CMTextFormat: PopOver & Message UI adjust
Add format selection box to the popover.

Update show_message logic to allow refreshing a existing message
ui element, rather than creating a new one.

Trigger refresh of the message ui element, when format selection
changes.
2025-12-04 19:41:40 +05:30
hanishkvc 701ebca477 SimpleChatTCRV:CMContentTextFormat: towards user fine adjustable
Add a textFormat field wrt ChatMessageEx.

User can be allowed to change how to interpret the text content
at a individual message level.
2025-12-04 19:41:40 +05:30
hanishkvc d97147568f SimpleChatTCRV:Markdown: Usage flow cleanup
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.
2025-12-04 19:41:40 +05:30
hanishkvc e9546168ae SimpleChatTCRV:Markdown:OrderedLists - allow only number markers 2025-12-04 19:41:40 +05:30
hanishkvc 6358a2083d SimpleChatTCRV:Markdown:List items without list marker cleanup
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.
2025-12-04 19:41:40 +05:30
hanishkvc 82d436b537 SimpleChatTCRV:Markdown: flexible unwind list 2025-12-04 19:41:40 +05:30
hanishkvc 11eab92d08 SimpleChatTCRV:TC:FetchUrlRaw: Rename to avoid confusion
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.
2025-12-04 19:41:40 +05:30
hanishkvc 67f971527d SimpleChatTCRV:Markdown:Process headline and horizline
Also update readme a bit, better satisfying md file format.
2025-12-04 19:41:40 +05:30
hanishkvc 707b719f67 SimpleChatTCRV:Markdown:ReEnable Sanitize, lineRaw
Maintain raw and sanitized versions of line.

Make blockquote work with raw line and not the sanitized line.
So irrespective of whether sanitize is enabled or not, the logic
will still work. Inturn re-enable HtmlSanitize.
2025-12-04 19:41:40 +05:30
hanishkvc 0f5be059cf SimpleChatTCRV:Markdown: Move Pre Fenced handling into func 2025-12-04 19:41:40 +05:30
hanishkvc edba012d80 SimpleChatTCRV:Markdown:BlockQuote support 2025-12-04 19:41:40 +05:30
hanishkvc 1d26453b52 SimpleChatTCRV:Markdown: CommonLogic listitem & para extend/append
Similar to listitem before, now also allow a para to have its long
lines split into adjacent lines. Inturn the logic will take care of
merging them into single para.

The common logic wrt both flows moved into its own helper function.
2025-12-04 19:41:40 +05:30
hanishkvc b3645a1164 SimpleChatTCRV:ToolCall:ExtAi: Task decomposition/planning
Had forgotten to include this in the examples before.
2025-12-04 19:41:40 +05:30
hanishkvc 2242ad4402 SimpleChatTCRV:Markdown:List: Allow split line items
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
2025-12-04 19:41:40 +05:30
hanishkvc 1129ab5a6d SimpleChatTCRV:Markdown:Basic List (ordered/unordered) handling
Rename from unordered to just list, given that the logic handles
both types of lists at a basic level now.
2025-12-04 19:41:40 +05:30
hanishkvc 226dc793b1 SimpleChatTCRV:Markdown:Lists - handle split lines to an extent
If a split line is found which remains within the constraints of
the preceding list item, then dont unwind the list, rather for
now add the split line as a new item at the same level.
2025-12-04 19:41:40 +05:30
hanishkvc b4be1cb4b8 SimpleChatTCRV:Markdown: Ordered Ya Unordered
Start ordered or unordered list as the case may be and push the
same into endType for matching unwinding.

Ignore empty lines and dont force a list unwind.
2025-12-04 19:41:40 +05:30
hanishkvc 2788752880 SimpleChatTCRV:Markdown:OrdUnOrded: EndType tracker initial go 2025-12-04 19:41:40 +05:30
hanishkvc 9b75e494be SimpleChatTCRV:Markdown:OrderedUnOrderd: Simplify flow
Avoid seperate new list level logic for a fresh list and list with
in list paths. Rather adjust lastOffset specifically for fresh list.

All paths lead to need to insert list item and the difference to be
handled wrt starting or ending a list level is handled by respective
condition check blocks directly without delaying it for later so no
need for that sList state, so remove.

Avoid check for same level list item path, as nothing special needs
to be do in that path currently.

Live identify the last offset, when unwinding.

NOTE: Logic currently will handle ordered lists on their own or
unordered lists on thier own or intermixed list containing both
type of lists within them, however remember that all will be shown
as unordered lists.

ALERT: if there is a really long line, the logic currently doesnt
support it being broken into smaller line with same or greater
offset than the line identifying the current list item.
2025-12-04 19:41:40 +05:30
hanishkvc e7b8fc1392 SimpleChatTCRV:Markdown:OrderedUnOrdered: rename to semantic 2025-12-04 19:41:40 +05:30
hanishkvc 908ca170fa SimpleChatTCRV:Markdown:OrderedUnOrdered: list.offsets 2025-12-04 19:41:40 +05:30
hanishkvc 9453a81b95 SimpleChatTCRV:Markdown:Ordered and Unordered
Update regex to match both ordered and unordered list
2025-12-04 19:41:40 +05:30
hanishkvc a1dc72ba66 SimpleChatTCRV:MarkDown:Cleanup overall initial go
Save copy of data being processed.

Try and sanitize the data passed for markdown to html conversion,
so that if there are any special characters wrt html in the passed
markdown content, it gets translated into a harmless text.

This also ensures that those text dont disappear, bcas of browser
trying to interpret them as html tagged content.

Trap any errors during sanitizing and or processing of the lines
in general and push them into a errors array. Callers of this
markdown class can decide whether to use the converted html or
not based on errors being empty or not or ...

Move the processing of unordered list into a function of its own.
Rather the ordered list can also use the same flow in general except
for some tiny changes including wrt the regex, potentially.
2025-12-04 19:41:40 +05:30
hanishkvc 654e234a4e SimpleChatTCRV:Markdown:User configurable per session
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.
2025-12-04 19:41:40 +05:30
hanishkvc edf4c6588d SimpleChatTCRV:MarkDown:Table cleanup initial go
Switch to the simpler split based flow.

Include tr wrt the table head block also.

Add a css entry to try and have header cell contents text aling
to left for now, given that there is no border or color shaded
or so distinguishing characteristics wrt the table cells for now.
2025-12-04 19:41:40 +05:30
hanishkvc 2f85d44428 SimpleChatTCRV:MarkDown:Tables initial go
Rather this wont work, need to refresh on regex, been too long.

Rather using split should be simpler

However the extraction of head and body parts with seperation
inbetween for transition should work

Rather the seperation is blindly assumed and corresponding line
discarded for now
2025-12-04 19:41:40 +05:30
hanishkvc 3cc5bd01ae SimpleChatTCRV:MarkDown:Tables initial skeleton
Try create a table head
2025-12-04 19:41:40 +05:30
hanishkvc 03220d4a2b SimpleChatTCRV:Markdown: Allow fixed spaces b4 fenced pre marker 2025-12-04 19:41:40 +05:30
hanishkvc 95c8cd6eba SimpleChatTCRV:MarkDown: Better Fenced Pre
Allow fenced code block / pre to be demarkated using either ```
or ~~~

Ensure the termination line wrt fenced block doesnt contain anything
else.

Same starting marker needs to be present wrt ending also
2025-12-04 19:41:40 +05:30
hanishkvc 924bb6cb47 SimpleChatTCRV:MarkDown:HorizLine and Unordered list
Allow for other valid char based markers wrt horizontal lines and
unordered lists

?Also allow for spaces after horizontal line marker, in same line?
2025-12-04 19:41:40 +05:30
hanishkvc 781f86fee8 SimpleChatTCRV:Markdown: Remove unordered list marker
also make flow simple by using same logic for putting the list
content.
2025-12-04 19:41:40 +05:30
hanishkvc c420f16504 SimpleChatTCRV:MarkDown:Cleanup Unordered list initial go
Ensure '---' is treated as a horizontal line and doesnt mess with
unordered list handling.

Take care of unwinding the unordered list everywhere it is needed.
2025-12-04 19:41:40 +05:30
hanishkvc be528bc34f SimpleChatTCRV:Markdown:Unordered list initial go 2025-12-04 19:41:40 +05:30
hanishkvc c9ddb90aae SimpleChatTCRV:MarkDown:Headings, Pre initial cleanup
Remove markdown heading markers

Fix pre equivalent blocks of markdown given that they can have
the block type following ``` marker

Remember to add line break at end of line wrt pre block.
2025-12-04 19:41:40 +05:30
hanishkvc d3f1a398d8 SimpleChatTCRV:Markdown:Initial skeleton
Try identify headings, and blocks in markdown and convert them
into equivalent stuff in html

Show the same in the chat message blocks.
2025-12-04 19:41:40 +05:30
hanishkvc c5eb783ec1 SimpleChatTCRV:Ui:Cleanup: Extended Type annotations
So there is slightly better typecheck and less extra code.
2025-12-04 19:41:40 +05:30
hanishkvc 3cd2e3fd90 SimpleChatTCRV:UI:Cleanup: Have common div+label+el logic
Avoid seperate duplicated logic for creating the div+label+el based
element
2025-12-04 19:41:40 +05:30
hanishkvc 073c570cad SimpleChatTCRV:AiCallingAi ToolCall: flow cleanup and flexibility
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.
2025-12-04 19:41:40 +05:30
hanishkvc 1751ed1827 SimpleChatTCRV:Cleanup importmap
Remove the unneeded , wrt last entry

Rather the import map isnt used currently, but certain entries
kept there for future, more as a reminder.
2025-12-04 19:41:40 +05:30
hanishkvc 143237a8d0 SimpleChatTCRV: Update/Cleanup the new readme 2025-12-04 19:41:40 +05:30
hanishkvc ec41001ba3 SimpleChatTCRV: Add simple readme in place of detailed one
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.
2025-12-04 19:41:40 +05:30
hanishkvc ba6c7872cc SimpleChatTCRV: split changelog from details into separate file 2025-12-04 19:41:40 +05:30
hanishkvc 214ca2e00b SimpleChatTCRV: Documentation cleanup
Move existing readme.md into docs/details.md

Similarly move the screenshot image into docs/
2025-12-04 19:41:40 +05:30
hanishkvc b1cfedaba7 SimpleChatTCRV:Misc cleanup continues... 2025-12-04 19:41:40 +05:30
hanishkvc b7b9109cb0 SimpleChatTCRV:Cleanup
Make a note on how user can always view the full chat history if
they want to.
2025-12-04 19:41:40 +05:30
hanishkvc 4bca1f6f3e SimpleChatTCRV:UIRefresh cleanup: Show only msgs in sliding window
Ensure we are working with the Chat Messages in Chat session, which
are in the currently active sliding window.

Remove any chat message blocks in the chat session ui, which are
no longer in the sliding window of context.

This brings uirefresh semantic to be in sync with chat_show logic
2025-12-04 19:41:40 +05:30
hanishkvc 856f403f1d SimpleChatTCRV:AnveshikaSallap: cleanup in general
Rename the default 2 chat session names to make them neutral.

Update internal name to include AnveshikaSallap, better matching
the semantic of the logic, given support for tool calling, vision,
reasoning, ...

Also update usage note wrt simpleproxy.py for web access related
tool calls and few other minor tweeks.
2025-12-04 19:41:40 +05:30
hanishkvc a4e023d21c SimpleChatTCRV:Config++:Cleanup the initial go
Ensure toolNames array is reset, each time setup is called, so
that it doesnt end up with duplicate entries and equally dont
end up with entries of tool calls which are no longer available,
maybe because some config changed etal.

Ensure the ChatId is logged wrt the toolweb related setup actions.

Ensure that ExternalAi tool call related chat session, has its
tools config disabled, when its created itself, so that end user
doesnt get confused, given that external_ai toolcall explicitly
forces tools support to disabled.

Update some of the notes and readme
2025-12-04 19:41:40 +05:30
hanishkvc 57cf87b19a SimpleChatTCRV:Config++:Save/Load Configs 2025-12-04 19:41:40 +05:30
hanishkvc f7e9bdeed5 SimpleChatTCRV:Config++:Cleanup: Hide/Show UserIn and ValidateTC
When switching to settings ui, hide the User input and ValidateTC
areas.

When switching back to any chat session, unhide User input, while
the ValidateTC ui will be handled by corresponding helper logic
called through the ShowMessage
2025-12-04 19:41:40 +05:30