slackline/api/agents

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Agent sessions and code channels: create, configure and render views in agent channels.

Types

A slash command an agent registers in a code channel.

pub type AgentCommand {
  AgentCommand(
    name: String,
    description: option.Option(String),
    argument_hint: option.Option(String),
  )
}

Constructors

  • AgentCommand(
      name: String,
      description: option.Option(String),
      argument_hint: option.Option(String),
    )

    Arguments

    name

    Command name without the leading slash. 1 to 31 characters, unique in the set.

    description

    What the command does, shown in the composer typeahead.

    argument_hint

    Hint for the command’s arguments, such as [title].

The external resource an agent session is centered on.

pub type AgentResource {
  AgentResource(
    url: option.Option(String),
    resource_type: option.Option(String),
    title: option.Option(String),
    provider: option.Option(String),
  )
}

Constructors

  • AgentResource(
      url: option.Option(String),
      resource_type: option.Option(String),
      title: option.Option(String),
      provider: option.Option(String),
    )

    Arguments

    url

    URL of the external resource. Maximum 2048 characters.

    resource_type

    Type of the external resource. Maximum 64 characters.

    title

    Display title of the external resource. Maximum 255 characters.

    provider

    Provider of the external resource. Maximum 64 characters.

A view attached to a code channel.

pub type AgentSessionView {
  AgentSessionView(
    view_id: String,
    type_: option.Option(String),
    view_key: option.Option(String),
    file_id: option.Option(String),
    name: option.Option(String),
    label: option.Option(String),
    content_version: option.Option(Int),
    date_added: option.Option(Int),
  )
}

Constructors

  • AgentSessionView(
      view_id: String,
      type_: option.Option(String),
      view_key: option.Option(String),
      file_id: option.Option(String),
      name: option.Option(String),
      label: option.Option(String),
      content_version: option.Option(Int),
      date_added: option.Option(Int),
    )

    Arguments

    view_id

    Encoded channel tab ID.

    type_

    View type: html, diff, block_kit or canvas.

    view_key

    Agent-assigned stable key. Absent for diff views.

    file_id

    Encoded ID of the backing file.

    name

    Display label for the view tab.

    label

    Display label for the view tab (the name used in the response example).

    content_version

    Server-assigned content version.

    date_added

    Unix timestamp of when the view was created.

The status of an agent conversation or session.

pub type AgentStatus {
  Active
  Processing
  Suspended
  Closed
}

Constructors

  • Active

    active

  • Processing

    processing

  • Suspended

    suspended

  • Closed

    closed

A comment thread on a canvas.

pub type CanvasComment {
  CanvasComment(
    id: String,
    ts: option.Option(String),
    user_id: option.Option(String),
    text: option.Option(String),
    quoted_text: option.Option(String),
    is_resolved: option.Option(Bool),
    replies: option.Option(List(CanvasCommentReply)),
    has_more_replies: option.Option(Bool),
  )
}

Constructors

  • CanvasComment(
      id: String,
      ts: option.Option(String),
      user_id: option.Option(String),
      text: option.Option(String),
      quoted_text: option.Option(String),
      is_resolved: option.Option(Bool),
      replies: option.Option(List(CanvasCommentReply)),
      has_more_replies: option.Option(Bool),
    )

    Arguments

    id

    ID of the comment thread.

    ts

    Timestamp of the top-level comment.

    user_id

    User who wrote the comment.

    text

    Text of the comment.

    quoted_text

    The highlighted canvas text the comment is anchored to.

    is_resolved

    Whether the thread is resolved.

    replies

    Threaded replies, oldest first (at most the 100 most recent).

    has_more_replies

    Whether older replies were dropped.

A reply in a canvas comment thread.

pub type CanvasCommentReply {
  CanvasCommentReply(
    ts: option.Option(String),
    user_id: option.Option(String),
    text: option.Option(String),
  )
}

Constructors

  • CanvasCommentReply(
      ts: option.Option(String),
      user_id: option.Option(String),
      text: option.Option(String),
    )

    Arguments

    ts

    Timestamp of the reply.

    user_id

    User who wrote the reply.

    text

    Text of the reply.

