Skip to content

Type Alias: AgentPromptBlock

ts
type AgentPromptBlock = 
  | {
  type: "text";
  text: string;
}
  | {
  type: "resource_link";
  uri: string;
  name?: string;
}
  | {
  type: "resource";
  uri: string;
  mimeType?: string;
  text: string;
};

Defined in: packages/sdk/src/agents-service.ts:521

Beta

One block of an outgoing prompt turn for a Chat session (AgentSessionHandle.prompt). Structured content, never a shell string — the entire quoting/escaping risk surface of a Terminal session's opening prompt (RFC 0033 phase 3) does not exist here.

  • "text" — a run of plain text. $HOME, backticks, quotes and newlines are all literal.
  • "resource_link" — a pointer to a file (or other URI) the agent may read if it chooses. uri is typically a file:// path inside the workspace. Always accepted — this is a pointer, not embedded content, so it needs no AgentPromptCapabilities gate.
  • "resource" — the file's own text inlined into the prompt, rather than a pointer the agent may or may not follow. Only send this to a session whose AgentSessionHandle.promptCapabilities has embeddedContext: true.

Images are deferred — no probe has yet checked what each agent actually accepts for one, and this union grows behind that once one has (RFC 0040 open question 3).

Union Members

Type Literal

ts
{
  type: "text";
  text: string;
}

Type Literal

ts
{
  type: "resource_link";
  uri: string;
  name?: string;
}

type

ts
readonly type: "resource_link";

uri

ts
readonly uri: string;

name?

ts
readonly optional name?: string;

A short display name for the link; defaults to the last path segment.


Type Literal

ts
{
  type: "resource";
  uri: string;
  mimeType?: string;
  text: string;
}

type

ts
readonly type: "resource";

uri

ts
readonly uri: string;

The resource's own URI, e.g. a file:// path.

mimeType?

ts
readonly optional mimeType?: string;

text

ts
readonly text: string;

The embedded text content. Binary (blob) resources are not modelled — nothing in Silo has needed to embed one yet.