All plugins

org-files

Lets the agent search and read your Org mode (.org) files and answer from their agenda, without Emacs running. org_files lists the files under plugins.entries.org-files.settings.paths, org_search finds headings by words, TODO keyword (each file's #+TODO, or your own org-todo-keywords), tags (inherited and #+FILETAGS included) and priority, org_agenda returns the entries for a span of days by org-agenda-list's default rules (SCHEDULED, overdue items on today, DEADLINE warnings, appointments, +1w/++1m/.+1d repeaters with Org's month arithmetic, date ranges; blocks, COMMENT and ARCHIVE subtrees skipped), checked against Org's own agenda tests, and org_read returns an entry or a file as Org text with its properties and subheadings. Standard library only. Not affiliated with the Org mode project or GNU Emacs. Disclosure — reads only the .org files under the paths you configure (hidden folders, symlinks and Emacs lock and auto-save files skipped), and what the agent reads goes to your model provider like the rest of the conversation; opens files read-only and writes nothing; makes no network calls, needs no credentials and runs no commands, Emacs included.

nftpoetristToolsv0.1.0Updated 1 day ago

About

Lets the agent search and read your Org mode (.org) files and answer from their agenda, without Emacs running. org_files lists the files under plugins.entries.org-files.settings.paths, org_search finds headings by words, TODO keyword (each file's #+TODO, or your own org-todo-keywords), tags (inherited and #+FILETAGS included) and priority, org_agenda returns the entries for a span of days by org-agenda-list's default rules (SCHEDULED, overdue items on today, DEADLINE warnings, appointments, +1w/++1m/.+1d repeaters with Org's month arithmetic, date ranges; blocks, COMMENT and ARCHIVE subtrees skipped), checked against Org's own agenda tests, and org_read returns an entry or a file as Org text with its properties and subheadings. Standard library only. Not affiliated with the Org mode project or GNU Emacs. Disclosure — reads only the .org files under the paths you configure (hidden folders, symlinks and Emacs lock and auto-save files skipped), and what the agent reads goes to your model provider like the rest of the conversation; opens files read-only and writes nothing; makes no network calls, needs no credentials and runs no commands, Emacs included.

hermes-org-files

A Hermes Agent plugin that lets the agent search and
read your Org mode files and answer from your agenda: what is scheduled
this week, which deadlines are close or overdue, when the next dentist appointment is. It reads the
.org files as they are on disk, with Python's standard library only. It does not need Emacs to be
running, and it never changes a file.

This plugin is not affiliated with the Org mode project or GNU Emacs.

Tools

ToolWhat it does
org_filesLists the configured files: id, #+TITLE, number of headings, number of open TODO items, and the TODO keywords each file uses.
org_searchSearches headings. Every word of query (or "quoted phrase") must appear in the heading or its own text (not its subheadings'); case and accents are ignored. Filters: todo (a keyword such as NEXT, or open, done, any), tags (all must be present; inherited tags and #+FILETAGS count), priority, file. Each result has the heading, outline path, TODO keyword, priority, tags and its SCHEDULED, DEADLINE and CLOSED dates.
org_agendaThe agenda for a span of days (default: 7 days from today), following org-agenda-list's rules with Org's default settings (below). Each entry has its date, time and end time, kind (scheduled, deadline, timestamp), a note (scheduled 3 days ago, deadline in 2 days, repeat, day 2 of 3), the heading, TODO keyword, tags and category.
org_readReads an entry (the heading, its text and its subheadings) as Org text, or a whole file. Returns its properties and its direct subheadings with ids. Long text comes back in parts (next_offset).

The tools are offered to the model only while at least one path is configured.

Install

hermes plugins install org-files --enable

No dependencies.

Configure

plugins:
  entries:
    org-files:
      settings:
        paths:                  # .org files, or folders holding them
          - ~/org               # your org-directory
          - ~/notes/projects.org
        todo_keywords: [TODO, NEXT, WAITING, "|", DONE, CANCELLED]   # optional, see below
        max_chars: 12000        # optional; characters per org_read call (1000-100000)

A folder is scanned up to 8 levels deep for *.org files. Hidden files and folders (such as
.git), symlinks, and Emacs's lock (.#file.org) and auto-save (#file.org#) files are skipped,
and so are .org_archive files. Each file's id is the configured folder's name followed by the path
inside it, for example org/work/projects.org.

TODO keywords. A file's own #+TODO: (or #+SEQ_TODO:, #+TYP_TODO:) lines decide which
words are TODO keywords and which of them count as done (those after |; without |, the last
one). Files without such a line use todo_keywords, which should match org-todo-keywords in your
Emacs configuration; the default is TODO | DONE, as in Org. Fast-access keys such as NEXT(n) or
WAITING(w@/!) may be written either way.

How the agenda is computed

The rules below were read from org-agenda.el and org-time.el and checked against Org's own
agenda tests (testing/lisp/test-org-agenda.el and its example files), with Org's default settings:

  • SCHEDULED shows on its own day. If it is not done and its day has passed, it also shows on
    today as overdue (scheduled N days ago), and on later days where its repeater falls. A delay
    cookie (SCHEDULED: <2024-03-05 Tue -14d>) hides it until that many days have passed. A done entry
    shows only on its own day.
  • DEADLINE shows on its own day and on later days where its repeater falls. If it is not done,
    it also shows on today when it has passed (deadline was N days ago) or is at most its warning
    period away (deadline in N days): the warning cookie (-5d) or else 14 days
    (org-deadline-warning-days).
  • Other active timestamps (<2024-03-14 Thu 15:30>), in a heading, its text or a property
    drawer, show on every day they fall on, repeats included. A range (<a>--<b>) shows on every day
    it spans, with its start time on the first day and its end time on the last.
  • Repeaters +1w, ++1m and .+3d (and h, d, w, m, y units) repeat from the date
    written in the file. Monthly and yearly repeats use Org's calendar arithmetic, so a monthly
    repeat from January 31 falls on March 2 (or 3) after February, and a yearly one from February 29
    on March 1. A repeater of 0 (+0d) is ignored, as in Org.
  • Not entries: timestamps in blocks (#+begin_src, #+begin_example, ...), fixed-width
    (: ) and comment (# ) lines, keyword lines, text before the first heading, COMMENT subtrees
    and subtrees tagged ARCHIVE, inactive timestamps ([2024-03-12 Tue]), and CLOSED dates.

Entries are sorted by day and time; entries without a time follow, scheduled before deadlines before
other timestamps, then in file order.

What it does on your machine (disclosure)

  • Reads only the files you configure. Your notes are personal data: what the agent reads goes to
    the model provider you use, like anything else in a conversation.
  • Writes nothing. Files are opened read-only and read whole on each call; nothing is kept between
    calls, so another Hermes profile never sees this profile's files. The tests check that no file's
    bytes, size or modification time and no file name changes while all four tools run.
  • No network, no credentials, no shell commands, no background work. The test suite refuses to
    open any socket while all four tools run. Emacs is not run or contacted.

Limits

  • Settings from your Emacs configuration other than the TODO keywords are not read:
    org-agenda-files (use paths), and changes to the agenda's defaults (org-deadline-warning-days,
    org-agenda-skip-scheduled-if-done, org-agenda-show-future-repeats and the like) are not applied.
  • Diary sexp timestamps (<%%(diary-float t 4 2)>), #+SETUPFILE and #+INCLUDE are not read.
    Habits (:STYLE: habit) are shown as ordinary scheduled entries.
  • Org's agenda sorts by an urgency score; this plugin uses the simpler order above.
  • Files must be UTF-8 (other bytes are replaced); encrypted files (.org.gpg) and org-crypt
    entries are not decrypted. Files over 20 MB are skipped and reported.
  • A heading id is its line number and a hash of the heading line. If lines are added above it, the
    same heading is still found; if the heading line itself changes, search again.

Development

python -m pip install pytest
python -m pytest -c tests/pytest.ini tests
ORG_FILES_REAL=~/org python -m pytest -c tests/pytest.ini tests -k real_world -s
ORG_MODE_CHECKOUT=~/src/org-mode python -m pytest -c tests/pytest.ini tests -k orgs_own   # Org's agenda tests
hermes plugins validate .

The tests build a GTD-style setup: per-file #+TODO keywords with fast-access keys, #+FILETAGS,
#+CATEGORY and CATEGORY properties, priorities, inherited tags, weekly, daily, monthly and yearly
repeaters, a warning cookie and a delay, a date range, appointments in headings, a done repeating
deadline, a COMMENT and an ARCHIVE subtree, and the look-alikes Org's agenda tests check are
ignored. A second file has CRLF line ends and accented text; Emacs lock and auto-save files sit next
to them.

ORG_FILES_REAL (one or more paths, separated like PATH) adds a test against real files: every
heading must read by its id and be found by a search for its own words, a year of agenda must build,
and no file may change. It was run against Org's own example files and manuals
(testing/examples/, doc/) and the Worg repository: 336 files, 5,642
headings, 7.5 MB.

ORG_MODE_CHECKOUT (a clone of Org mode)
adds a test that replays the cases of Org's test-org-agenda.el that use its example files
(scheduled-non-todo, non-scheduled-re-matches, property-timestamp, time-grid,
skip-scheduled-repeats-after-deadline) and expects the entries Org's assertions expect. It reads
those files in place; none is copied into this repository.

License

MIT

README from the reviewed commit 6411846; it updates when the author re-pins.

More by nftpoetrist

6 plugins by nftpoetrist in the catalog.

nftpoetristcalibre-libraryLets the agent search your calibre e-book libraries and read their EPUB and TXT books, from the metadata.db and book folders calibre leaves on disk; calibre need not be installed or running. calibre_search matches titles, authors, series, tags, publishers and identifiers (ISBN, ASIN, ...) ignoring case and accents, with author, series, tag, format and language filters; calibre_book shows everything calibre records about a book and its files; calibre_read returns an EPUB in reading order with chapter offsets, or a TXT decoded as UTF-8 or Windows-1252, in parts. Standard library only. Not affiliated with calibre. Disclosure — reads only the library folders you configure: metadata.db, opened read-only per call (mode=ro, or immutable=1 for a WAL-mode database, which is refused while its -wal holds changes), and the one book file asked for, which must lie inside the library folder. EPUBs are read in place, never extracted; a package declaring a DTD or entities, a document over 32 MB unpacked or a book over 128 MB is refused. Writes nothing, makes no network calls, needs no credentials and runs no commands. Book text and descriptions are returned to the model as they are, with scripts and styles stripped.Communitytools1nftpoetristoffline-docsetsLets the agent look up API documentation in docsets on this machine without internet access: the offline format Dash and Zeal use, with an index of every function, class and guide plus the HTML pages (Kapeli's public feeds list about 180, among them Python, Node.js, Bash, SQLite and Vim). docset_list lists the docsets configured under plugins.entries.offline-docsets.settings.paths, docset_search looks entries up by name in Dash's searchIndex or Apple's Core Data index, and docset_read returns a page as plain text starting at the entry's own section, in parts, with in-docset links listed. Standard library only. Not affiliated with Kapeli or Zeal. Disclosure — reads only the docsets you configure, and only pages inside each docset's Documents folder (paths through .., encoded .., absolute paths or symlinks that leave it are refused); opens the SQLite index with mode=ro&immutable=1 so nothing is written, a WAL-mode index's -wal and -shm files included; makes no network calls, needs no credentials and runs no commands. Page text is returned to the model as the documentation's authors wrote it, with scripts and styles stripped.Communitytoolsnftpoetristoffline-mailLets the agent search and read mail archives on this machine without signing in to any mail account: mbox files (Thunderbird's folders, a Google Takeout export of Gmail, mailing-list archives) and Maildir folders (mutt, mbsync, OfflineIMAP, Dovecot). mail_folders lists the folders found under plugins.entries.offline-mail.settings.paths, mail_search finds messages by the words of their subject, names, addresses or text (case and accents ignored) with folder, sender, recipient, date and Message-ID filters, newest first, and mail_read returns a message's headers, text (the plain-text part, or the HTML part as text) and attachment list, in parts. Standard library only. Disclosure — reads only the mail files under the paths you configure, and what the agent reads goes to your model provider like the rest of the conversation; opens files read-only and never sends, moves, deletes or marks mail (a Maildir message is not renamed to seen); makes no network calls, needs no credentials and runs no commands. Message text is returned as its senders wrote it, with HTML scripts and styles removed.Communitytoolsnftpoetristoffline-zimLets the agent search and read ZIM files on this machine without internet access: the open archive format behind Kiwix's offline Wikipedia, Wiktionary, Stack Exchange, Project Gutenberg and other libraries. zim_list_books lists the ZIM files configured under plugins.entries.offline-zim.settings.paths, zim_search uses each archive's full-text index (or its titles when it has none), and zim_read returns an article as plain text in parts, with redirects followed and in-book links listed. Not affiliated with Kiwix or openZIM; reads archives with python-libzim. Disclosure — reads only the ZIM files and folders you configure (folders are listed to find *.zim), makes no network calls, writes nothing, needs no credentials and runs no commands. Article text is returned to the model as the archive's maker wrote it, with scripts and styles stripped. The libzim dependency is GPL-3.0-or-later.Communitytools

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section