The format of returned canvas content.

pub type CanvasContentFormat {
  MarkdownFormat
}

Constructors

  • MarkdownFormat

    markdown

Code channel properties to set with agents.conversations.setProperties. Only provided fields are updated.

pub type CodeChannelProperties {
  CodeChannelProperties(
    context_bar_items: option.Option(List(ContextBarItem)),
    summary_message: option.Option(SummaryMessage),
  )
}

Constructors

  • CodeChannelProperties(
      context_bar_items: option.Option(List(ContextBarItem)),
      summary_message: option.Option(SummaryMessage),
    )

    Arguments

    context_bar_items

    Items displayed in the channel context bar (max 5). The array replaces the current set.

    summary_message

    Records which message in the channel represents the current summary.

An item in a code channel’s context bar.

pub type ContextBarItem {
  ContextBarItem(
    key: String,
    label: String,
    icon: option.Option(String),
    url: option.Option(String),
    item_type: option.Option(String),
  )
}

Constructors

  • ContextBarItem(
      key: String,
      label: String,
      icon: option.Option(String),
      url: option.Option(String),
      item_type: option.Option(String),
    )

    Arguments

    key

    Unique identifier for the item within the channel. Maximum 64 characters.

    label

    Display text. Maximum 128 characters.

    icon

    Icon beside the label: branch, folder, hierarchy, life-ring, link, globe, terminal, code, search or lock.

    url

    Makes the item a link to this URL. Maximum 2048 characters.

    item_type

    info (default, informational) or action (clicking delivers a code_channel_action event).

Identifies agents.conversations.archive in the slackline.Call that conversations_archive returns.

pub type ConversationsArchive

Identifies agents.conversations.create in the slackline.Call that conversations_create returns.

pub type ConversationsCreate

A successful response from agents.conversations.create.

pub type ConversationsCreateResponse {
  ConversationsCreateResponse(channel_id: String)
}

Constructors

  • ConversationsCreateResponse(channel_id: String)

    Arguments

    channel_id

    ID of the created (or existing, for a repeated session_id) code channel.

Identifies agents.conversations.getCanvas in the slackline.Call that conversations_get_canvas returns.

pub type ConversationsGetCanvas

A successful response from agents.conversations.getCanvas.

pub type ConversationsGetCanvasResponse {
  ConversationsGetCanvasResponse(
    canvas_id: String,
    title: option.Option(String),
    content: option.Option(String),
    comments: option.Option(List(CanvasComment)),
    has_more_comments: option.Option(Bool),
  )
}

Constructors

  • ConversationsGetCanvasResponse(
      canvas_id: String,
      title: option.Option(String),
      content: option.Option(String),
      comments: option.Option(List(CanvasComment)),
      has_more_comments: option.Option(Bool),
    )

    Arguments

    title

    Title of the canvas.

    content

    Canvas content in the requested format (markdown).

    comments

    Comment threads, oldest first (at most the 100 most recent).

    has_more_comments

    Whether older comment threads were dropped.

Identifies agents.conversations.listViews in the slackline.Call that conversations_list_views returns.

pub type ConversationsListViews

A successful response from agents.conversations.listViews.

pub type ConversationsListViewsResponse {
  ConversationsListViewsResponse(
    views: option.Option(List(AgentSessionView)),
  )
}

Constructors

Identifies agents.conversations.removeView in the slackline.Call that conversations_remove_view returns.

pub type ConversationsRemoveView

A successful response from agents.conversations.removeView.

pub type ConversationsRemoveViewResponse {
  ConversationsRemoveViewResponse(
    channel_id: String,
    view_id: option.Option(String),
  )
}

Constructors

  • ConversationsRemoveViewResponse(
      channel_id: String,
      view_id: option.Option(String),
    )

    Arguments

    view_id

    ID of the removed view.

Identifies agents.conversations.setCanvasContent in the slackline.Call that conversations_set_canvas_content returns.

