Contracts

The mirrors of the platform’s api contracts: the Smarter Chat api (version 2), the Smarter Journal, and the Django-React integration.

class ViteManifest(chunks, buildInfo)

A React app’s Vite-generated manifest.json: its chunks, keyed by source path, and Smarter’s build information.

Example

const manifest = ViteManifest.parse(JSON.parse(readFileSync("manifest.json", "utf-8")));
const entry = manifest.entryKey();
if (entry) console.log(manifest.collectAssets(entry, "js"));
Arguments:
  • chunks (Record) – The chunks, keyed by source path.

  • buildInfo (object | null) – The build information.

ViteManifest.buildInfo

The _custom build information, if the package’s vite.config.ts adds it.

Type:

object | null

ViteManifest.chunks

The manifest’s chunks, keyed by source path.

Type:

Record<string, ViteManifestChunk>

ViteManifest.isEmpty

Whether the manifest has any chunks.

Type:

boolean

ViteManifest.collectAssets(key, assetType, seen)

Recursively collect the JS or CSS files of a chunk and of its static imports.

A chunk’s own files come first, followed by those of each of its imports, depth first, in the order they are listed. Each chunk is visited once, so circular imports terminate.

Arguments:
  • key (string) – The manifest key of the chunk to collect assets for.

  • assetType (ReactAssetType) – js for the chunks’ file, css for their css files.

  • seen (Set) – The keys already visited, used by the recursion.

Returns:

The asset file paths, relative to the app’s static directory.

Return type:

string[]

ViteManifest.entryKey()

The key of the manifest’s entry point, the first chunk with "isEntry": true.

Returns:

The entry point’s key, or null if the manifest has no entry point.

Return type:

string | null

ViteManifest.toJSON()

The manifest in the shape of manifest.json, with the build information as its _custom entry.

Returns:

The chunks, keyed by source path, and _custom.

Return type:

Record<string, ViteManifestChunk | ReactAppBuildInfo>

ViteManifest.parse(data)

Validate a manifest.json’s content, and split its _custom entry from its chunks.

Arguments:
  • data (unknown) – The parsed manifest.json.

Returns:

The manifest.

Throws:

ZodError – If an entry is not a chunk.

Return type:

ViteManifest

messageText(message)

A message’s text: its content, or the text of its text parts, joined by blank lines.

Arguments:
  • message (object) – The message.

Returns:

The text, or an empty string.

Return type:

string

promptText(result)

The text of the LLM’s final reply: the last assistant message that has content, or an empty string.

Arguments:
  • result (object) – A prompt’s result, e.g. a prompt response’s data.

Returns:

The text.

Return type:

string

SmarterJournaledResponse(data)

The schema of a successful journaled response: the envelope, the response’s data, and an optional message.

Arguments:
  • data (T) – The schema of the endpoint’s data.

Returns:

The response’s schema.

Return type:

object

withPromptText(response)

Add the non-enumerable text getter to a prompt response.

Arguments:
  • response (object) – The response.

Returns:

The same object, as a PromptResponse.

Return type:

PromptResponse

BUILD_INFO_KEY

The key of the build information that each React package’s vite.config.ts adds to its manifest.json.

Type:

“_custom”

CHAT_CONTRACT_V2

The version of the Smarter Chat api contract that the SDK reads.

Type:

2

CHAT_CONTRACT_V2_CAPABILITY

The X-Smarter-Capabilities value with which the SDK asks for version 2 of the contract.

Type:

“chat-contract-v2”

class JournalEntry()

A Smarter Journal entry, as /api/v1/journal/ returns it.

The list returns entries without request and response. Retrieving one entry by its key includes them. Only superusers may read the journal, because the request documents hold the callers’ credentials.

A Zod schema, and the type of the same name that it validates.

JournalEntry.command
Type:

string

JournalEntry.createdAt
Type:

string | null | undefined

JournalEntry.key
Type:

string

JournalEntry.request
Type:

JsonValue | null | undefined

JournalEntry.response
Type:

JsonValue | null | undefined

JournalEntry.statusCode
Type:

number

JournalEntry.thing
Type:

string

JournalEntry.user

The username of the caller, or null for an anonymous request.

Type:

string | null | undefined

class JournalPage()

One page of the journal’s entries.

