Member Junction
    Preparing search index...

    Manages artifact tools for a single agent run.

    Follows the ScratchpadManager pattern:

    • Instantiated once per run
    • Holds references to input artifacts with alpha IDs
    • Generates manifest + tool documentation for prompt injection
    • Executes tool calls and stores results for next turn
    • Serializable for persistence
    Index

    Constructors

    Methods

    • Distinct artifact tool names available across all input artifacts. Used to register artifact tools into a pipeline's tool registry (one invocable per name; the target artifact is selected at call time via an artifactId param).

      Returns string[]

    • Returns artifact content formatted as NativeFileInput candidates for the AIPromptRunner. Only artifacts with a known MIME type and string/Buffer content are included. The runner will check each against the driver's FileCapabilities before actually attaching them.

      For each candidate, eagerly extracts text content so the Prompts package can fall back to a plain-text injection when the driver doesn't support native file input (e.g., Cerebras, older OpenAI-compat providers).

      Returns Promise<NativeFileInput[]>

    • Markdown manifest: artifact IDs, names, types, optional routing annotations, plus modality-mismatch warnings when the active driver can't process a media artifact's MIME. The warning is what stops non-vision models from pretending to see image artifacts based on pattern-matched few-shot examples.

      Parameters

      • Optionalopts: { supportedMimeTypes?: readonly string[] }
        • OptionalsupportedMimeTypes?: readonly string[]

          Driver-declared file capabilities. When provided, any artifact whose MIME doesn't match (and isn't a text-based type the agent reaches via tools) gets a per-entry warning telling the agent the model can't process the artifact. Pass undefined to disable the check (legacy callers).

      Returns string

    • Builds a truncated inline preview of a tables-based content JSON by keeping only the first maxRowsPerTable rows per table and attaching truncation metadata.

      Parameters

      • contentJson: string
      • maxRowsPerTable: number = 30

      Returns string

    • Determines whether artifact content should be externalized to MJStorage instead of being stored inline.

      Parameters

      • contentLength: number
      • Optionaloptions: { maxInlineChars?: number }

      Returns { reason: string; shouldExternalize: boolean }