pub type ConversationsSetCanvasContent

A successful response from agents.conversations.setCanvasContent.

pub type ConversationsSetCanvasContentResponse {
  ConversationsSetCanvasContentResponse(
    canvas_id: String,
    sections_changed_count: option.Option(Int),
  )
}

Constructors

  • ConversationsSetCanvasContentResponse(
      canvas_id: String,
      sections_changed_count: option.Option(Int),
    )

    Arguments

    sections_changed_count

    Number of canvas sections that changed.

Identifies agents.conversations.setCommands in the slackline.Call that conversations_set_commands returns.

pub type ConversationsSetCommands

A successful response from agents.conversations.setCommands.

pub type ConversationsSetCommandsResponse {
  ConversationsSetCommandsResponse(
    channel_id: String,
    command_count: option.Option(Int),
  )
}

Constructors

  • ConversationsSetCommandsResponse(
      channel_id: String,
      command_count: option.Option(Int),
    )

    Arguments

    command_count

    Number of commands registered.

Identifies agents.conversations.setProperties in the slackline.Call that conversations_set_properties returns.

pub type ConversationsSetProperties

A successful response from agents.conversations.setProperties.

pub type ConversationsSetPropertiesResponse {
  ConversationsSetPropertiesResponse(
    channel_id: String,
    warning: option.Option(String),
  )
}

Constructors

  • ConversationsSetPropertiesResponse(
      channel_id: String,
      warning: option.Option(String),
    )

    Arguments

    warning

    Warning such as too_many_context_bar_items or action_with_url_overridden_to_info.

Identifies agents.conversations.setView in the slackline.Call that conversations_set_view returns.

pub type ConversationsSetView

A successful response from agents.conversations.setView.

pub type ConversationsSetViewResponse {
  ConversationsSetViewResponse(
    channel_id: String,
    view_id: String,
    file_id: option.Option(String),
    canvas_id: option.Option(String),
    content_version: option.Option(Int),
    type_: option.Option(String),
  )
}

Constructors

  • ConversationsSetViewResponse(
      channel_id: String,
      view_id: String,
      file_id: option.Option(String),
      canvas_id: option.Option(String),
      content_version: option.Option(Int),
      type_: option.Option(String),
    )

    Arguments

    view_id

    Encoded channel tab ID of the view. Use it as tab_id to link to the view.

    file_id

    Encoded ID of the backing file.

    canvas_id

    Encoded ID of the canvas, for canvas views.

    content_version

    Server-assigned content version, bumped on each update.

    type_

    View type: html, diff, block_kit or canvas.

Identifies agents.sessions.rename in the slackline.Call that sessions_rename returns.

pub type SessionsRename

A successful response from agents.sessions.rename.

pub type SessionsRenameResponse {
  SessionsRenameResponse(title: option.Option(String))
}

Constructors

  • SessionsRenameResponse(title: option.Option(String))

    Arguments

    title

    The new title of the session.

Identifies agents.sessions.setStatus in the slackline.Call that sessions_set_status returns.

pub type SessionsSetStatus

A successful response from agents.sessions.setStatus.

pub type SessionsSetStatusResponse {
  SessionsSetStatusResponse(
    status: option.Option(String),
    agent_status: option.Option(String),
    title: option.Option(String),
  )
}

Constructors

  • SessionsSetStatusResponse(
      status: option.Option(String),
      agent_status: option.Option(String),
      title: option.Option(String),
    )

    Arguments

    status

    Session-level status, derived from all agents in the session.

    agent_status

    The calling agent’s own status.

    title

    Title of the session.

Which message in a code channel is the current session summary.

pub type SummaryMessage {
  SummaryMessage(
    message_ts: String,
    thread_ts: option.Option(String),
  )
}

Constructors

  • SummaryMessage(
      message_ts: String,
      thread_ts: option.Option(String),
    )

    Arguments

    message_ts

    Timestamp of the summary message in the code channel.

    thread_ts

    If the summary is a thread reply, the parent message timestamp.

The access the channel gets to a view.

