import { jsx as _jsx } from "react/jsx-runtime";
import { AgentActivityFeed } from './agent-activity-feed.js';
import { AgentMessageKind } from '../../../../../packages/core/src/domain/generated/output.js';
const meta = {
    title: 'AgentActivity/AgentActivityFeed',
    component: AgentActivityFeed,
    parameters: { layout: 'padded' },
    decorators: [
        (Story) => (_jsx("div", { className: "max-w-2xl", children: _jsx(Story, {}) })),
    ],
};
export default meta;
function message(overrides = {}) {
    return {
        kind: 'agent_message',
        messageId: 'msg-1',
        appId: 'app-1',
        featureId: 'feat-1',
        fromActor: 'agent:run-abcd',
        fromAgentRunId: 'run-abcd',
        toTarget: 'broadcast',
        toKind: 'broadcast',
        messageKind: AgentMessageKind.status,
        payload: JSON.stringify({ phase: 'started', detail: 'kicked off feature agent' }),
        correlationId: undefined,
        createdAt: '2026-04-29T09:00:00Z',
        ...overrides,
    };
}
export const Empty = {
    args: {
        scopeType: 'app',
        scopeId: 'app-1',
        featureId: 'feat-1',
        overrideMessages: [],
    },
};
export const FewMessages = {
    args: {
        scopeType: 'app',
        scopeId: 'app-1',
        featureId: 'feat-1',
        overrideMessages: [
            message({ messageId: 'm1' }),
            message({
                messageId: 'm2',
                messageKind: AgentMessageKind.request,
                payload: JSON.stringify({ ask: 'review my plan' }),
                createdAt: '2026-04-29T09:01:00Z',
            }),
        ],
    },
};
export const ManyMessages = {
    args: {
        scopeType: 'app',
        scopeId: 'app-1',
        featureId: 'feat-1',
        overrideMessages: Array.from({ length: 12 }, (_, i) => message({
            messageId: `m${i + 1}`,
            messageKind: i % 4 === 0
                ? AgentMessageKind.blocked
                : i % 3 === 0
                    ? AgentMessageKind.reply
                    : AgentMessageKind.status,
            payload: JSON.stringify({ step: i + 1 }),
            createdAt: new Date(Date.parse('2026-04-29T09:00:00Z') + i * 60_000).toISOString(),
        })),
    },
};
export const Error = {
    args: {
        scopeType: 'app',
        scopeId: 'app-1',
        featureId: 'feat-1',
        overrideMessages: [],
        errorMessage: 'Failed to load agent activity feed',
    },
};
