Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions assets/sourceos/shell/turtle-shell-init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,39 @@ tkn() {
python3 "$(_turtle_ticket_bin)" comment "$@"
}

# ── Doc feedback ───────────────────────────────────────────────────────────────

_turtle_doc_feedback_bin() {
local _b
for _b in \
"${TURTLE_SOURCEOS_BIN:-$HOME/.local/share/sourceos/bin}/turtle-doc-feedback" \
"${${(%):-%x}:h}/turtle-doc-feedback"; do
[[ -x "$_b" ]] && { printf '%s' "$_b"; return; }
done
printf '%s' "$(dirname "${(%):-%x}")/turtle-doc-feedback"
}

# docfb <doc_ref> <up|down|question|neutral> [comment]
# Submit doc feedback; emoji shortcuts: 👍=up, 👎=down, ❓=question
docfb() {
local _doc="${1:?Usage: docfb <doc_ref> <sentiment> [comment]}"; shift
local _sent="$1"; shift
# emoji → word mapping
case "$_sent" in
👍|+1|up) _sent=up ;;
👎|-1|down) _sent=down ;;
❓|'?'|question) _sent=question ;;
*) ;;
esac
python3 "$(_turtle_doc_feedback_bin)" submit "$_doc" "$_sent" "$@"
}

# docfaq [<doc_ref>] — show derived FAQ stubs
docfaq() { python3 "$(_turtle_doc_feedback_bin)" faq "$@" }

# docdistill [<doc_ref>] — run Noetica distillation over feedback
docdistill() { python3 "$(_turtle_doc_feedback_bin)" distill "$@" }

# Auto-start Matrix bridge daemon at shell init if config is present
if [[ -f "${HOME}/.config/sourceos/matrix.yaml" ]] || \
[[ -n "${MATRIX_ACCESS_TOKEN:-}" ]]; then
Expand Down
7 changes: 7 additions & 0 deletions assets/sourceos/turtleterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,10 @@ local PALETTE_COMMANDS = {
{ label = '🎫 Ticket: close (tkc) —', id = 'ticket_close' },
{ label = '🎫 Ticket: comment (tkn) —', id = 'ticket_note' },
{ label = '🎫 Ticket: summary —', id = 'ticket_summary' },
-- Doc feedback
{ label = '📖 Doc feedback: submit (docfb) —', id = 'doc_feedback' },
{ label = '📖 Doc FAQ: show stubs (docfaq) —', id = 'doc_faq' },
{ label = '📖 Doc FAQ: distill (docdistill) —', id = 'doc_distill' },
}

local function turtle_command_palette()
Expand Down Expand Up @@ -1590,6 +1594,9 @@ local function turtle_command_palette()
ticket_close = act.SendString('tkc '),
ticket_note = act.SendString('tkn '),
ticket_summary = act.SendString('ticket summary\n'),
doc_feedback = act.SendString('docfb '),
doc_faq = act.SendString('docfaq\n'),
doc_distill = act.SendString('docdistill\n'),
}
local a = dispatch[id]
if a then w:perform_action(a, p) end
Expand Down
Loading