pub type ViewAccessLevel {
  WriteAccess
  CommentAccess
  ReadAccess
}

Constructors

  • WriteAccess

    write

  • CommentAccess

    comment

  • ReadAccess

    read

Content-Security-Policy domain declarations for an html view.

pub type ViewCsp {
  ViewCsp(resource_domains: option.Option(List(String)))
}

Constructors

  • ViewCsp(resource_domains: option.Option(List(String)))

    Arguments

    resource_domains

    Additional https:// origins the view loads resources from.

Values

pub fn agent_command_decoder() -> decode.Decoder(AgentCommand)

Decodes AgentCommand from json.

pub fn agent_command_to_json(it: AgentCommand) -> json.Json

Encodes AgentCommand as json.

pub fn agent_resource_decoder() -> decode.Decoder(AgentResource)

Decodes AgentResource from json.

pub fn agent_resource_to_json(it: AgentResource) -> json.Json

Encodes AgentResource as json.

pub fn agent_session_view_decoder() -> decode.Decoder(
  AgentSessionView,
)

Decodes AgentSessionView from json.

pub fn agent_session_view_to_json(
  it: AgentSessionView,
) -> json.Json

Encodes AgentSessionView as json.

pub fn agent_status_decoder() -> decode.Decoder(AgentStatus)

Decodes AgentStatus from a json string.

pub fn agent_status_from_string(
  string: String,
) -> Result(AgentStatus, Nil)

Parses AgentStatus from its json string.

pub fn agent_status_to_json(it: AgentStatus) -> json.Json

Encodes AgentStatus as a json string.

pub fn agent_status_to_string(it: AgentStatus) -> String

The json string of AgentStatus.

pub fn canvas_comment_decoder() -> decode.Decoder(CanvasComment)

Decodes CanvasComment from json.

pub fn canvas_comment_reply_decoder() -> decode.Decoder(
  CanvasCommentReply,
)

Decodes CanvasCommentReply from json.

pub fn canvas_comment_reply_to_json(
  it: CanvasCommentReply,
) -> json.Json

Encodes CanvasCommentReply as json.

pub fn canvas_comment_to_json(it: CanvasComment) -> json.Json

Encodes CanvasComment as json.

pub fn canvas_content_format_decoder() -> decode.Decoder(
  CanvasContentFormat,
)

Decodes CanvasContentFormat from a json string.

pub fn canvas_content_format_from_string(
  string: String,
) -> Result(CanvasContentFormat, Nil)

Parses CanvasContentFormat from its json string.

pub fn canvas_content_format_to_json(
  it: CanvasContentFormat,
) -> json.Json

Encodes CanvasContentFormat as a json string.

pub fn canvas_content_format_to_string(
  it: CanvasContentFormat,
) -> String

The json string of CanvasContentFormat.

pub fn code_channel_properties_decoder() -> decode.Decoder(
  CodeChannelProperties,
)

Decodes CodeChannelProperties from json.

pub fn code_channel_properties_to_json(
  it: CodeChannelProperties,
) -> json.Json

Encodes CodeChannelProperties as json.

pub fn context_bar_item_decoder() -> decode.Decoder(
  ContextBarItem,
)

Decodes ContextBarItem from json.

pub fn context_bar_item_to_json(it: ContextBarItem) -> json.Json

Encodes ContextBarItem as json.

pub fn conversations_archive(
  channel_id channel_id: String,
) -> slackline.Call(ConversationsArchive, Nil)

agents.conversations.archive: Archives a code channel, optionally recording a summary message on the channel.

agents.ConversationsArchive identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_archive.

Bot token scopes: code_channels:manage.

Documented errors: already_archived, channel_not_found, no_origin_link, not_agent_channel, not_authorized, origin_channel_not_found, origin_message_not_found, restricted_action, summary_message_not_found.

pub fn conversations_create() -> slackline.Call(
  ConversationsCreate,
  ConversationsCreateResponse,
)

agents.conversations.create: Creates a dedicated code channel for an agent session.

