skill added

This commit is contained in:
2026-08-28 14:08:51 +02:00
parent 1316e49456
commit 2743dfb4c0
3 changed files with 322 additions and 5 deletions
+16
View File
@@ -214,6 +214,13 @@
(regexp-match? #px"^/api/(?:auth|agent)(?:/|$)"
(request-path request)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; goal : Add one HTTP header to an existing response.
; pre : Value is a response and extra-header is an HTTP header.
; post : The original response remains unchanged.
; result : A response with the same body and metadata and the additional
; header prepended to its header list.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (response-add-header value extra-header)
(response (response-code value)
(response-message value)
@@ -222,6 +229,15 @@
(cons extra-header (response-headers value))
(response-output value)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; goal : Dispatch an API request and renew an eligible browser cookie.
; pre : Current-player and current-auth are initialized and request targets
; an API route.
; post : The selected handler has run. A due browser-session renewal is
; recorded and returned as Set-Cookie; agent requests never renew it.
; result : The HTTP response produced by the API handler, optionally extended
; with the renewed session cookie.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (dispatch-api request)
(define value (api-dispatch request))
(define renewed-cookie