A Zod schema, and the type of the same name that it validates.

JournalPage.objects
Type:

object[]

JournalPage.pagination
Type:

object

class JournalPagination()

The description of one page of the journal’s entries.

A Zod schema, and the type of the same name that it validates.

JournalPagination.count
Type:

number

JournalPagination.numPages
Type:

number

JournalPagination.ordering
Type:

string

JournalPagination.page
Type:

number

JournalPagination.pageSize
Type:

number

JournalPagination.search
Type:

string

JournalPagination.sortFields
Type:

string[]

LLM_MESSAGE_ROLES

The message roles that the LLM providers accept. Smarter’s own roles, smarter and smarter_error, are informational.

Type:

unknown

class PromptChatApiAudioPart()

An audio part of a message’s content.

A Zod schema, and the type of the same name that it validates.

PromptChatApiAudioPart.input_audio
Type:

object

PromptChatApiAudioPart.type
Type:

“input_audio”

class PromptChatApiChoice()

A choice of a chat completion.

A Zod schema, and the type of the same name that it validates.

PromptChatApiChoice.finish_reason

e.g. stop, length or tool_calls.

Type:

string | null | undefined

PromptChatApiChoice.index
Type:

number

PromptChatApiChoice.message
Type:

object | null | undefined

class PromptChatApiCompletion()

The LLM’s chat completion, in the format of the OpenAI api.

A Zod schema, and the type of the same name that it validates.

PromptChatApiCompletion.choices
Type:

object[]

PromptChatApiCompletion.created
Type:

number | null | undefined

PromptChatApiCompletion.id
Type:

string | null | undefined

PromptChatApiCompletion.model
Type:

string | null | undefined

PromptChatApiCompletion.object
Type:

string | null | undefined

PromptChatApiCompletion.service_tier
Type:

string | null | undefined

PromptChatApiCompletion.system_fingerprint
Type:

string | null | undefined

PromptChatApiCompletion.usage
Type:

object | null | undefined

class PromptChatApiConfig()

An LLMClient’s chat configuration: the LLMClient, the chat session’s key and history, and its plugins and functions.

A new session’s configuration has an empty history. Pass its session_key to the prompt api to continue the session.

A Zod schema, and the type of the same name that it validates.

PromptChatApiConfig.contract
Type:

number

PromptChatApiConfig.debug_mode

The platform’s ENABLE_REACTAPP_DEBUG_MODE waffle switch.

Type:

boolean

PromptChatApiConfig.functions
Type:

object | null | undefined

PromptChatApiConfig.history
Type:

object

PromptChatApiConfig.llmclient
Type:

object

PromptChatApiConfig.meta_data
Type:

object

PromptChatApiConfig.plugins
Type:

object

PromptChatApiConfig.sandbox_mode

True for a workbench url.

Type:

boolean

PromptChatApiConfig.session_key

The chat session’s key.

Type:

string

class PromptChatApiConfigRequest()

The configuration api’s request body.

A Zod schema, and the type of the same name that it validates.

PromptChatApiConfigRequest.session_key

The chat session’s key, or null for a new session.

Type:

string | null | undefined

class PromptChatApiConfigResponse()

The configuration api’s response.

A Zod schema, and the type of the same name that it validates.

PromptChatApiConfigResponse.api

The api version, e.g. smarter.sh/v1.

Type:

string

PromptChatApiConfigResponse.data
Type:

object

PromptChatApiConfigResponse.metadata
Type:

object

PromptChatApiContentPart

A part of a message whose content is a list of parts, by its type.

Type:

object | object | object | object | object

class PromptChatApiEnvelope()

The fields that every chat response adds beside data.

A Zod schema, and the type of the same name that it validates.

PromptChatApiEnvelope.api

The api version, e.g. smarter.sh/v1.

Type:

string

PromptChatApiEnvelope.metadata
Type:

object

class PromptChatApiErrorBody()

The error of a chat error response.

A Zod schema, and the type of the same name that it validates.

PromptChatApiErrorBody.description

A human-readable description.

Type:

string

PromptChatApiErrorBody.errorClass

The name of the error’s class, e.g. NotFound or LLMProviderError.

Type:

string

PromptChatApiErrorBody.status

The http status.

Type:

number

class PromptChatApiErrorResponse()

A chat error response.

