feat(tess): wire durable interaction surfaces (#732)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was canceled

This commit was merged in pull request #732.
This commit is contained in:
2026-07-13 10:05:29 +00:00
parent 84d884b932
commit 0b621660c8
16 changed files with 782 additions and 58 deletions

View File

@@ -10,6 +10,7 @@ describe('generic interaction CLI', (): void => {
expect(command.commands.map((item) => item.name()).sort()).toEqual([
'attach',
'chat',
'enroll',
'health',
'recover',
'send',

View File

@@ -3,6 +3,7 @@ import type { Command } from 'commander';
import { withAuth } from './with-auth.js';
import {
attachInteractionSession,
enrollInteractionSession,
fetchInteractionHealth,
fetchInteractionSessions,
fetchInteractionStatus,
@@ -10,6 +11,7 @@ import {
recoverInteractionSession,
sendInteractionMessage,
stopInteractionSession,
streamInteractionSession,
} from '../tui/gateway-api.js';
interface InteractionOptions {
@@ -103,18 +105,48 @@ export function registerInteractionCommand(program: Command): Command {
});
options(
command.command('attach <sessionId>').description('Create a scoped read or write attachment'),
command
.command('enroll <sessionId> <provider> <runtimeSessionId>')
.description('Bind an authorized runtime session to a durable conversation handle'),
).action(
async (
sessionId: string,
providerId: string,
runtimeSessionId: string,
opts: InteractionOptions,
) => {
const request = await authRequest(opts);
print(
await enrollInteractionSession(request.gateway, request.cookie, {
...request,
sessionId,
providerId,
runtimeSessionId,
}),
);
},
);
options(
command
.command('attach <sessionId>')
.description('Create a scoped read or write attachment and stream the session'),
)
.option('--control', 'Request control mode (provider policy may deny it)')
.action(async (sessionId: string, opts: InteractionOptions & { control?: boolean }) => {
const request = await authRequest(opts);
print(
await attachInteractionSession(request.gateway, request.cookie, {
...request,
sessionId,
mode: opts.control ? 'control' : 'read',
}),
);
const attachment = await attachInteractionSession(request.gateway, request.cookie, {
...request,
sessionId,
mode: opts.control ? 'control' : 'read',
});
print(attachment);
for await (const event of streamInteractionSession(request.gateway, request.cookie, {
...request,
sessionId,
})) {
print(event);
}
});
const send = options(