Files
passepartout/org/channel-cli.org
Amr Gharbeia da160b71e3
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
passepartout: v0.5.0 File Reorganization
Extract non-core fragments using self-repair criterion:
- core-context -> symbolic-awareness (224 lines, fboundp guards in think())
- heartbeat generation -> symbolic-events (renamed events-start-heartbeat)

Rename 23 files for clarity and new naming scheme:
- 6 core: core-package, core-transport, core-pipeline,
          core-perceive, core-reason, core-act
- 13 system: symbolic-*, neuro-*, embedding-*, channel-shell
- 4 gateway: channel-cli, channel-tui-*, channel-tui-state

Utility relocations:
- markdown-strip -> programming-markdown
- plist-keywords-normalize -> programming-lisp
- cognitive-tool-prompt -> programming-tools
- VAULT-MEMORY -> security-vault
- Merge *backend-registry* into *probabilistic-backends*

Split gateway-messaging into channel-telegram/channel-signal/
channel-discord/channel-slack (4 independent skills)

Delete dead system-model.lisp (16-line wrapper)

Document self-repair criterion in DESIGN_DECISIONS

Version bump: 0.4.3 -> 0.5.0
2026-05-07 18:20:48 -04:00

2.3 KiB

SKILL: CLI Gateway (org-skill-cli-gateway.org)

Overview

The CLI Gateway is the simplest interface to Passepartout — raw stdin/stdout over TCP. It connects to the daemon's framed protocol and translates between terminal input/output and the plist-based communication format. No TUI, no ncurses, no dependencies beyond a TCP socket. Every other gateway (TUI, Emacs, Telegram) builds on this same protocol.

Contract

  1. (gateway-cli-input text): wraps text in a :user-input envelope with :source :CLI and injects into the pipeline via inject-stimulus.

Implementation

Package Context

(in-package :passepartout)

CLI Command Handling

;; REPL-VERIFIED: 2026-05-03T13:00:00

(defun gateway-cli-input (text)
  "Processes raw text from the command line."
  (inject-stimulus (list :type :EVENT 
                         :payload (list :sensor :user-input :text text) 
                         :meta (list :source :CLI))))

Skill Registration

(defskill :passepartout-gateway-cli
  :priority 100
  :trigger (lambda (ctx) (eq (getf (getf ctx :meta) :source) :CLI))
  :deterministic (lambda (action ctx) (declare (ignore ctx)) action))

Test Suite

(eval-when (:compile-toplevel :load-toplevel :execute)
  (ql:quickload :fiveam :silent t))

(defpackage :passepartout-gateway-cli-tests
  (:use :cl :passepartout)
  (:export #:cli-suite))

(in-package :passepartout-gateway-cli-tests)

(fiveam:def-suite cli-suite :description "Verification of the CLI Gateway")
(fiveam:in-suite cli-suite)

(fiveam:test test-gateway-cli-input-format
  "Contract 1: gateway-cli-input injects a properly formed signal without error."
  (handler-case
      (progn (gateway-cli-input "hello") (fiveam:pass))
    (error (c)
      (fiveam:fail "gateway-cli-input crashed: ~a" c))))

Load-Time Sanity Check

Verifies the function exists and can be called at load time without depending on FiveAM macro resolution in the jailed package.

(handler-case
    (progn (gateway-cli-input "test-load") (log-message "CLI: Load-time test OK"))
  (error (c) (log-message "CLI: Load-time test FAILED: ~a" c)))