A Zod schema, and the type of the same name that it validates.

PromptChatApiErrorResponse.api
Type:

string | null | undefined

PromptChatApiErrorResponse.error
Type:

object

PromptChatApiErrorResponse.metadata
Type:

object | null | undefined

class PromptChatApiFilePart()

A file part of a message’s content.

A Zod schema, and the type of the same name that it validates.

PromptChatApiFilePart.file
Type:

object

PromptChatApiFilePart.type
Type:

“file”

class PromptChatApiFileRef()

A file, base64 encoded, or by the provider’s file id.

A Zod schema, and the type of the same name that it validates.

PromptChatApiFileRef.file_data
Type:

string | null | undefined

PromptChatApiFileRef.file_id
Type:

string | null | undefined

PromptChatApiFileRef.filename
Type:

string | null | undefined

class PromptChatApiFunctionCall()

The function that a tool call calls.

A Zod schema, and the type of the same name that it validates.

PromptChatApiFunctionCall.arguments

The function’s arguments, as a JSON string.

Type:

string

PromptChatApiFunctionCall.name
Type:

string

class PromptChatApiFunctionList()

The LLMClient’s built-in functions.

A Zod schema, and the type of the same name that it validates.

PromptChatApiFunctionList.functions
Type:

object[]

PromptChatApiFunctionList.meta_data
Type:

object

class PromptChatApiHistory()

The chat session’s history.

A Zod schema, and the type of the same name that it validates.

PromptChatApiHistory.chat_history

The session’s messages, which restore the chat thread.

Type:

object[]

PromptChatApiHistory.llmclient_request_history
Type:

object[] | null | undefined

PromptChatApiHistory.plugin_selector_history
Type:

object[] | null | undefined

PromptChatApiHistory.prompt_plugin_usage_history
Type:

object[] | null | undefined

PromptChatApiHistory.prompt_tool_call_history
Type:

object[] | null | undefined

class PromptChatApiImagePart()

An image part of a message’s content.

A Zod schema, and the type of the same name that it validates.

PromptChatApiImagePart.image_url
Type:

object

PromptChatApiImagePart.type
Type:

“image_url”

class PromptChatApiImageUrl()

An image, by its url or as a data url.

A Zod schema, and the type of the same name that it validates.

PromptChatApiImageUrl.detail
Type:

string | null | undefined

PromptChatApiImageUrl.url
Type:

string

class PromptChatApiInputAudio()

Audio, base64 encoded.

A Zod schema, and the type of the same name that it validates.

PromptChatApiInputAudio.data
Type:

string

PromptChatApiInputAudio.format
Type:

string

class PromptChatApiJournalMetadata()

The metadata of a chat response.

A Zod schema, and the type of the same name that it validates.

PromptChatApiJournalMetadata.command

The journal’s command, e.g. prompt.

Type:

string | null | undefined

PromptChatApiJournalMetadata.key
Type:

string | null | undefined

PromptChatApiJournalMetadata.thing

The journal’s thing, e.g. LLMClient.

Type:

string | null | undefined

class PromptChatApiListMetaData()

The counts of a list of the LLMClient’s plugins or functions.

A Zod schema, and the type of the same name that it validates.

PromptChatApiListMetaData.functions_returned
Type:

number | null | undefined

PromptChatApiListMetaData.plugins_returned
Type:

number | null | undefined

PromptChatApiListMetaData.total_functions
Type:

number | null | undefined

PromptChatApiListMetaData.total_plugins
Type:

number | null | undefined

class PromptChatApiLLMClient()

The LLMClient, as its configuration describes it.

A Zod schema, and the type of the same name that it validates.

PromptChatApiLLMClient.app_assistant
Type:

string | null | undefined

PromptChatApiLLMClient.app_example_prompts
Type:

string[] | null | undefined

PromptChatApiLLMClient.app_file_attachment
Type:

boolean | null | undefined

PromptChatApiLLMClient.app_info_url
Type:

string | null | undefined

PromptChatApiLLMClient.app_name
Type:

string | null | undefined

PromptChatApiLLMClient.app_placeholder
Type:

string | null | undefined

PromptChatApiLLMClient.app_welcome_message
Type:

string | null | undefined

PromptChatApiLLMClient.default_model
Type:

string | null | undefined

PromptChatApiLLMClient.default_system_role

