summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/action_document.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-19 08:36:13 +0300
committerPaul Buetow <paul@buetow.org>2026-06-19 08:36:13 +0300
commit8dbec6969ceff32662c41bd267210c34b90d8810 (patch)
treea91c3561a74287a41d60d9f00fe4fe3a6e9e04a8 /internal/hexaiaction/action_document.go
parent54cf02d5ec926799f1e96c6b21d4cfd41fc0617d (diff)
Refactor hexaiaction handlers for nk0
Diffstat (limited to 'internal/hexaiaction/action_document.go')
-rw-r--r--internal/hexaiaction/action_document.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/hexaiaction/action_document.go b/internal/hexaiaction/action_document.go
new file mode 100644
index 0000000..c0d560a
--- /dev/null
+++ b/internal/hexaiaction/action_document.go
@@ -0,0 +1,17 @@
+package hexaiaction
+
+import "context"
+
+func init() {
+ registerActionHandler(ActionDocument, actionHandlerFunc(handleDocumentActionRequest))
+}
+
+func handleDocumentActionRequest(ctx context.Context, req actionRequest) (string, error) {
+ return handleDocumentAction(ctx, req.parts, req.cfg, req.client)
+}
+
+func handleDocumentAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) {
+ return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) {
+ return runDocument(cctx, cfg, client, parts.Selection)
+ })
+}