agents.ConversationsCreate identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_create.

Bot token scopes: code_channels:manage.

Documented errors: channel_creation_failed, channel_not_viewable, feature_disabled, invalid_agent, invalid_origin_link, invite_failed, name_or_origin_required, no_shared_workspace, open_failed, origin_channel_externally_shared, origin_channel_is_file_channel, restricted_action, user_not_enabled.

pub fn conversations_create_response_decoder() -> decode.Decoder(
  ConversationsCreateResponse,
)

Decodes the response from agents.conversations.create.

pub fn conversations_get_canvas(
  channel channel: String,
  canvas_id canvas_id: String,
) -> slackline.Call(
  ConversationsGetCanvas,
  ConversationsGetCanvasResponse,
)

agents.conversations.getCanvas: Fetches a canvas attached to an agent session channel in a single round-trip.

agents.ConversationsGetCanvas identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_get_canvas.

Bot token scopes: code_channels:manage.

Rate limit tier: t3.

Documented errors: canvas_content_fetch_failed, canvas_not_found, channel_not_found, comments_fetch_failed, not_agent_channel, not_authorized.

pub fn conversations_get_canvas_response_decoder() -> decode.Decoder(
  ConversationsGetCanvasResponse,
)

Decodes the response from agents.conversations.getCanvas.

pub fn conversations_list_views(
  channel_id channel_id: String,
) -> slackline.Call(
  ConversationsListViews,
  ConversationsListViewsResponse,
)

agents.conversations.listViews: Lists the views currently attached to a code channel.

agents.ConversationsListViews identifies this method in slackline.Call.

Bot token scopes: code_channels:manage.

Documented errors: channel_not_found, not_agent_channel, not_authorized.

pub fn conversations_list_views_response_decoder() -> decode.Decoder(
  ConversationsListViewsResponse,
)

Decodes the response from agents.conversations.listViews.

pub fn conversations_remove_view(
  channel_id channel_id: String,
) -> slackline.Call(
  ConversationsRemoveView,
  ConversationsRemoveViewResponse,
)

agents.conversations.removeView: Removes a view from a code channel.

agents.ConversationsRemoveView identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_remove_view.

Bot token scopes: code_channels:manage.

Documented errors: channel_not_found, not_agent_channel, not_authorized, not_view_owner, view_not_found, view_remove_failed.

pub fn conversations_remove_view_response_decoder() -> decode.Decoder(
  ConversationsRemoveViewResponse,
)

Decodes the response from agents.conversations.removeView.

pub fn conversations_set_canvas_content(
  channel channel: String,
  canvas_id canvas_id: String,
  content content: String,
) -> slackline.Call(
  ConversationsSetCanvasContent,
  ConversationsSetCanvasContentResponse,
)

agents.conversations.setCanvasContent: Replaces the full markdown content of a canvas attached to a code channel, preserving the comment threads on the sections your agent didn’t change.

agents.ConversationsSetCanvasContent identifies this method in slackline.Call.

Bot token scopes: code_channels:manage.

Rate limit tier: t3.

Documented errors: canvas_content_fetch_failed, canvas_content_update_failed, canvas_not_found, channel_not_found, content_too_large, not_agent_channel, not_authorized, too_many_sections.

pub fn conversations_set_canvas_content_response_decoder() -> decode.Decoder(
  ConversationsSetCanvasContentResponse,
)

Decodes the response from agents.conversations.setCanvasContent.

pub fn conversations_set_commands(
  channel_id channel_id: String,
  commands commands: List(AgentCommand),
) -> slackline.Call(
  ConversationsSetCommands,
  ConversationsSetCommandsResponse,
)

agents.conversations.setCommands: Registers the set of slash commands your agent offers in a code channel.

agents.ConversationsSetCommands identifies this method in slackline.Call.

Bot token scopes: code_channels:manage.

Documented errors: agent_required, channel_not_found, colliding_with_builtin, duplicate_command, invalid_commands, no_actions_url, not_agent_channel, not_authorized, properties_update_failed, too_many_agents, too_many_commands.