The system prompt of a new chat session.

Type:

string | null | undefined

PromptChatApiLLMClient.deployed
Type:

boolean | null | undefined

PromptChatApiLLMClient.id
Type:

number

PromptChatApiLLMClient.name
Type:

string

PromptChatApiLLMClient.provider
Type:

string | null | undefined

PromptChatApiLLMClient.styles
Type:

object | null | undefined

PromptChatApiLLMClient.url_llmclient

The url of the LLMClient’s prompt api.

Type:

string | null | undefined

PromptChatApiLLMClient.version
Type:

string | null | undefined

class PromptChatApiLLMClientFunction()

A built-in function of the LLMClient.

A Zod schema, and the type of the same name that it validates.

PromptChatApiLLMClientFunction.created_at
Type:

string | null | undefined

PromptChatApiLLMClientFunction.id
Type:

number

PromptChatApiLLMClientFunction.llmclient
Type:

number

PromptChatApiLLMClientFunction.name

get_current_weather, date_calculator or calculator.

Type:

string | null | undefined

PromptChatApiLLMClientFunction.updated_at
Type:

string | null | undefined

class PromptChatApiLLMClientPlugin()

A plugin of the LLMClient.

A Zod schema, and the type of the same name that it validates.

PromptChatApiLLMClientPlugin.created_at
Type:

string | null | undefined

PromptChatApiLLMClientPlugin.id
Type:

number

PromptChatApiLLMClientPlugin.llmclient
Type:

number

PromptChatApiLLMClientPlugin.plugin_meta
Type:

object

PromptChatApiLLMClientPlugin.updated_at
Type:

string | null | undefined

class PromptChatApiLLMClientRequest()

A request that Smarter sent to the LLM.

A Zod schema, and the type of the same name that it validates.

PromptChatApiLLMClientRequest.created_at
Type:

string | null | undefined

PromptChatApiLLMClientRequest.id
Type:

number

PromptChatApiLLMClientRequest.is_aggregation
Type:

boolean | null | undefined

PromptChatApiLLMClientRequest.llmclient
Type:

number

PromptChatApiLLMClientRequest.request
Type:

object | null | undefined

PromptChatApiLLMClientRequest.session_key
Type:

string | null | undefined

PromptChatApiLLMClientRequest.updated_at
Type:

string | null | undefined

class PromptChatApiMessage()

A message of a chat thread, in the format of the OpenAI api.

Smarter adds its own roles: smarter for informational messages (e.g. the prompt’s configuration, the tools presented to the LLM, and its token charges), and smarter_error. These are saved in the session’s history, and are never sent to the LLM.

A Zod schema, and the type of the same name that it validates.

PromptChatApiMessage.content

The message’s text, or a list of content parts.

Type:

unknown | null | undefined

PromptChatApiMessage.name

The name of a tool message’s function.

Type:

string | null | undefined

PromptChatApiMessage.role

system, assistant, user, tool, smarter or smarter_error.

Type:

string

PromptChatApiMessage.tool_call_id

The tool call that a tool message answers.

Type:

string | null | undefined

PromptChatApiMessage.tool_calls

An assistant message’s tool calls.

Type:

object[] | null | undefined

class PromptChatApiMetaData()

The LLMClient’s state.

A Zod schema, and the type of the same name that it validates.

PromptChatApiMetaData.is_deployed
Type:

boolean | null | undefined

PromptChatApiMetaData.is_valid
Type:

boolean | null | undefined

PromptChatApiMetaData.ready
Type:

boolean | null | undefined

class PromptChatApiOrmModel()

The fields of a Django row that the contract returns.

A Zod schema, and the type of the same name that it validates.

PromptChatApiOrmModel.created_at
Type:

string | null | undefined

PromptChatApiOrmModel.id
Type:

number

PromptChatApiOrmModel.updated_at
Type:

string | null | undefined

class PromptChatApiPluginList()

The LLMClient’s plugins.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPluginList.meta_data
Type:

object

PromptChatApiPluginList.plugins
Type:

object[]

class PromptChatApiPluginMeta()

A plugin’s metadata.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPluginMeta.annotations
Type:

unknown | null | undefined

PromptChatApiPluginMeta.created_at
Type:

string | null | undefined

PromptChatApiPluginMeta.description
Type:

