import { z } from 'zod';
import { EXIT_CODES, parseCommandArgs } from "../../infrastructure.js";
import { openGraph } from "../../shared.js";
export const STRAND_SUBCOMMAND = Object.freeze({
    name: 'list',
    summary: 'List strand descriptors for the graph',
});
const LIST_OPTIONS = {};
const listStrandSchema = z.object({}).strict();
/** Lists all strand descriptors for the graph. */
export async function handleStrandSubcommand({ options, args }) {
    parseCommandArgs(args, LIST_OPTIONS, listStrandSchema);
    const { graph, graphName } = await openGraph(options);
    const strands = await graph.listStrands();
    return {
        payload: {
            graph: graphName,
            strandAction: 'list',
            strands,
        },
        exitCode: EXIT_CODES.OK,
    };
}
