Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
733d434
SimpleChatTC:tooljs: Trap console.log and store in new result key
hanishkvc Oct 11, 2025
bac82e4
SimpleChatTC: Implement a simple toolcall handling flow
hanishkvc Oct 11, 2025
ddfbd88
SimpleChatTC: Cleanup initial/1st go toolcall flow
hanishkvc Oct 11, 2025
c89524b
SimpleChatTC: Trap any exception raised during tool call
hanishkvc Oct 11, 2025
6041f72
SimpleChatTC: More clearer description of toolcalls execution env
hanishkvc Oct 12, 2025
bcdf4c7
SimpleChatTC: Clarify some type definitions to avoid warnings
hanishkvc Oct 12, 2025
76748cf
SimpleChatTC: Move tool calling to tools, try trap async failures
hanishkvc Oct 12, 2025
ff342e8
SimpleChatTC: Pass toolname to the tool handler
hanishkvc Oct 12, 2025
6834166
SimpleChatTC: Cleanup the function description a bit
hanishkvc Oct 12, 2025
966b8d6
SimpleChatTC: Update the readme.md wrt tool calling a bit
hanishkvc Oct 12, 2025
547e02a
SimpleChatTC: ToolCall hs info in normal assistant-user chat flow
hanishkvc Oct 12, 2025
beeb86d
SimpleChatTC: Add ui elements for tool call verify and trigger
hanishkvc Oct 12, 2025
074182a
SimpleChatTC: Let user trigger tool call, instead of automatic
hanishkvc Oct 12, 2025
a766fdf
SimpleChatTC: Update readme with bit more details, Cleaner UI
hanishkvc Oct 12, 2025
6dbbcb0
SimpleChatTC: Tool Calling UI elements use up horizontal space
hanishkvc Oct 12, 2025
f669ba6
SimpleChatTC: Update readme wrt --jinja argument and bit more
hanishkvc Oct 12, 2025
6fa4440
SimpleChatTC: Move console.log trapping into its own module
hanishkvc Oct 13, 2025
c3670cc
SimpleChatTC:ToolsConsole:Cleanup a bit, add basic set of notes
hanishkvc Oct 13, 2025
a5bf49b
SimpleChatTC: Initial skeleton of a simple toolsworker
hanishkvc Oct 13, 2025
7bd3ed8
SimpleChatTC: Pass around structured objects wrt tool worker
hanishkvc Oct 13, 2025
75f6e57
SimpleChatTC: Actual tool call implementations simplified
hanishkvc Oct 13, 2025
05a2448
SimpleChatTC: Get ready for decoupled tool call response
hanishkvc Oct 13, 2025
7b7c57f
SimpleChatTC: Web worker flow initial go cleanup
hanishkvc Oct 13, 2025
672e168
SimpleChatTC: Increase the sliding window context to Last4 QA
hanishkvc Oct 13, 2025
06a5480
SimpleChatTC: Update readme.md wrt latest updates. 2k maxtokens
hanishkvc Oct 13, 2025
2899c84
SimpleChatTC: update descs to indicate use of web workers
hanishkvc Oct 13, 2025
6e7c9f5
SimpleChatTC:ChatMessage: AssistantResponse into chat message class
hanishkvc Oct 14, 2025
7119b5a
SimpleChatTC:ChatMessageEx: UpdateStream logic
hanishkvc Oct 14, 2025
0d8ce70
SimpleChatTC:ChatMessageEx:cleanup, HasToolCalls, ContentEquiv
hanishkvc Oct 14, 2025
4ab4462
SimpleChatTC:ChatMessage: remove ResponseExtractStream
hanishkvc Oct 14, 2025
d59fa84
SimpleChatTC:ChatMessageEx: add update_oneshot
hanishkvc Oct 14, 2025
5c4ee51
SimpleChatTC:ChatMessageEx: ods load, system prompt related
hanishkvc Oct 14, 2025
8b63a41
SimpleChatTC:ChatMessageEx: RecentChat, GetSystemLatest
hanishkvc Oct 14, 2025
68421cc
SimpleChatTC:ChatMessageEx: Upd Add, rm sysPromptAtBeginOnly hlpr
hanishkvc Oct 14, 2025
6cc1130
SimpleChatTC:ChatMessageEx: Recent chat users upd
hanishkvc Oct 14, 2025
e707d91
SimpleChatTC:ChatMessageEx: Cleanup remaining stuff
hanishkvc Oct 14, 2025
674312b
SimpleChatTC:Load allows old and new ChatMessage(Ex) formats
hanishkvc Oct 14, 2025
df5cfac
SimpleChatTC:ChatMessageEx: send tool_calls, only if needed
hanishkvc Oct 14, 2025
f8749a3
SimpleChatTC:Propogate toolcall id through tool call chain
hanishkvc Oct 14, 2025
9f234e3
SimpleChatTC:ChatMessageEx: Build tool role result fully
hanishkvc Oct 14, 2025
42b3fe1
SimpleChatTC:ChatMessageEx:While at it also ns_delete
hanishkvc Oct 14, 2025
29a6deb
SimpleChatTC:Readme: Updated wrt new relativelyProper toolCallsHS
hanishkvc Oct 14, 2025
8a28b33
SimpleChatTC:ChatMessageEx: Better tool result extractor
hanishkvc Oct 15, 2025
e43342b
SimpleChatTC:ChatMessageEx: 1st go at trying to track promises
hanishkvc Oct 15, 2025
d0c3939
SimpleChatTC:TrapPromise: log the trapping
hanishkvc Oct 15, 2025
84fd55b
SimpleChatTC:Promises: trap normal fetch (dont care await or not)
hanishkvc Oct 15, 2025
ada6fd1
SimpleChatTC: Allow await in generated code that will be evald
hanishkvc Oct 15, 2025
ae62f3a
SimpleChatTC:Ensure fetch's promise chain is also trapped
hanishkvc Oct 15, 2025
1f685f1
SimpleChatTC: update readme wrt promise related trapping
hanishkvc Oct 15, 2025
32bb28e
SimpleChatTC:WebFetchThroughProxy:Initial go creating request
hanishkvc Oct 16, 2025
807589a
SimpleChatTC:SimpleProxy:Process args --port
hanishkvc Oct 16, 2025
27bb63d
SimpleChatTC:SimpleProxy: Start server, Show requested path
hanishkvc Oct 16, 2025
dc58ac7
SimpleChatTC:SimpleProxy: Cleanup for basic run
hanishkvc Oct 16, 2025
d829e2f
SimpleChatTC:SimpleProxy: Extract and check path, route to handlers
hanishkvc Oct 16, 2025
5a3696e
SimpleChatTC:SimpleProxy:implement handle_urlraw
hanishkvc Oct 16, 2025
4770ef3
SimpleChatTC:SimpleProxy:UrlRaw: Fixup basic oversight wrt 1st go
hanishkvc Oct 16, 2025
3e05746
SimpleChatTC:WebFetch: Update to use internal SimpleProxy.py
hanishkvc Oct 16, 2025
d297cf5
SimpleChatTC:SimpleProxy: Cleanup few messages
hanishkvc Oct 16, 2025
a4d1028
SimpleChatTC:SimpleProxy:Common UrlReq helper for UrlRaw & UrlText
hanishkvc Oct 16, 2025
bf116f9
SimpleChatTC:SimpleProxy: ElementTree, No _UrlopenRet
hanishkvc Oct 16, 2025
702c1ca
SimpleChatTC:SimpleProxy: Switch to html.parser
hanishkvc Oct 16, 2025
874aef3
SimpleChatTC:SimpleProxy:UrlText: Capture body except for scripts
hanishkvc Oct 16, 2025
00cb967
SimpleChatTC:SimpleProxy:UrlText: Avoid style blocks also
hanishkvc Oct 16, 2025
adff879
SimpleChatTC:WebUrl FetchStrip through simple proxy
hanishkvc Oct 16, 2025
cf324a9
SimpleChatTC:SimpleProxy:UrlText: Try strip empty lines some what
hanishkvc Oct 16, 2025
926d871
SimpleChatTC:SimpleProxy:UrlText: Slightly better trimming
hanishkvc Oct 16, 2025
54e03ae
SimpleChatTC:WebUrlText:Update name and desc to see if prefered
hanishkvc Oct 16, 2025
a2c1d43
SimpleChatTC:SimpleProxy:Options just in case
hanishkvc Oct 16, 2025
724b382
SimpleChatTC:WebFetch:UrlEnc url2fetch b4Passing toProxy asQuery
hanishkvc Oct 16, 2025
e1e4fc3
SimpleChatTC: Update readme wrt web fetch and related simple proxy
hanishkvc Oct 17, 2025
8f9f098
SimpleChatTC:SimpleProxy:HtmlParser more generic and flexible
hanishkvc Oct 17, 2025
750bf4e
SimpleChatTC:WebFetch: Cleanup the names and descriptions a bit
hanishkvc Oct 17, 2025
35f6832
SimpleChatTC:SimpleProxy: Ensure CORS related headers sent always
hanishkvc Oct 17, 2025
b78dbc5
SimpleChatTC:WebFetch:Trap Non Ok status and raise error
hanishkvc Oct 17, 2025
84708b8
SimpleChatTC:WebFetch: Update readme to reflect the new names
hanishkvc Oct 17, 2025
7cd77f4
SimpleChatTC:Tools: Pick proxy server address from document[gMe]
hanishkvc Oct 18, 2025
8abbff2
SimpleChatTC:UI: el_get/el_set to avoid warnings
hanishkvc Oct 19, 2025
cbc0e7b
SimpleChatTC:UI:Common helper to edit obj members of few types
hanishkvc Oct 20, 2025
218dc9b
SimpleChatTC:UI:ObjPropEdits handle objects, use for gMe
hanishkvc Oct 20, 2025
abcf59d
SimpleChatTC:Use generic obj props edit for settings in general
hanishkvc Oct 20, 2025
4f16546
SimpleChatTC:Trappable UiShowObjPropsEdit for custom handling
hanishkvc Oct 20, 2025
ac19226
SimpleChatTC:UiShowObjPropsEdit allow refining
hanishkvc Oct 20, 2025
0853c3e
SimpleChatTC:ObjPropsEdit: Obj within Obj aware fRefiner
hanishkvc Oct 20, 2025
2001b05
SimpleChatTC:NonStreaming: Update oneshot mode wrt tool calls
hanishkvc Oct 20, 2025
231fd43
SimpleChatTC: Update/Cleanup readme
hanishkvc Oct 20, 2025
8280494
SimpleChatTC:WebFetch: Enable only if something at proxyUrl
hanishkvc Oct 20, 2025
122484a
SimpleChatTC:WebFetch: Check for the specific proxy paths
hanishkvc Oct 20, 2025
913de69
SimpleChatTC:WebFetch: Try confirm simpleproxy before enabling
hanishkvc Oct 20, 2025
2f38893
SimpleChatTC:Fetch:Proxy URL rename and in settings
hanishkvc Oct 20, 2025
1ed31cb
SimpleChatTC:ShowInfo: Create and use common automated info show
hanishkvc Oct 20, 2025
d24b513
SimpleChatTC:ShowInfo: Make logic recursive, avoid JSON.stringify
hanishkvc Oct 20, 2025
abd8220
SimpleChatTC:ShowObjPropsInfo: Use sections to indicate relations
hanishkvc Oct 21, 2025
8294be0
SimpleChatTC:ShowInfo: Allow showing minimal info set, if needed
hanishkvc Oct 21, 2025
b902cdd
SimpleChatTC:ShowInfo:Clean up layout of showing of props data
hanishkvc Oct 21, 2025
ea7b7d9
SimpleChatTC:Cleanup: Move bTools and toolFetchProxyUrl into tools
hanishkvc Oct 21, 2025
c61b75b
SimpleChatTC:Cleanup:EditObjProps: rename vars followingConvention
hanishkvc Oct 21, 2025
6328a9b
SimpleChatTC:Cleanup:Rename func arg to match semantic better
hanishkvc Oct 21, 2025
7d3d57a
SimpleChatTC:ShowObjPropsEdit:Any depth trapping of ui setup
hanishkvc Oct 21, 2025
f78f430
SimpleChatTC:ShowObjPropsEdit:Any depth trapping of ui setup - t2
hanishkvc Oct 21, 2025
d517e6c
SimpleChatTC:Cleanup:ChatProps: Move bStream into it
hanishkvc Oct 21, 2025
d09e23b
SimpleChatTC:Cleanup:ChatProps: iRecentUserMsgCnt
hanishkvc Oct 21, 2025
f994cd5
SimpleChatTC:Cleanup:ChatProps: bCompletionFreshChatAlways
hanishkvc Oct 21, 2025
4f943e7
SimpleChatTC:Cleanup:ChatProps: bCompletionInsertStandardRolePrefix
hanishkvc Oct 21, 2025
f9ef84b
SimpleChatTC:Cleanup:ChatProps: bTrimGarbage
hanishkvc Oct 21, 2025
412b678
SimpleChatTC:Cleanup:ChatProps: apiEP
hanishkvc Oct 22, 2025
9a3bafe
SimpleChatTC:Tools: Show available tool names
hanishkvc Oct 22, 2025
ee3c885
SimpleChatTC:SimpleProxy:Allow for loading json based config file
hanishkvc Oct 23, 2025
9b5ee22
SimpleChatTC:SimpleProxy: Update doc following python convention
hanishkvc Oct 23, 2025
013e479
SimpleChatTC:SimpleProxy: AllowedDomains based filtering
hanishkvc Oct 23, 2025
2e1ff71
SimpleChatTC:SimpleProxy: Cleanup domain filtering and general
hanishkvc Oct 23, 2025
3d8a23e
SimpleChatTC:SimpleProxy: Include a sample config file
hanishkvc Oct 23, 2025
ce6a708
SimpleChatTC: Update readme a bit
hanishkvc Oct 23, 2025
5e2651c
SimpleChatTC:SimpleProxy: Some debug prints which give info
hanishkvc Oct 23, 2025
ee56ea2
SimpleChatTC:SimpleProxy:Try mimic real client using got req info
hanishkvc Oct 23, 2025
7ee75a6
SimpleChatTC:SimpleProxy:Cleanup a bit
hanishkvc Oct 23, 2025
b87e348
SimpleChatTC:SimpleProxy: mimicing got req helps wrt duckduckgo
hanishkvc Oct 23, 2025
797b5a9
SimpleChatTC:ToolCall response relaxed handling
hanishkvc Oct 23, 2025
e4c74f9
SimpleChatTC:SimpleProxy: Update readme wrt mimicing client req
hanishkvc Oct 23, 2025
436d109
SimpleChatTC:ToolResponse: Use browser dom for xml/html safe
hanishkvc Oct 23, 2025
a20a731
SimpleChatTC:SimpleProxy: debug dumps to identify funny bing
hanishkvc Oct 23, 2025
33537f5
SimpleChatTC:SimpleProxy:Cleanup
hanishkvc Oct 23, 2025
86f7f27
SimpleChatTC:Auto tool calling control to end user
hanishkvc Oct 23, 2025
7a156d7
SimpleChatTC:AutoToolCalls: Track and clear related timers
hanishkvc Oct 24, 2025
aa69cce
SimpleChatTC: Cleanup whitespaces
hanishkvc Oct 24, 2025
00678c9
SimpleChatTC:Cleanup whitespace - github editorconfig checker
hanishkvc Oct 24, 2025
a5d7f41
SimpleChatTC:Update and cleanup the readme a bit
hanishkvc Oct 26, 2025
6bff69f
SimpleChatTC:Duplicate tooljs.mjs to toolweb.mjs
hanishkvc Oct 26, 2025
0407c78
SimpleChatTC:ToolCalling:Seprat out JSWebWorker and ProxyBasedWeb
hanishkvc Oct 26, 2025
41addbb
SimpleChatTC:ToolCall:SearchWebText using UrlText
hanishkvc Oct 26, 2025
ba30422
SimpleChatTC:ToolCallWeby: Cleanup the toolweb module flow
hanishkvc Oct 26, 2025
5352ccb
SimpleChatTC:WebSearchPlus: Update readme, Wikipedia in allowed
hanishkvc Oct 26, 2025
7624674
SimpleChatTC:ToolCallResponseTimeout: Allow end user to control
hanishkvc Oct 26, 2025
7e6a1c2
SimpleChatTC:SimpleProxy:LoadConfig ProcessArgs cleanup - initial
hanishkvc Oct 27, 2025
f7591c1
SimpleChatTC:SimpleProxy: Prg Parameters handling cleanup - next
hanishkvc Oct 27, 2025
2bfc0f6
SimpleChatTC:SimpleProxy:BearerInsecure a needed config
hanishkvc Oct 27, 2025
8f7888f
SimpleChatTC:SimpleProxy: Check for bearer authorization
hanishkvc Oct 27, 2025
2e2024e
SimpleChatTC:tools.proxyUrl: rename to just proxyUrl
hanishkvc Oct 27, 2025
d13ba39
SimpleChatTC:SimpleProxy:ClientUI: Send Authorization bearer
hanishkvc Oct 27, 2025
66d8b7f
SimpleChatTC:SimpleProxy: once in a bluemoon transformed bearer
hanishkvc Oct 27, 2025
3d3e372
SimpleChatTC:ToolTemp and ChatShow
hanishkvc Oct 27, 2025
2aa9d73
SimpleChatTC:ToolCallErrPath:ToolTemp and MultiChatUIChatShow
hanishkvc Oct 27, 2025
6fc281a
SimpleChatTC:ToolTemp: Ensure add removes non promoted ToolTemp
hanishkvc Oct 27, 2025
9923939
SimpleChatTC:ChatSessionID through the tool call cycle
hanishkvc Oct 27, 2025
ca7156d
SimpleChatTC:ChatSessionID: Get all handlers to account for chatid
hanishkvc Oct 27, 2025
cec3187
SimpleChatTC:Reasoning: Initial Go
hanishkvc Oct 27, 2025
1e3c00b
SimpleChatTC:Reasoning: Cleanup the initial go
hanishkvc Oct 28, 2025
1a8b231
SimpleChatTC:SimpleProxy: Include some news sites in allowed domains
hanishkvc Oct 28, 2025
32774ac
SimpleChatTC:Show: Cleanup
hanishkvc Oct 28, 2025
3328c0d
SimpleChatTC:MultiChatUI.ChatShow: Mov SimpleChat.Show in -initial
hanishkvc Oct 28, 2025
643d41b
SimpleChatTC:MultiChatUI:ChatShow cleanup of Initial skeleton
hanishkvc Oct 28, 2025
c77d8e1
SimpleChatTC:Reasoning+: Update readme wrt reasoning, flow cleanup
hanishkvc Oct 28, 2025
8292814
SimpleChatTC:Cleanup: tool resp xml, some allowed domains
hanishkvc Oct 28, 2025
c13a27a
SimpleChatTC:Cleanup:Move showing message into ShowMessage
hanishkvc Oct 29, 2025
e05fd53
SimpleChatTC:ShowMessage: containers, role, contents
hanishkvc Oct 29, 2025
84d3006
SimpleChatTC:CSS: Instead of hardcoded btn minwidth use padding
hanishkvc Oct 29, 2025
1d5472e
SimpleChatTC:ShowMessage: Seperate out the content parts
hanishkvc Oct 29, 2025
25635b5
SimpleChatTC:ShowMessage:Show any number of toolcalls
hanishkvc Oct 29, 2025
a95ab44
SimpleChatTC:UICleanup: WordBreaks, Print avoid side vertical
hanishkvc Oct 29, 2025
3665dae
SimpleChatTC:UICleanup:ShowMessage: Update readme
hanishkvc Oct 29, 2025
e859563
SimpleChatTC:DataStore: Initial skeleton of a Db WebWorker
hanishkvc Oct 29, 2025
dfc0616
SimpleChatTC:DataStore: Duplicate tooljs to tooldb initial skel
hanishkvc Oct 29, 2025
a443380
SimpleChatTC:DataStore: Remaining plumbing to try this
hanishkvc Oct 29, 2025
6a489a5
SimpleChatTC:DataStore:FuncCallArgs: Any type not supported
hanishkvc Oct 29, 2025
544226a
SimpleChatTC:DataStore:Eagerness to Wrong JSON conversions
hanishkvc Oct 29, 2025
219de66
SimpleChatTC:DataStore: Dont ignore the error paths
hanishkvc Oct 29, 2025
e584c82
SimpleChatTC:DataStore:Put, stringify undefined, readme
hanishkvc Oct 29, 2025
e36e7aa
SimpleChatTC:DataStore: Delete a record - the db web worker side
hanishkvc Oct 30, 2025
8d65c24
SimpleChatTC:DataStore:Delete a record - the plumbing side
hanishkvc Oct 30, 2025
4c98081
SimpleChatTC:DataStore:list - web worker side logic
hanishkvc Oct 30, 2025
0715397
SimpleChatTC:DataStore:List keys - the plumbing
hanishkvc Oct 30, 2025
7bcdbd1
SimpleChatTC:DataStore:Cleanup:Msg, duplicate on routing side
hanishkvc Oct 30, 2025
2441f01
SimpleChatTC:DataStore: update readme
hanishkvc Oct 30, 2025
e70b8c9
SimpleChatTC:ToolsWorker: Update note to flow with chat session id
hanishkvc Nov 1, 2025
88bb974
SimpleChatTC:Seperate out actual nw handshake - initial go
hanishkvc Nov 1, 2025
16f2ec8
SimpleChatTC:Move chat server handshake to SimpleChat
hanishkvc Nov 1, 2025
f8503f4
SimpleChatTC:Raise Error on Ai Chat server handshake NotOk resp
hanishkvc Nov 1, 2025
7463b8f
SimpleChatTC: Update readme
hanishkvc Nov 1, 2025
4c3398a
SimpleChatTC:SimpleProxy: Enable allowing or not requested feature
hanishkvc Nov 1, 2025
e8f0e6e
SimpleChatTC:SimpleProxy:Pdf2Text:Initial plumbing
hanishkvc Nov 1, 2025
c7a22b7
SimpleChatTC:SimpleProxy:Pdf2Text: Move handling url to its own
hanishkvc Nov 1, 2025
57874b1
SimpleChatTC:SimpleProxy:Pdf2Text: Initial go
hanishkvc Nov 1, 2025
d9b30a9
SimpleChatTC:SimpleProxy:Pdf2Text: js side initial plumbing
hanishkvc Nov 1, 2025
909993c
SimpleChatTC:Pdf2Text: cleanup initial go
hanishkvc Nov 1, 2025
3be0128
SimpleChatTC:ResultMaxDataLength, Desc
hanishkvc Nov 1, 2025
cff8742
SimpleChatTC:Pdf2Text: Refine desc and MaxResultDataLength
hanishkvc Nov 1, 2025
6d74227
SimpleChatTC:Pdf2Text and otherwise readme update
hanishkvc Nov 1, 2025
827d9cf
SimpleChatTC:SimpleProxyHS: make helper work with any num of args
hanishkvc Nov 1, 2025
bd40771
SimpleChatTC:TC Result truncating only if needed
hanishkvc Nov 1, 2025
0dc5c7c
SimpleChatTC:Pdf2Text: Make it work with a subset of pages
hanishkvc Nov 1, 2025
0e95ee9
SimpleChatTC:Fixup auto toolcall wrt newer ChatShow flow
hanishkvc Nov 1, 2025
d1a6c19
SimpleChatTC:Update notes
hanishkvc Nov 2, 2025
78ff9a7
SimpleChatTC:SimpleProxy:UrlValidator module initial skeleton
hanishkvc Nov 2, 2025
da8c195
SimpleChatTC:SimpleProxy:UrlValidator initial go
hanishkvc Nov 2, 2025
ed042c7
SimpleChatTC:SimpleProxy: Use urlvalidator
hanishkvc Nov 2, 2025
a798d1a
SimpleChatTC:SimpleProxy: AuthAndRun hlpr for paths that check auth
hanishkvc Nov 2, 2025
46016aa
SimpleChatTC:SimpleProxy:Move pdf logic into its own module
hanishkvc Nov 2, 2025
a7db3c0
SimpleChatTC:SimpleProxy: Move web requests to its own module
hanishkvc Nov 2, 2025
f1800c6
SimpleChatTC:SimpleProxy: Avoid circular deps wrt Type Checking
hanishkvc Nov 2, 2025
ad229ba
SimpleChatTC:SimpleProxy:Pdf2Text cleanup page number handling
hanishkvc Nov 2, 2025
366c1c5
SimpleChatTC:SimpleProxy: getting local / web file module ++
hanishkvc Nov 2, 2025
5b9e8e4
SimpleChatTC:SimpleProxy:Pdf2Text update /cleanup readme
hanishkvc Nov 2, 2025
e974137
SimpleChatTC:SimpleProxy:Switch web flow to use file helpers
hanishkvc Nov 2, 2025
ab5e9dd
SimpleChatTC:SimpleProxy:Add generic arxiv.org entry to allowed
hanishkvc Nov 2, 2025
ebe8926
SimpleChatTC: Cleanup - remove older now unused show chat logic
hanishkvc Nov 2, 2025
d2544d1
SimpleChatTC:Cleanup Usage Note and its presentation a bit
hanishkvc Nov 2, 2025
58d631d
SimpleChatTC:Cleanup:UsageNote, Initial SettingsInfo shown
hanishkvc Nov 3, 2025
45eac40
SimpleChatTC:PdfText:Cleanup rename to follow a common convention
hanishkvc Nov 3, 2025
108290d
SimpleChatTC: ToolCalling enabled, Sliding window adjust
hanishkvc Nov 3, 2025
64a0f7b
SimpleChatTC:SimpleProxy: Validate deps wrt enabled service paths
hanishkvc Nov 3, 2025
8e2c376
SimpleChatTC:SettingsDefault:Enable cache prompt api option
hanishkvc Nov 3, 2025
fe2443b
SimpleChatTC:WebTools And Search - headers and search drops - js
hanishkvc Nov 3, 2025
34fe99e
SimpleChatTC:WebTools: urltext-tag-drops python side - skel
hanishkvc Nov 3, 2025
babfb96
SimpleChatTC:WebTools:UrlText:HtmlParser: tag drops - refine
hanishkvc Nov 3, 2025
58a5963
SimpleChatTC:Cleanup in general
hanishkvc Nov 3, 2025
9b9b9be
SimpleChatTC:Cleanup: General T2
hanishkvc Nov 4, 2025
c39af13
SimpleChatTC:UI:ClearChat, Unicode icons for Clear, settings
hanishkvc Nov 4, 2025
7105f46
SimpleChatTC:FetchPdfAsText: Renamed function call
hanishkvc Nov 5, 2025
87a7605
SimpleChatTC:System Date and Time
hanishkvc Nov 5, 2025
721936e
SimpleChatTC:Cleanup:Make main chat related classes importable
hanishkvc Nov 5, 2025
3ff68e3
SimpleChatTC:Cleanup:MeInTools: update tools, toolweb
hanishkvc Nov 5, 2025
2618d3a
SimpleChatTC:MeInTools: WebWorkers in Me
hanishkvc Nov 5, 2025
20610ab
SimpleChatTC:Rather bring in Tools Class
hanishkvc Nov 5, 2025
0a28fb7
SimpleChatTC:ToolsManager: Instantiate in Me and Use
hanishkvc Nov 5, 2025
a659344
SimpleChatTC:ToolsManager: Cleanup inc delayed direct posting
hanishkvc Nov 5, 2025
3894f4e
SimpleChatTC:TrackToolCalls:helps ignor delayed response, if reqd
hanishkvc Nov 6, 2025
cc12dd9
SimpleChatTC:TCPending: Clear pending in unhappy paths
hanishkvc Nov 6, 2025
32429f4
SimpleChatTC:IndexHTML:Fix a oversight with new module added
hanishkvc Nov 6, 2025
2c995a4
SimpleChatTC:SimpleProxy:XMLText: initial go
hanishkvc Nov 6, 2025
f7897a4
SimpleChatTC:XmlText: Add plumbing on web client ui ie js side
hanishkvc Nov 6, 2025
802fc73
SimpleChatTC:XmlText: Cleanup initial go
hanishkvc Nov 6, 2025
b7ec642
SimpleChatTC:XMLFiltered: Retain xml tags with selective dropping
hanishkvc Nov 7, 2025
04c8c88
SimpleChatTC:XmlFiltered: Use re with heirarchy of tags to filter
hanishkvc Nov 7, 2025
4938d9a
SimpleChatTC:ShowToolCall: Trap invalid args generated by GenAi
hanishkvc Nov 7, 2025
cb5ca21
SimpleChatTC:Rename fetch_web_url_text to fetch_html_text
hanishkvc Nov 7, 2025
42a6b3c
SimpleChatTC:XmlFiltered: Avoid showing skipped tags as no content
hanishkvc Nov 7, 2025
323d070
SimpleChatTC:Get body also for Not Ok responses from ai server
hanishkvc Nov 7, 2025
b7cb9d6
SimpleChatTC:PdfText:Add initial skeleton for outline
hanishkvc Nov 7, 2025
624ec10
SimpleChatTC:PdfText: Numbering T1 - Diff Scheme needed
hanishkvc Nov 7, 2025
91d71a8
SimpleChatTC:PdfText:Numbering T2 - Need diff scheme
hanishkvc Nov 7, 2025
4d394d7
SimpleChatTC:PdfText:Basic Outline and its Numbering done
hanishkvc Nov 7, 2025
d9b1759
SimpleChatTC:ChatMessage undefined driven
hanishkvc Nov 8, 2025
abc1e60
SimpleChatTC:NSChatMessage class driven wrt ChatMessageEx
hanishkvc Nov 8, 2025
0503129
SimpleChatTC:NSChatMessage: Update SimpleChat to use same
hanishkvc Nov 8, 2025
ae1efa5
SimpleChatTC:NSChatMessage: MultiChatUI and beyond updated for same
hanishkvc Nov 8, 2025
1b3ba49
SimpleChatTC:NSChatMessage with tool response/result fields
hanishkvc Nov 8, 2025
cdbb9d2
SimpleChatTC:NSChatMessage:ToolResponse show handling
hanishkvc Nov 8, 2025
dcb29fa
SimpleChatTC:NSChatMessage: Handle edits by user wrt tool response
hanishkvc Nov 8, 2025
3961898
SimpleChatTC:NSChatMessage:Tool role newFromOld and load fixup
hanishkvc Nov 8, 2025
8d139f8
SimpleChatTC:NSChatMessage: fix up initial go
hanishkvc Nov 8, 2025
6f52615
SimpleChatTC:NSChatMessage:ToolResult User Input Background color
hanishkvc Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/server/public_simplechat/datautils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export function trim_hist_garbage_at_end(sIn, maxType, maxUniq, maxMatchLenThres
let iNum = 0;
let iOth = 0;
// Learn
/**
* @type {Object<string, number>}
*/
let hist = {};
let iUniq = 0;
for(let i=0; i<maxMatchLenThreshold; i++) {
Expand Down
21 changes: 19 additions & 2 deletions tools/server/public_simplechat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@
<script type="importmap">
{
"imports": {
"simplechat": "./simplechat.js",
"datautils": "./datautils.mjs",
"ui": "./ui.mjs"
}
}
</script>
<script src="simplechat.js" type="module" defer></script>
<script src="main.js" type="module" defer></script>
<link rel="stylesheet" href="simplechat.css" />
</head>
<body>
<div class="samecolumn" id="fullbody">

<div class="sameline" id="heading">
<p class="heading flex-grow" > <b> SimpleChat </b> </p>
<button id="settings">Settings</button>
<div>
<button id="clearchat">&#x1F9F9; ClearChat</button>
<button id="settings">&#x2699; Settings</button>
</div>
</div>

<div id="sessions-div" class="sameline"></div>
Expand All @@ -40,6 +44,19 @@
<p> You need to have javascript enabled.</p>
</div>

<hr>
<div id="tool-div">
<div>
<div class="sameline">
<textarea id="toolname-in" class="flex-grow" rows="1" placeholder="name of tool to run"></textarea>
<button id="tool-btn">run tool</button>
</div>
</div>
<div class="sameline">
<textarea id="toolargs-in" class="flex-grow" rows="2" placeholder="arguments to pass to the specified tool"></textarea>
</div>
</div>

<hr>
<div class="sameline">
<textarea id="user-in" class="flex-grow" rows="2" placeholder="enter your query to the ai model here" ></textarea>
Expand Down
24 changes: 24 additions & 0 deletions tools/server/public_simplechat/local.tools/debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Helpers for debugging
# by Humans for All


import time

gMe = { '--debug' : False }


def setup(bEnable):
global gMe
gMe['--debug'] = bEnable


def dump(meta: dict, data: dict):
if not gMe['--debug']:
return
timeTag = f"{time.time():0.12f}"
with open(f"/tmp/simpleproxy.{timeTag}.meta", '+w') as f:
for k in meta:
f.write(f"\n\n\n\n{k}:{meta[k]}\n\n\n\n")
with open(f"/tmp/simpleproxy.{timeTag}.data", '+w') as f:
for k in data:
f.write(f"\n\n\n\n{k}:{data[k]}\n\n\n\n")
81 changes: 81 additions & 0 deletions tools/server/public_simplechat/local.tools/filemagic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Handle file related helpers, be it a local file or one on the internet
# by Humans for All

import urllib.request
import urllib.parse
import debug
from dataclasses import dataclass


@dataclass(frozen=True)
class Response:
"""
Used to return result wrt urlreq helper below.
"""
callOk: bool
statusCode: int
statusMsg: str = ""
contentType: str = ""
contentData: bytes = b""



def get_from_web(url: str, tag: str, inContentType: str, inHeaders: dict[str, str|None]):

Check failure on line 23 in tools/server/public_simplechat/local.tools/filemagic.py

View workflow job for this annotation

GitHub Actions / pyright type-check

Alternative syntax for unions requires Python 3.10 or newer (reportGeneralTypeIssues)
"""
Get the url specified from web.

If passed header doesnt contain certain useful http header entries,
some predefined defaults will be used in place.
"""
try:
hUA = inHeaders.get('User-Agent', None)
if not hUA:
hUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0'
hAL = inHeaders.get('Accept-Language', None)
if not hAL:
hAL = "en-US,en;q=0.9"
hA = inHeaders.get('Accept', None)
if not hA:
hA = "text/html,*/*"
headers = {
'User-Agent': hUA,
'Accept': hA,
'Accept-Language': hAL
}
req = urllib.request.Request(url, headers=headers)
# Get requested url
print(f"DBUG:{tag}:Req:{req.full_url}:{req.headers}")
with urllib.request.urlopen(req, timeout=10) as response:
contentData = response.read()
statusCode = response.status or 200
statusMsg = response.msg or ""
contentType = response.getheader('Content-Type') or inContentType
print(f"DBUG:FM:GFW:Resp:{response.status}:{response.msg}")
debug.dump({ 'url': req.full_url, 'headers': req.headers, 'ctype': contentType }, { 'cdata': contentData })
return Response(True, statusCode, statusMsg, contentType, contentData)
except Exception as exc:
return Response(False, 502, f"WARN:{tag}:Failed:{exc}")


def get_from_local(urlParts: urllib.parse.ParseResult, tag: str, inContentType: str):
"""
Get the requested file from the local filesystem
"""
try:
fPdf = open(urlParts.path, 'rb')
dPdf = fPdf.read()
return Response(True, 200, "", inContentType, dPdf)
except Exception as exc:
return Response(False, 502, f"WARN:{tag}:Failed:{exc}")


def get_file(url: str, tag: str, inContentType: str, inHeaders: dict[str, str|None]={}):

Check failure on line 72 in tools/server/public_simplechat/local.tools/filemagic.py

View workflow job for this annotation

GitHub Actions / pyright type-check

Alternative syntax for unions requires Python 3.10 or newer (reportGeneralTypeIssues)
"""
Based on the scheme specified in the passed url,
either get from local file system or from the web.
"""
urlParts = urllib.parse.urlparse(url)
if urlParts.scheme == "file":
return get_from_local(urlParts, tag, inContentType)
else:
return get_from_web(url, tag, inContentType, inHeaders)
94 changes: 94 additions & 0 deletions tools/server/public_simplechat/local.tools/pdfmagic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Helper to manage pdf related requests
# by Humans for All

import urllib.parse
import urlvalidator as uv
import filemagic as mFile
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from simpleproxy import ProxyHandler


PDFOUTLINE_MAXDEPTH=4


def extract_pdfoutline(ol: Any, prefix: list[int]):
"""
Helps extract the pdf outline recursively, along with its numbering.
"""
if (len(prefix) > PDFOUTLINE_MAXDEPTH):
return ""
if type(ol).__name__ != type([]).__name__:
prefix[-1] += 1
return f"{".".join(map(str,prefix))}:{ol['/Title']}\n"

Check failure on line 24 in tools/server/public_simplechat/local.tools/pdfmagic.py

View workflow job for this annotation

GitHub Actions / pyright type-check

Strings nested within an f-string cannot use the same quote character as the f-string prior to Python 3.12 (reportGeneralTypeIssues)
olText = ""
prefix.append(0)
for (i,iol) in enumerate(ol):
olText += extract_pdfoutline(iol, prefix)
prefix.pop()
return olText


def process_pdftext(url: str, startPN: int, endPN: int):
"""
Extract textual content from given pdf.

* Validate the got url.
* Get the pdf file.
* Extract textual contents of the pdf from given start page number to end page number (inclusive).
* if -1 | 0 is specified wrt startPN, the actual starting page number (rather 1) will be used.
* if -1 | 0 is specified wrt endPN, the actual ending page number will be used.

NOTE: Page numbers start from 1, while the underlying list data structure index starts from 0
"""
import pypdf

Check failure on line 45 in tools/server/public_simplechat/local.tools/pdfmagic.py

View workflow job for this annotation

GitHub Actions / pyright type-check

Import "pypdf" could not be resolved (reportMissingImports)
import io
gotVU = uv.validate_url(url, "HandlePdfText")
if not gotVU.callOk:
return { 'status': gotVU.statusCode, 'msg': gotVU.statusMsg }
gotFile = mFile.get_file(url, "ProcessPdfText", "application/pdf", {})
if not gotFile.callOk:
return { 'status': gotFile.statusCode, 'msg': gotFile.statusMsg, 'data': gotFile.contentData}
tPdf = ""
oPdf = pypdf.PdfReader(io.BytesIO(gotFile.contentData))
if (startPN <= 0):
startPN = 1
if (endPN <= 0) or (endPN > len(oPdf.pages)):
endPN = len(oPdf.pages)
# Add the pdf outline, if available
outlineGot = extract_pdfoutline(oPdf.outline, [])
if outlineGot:
tPdf += f"\n\nOutline Start\n\n{outlineGot}\n\nOutline End\n\n"
# Add the pdf page contents
for i in range(startPN, endPN+1):
pd = oPdf.pages[i-1]
tPdf = tPdf + pd.extract_text()
return { 'status': 200, 'msg': "PdfText Response follows", 'data': tPdf }


def handle_pdftext(ph: 'ProxyHandler', pr: urllib.parse.ParseResult):
"""
Handle requests to pdftext path, which is used to extract plain text
from the specified pdf file.
"""
queryParams = urllib.parse.parse_qs(pr.query)
url = queryParams['url'][0]
startP = queryParams.get('startPageNumber', -1)
if isinstance(startP, list):
startP = int(startP[0])
endP = queryParams.get('endPageNumber', -1)
if isinstance(endP, list):
endP = int(endP[0])
print(f"INFO:HandlePdfText:Processing:{url}:{startP}:{endP}...")
gotP2T = process_pdftext(url, startP, endP)
if (gotP2T['status'] != 200):
ph.send_error(gotP2T['status'], gotP2T['msg'] )
return
ph.send_response(gotP2T['status'], gotP2T['msg'])
ph.send_header('Content-Type', 'text/text')
# Add CORS for browser fetch, just in case
ph.send_header('Access-Control-Allow-Origin', '*')
ph.end_headers()
print(f"INFO:HandlePdfText:ExtractedText:{url}...")
ph.wfile.write(gotP2T['data'].encode('utf-8'))
55 changes: 55 additions & 0 deletions tools/server/public_simplechat/local.tools/simpleproxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"allowed.schemes": [
"file",
"http",
"https"
],
"allowed.domains": [
".*\\.wikipedia\\.org$",
".*\\.bing\\.com$",
"^www\\.bing\\.com$",
".*\\.yahoo\\.com$",
"^search\\.yahoo\\.com$",
".*\\.brave\\.com$",
"^search\\.brave\\.com$",
"^brave\\.com$",
".*\\.duckduckgo\\.com$",
"^duckduckgo\\.com$",
".*\\.google\\.com$",
"^google\\.com$",
".*\\.arxiv\\.org$",
"^arxiv\\.org$",
".*\\.nature\\.com$",
".*\\.science\\.org$",
"^apnews\\.com$",
".*\\.apnews\\.com$",
".*\\.reuters\\.com$",
".*\\.bloomberg\\.com$",
".*\\.forbes\\.com$",
".*\\.npr\\.org$",
".*\\.cnn\\.com$",
".*\\.theguardian\\.com$",
".*\\.bbc\\.com$",
".*\\.france24\\.com$",
".*\\.dw\\.com$",
".*\\.jpost\\.com$",
".*\\.aljazeera\\.com$",
".*\\.alarabiya\\.net$",
".*\\.rt\\.com$",
"^tass\\.com$",
".*\\.channelnewsasia\\.com$",
".*\\.scmp\\.com$",
".*\\.nikkei\\.com$",
".*\\.nhk\\.or\\.jp$",
".*\\.indiatoday\\.in$",
"^theprint\\.in$",
".*\\.ndtv\\.com$",
"^lwn\\.net$",
"^arstechnica\\.com$",
".*\\.linkedin\\.com$",
".*\\.github\\.io$",
"^github\\.com$",
".*\\.github\\.com$"
],
"bearer.insecure": "NeverSecure"
}
Loading
Loading