string | null | undefined

PromptChatApiPluginMeta.id
Type:

number

PromptChatApiPluginMeta.name
Type:

string

PromptChatApiPluginMeta.plugin_class

api, skill, sql, static, websearch or imagesearch.

Type:

string

PromptChatApiPluginMeta.tags
Type:

string[]

PromptChatApiPluginMeta.updated_at
Type:

string | null | undefined

PromptChatApiPluginMeta.version
Type:

string | null | undefined

class PromptChatApiPluginSelection()

A plugin selector’s decision in the chat session.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPluginSelection.created_at
Type:

string | null | undefined

PromptChatApiPluginSelection.id
Type:

number

PromptChatApiPluginSelection.messages
Type:

object[] | null | undefined

PromptChatApiPluginSelection.plugin_selector
Type:

number

PromptChatApiPluginSelection.search_term
Type:

string | null | undefined

PromptChatApiPluginSelection.session_key
Type:

string | null | undefined

PromptChatApiPluginSelection.updated_at
Type:

string | null | undefined

class PromptChatApiProgressEvent()

The data of a progress event: a step of a running prompt.

Events may carry more fields, depending on their type, e.g. tool and arguments.

A Zod schema, and the type of the same name that it validates.

PromptChatApiProgressEvent.message

A short sentence, which a chat ui can display as is.

Type:

string

PromptChatApiProgressEvent.type

llm_request, tool_requested, tool_responded, plugin_called, mcp_tool_called, mcp_tool_responded or mcp_tool_failed.

Type:

string

class PromptChatApiProgressResult()

The data of the final result event.

A Zod schema, and the type of the same name that it validates.

PromptChatApiProgressResult.response

Exactly the JSON of a non-streaming response.

Type:

unknown

PromptChatApiProgressResult.status

The prompt’s http status.

Type:

number

class PromptChatApiPromptPluginUsage()

A use of a plugin in the chat session.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPromptPluginUsage.created_at
Type:

string | null | undefined

PromptChatApiPromptPluginUsage.id
Type:

number

PromptChatApiPromptPluginUsage.input_text
Type:

string | null | undefined

PromptChatApiPromptPluginUsage.plugin
Type:

number

PromptChatApiPromptPluginUsage.prompt
Type:

number

PromptChatApiPromptPluginUsage.updated_at
Type:

string | null | undefined

class PromptChatApiPromptRequest()

The prompt api’s request body.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPromptRequest.messages
Type:

object[]

PromptChatApiPromptRequest.session_key
Type:

string | null | undefined

class PromptChatApiPromptResponse()

The prompt api’s response.

A failed prompt has error too, and its data.messages include a smarter_error message. The SDK adds a non-enumerable text getter to the responses that it returns: see promptText.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPromptResponse.api

The api version, e.g. smarter.sh/v1.

Type:

string

PromptChatApiPromptResponse.data
Type:

object

PromptChatApiPromptResponse.error
Type:

object | null | undefined

PromptChatApiPromptResponse.metadata
Type:

object

class PromptChatApiPromptResult()

The result of a prompt.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPromptResult.completion

The LLM’s chat completion.

Type:

object | null | undefined

PromptChatApiPromptResult.contract
Type:

number

PromptChatApiPromptResult.messages

The messages that the prompt added to the chat thread, in order.

Type:

object[]

PromptChatApiPromptResult.plugins

The plugins that Smarter selected.

Type:

string[]

PromptChatApiPromptResult.status

The prompt’s http status: 200, or the LLM provider’s error status.

Type:

number

PromptChatApiPromptResult.tools

The functions that the LLM could call.

Type:

string[]

class PromptChatApiPromptToolCall()

A tool call of the chat session.

A Zod schema, and the type of the same name that it validates.

PromptChatApiPromptToolCall.created_at
Type:

string | null | undefined

PromptChatApiPromptToolCall.function_args
Type:

string | null | undefined

PromptChatApiPromptToolCall.function_name
Type:

string | null | undefined

PromptChatApiPromptToolCall.id
Type:

number

PromptChatApiPromptToolCall.plugin
Type:

number | null | undefined

PromptChatApiPromptToolCall.prompt
Type:

number

PromptChatApiPromptToolCall.request
Type:

JsonValue | null | undefined

