Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/grid/AIRC-CONTINUUM-BRIDGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# AIRC Continuum Bridge

Status: v0 development/test harness.

AIRC is the external collaboration wire. Continuum remains the system under
test. The bridge lets agents speak over AIRC while Continuum receives those
messages through normal commands.

## Shape

```text
AIRC room/message
-> airc/bridge
-> collaboration/chat/send
-> chat/export, activity/list, rooms, assertions
-> optional airc CLI response
```

Normal AIRC messages are mirrored into Continuum chat as:

```text
[airc:<nick>] <message>
```

Explicit development directives use `!continuum`:

```text
!continuum ping
!continuum rooms
!continuum chat --room general "hello from the mesh"
!continuum export --room general --last 20
!continuum assert seen marker-123 --room general --last 80
!continuum activity list
```

## Why This Exists

Agents should not need to remember direct `jtag collaboration/chat/send` and
`jtag collaboration/chat/export` calls during collaboration tests. They should
talk over AIRC, and the bridge should materialize the traffic inside Continuum.

## Boundary

The bridge is an allowlisted adapter. It does not expose arbitrary
`Commands.execute()` over AIRC. Add new directive handlers only when there is a
clear integration surface to test.

The AIRC channel is preserved as transport metadata; it is not assumed to be a
valid Continuum room. The default Continuum target room is `general`, and
explicit room selection uses `--room`.

Bridge responses are prefixed with `[continuum]` and skipped on ingest to avoid
multi-bridge echo loops.

Heavy data should stay out of AIRC. Use AIRC for manifests, handles, room
markers, artifact hashes, and job ids; use Continuum/Grid data paths for model
weights, LoRA artifacts, voice/video, and high-volume streams.

## Harness

For deterministic tests without a live AIRC monitor:

```bash
printf 'mac-codex: hello from airc\n' | node src/scripts/continuum-airc-bridge.mjs --channel=general
printf '{"senderNick":"win-claude","channel":"general","message":"!continuum ping"}\n' | node src/scripts/continuum-airc-bridge.mjs --mirror-response
```
52 changes: 52 additions & 0 deletions src/commands/airc/bridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# AIRC Bridge Command

Ingest one AIRC message into Continuum.

Normal AIRC text becomes a Continuum chat message. Explicit `!continuum`
directives become bounded development/test commands, so agents can test
Continuum through the same collaboration surface they already use instead of
calling `jtag collaboration/chat/send` and `jtag collaboration/chat/export`
manually.

## Usage

```bash
./jtag airc/bridge --senderNick=mac-codex --channel=general --message="hello from airc"
./jtag airc/bridge --senderNick=mac-codex --channel=general --message="!continuum ping" --mirrorResponse=true
./jtag airc/bridge --senderNick=mac-codex --channel=general --message="!continuum export general --last 20"
```

## Parameters

- `message` required: raw AIRC message body.
- `senderNick` optional: AIRC sender nick for attribution.
- `channel` optional: AIRC channel; defaults to `general`.
- `room` optional: Continuum room override; defaults to `general`.
- `commandPrefix` optional: directive prefix; defaults to `!continuum`.
- `dryRun` optional: parse without executing commands.
- `mirrorResponse` optional: send directive responses back through the `airc` CLI.

## Directives

- `!continuum ping`
- `!continuum status`
- `!continuum rooms [--limit N]`
- `!continuum chat [--room room] <message>`
- `!continuum export [--room room] [--last N]`
- `!continuum assert seen <marker> [--room room] [--last N]`
- `!continuum activity list [--limit N]`

## Boundary

This command is intentionally allowlisted. It does not expose arbitrary
`Commands.execute()` over AIRC. Add new directives deliberately as bridge
integration points become stable.

Broadcast AIRC messages are attributed to the provided nick for collaboration
visibility, not authentication. Treat bridged chat text as human/agent input,
not as a trusted identity or authorization signal.

Bridge-origin AIRC replies are prefixed with `[continuum]` and skipped on
ingest to prevent echo loops when more than one bridge is listening.

Large list/export directives are clamped to a bounded limit.
14 changes: 14 additions & 0 deletions src/commands/airc/bridge/browser/AircBridgeBrowserCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { JTAGContext } from '@system/core/types/JTAGTypes';
import type { ICommandDaemon } from '@daemons/command-daemon/shared/CommandBase';
import { AircBridgeCommand } from '../shared/AircBridgeCommand';
import type { AircBridgeParams, AircBridgeResult } from '../shared/AircBridgeTypes';

export class AircBridgeBrowserCommand extends AircBridgeCommand {
constructor(context: JTAGContext, subpath: string, commander: ICommandDaemon) {
super(context, subpath, commander);
}

protected async executeAircBridge(params: AircBridgeParams): Promise<AircBridgeResult> {
return this.remoteExecute(params);
}
}
31 changes: 31 additions & 0 deletions src/commands/airc/bridge/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@jtag-commands/airc/bridge",
"version": "1.0.0",
"description": "Ingest AIRC messages into Continuum chat and bounded development/test commands.",
"main": "server/AircBridgeServerCommand.ts",
"types": "shared/AircBridgeTypes.ts",
"scripts": {
"test": "npm run test:unit",
"test:unit": "npx tsx test/unit/AircBridgeProtocolCheck.ts",
"lint": "npx eslint **/*.ts",
"typecheck": "npx tsc --noEmit"
},
"peerDependencies": {
"@jtag/core": "*"
},
"files": [
"shared/**/*.ts",
"browser/**/*.ts",
"server/**/*.ts",
"test/**/*.ts",
"README.md"
],
"keywords": [
"jtag",
"command",
"airc/bridge",
"continuum",
"airc"
],
"license": "MIT"
}
Loading
Loading