summaryrefslogtreecommitdiff
path: root/core/plumbing
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 22:03:14 -0300
committerGabriel Schneider <[email protected]>2026-11-18 22:23:51 -0300
commit99f5b10eccd95aa0066ea6fe6bb75f367ab56a47 (patch)
tree813596ea84318a7bae4fd7416ba463de8e3b7107 /core/plumbing
parent92d553123673376adf6126ab90d49a22c5b833d2 (diff)
downloadpardes-99f5b10eccd95aa0066ea6fe6bb75f367ab56a47.tar.gz
pardes-99f5b10eccd95aa0066ea6fe6bb75f367ab56a47.zip
core: src/ becomes core/, pardes.zig its root.zig (the reorganisation's tree, step 2d), and every mention of a src/ path follows: the build's paths, the core's imports of its root, the tests that read the repository's files by path (lspbench's, look.zig's spans over core/look.zig), the comments that cite files, the documents and the manual (the typst corpus reads core/tutor.txt and core/plumbing); left as they were: the /src tree's served names (src/pardes.zig and the rest are the 9P tree's, not the repository's), the CHANGELOG's history, fixtures that are only strings; fs-unit-test runs from the core's root (a module of the core rooted at fs.zig had the runtime's and the devices' `core` be fs.zig); nothing else changes: the ledger (pardes.test.* now root.test.*), frames byte-identical, replicas and process-test the base's
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/plumbing')
-rw-r--r--core/plumbing51
1 files changed, 51 insertions, 0 deletions
diff --git a/core/plumbing b/core/plumbing
new file mode 100644
index 00000000..4e8cd702
--- /dev/null
+++ b/core/plumbing
@@ -0,0 +1,51 @@
+# pardes's plumbing rules, in plumb(6)'s language: a plumbing file of
+# your own names this one as `include basic`. A message (plumb/send) is
+# matched against the rule sets in order; the first whose patterns all
+# hold takes it, and its actions say where it goes: a port pardes reads
+# itself (edit: a file or directory opened as Look opens one; web: the
+# host's browser; a loaded kind by its name, `image`, `pdf`), another
+# port a program reads, or a word or program started. One that none
+# takes is Look's own: a file or directory opened, else the word
+# searched for. A look sends what it looks at: type text, src pardes
+# (term from a terminal's raw mode, a kind's name from its pane), wdir
+# its pane's directory, data the name as Look reads it.
+
+# urls go to the web browser (the host's: xdg-open, open on macOS)
+type is text
+data matches 'https?://.*'
+plumb to web
+
+# a diff or patch looked at bare is stacked in a +Diff; one with no
+# hunk in it opens as text
+type is text
+data matches '.*\.(diff|patch)'
+arg isfile $data
+plumb start Diff $file
+
+# existing directories, and existing files at the place written after
+# them, go to the editor; a file a kind shows (a picture, a PDF) to
+# that kind
+type is text
+arg isdir $data
+plumb to edit
+
+type is text
+arg isfile $data
+plumb to edit
+
+# a commit hash looked at in the editor, in a git work tree: git show,
+# stacked in a +Diff (outside one, Diff declines and the word is
+# searched for)
+type is text
+src is pardes
+data matches '[0-9a-f]{7,40}'
+data matches '[0-9a-f]*[0-9][0-9a-f]*'
+data matches '[0-9a-f]*[a-f][0-9a-f]*'
+plumb start Diff $0
+
+# a diff paged (git show, git log -p) is shown stacked in a +Diff in
+# its +Pager's place
+type is text/x-diff
+attr delete action
+attr add action=showdiff
+plumb to edit