PromptChatApiPromptToolCall.response
Type:

JsonValue | null | undefined

PromptChatApiPromptToolCall.updated_at
Type:

string | null | undefined

class PromptChatApiRefusalPart()

The LLM’s refusal, as a part of a message’s content.

A Zod schema, and the type of the same name that it validates.

PromptChatApiRefusalPart.refusal
Type:

string

PromptChatApiRefusalPart.type
Type:

“refusal”

class PromptChatApiStyles()

The LLMClient’s chat ui styles.

A Zod schema, and the type of the same name that it validates.

PromptChatApiStyles.app_background_image_size
Type:

string | null | undefined

PromptChatApiStyles.app_background_image_url
Type:

string | null | undefined

PromptChatApiStyles.app_logo_url
Type:

string | null | undefined

PromptChatApiStyles.assistant_avatar_url
Type:

string | null | undefined

PromptChatApiStyles.border_radius
Type:

string | null | undefined

PromptChatApiStyles.buttons
Type:

object | null | undefined

PromptChatApiStyles.conversation_header
Type:

object | null | undefined

PromptChatApiStyles.font_family
Type:

string | null | undefined

PromptChatApiStyles.font_size
Type:

string | null | undefined

PromptChatApiStyles.google_font
Type:

string | null | undefined

PromptChatApiStyles.incoming_message
Type:

object | null | undefined

PromptChatApiStyles.main_container
Type:

object | null | undefined

PromptChatApiStyles.message_input
Type:

object | null | undefined

PromptChatApiStyles.message_list
Type:

object | null | undefined

PromptChatApiStyles.outgoing_message
Type:

object | null | undefined

PromptChatApiStyles.typing_indicator
Type:

object | null | undefined

PromptChatApiStyles.user_avatar_url
Type:

string | null | undefined

class PromptChatApiStyleSection()

The colors of one section of the chat ui.

A Zod schema, and the type of the same name that it validates.

PromptChatApiStyleSection.background_color
Type:

string | null | undefined

PromptChatApiStyleSection.border_color
Type:

string | null | undefined

PromptChatApiStyleSection.color
Type:

string | null | undefined

PromptChatApiStyleSection.editor_background_color
Type:

string | null | undefined

PromptChatApiStyleSection.info_color
Type:

string | null | undefined

Type:

string | null | undefined

PromptChatApiStyleSection.placeholder_color
Type:

string | null | undefined

class PromptChatApiTextPart()

A text part of a message’s content.

A Zod schema, and the type of the same name that it validates.

PromptChatApiTextPart.text
Type:

string

PromptChatApiTextPart.type
Type:

“text”

class PromptChatApiTokenDetails()

The breakdown of a completion’s tokens.

A Zod schema, and the type of the same name that it validates.

PromptChatApiTokenDetails.audio_tokens
Type:

number | null | undefined

PromptChatApiTokenDetails.cached_tokens
Type:

number | null | undefined

PromptChatApiTokenDetails.reasoning_tokens
Type:

number | null | undefined

class PromptChatApiToolCall()

A tool call of an assistant message.

A Zod schema, and the type of the same name that it validates.

PromptChatApiToolCall.function
Type:

object

PromptChatApiToolCall.id
Type:

string

PromptChatApiToolCall.type
Type:

string

class PromptChatApiUsage()

A chat completion’s token usage.

A Zod schema, and the type of the same name that it validates.

PromptChatApiUsage.completion_tokens
Type:

number | null | undefined

PromptChatApiUsage.completion_tokens_details
Type:

object | null | undefined

PromptChatApiUsage.prompt_tokens
Type:

number | null | undefined

PromptChatApiUsage.prompt_tokens_details
Type:

object | null | undefined

PromptChatApiUsage.total_tokens
Type:

number | null | undefined

class ReactAppAssets()

The ordered JS and CSS files of a React app’s entry point, which a Django template includes.

A Zod schema, and the type of the same name that it validates.

ReactAppAssets.css

The CSS files, the entry point’s first.

Type:

string[]

ReactAppAssets.js

The JS files, the entry point’s first.

Type:

string[]

class ReactAppBuildInfo()

The build information that each React package’s vite.config.ts adds to its manifest.json, as _custom.

A Zod schema, and the type of the same name that it validates.

ReactAppBuildInfo.buildEnv

