PromptRunner.Packets (PromptRunnerSDK v0.10.0)

Copy Markdown View Source

Prompt operations within a packet.

Summary

Functions

amend_prompt_contract(packet_root, prompt_id, amendment)

@spec amend_prompt_contract(String.t(), String.t(), map()) :: :ok | {:error, term()}

Writes an amendment back into the packet's own prompt file.

A separate explicit act, never a side effect of amending a run: the packet is a versioned artifact, and changing what a prompt requires is a commit somebody should be able to review.

create_prompt(packet_root, attrs, opts \\ [])

@spec create_prompt(String.t(), map(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

list_prompts(packet_root)

@spec list_prompts(String.t()) :: {:ok, [PromptRunner.Prompt.t()]} | {:error, term()}

load_prompt(packet_root, prompt_id)

@spec load_prompt(String.t(), String.t()) ::
  {:ok, PromptRunner.Prompt.t()} | {:error, term()}

sync_checklists(packet_root)

@spec sync_checklists(String.t()) ::
  {:ok, %{paths: [String.t()], warnings: [map()]}} | {:error, term()}