Commit Graph

5 Commits

Author SHA1 Message Date
Levi Neely 32e4fd0007 Make ork a pure 9P client with friendly commands
ork now operates solely as a 9P client against ork-server; all org
intelligence lives in the server. Remove the local file-parsing command
layer (commands.rs) and its org-ast/org-parser/orkmode-core/serde deps.

Base verbs speak raw 9P: ls, read, write, rdwr. Address resolves from
--addr, then $ORK_ADDR, then tcp://localhost:5640.

Add friendly commands, all thin compositions of the base 9P operations:
docs, sections, todos, agenda, get, set, add (--parent), mkdoc, reload.

Fix the directory-listing parser in client.rs: the stat-entry name offset
double-counted the size field (pos + 2 + 41 instead of pos + 41), so ls
returned nothing. Handle a downstream reader closing early (e.g. | head)
by treating BrokenPipe as a clean exit instead of panicking.
2026-09-30 21:29:09 +02:00
Levi Neely 9e2fcb9010 Add 9P2000 server implementation
- p9.rs: Full 9P2000 protocol handler
  - Tversion/Tattach/Twalk/Topen/Tread/Twrite/Tclunk/Tstat
  - Directory listing with stat encoding
  - File read/write with buffering
  - Rdwr support for command files

- ork-server binary:
  - TCP or Unix socket listener
  - Threaded connection handling
  - Usage: ork-server -a unix:///tmp/ork.sock ~/org

Tested with plan9port 9p client - read/write/ls all working.
2026-09-30 15:09:59 +02:00
Levi Neely 6bb2994dff Add section creation with UUID IDs
- new file at root: create org file
- new file at doc level: create top-level section
- new file at section level: create child section
- All created sections get UUID in :ID: property
- body file added to doc (alias for raw)
- Test for section creation via 9P namespace
2026-09-30 10:41:19 +02:00
Levi Neely 246bd9bb5a Add ork-server crate with virtfs EDSL
- virtfs: Declarative filesystem EDSL (port of ollie's pattern)
  - dir(), file(), each(), dir_dynamic() constructors
  - read(), write(), rdwr(), rw() handlers
  - FsNode with walk(), list(), read(), write()

- state: OrkState manages parsed documents
  - Scans org directory, parses on load
  - Section ID from CUSTOM_ID > ID > slugified title
  - Read/write document content

- namespace: 9P namespace builder
  - ctl, idx, keywords at root
  - agenda/todos, agenda/today, agenda/week
  - {doc}/ with raw, meta, and sections
  - {section}/ with headline, title, keyword, priority, tags
  - Nested children for subsections
2026-09-30 10:31:11 +02:00
Levi Neely 14fc3233e9 Initial commit: org-mode parser and CLI
- org-ast: AST types for org documents
- org-parser: tree-sitter based parser
- orkmode-core: library + C FFI
- ork-cli: directory-aware CLI tool

CLI operates on directories by default, supports -R for recursive.
2026-09-30 09:43:21 +02:00