The build’s NODE_ENV, e.g. production.

Type:

string

ReactAppBuildInfo.buildTime

When the app was built.

Type:

string

ReactAppBuildInfo.version

The version of the app’s npm package.

Type:

string

class SAMJournalApiEnvelope()

The fields that every journaled response adds beside its own data.

A Zod schema, and the type of the same name that it validates.

SAMJournalApiEnvelope.api

The api version, e.g. smarter.sh/v1.

Type:

string

SAMJournalApiEnvelope.metadata
Type:

object | null | undefined

class SAMJournalApiErrorBody()

The error of a journaled error response. Every error of the cli api has this shape.

A Zod schema, and the type of the same name that it validates.

SAMJournalApiErrorBody.args

The exception’s arguments, or the request’s url.

Type:

JsonValue | null | undefined

SAMJournalApiErrorBody.cause

The exception’s cause.

Type:

string | null | undefined

SAMJournalApiErrorBody.command

The journal’s command, e.g. describe.

Type:

string | null | undefined

SAMJournalApiErrorBody.context

The exception’s context, or the response’s thing and command.

Type:

string | null | undefined

SAMJournalApiErrorBody.description

A human-readable description of the error.

Type:

string | null | undefined

SAMJournalApiErrorBody.errorClass

The name of the exception’s class, e.g. SAMBrokerErrorNotFound.

Type:

string

SAMJournalApiErrorBody.stacktrace

The server’s stack trace, when the platform includes it.

Type:

string | null | undefined

SAMJournalApiErrorBody.status

The http status.

Type:

number

SAMJournalApiErrorBody.thing

The journal’s thing, e.g. Guardrail.

Type:

string | null | undefined

class SAMJournalApiErrorResponse()

The body of a journaled error response.

A Zod schema, and the type of the same name that it validates.

SAMJournalApiErrorResponse.api

The api version, e.g. smarter.sh/v1.

Type:

string

SAMJournalApiErrorResponse.error
Type:

object

SAMJournalApiErrorResponse.metadata
Type:

object | null | undefined

class SAMJournalApiMetadata()

The metadata of a journaled response: its command and thing, and the key of its journal entry.

A Zod schema, and the type of the same name that it validates.

SAMJournalApiMetadata.command

The journal’s command, e.g. apply.

Type:

string

SAMJournalApiMetadata.key

The key of the response’s journal entry, when the journal is enabled.

Type:

string | null | undefined

SAMJournalApiMetadata.thing

The journal’s thing, e.g. Guardrail. The string None when there is none.

Type:

string

class SmarterJournalMessage()

A journaled response that carries only a message, e.g. the response of delete or deploy.

A Zod schema, and the type of the same name that it validates.

SmarterJournalMessage.api

The api version, e.g. smarter.sh/v1.

Type:

string

SmarterJournalMessage.message

A human-readable message, e.g. LLMClient calculator applied.

Type:

string | null | undefined

SmarterJournalMessage.metadata
Type:

object | null | undefined

class ViteManifestChunk()

One entry of a Vite-generated manifest.json: a chunk, or a static asset. See https://vite.dev/guide/backend-integration.

A Zod schema, and the type of the same name that it validates.

ViteManifestChunk.assets

The other static files that this chunk references.

Type:

string[]

ViteManifestChunk.css

The CSS files that this chunk loads.

Type:

string[]

ViteManifestChunk.dynamicImports

The manifest keys of dynamically imported chunks.

Type:

string[]

ViteManifestChunk.file

The output file of this chunk, relative to the app’s static directory.

Type:

string

ViteManifestChunk.imports

The manifest keys of statically imported chunks.

Type:

string[]

ViteManifestChunk.isDynamicEntry

Whether this chunk is a dynamic entry point.

Type:

boolean

ViteManifestChunk.isEntry

Whether this chunk is an entry point.

Type:

boolean

ViteManifestChunk.name

The chunk’s name.

Type:

string | null | undefined

ViteManifestChunk.names

The names of a static asset.

Type:

string[]

ViteManifestChunk.src

The chunk’s source path.

Type:

string | null | undefined

PromptResponse

A prompt response, with the text of the LLM’s final reply.

Type:

unknown

ReactAssetType

The kinds of asset that a React app’s entry point loads.

Type:

“js” | “css”