pub fn conversations_set_commands_response_decoder() -> decode.Decoder(
  ConversationsSetCommandsResponse,
)

Decodes the response from agents.conversations.setCommands.

pub fn conversations_set_properties(
  channel_id channel_id: String,
) -> slackline.Call(
  ConversationsSetProperties,
  ConversationsSetPropertiesResponse,
)

agents.conversations.setProperties: Sets properties on a code channel: context bar items and external resource details.

agents.ConversationsSetProperties identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_set_properties.

Bot token scopes: code_channels:manage.

Documented errors: channel_not_found, invalid_status, invalid_title, no_properties_provided, not_agent_channel, not_authorized.

pub fn conversations_set_properties_response_decoder() -> decode.Decoder(
  ConversationsSetPropertiesResponse,
)

Decodes the response from agents.conversations.setProperties.

pub fn conversations_set_view(
  channel_id channel_id: String,
) -> slackline.Call(
  ConversationsSetView,
  ConversationsSetViewResponse,
)

agents.conversations.setView: Creates or updates a view in a code channel. Views can render HTML, diffs, Block Kit, or canvases as tabs alongside the conversation.

agents.ConversationsSetView identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/conversations_set_view.

Bot token scopes: code_channels:manage.

Documented errors: canvas_not_found, channel_not_found, content_too_large, invalid_blocks, invalid_csp_domain, invalid_view_type, missing_required_arg, not_agent_channel, not_authorized, not_view_owner, too_many_views, view_creation_failed.

pub fn conversations_set_view_response_decoder() -> decode.Decoder(
  ConversationsSetViewResponse,
)

Decodes the response from agents.conversations.setView.

pub fn sessions_rename(
  title title: String,
) -> slackline.Call(SessionsRename, SessionsRenameResponse)

agents.sessions.rename: Rename an agent session.

agents.SessionsRename identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/sessions_rename.

Bot token scopes: chat:write.

Rate limit tier: t3.

Documented errors: channel_not_found, feature_disabled, invalid_name, is_archived, name_taken, not_authorized, session_not_found, thread_ts_not_allowed, thread_ts_required.

pub fn sessions_rename_response_decoder() -> decode.Decoder(
  SessionsRenameResponse,
)

Decodes the response from agents.sessions.rename.

pub fn sessions_set_status(
  status status: AgentStatus,
) -> slackline.Call(SessionsSetStatus, SessionsSetStatusResponse)

agents.sessions.setStatus: Set an agent session’s lifecycle status, creating the session if needed.

agents.SessionsSetStatus identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/agents/sessions_set_status.

Bot token scopes: chat:write.

Rate limit tier: t3.

Documented errors: channel_not_found, feature_disabled, invalid_status, not_authorized, thread_ts_not_allowed, thread_ts_required, user_not_found.

pub fn sessions_set_status_response_decoder() -> decode.Decoder(
  SessionsSetStatusResponse,
)

Decodes the response from agents.sessions.setStatus.

pub fn summary_message_decoder() -> decode.Decoder(SummaryMessage)

Decodes SummaryMessage from json.

pub fn summary_message_to_json(it: SummaryMessage) -> json.Json

Encodes SummaryMessage as json.

pub fn view_access_level_decoder() -> decode.Decoder(
  ViewAccessLevel,
)

Decodes ViewAccessLevel from a json string.

pub fn view_access_level_from_string(
  string: String,
) -> Result(ViewAccessLevel, Nil)

Parses ViewAccessLevel from its json string.

pub fn view_access_level_to_json(
  it: ViewAccessLevel,
) -> json.Json

Encodes ViewAccessLevel as a json string.

pub fn view_access_level_to_string(it: ViewAccessLevel) -> String

The json string of ViewAccessLevel.

pub fn view_csp_decoder() -> decode.Decoder(ViewCsp)

Decodes ViewCsp from json.

pub fn view_csp_to_json(it: ViewCsp) -> json.Json

Encodes ViewCsp as json.

✨ Search Document