Member Junction
    Preparing search index...

    Interface LoopAgentResponse<P>

    Response structure for Loop Agent Type

    interface LoopAgentResponse<P = any> {
        actionableCommands?: ActionableCommand[];
        artifactToolCalls?: ArtifactToolCall[];
        automaticCommands?: AutomaticCommand[];
        confidence?: number;
        conversationToolCalls?: ConversationToolCall[];
        memoryWrites?: MemoryWriteRequest[];
        message?: string;
        nextStep?: {
            actions?: { name: string; params: Record<string, unknown> }[];
            clientTools?: {
                description?: string;
                Description?: string;
                name?: string;
                Name?: string;
                params?: Record<string, unknown>;
                Params?: Record<string, unknown>;
                timeoutMs?: number;
                TimeoutMs?: number;
            }[];
            forEach?: ForEachOperation;
            messageIndex?: number;
            pipeline?: AgentPipelineRequest;
            plan?: string;
            reason?: string;
            skills?: { name: string; reason?: string }[];
            subAgent?: {
                message: string;
                name: string;
                templateParameters?: Record<string, any>;
                terminateAfter: boolean;
            };
            subAgents?: {
                message: string;
                name: string;
                templateParameters?: Record<string, any>;
                terminateAfter: boolean;
            }[];
            type: | "Actions"
            | "Chat"
            | "ForEach"
            | "Retry"
            | "Sub-Agent"
            | "While"
            | "Plan"
            | "Skill"
            | "Pipeline"
            | "ClientTools";
            while?: WhileOperation;
        };
        payloadChangeRequest?: AgentPayloadChangeRequest<P>;
        reasoning?: string;
        responseForm?: AgentResponseForm;
        scratchpad?: AgentScratchpad;
        taskComplete?: boolean;
    }

    Type Parameters

    • P = any
    Index

    Properties

    actionableCommands?: ActionableCommand[]

    Optional actionable commands shown as clickable buttons/links. Typically used after completing work to provide navigation to created/modified resources.

    2.116.0

    artifactToolCalls?: ArtifactToolCall[]

    Artifact tool invocations — explore input artifacts without dumping full content into context. Processed inline on the same turn as other response fields (zero turn cost). Results are injected into the next turn's prompt via _ARTIFACT_TOOL_RESULTS.

    automaticCommands?: AutomaticCommand[]

    Optional automatic commands executed immediately when received. Used for refreshing data, showing notifications, and updating UI state.

    2.116.0

    confidence?: number

    Confidence level (0.0-1.0)

    conversationToolCalls?: ConversationToolCall[]

    Conversation-history retrieval tool invocations — page exact pre-summary messages back into context by their persisted Sequence handles, or search the full stored history. Processed inline on the same turn as other response fields (zero turn cost); results are injected as a conversation message on the next turn. Only honored when the run has a conversationId.

    memoryWrites?: MemoryWriteRequest[]

    Durable memory writes — record facts/preferences that persist across runs. Processed inline on the same turn as other response fields (zero turn cost). Each write lands as a Provisional agent note — immediately injectable into future runs, later hardened or pruned by the Memory Manager. Only honored when the agent has AllowMemoryWrite enabled; the framework enforces type restriction, scope clamping, deduplication, and per-run caps.

    message?: string

    Plain text message (<100 words). Required for 'Chat' type, omit for others

    nextStep?: {
        actions?: { name: string; params: Record<string, unknown> }[];
        clientTools?: {
            description?: string;
            Description?: string;
            name?: string;
            Name?: string;
            params?: Record<string, unknown>;
            Params?: Record<string, unknown>;
            timeoutMs?: number;
            TimeoutMs?: number;
        }[];
        forEach?: ForEachOperation;
        messageIndex?: number;
        pipeline?: AgentPipelineRequest;
        plan?: string;
        reason?: string;
        skills?: { name: string; reason?: string }[];
        subAgent?: {
            message: string;
            name: string;
            templateParameters?: Record<string, any>;
            terminateAfter: boolean;
        };
        subAgents?: {
            message: string;
            name: string;
            templateParameters?: Record<string, any>;
            terminateAfter: boolean;
        }[];
        type: | "Actions"
        | "Chat"
        | "ForEach"
        | "Retry"
        | "Sub-Agent"
        | "While"
        | "Plan"
        | "Skill"
        | "Pipeline"
        | "ClientTools";
        while?: WhileOperation;
    }

    Next action. Required when taskComplete=false

    Type Declaration

    • Optionalactions?: { name: string; params: Record<string, unknown> }[]

      Actions to execute (when type='Actions')

    • OptionalclientTools?: {
          description?: string;
          Description?: string;
          name?: string;
          Name?: string;
          params?: Record<string, unknown>;
          Params?: Record<string, unknown>;
          timeoutMs?: number;
          TimeoutMs?: number;
      }[]

      Client tools to invoke (when type='ClientTools'). Supports both PascalCase (spec) and camelCase (LLM convenience).

    • OptionalforEach?: ForEachOperation

      ForEach operation details (when type='ForEach')

    • OptionalmessageIndex?: number

      Index of a compacted message to expand (when type='Retry'). The message is restored to full content and the prompt re-runs.

    • Optionalpipeline?: AgentPipelineRequest

      Tool pipeline to run server-side (when type='Pipeline'). Like client tools, it is a yield/await action: the agent cannot know the result until it executes, so the loop runs the pipeline inline, injects the final output, and forces one more turn. Only the final step's output enters the context window. Modeling it as a nextStep.type (rather than a top-level field) makes it structurally mutually exclusive with Actions/Chat/etc. — the LLM cannot accidentally request a pipeline AND another step in the same turn.

    • Optionalplan?: string

      The proposed plan (when type='Plan', Plan Mode only). Presenting a plan pauses the run and asks the human to approve or edit it via a response-form card before you may execute any Actions or Sub-Agents. See the Plan Mode section for when this is required.

    • Optionalreason?: string

      Reason for expanding the message (when type='Retry')

    • Optionalskills?: { name: string; reason?: string }[]

      Skills to activate (when type='Skill'). Reference by catalog Name only — you only ever see name + description for skills you haven't activated yet (progressive disclosure). Activating a skill appends its full instructions to your context and enables its bundled Actions/sub-agents for the rest of this run. This is NOT a nested agent run.

    • OptionalsubAgent?: {
          message: string;
          name: string;
          templateParameters?: Record<string, any>;
          terminateAfter: boolean;
      }

      Sub-agent details (when type='Sub-Agent')

      • message: string

        Instructions for the sub-agent, NOT the payload, that is handled elsewhere

      • name: string
      • OptionaltemplateParameters?: Record<string, any>

        Extra parameters - NOT the payload, only use these if the sub-agent specifically defines parameters in its metadata, otherwise these will be ignored and waste tokens!

      • terminateAfter: boolean

        true=end parent, false=continue

    • OptionalsubAgents?: {
          message: string;
          name: string;
          templateParameters?: Record<string, any>;
          terminateAfter: boolean;
      }[]

      Multiple sub-agents to run in parallel (when type='Sub-Agent')

    • type:
          | "Actions"
          | "Chat"
          | "ForEach"
          | "Retry"
          | "Sub-Agent"
          | "While"
          | "Plan"
          | "Skill"
          | "Pipeline"
          | "ClientTools"

      Operation type: 'Actions' | 'ClientTools' | 'Sub-Agent' | 'Chat' | 'Retry' | 'ForEach' | 'While' | 'Pipeline' | 'Skill'

    • Optionalwhile?: WhileOperation

      While operation details (when type='While')

    payloadChangeRequest?: AgentPayloadChangeRequest<P>

    Payload changes. Omit if no changes needed

    reasoning?: string

    Internal reasoning for debugging

    responseForm?: AgentResponseForm

    Optional response form to collect structured user input. When present, UI will render appropriate input controls.

    2.116.0

    scratchpad?: AgentScratchpad

    Private working memory — not shared with parent or sub-agents. Processed inline on the same turn as other response fields (zero turn cost). Use for internal reasoning notes and structured task tracking.

    2.46.0

    taskComplete?: boolean

    Task completion status. true = terminate loop, false = continue