Skip to main content

Nats

@retr0h/natsv2026.04.21.1· 9d agoMODELS·SKILLS
01README

General-purpose NATS transport for swamp — exec, upload, wait for agent connection. Pairs with swamp-nats-agent (https://github.com/retr0h/swamp-nats-agent).

02Release Notes

@adam/cfgmgmt drop-in compat: exports match adam's _lib/ssh.ts byte-for-byte (exec, execSudo, writeFile, writeFileAs, scpFile, scpFileAs, shellEscape, closeAll). nats_host globalArgs mirror cfgmgmt's GlobalArgsSchema (nodeHost, nodeUser, nodePort, nodeIdentityFile, become, becomeUser, becomePassword). Sudo moves from method args to globalArgs.

03Models1
@retr0h/nats/hostv2026.04.21.1nats_host.ts

Global Arguments

ArgumentTypeDescription
nodeHoststringTarget hostname (maps to NATS subject suffix)
nodeUserstringAgent-side user (SSH-era field, advisory)
nodePortnumberSSH port (ignored by NATS transport)
nodeIdentityFile?stringSSH private key path (ignored by NATS transport)
becomebooleanRun commands with sudo on the agent
becomeUserstringUser to become when sudo is true
becomePassword?stringPassword for sudo -S (piped via stdin)
natsUrlstringNATS server URL (nats://host:port)
natsSubjectPrefixstringSubject prefix for multi-tenant namespace isolation
timeoutMsnumberPer-request timeout (ms)
natsUser?stringNATS user/pass auth — username
natsPass?stringNATS user/pass auth — password
natsToken?stringNATS static token auth
natsCredsPath?stringPath to NATS creds file (user JWT + nkey, recommended)
natsNKeySeed?stringNATS nkey seed (alternative to creds file)
natsTlsCaFile?stringmTLS — CA certificate file
natsTlsCertFile?stringmTLS — client certificate file
natsTlsKeyFile?stringmTLS — client key file
fn exec(command: string, timeout: number, stdin?: string)
Run a command on the remote host via swamp-nats-agent. Returns stdout/stderr/exitCode without throwing on non-zero exit.
ArgumentTypeDescription
commandstringCommand to execute
timeoutnumberEnforced timeout in seconds (agent cancels via AbortSignal)
stdin?stringData to pipe to the command's stdin
fn upload(dest: string, content: string, contentEncoding: enum, mode?: string, owner?: string, group?: string)
Write file content to a remote path via swamp-nats-agent. Supports UTF-8 and base64 encoded content; atomic write under sudo via install(1).
ArgumentTypeDescription
deststringRemote destination path
contentstringFile content — UTF-8 string or base64-encoded bytes
contentEncodingenumEncoding of content
mode?stringFile mode (octal, e.g. 0644)
owner?stringFile owner
group?stringFile group
fn waitForConnection(timeout: number)
Poll the swamp-nats-agent on the target host until it replies or timeout elapses.
ArgumentTypeDescription
timeoutnumberTimeout in seconds

Resources

result(infinite)— NATS operation result
04Skills1
nats1 file
05Previous Versions1
2026.04.20.1Apr 21, 2026

Initial release — NATS (JetStream) transport for swamp, pairs with swamp-nats-agent

06Stats
Downloads
0
Archive size
85.6 KB

Not yet scored.

A score will be generated the next time this extension is published. The owner can also trigger scoring manually.

07Security Notice

This extension includes AI agent skills that can modify AI assistant behavior. Review the skill files before installing.

08Platforms
09Labels