Skip to content
Ona Docs

Agents

CreateAgentExecutionConversationToken
agents.create_execution_conversation_token(AgentCreateExecutionConversationTokenParams**kwargs) -> AgentCreateExecutionConversationTokenResponse
POST/gitpod.v1.AgentService/CreateAgentExecutionConversationToken
CreatePrompt
agents.create_prompt(AgentCreatePromptParams**kwargs) -> AgentCreatePromptResponse
POST/gitpod.v1.AgentService/CreatePrompt
DeleteAgentExecution
agents.delete_execution(AgentDeleteExecutionParams**kwargs) -> object
POST/gitpod.v1.AgentService/DeleteAgentExecution
DeletePrompt
agents.delete_prompt(AgentDeletePromptParams**kwargs) -> object
POST/gitpod.v1.AgentService/DeletePrompt
ListAgentExecutions
agents.list_executions(AgentListExecutionsParams**kwargs) -> SyncAgentExecutionsPage[AgentExecution]
POST/gitpod.v1.AgentService/ListAgentExecutions
ListPrompts
agents.list_prompts(AgentListPromptsParams**kwargs) -> SyncPromptsPage[Prompt]
POST/gitpod.v1.AgentService/ListPrompts
GetAgentExecution
agents.retrieve_execution(AgentRetrieveExecutionParams**kwargs) -> AgentRetrieveExecutionResponse
POST/gitpod.v1.AgentService/GetAgentExecution
GetPrompt
agents.retrieve_prompt(AgentRetrievePromptParams**kwargs) -> AgentRetrievePromptResponse
POST/gitpod.v1.AgentService/GetPrompt
SendToAgentExecution
agents.send_to_execution(AgentSendToExecutionParams**kwargs) -> object
POST/gitpod.v1.AgentService/SendToAgentExecution
StartAgent
agents.start_execution(AgentStartExecutionParams**kwargs) -> AgentStartExecutionResponse
POST/gitpod.v1.AgentService/StartAgent
StopAgentExecution
agents.stop_execution(AgentStopExecutionParams**kwargs) -> object
POST/gitpod.v1.AgentService/StopAgentExecution
UpdatePrompt
agents.update_prompt(AgentUpdatePromptParams**kwargs) -> AgentUpdatePromptResponse
POST/gitpod.v1.AgentService/UpdatePrompt
ModelsExpand Collapse
class AgentCodeContext:
context_url: Optional[ContextURL]
environment_class_id: Optional[str]
formatuuid
url: Optional[str]
formaturi
environment_id: Optional[str]
formatuuid
project_id: Optional[str]
formatuuid
pull_request: Optional[PullRequest]

Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension

id: Optional[str]

Unique identifier from the source system (e.g., “123” for GitHub PR #123)

author: Optional[str]

Author name as provided by the SCM system

draft: Optional[bool]

Whether this is a draft pull request

from_branch: Optional[str]

Source branch name (the branch being merged from)

repository: Optional[PullRequestRepository]

Repository information

clone_url: Optional[str]
host: Optional[str]
name: Optional[str]
owner: Optional[str]
state: Optional[State]

Current state of the pull request

One of the following:
"STATE_UNSPECIFIED"
"STATE_OPEN"
"STATE_CLOSED"
"STATE_MERGED"
title: Optional[str]

Pull request title

to_branch: Optional[str]

Target branch name (the branch being merged into)

url: Optional[str]

Pull request URL (e.g., “https://github.com/owner/repo/pull/123”)

class AgentExecution:
id: Optional[str]

ID is a unique identifier of this agent run. No other agent run with the same name must be managed by this agent manager

metadata: Optional[Metadata]

Metadata is data associated with this agent that’s required for other parts of Gitpod to function

annotations: Optional[Dict[str, str]]

annotations are key-value pairs for tracking external context.

created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]
id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]
name: Optional[str]
role: Optional[Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"]]

role is the role of the agent execution

One of the following:
"AGENT_EXECUTION_ROLE_UNSPECIFIED"
"AGENT_EXECUTION_ROLE_DEFAULT"
"AGENT_EXECUTION_ROLE_WORKFLOW"
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
workflow_action_id: Optional[str]

workflow_action_id is set when this agent execution was created as part of a workflow. Used to correlate agent executions with their parent workflow execution action.

formatuuid
spec: Optional[Spec]

Spec is the configuration of the agent that’s required for the runner to start the agent

agent_id: Optional[str]
formatuuid
code_context: Optional[AgentCodeContext]
context_url: Optional[ContextURL]
environment_class_id: Optional[str]
formatuuid
url: Optional[str]
formaturi
environment_id: Optional[str]
formatuuid
project_id: Optional[str]
formatuuid
pull_request: Optional[PullRequest]

Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension

id: Optional[str]

Unique identifier from the source system (e.g., “123” for GitHub PR #123)

author: Optional[str]

Author name as provided by the SCM system

draft: Optional[bool]

Whether this is a draft pull request

from_branch: Optional[str]

Source branch name (the branch being merged from)

repository: Optional[PullRequestRepository]

Repository information

clone_url: Optional[str]
host: Optional[str]
name: Optional[str]
owner: Optional[str]
state: Optional[State]

Current state of the pull request

One of the following:
"STATE_UNSPECIFIED"
"STATE_OPEN"
"STATE_CLOSED"
"STATE_MERGED"
title: Optional[str]

Pull request title

to_branch: Optional[str]

Target branch name (the branch being merged into)

url: Optional[str]

Pull request URL (e.g., “https://github.com/owner/repo/pull/123”)

desired_phase: Optional[Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", 2 more]]

desired_phase is the desired phase of the agent run

One of the following:
"PHASE_UNSPECIFIED"
"PHASE_PENDING"
"PHASE_RUNNING"
"PHASE_WAITING_FOR_INPUT"
"PHASE_STOPPED"
limits: Optional[SpecLimits]
max_input_tokens: Optional[str]
max_iterations: Optional[str]
max_output_tokens: Optional[str]
loop_conditions: Optional[List[SpecLoopCondition]]
id: Optional[str]
description: Optional[str]
expression: Optional[str]
session: Optional[str]
spec_version: Optional[str]

version of the spec. The value of this field has no semantic meaning (e.g. don’t interpret it as as a timestamp), but it can be used to impose a partial order. If a.spec_version < b.spec_version then a was the spec before b.

status: Optional[Status]

Status is the current status of the agent

cached_creation_tokens_used: Optional[str]
cached_input_tokens_used: Optional[str]
context_window_length: Optional[str]
conversation_url: Optional[str]

conversation_url is the URL to the conversation (all messages exchanged between the agent and the user) of the agent run.

current_activity: Optional[str]

current_activity is the current activity description of the agent execution.

current_operation: Optional[StatusCurrentOperation]

current_operation is the current operation of the agent execution.

llm: Optional[StatusCurrentOperationLlm]
complete: Optional[bool]
retries: Optional[str]

retries is the number of times the agent run has retried one or more steps

session: Optional[str]
tool_use: Optional[StatusCurrentOperationToolUse]
complete: Optional[bool]
tool_name: Optional[str]
minLength1
failure_message: Optional[str]

failure_message contains the reason the agent run failed to operate.

failure_reason: Optional[Literal["AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT", "AGENT_EXECUTION_FAILURE_REASON_SERVICE", 3 more]]

failure_reason contains a structured reason code for the failure.

One of the following:
"AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED"
"AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT"
"AGENT_EXECUTION_FAILURE_REASON_SERVICE"
"AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION"
"AGENT_EXECUTION_FAILURE_REASON_INTERNAL"
"AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION"
input_tokens_used: Optional[str]
iterations: Optional[str]
judgement: Optional[str]

judgement is the judgement of the agent run produced by the judgement prompt.

mcp_integration_statuses: Optional[List[StatusMcpIntegrationStatus]]

mcp_integration_statuses contains the status of all MCP integrations used by this agent execution

id: Optional[str]

id is the unique name of the MCP integration

failure_message: Optional[str]

failure_message contains the reason the MCP integration failed to connect or operate

name: Optional[str]

name is the unique name of the MCP integration (e.g., “linear”, “notion”)

phase: Optional[Literal["MCP_INTEGRATION_PHASE_UNSPECIFIED", "MCP_INTEGRATION_PHASE_INITIALIZING", "MCP_INTEGRATION_PHASE_READY", 2 more]]

phase is the current connection/health phase

One of the following:
"MCP_INTEGRATION_PHASE_UNSPECIFIED"
"MCP_INTEGRATION_PHASE_INITIALIZING"
"MCP_INTEGRATION_PHASE_READY"
"MCP_INTEGRATION_PHASE_FAILED"
"MCP_INTEGRATION_PHASE_UNAVAILABLE"
warning_message: Optional[str]

warning_message contains warnings (e.g., rate limiting, degraded performance)

mode: Optional[AgentMode]

mode is the current operational mode of the agent execution. This is set by the agent when entering different modes (e.g., Ralph mode via /ona:ralph command).

One of the following:
"AGENT_MODE_UNSPECIFIED"
"AGENT_MODE_EXECUTION"
"AGENT_MODE_PLANNING"
"AGENT_MODE_RALPH"
"AGENT_MODE_SPEC"
outputs: Optional[Dict[str, StatusOutputs]]

outputs is a map of key-value pairs that can be set by the agent during execution. Similar to task execution outputs, but with typed values for structured data.

bool_value: Optional[bool]
float_value: Optional[float]
formatdouble
int_value: Optional[str]
string_value: Optional[str]
maxLength4096
output_tokens_used: Optional[str]
phase: Optional[Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", 2 more]]
One of the following:
"PHASE_UNSPECIFIED"
"PHASE_PENDING"
"PHASE_RUNNING"
"PHASE_WAITING_FOR_INPUT"
"PHASE_STOPPED"
session: Optional[str]
status_version: Optional[str]

version of the status. The value of this field has no semantic meaning (e.g. don’t interpret it as as a timestamp), but it can be used to impose a partial order. If a.status_version < b.status_version then a was the status before b.

supported_model: Optional[Literal["SUPPORTED_MODEL_UNSPECIFIED", "SUPPORTED_MODEL_SONNET_3_5", "SUPPORTED_MODEL_SONNET_3_7", 18 more]]

supported_model is the LLM model being used by the agent execution.

One of the following:
"SUPPORTED_MODEL_UNSPECIFIED"
"SUPPORTED_MODEL_SONNET_3_5"
"SUPPORTED_MODEL_SONNET_3_7"
"SUPPORTED_MODEL_SONNET_3_7_EXTENDED"
"SUPPORTED_MODEL_SONNET_4"
"SUPPORTED_MODEL_SONNET_4_EXTENDED"
"SUPPORTED_MODEL_SONNET_4_5"
"SUPPORTED_MODEL_SONNET_4_5_EXTENDED"
"SUPPORTED_MODEL_SONNET_4_6"
"SUPPORTED_MODEL_SONNET_4_6_EXTENDED"
"SUPPORTED_MODEL_OPUS_4"
"SUPPORTED_MODEL_OPUS_4_EXTENDED"
"SUPPORTED_MODEL_OPUS_4_5"
"SUPPORTED_MODEL_OPUS_4_5_EXTENDED"
"SUPPORTED_MODEL_OPUS_4_6"
"SUPPORTED_MODEL_OPUS_4_6_EXTENDED"
"SUPPORTED_MODEL_HAIKU_4_5"
"SUPPORTED_MODEL_OPENAI_4O"
"SUPPORTED_MODEL_OPENAI_4O_MINI"
"SUPPORTED_MODEL_OPENAI_O1"
"SUPPORTED_MODEL_OPENAI_O1_MINI"
transcript_url: Optional[str]

transcript_url is the URL to the LLM transcript (all messages exchanged between the agent and the LLM) of the agent run.

used_environments: Optional[List[StatusUsedEnvironment]]

used_environments is the list of environments that were used by the agent execution.

created_by_agent: Optional[bool]
environment_id: Optional[str]
formatuuid
warning_message: Optional[str]

warning_message contains warnings, e.g. when the LLM is overloaded.

class AgentMessage:

AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa).

payload: Optional[str]

Free-form payload of the message.

type: Optional[Type]
One of the following:
"TYPE_UNSPECIFIED"
"TYPE_UPDATE"
"TYPE_COMPLETE"
Literal["AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING", 2 more]

AgentMode defines the operational mode of an agent

One of the following:
"AGENT_MODE_UNSPECIFIED"
"AGENT_MODE_EXECUTION"
"AGENT_MODE_PLANNING"
"AGENT_MODE_RALPH"
"AGENT_MODE_SPEC"
class Prompt:
id: Optional[str]
metadata: Optional[PromptMetadata]
created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]

creator is the identity of the prompt creator

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]

description is a description of what the prompt does

name: Optional[str]

name is the human readable name of the prompt

organization_id: Optional[str]

organization_id is the ID of the organization that contains the prompt

formatuuid
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
spec: Optional[PromptSpec]
command: Optional[str]

command is the unique command string within the organization

maxLength50
is_command: Optional[bool]

is_command indicates if this prompt is a command

is_skill: Optional[bool]

is_skill indicates if this prompt is a skill (workflow instructions for agents)

is_template: Optional[bool]

is_template indicates if this prompt is a template

prompt: Optional[str]

prompt is the content of the prompt

maxLength20000
class PromptMetadata:
created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]

creator is the identity of the prompt creator

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]

description is a description of what the prompt does

name: Optional[str]

name is the human readable name of the prompt

organization_id: Optional[str]

organization_id is the ID of the organization that contains the prompt

formatuuid
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
class PromptSpec:
command: Optional[str]

command is the unique command string within the organization

maxLength50
is_command: Optional[bool]

is_command indicates if this prompt is a command

is_skill: Optional[bool]

is_skill indicates if this prompt is a skill (workflow instructions for agents)

is_template: Optional[bool]

is_template indicates if this prompt is a template

prompt: Optional[str]

prompt is the content of the prompt

maxLength20000
Literal["ROLE_UNSPECIFIED", "ROLE_PARENT", "ROLE_CHILD"]

Role identifies the sender’s relationship in the parent/child hierarchy.

One of the following:
"ROLE_UNSPECIFIED"
"ROLE_PARENT"
"ROLE_CHILD"
Literal["TYPE_UNSPECIFIED", "TYPE_UPDATE", "TYPE_COMPLETE"]
One of the following:
"TYPE_UNSPECIFIED"
"TYPE_UPDATE"
"TYPE_COMPLETE"
class UserInputBlock:
id: Optional[str]
created_at: Optional[datetime]

Timestamp when this block was created. Used for debugging and support bundles.

formatdate-time
Deprecatedimage: Optional[Image]

ImageInput allows sending images to the agent. Client must provide the MIME type; backend validates against magic bytes.

data: Optional[str]

Raw image data (max 4MB). Supported formats: PNG, JPEG.

formatbyte
maxLength4194304
minLength1
mime_type: Optional[Literal["image/png", "image/jpeg"]]
One of the following:
"image/png"
"image/jpeg"
inputs: Optional[List[Input]]
image: Optional[InputImage]

ImageInput allows sending images to the agent. Client must provide the MIME type; backend validates against magic bytes.

data: Optional[str]

Raw image data (max 4MB). Supported formats: PNG, JPEG.

formatbyte
maxLength4194304
minLength1
mime_type: Optional[Literal["image/png", "image/jpeg"]]
One of the following:
"image/png"
"image/jpeg"
text: Optional[InputText]
content: Optional[str]
minLength1
Deprecatedtext: Optional[Text]
content: Optional[str]
minLength1
class WakeEvent:

WakeEvent is sent by the backend to wake an agent when a registered interest fires. Delivered via SendToAgentExecution as a new oneof variant.

environment: Optional[Environment]
environment_id: Optional[str]
failure_message: Optional[List[str]]
phase: Optional[str]

The phase the environment reached (e.g. “running”, “stopped”, “deleted”).

interest_id: Optional[str]

The interest ID that fired (from WaitingInfo.Interest.id).

loop_retrigger: Optional[LoopRetrigger]
outputs: Optional[Dict[str, str]]
unmet_conditions: Optional[List[LoopRetriggerUnmetCondition]]
id: Optional[str]
description: Optional[str]
expression: Optional[str]
iteration: Optional[int]
formatint32
max_iterations: Optional[int]
formatint32
reason: Optional[str]
timer: Optional[Timer]
fired_at: Optional[datetime]

The actual time the timer was evaluated as expired.

formatdate-time
class AgentCreateExecutionConversationTokenResponse:
token: Optional[str]
class AgentCreatePromptResponse:
prompt: Optional[Prompt]
id: Optional[str]
metadata: Optional[PromptMetadata]
created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]

creator is the identity of the prompt creator

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]

description is a description of what the prompt does

name: Optional[str]

name is the human readable name of the prompt

organization_id: Optional[str]

organization_id is the ID of the organization that contains the prompt

formatuuid
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
spec: Optional[PromptSpec]
command: Optional[str]

command is the unique command string within the organization

maxLength50
is_command: Optional[bool]

is_command indicates if this prompt is a command

is_skill: Optional[bool]

is_skill indicates if this prompt is a skill (workflow instructions for agents)

is_template: Optional[bool]

is_template indicates if this prompt is a template

prompt: Optional[str]

prompt is the content of the prompt

maxLength20000
class AgentRetrieveExecutionResponse:
agent_execution: Optional[AgentExecution]
id: Optional[str]

ID is a unique identifier of this agent run. No other agent run with the same name must be managed by this agent manager

metadata: Optional[Metadata]

Metadata is data associated with this agent that’s required for other parts of Gitpod to function

annotations: Optional[Dict[str, str]]

annotations are key-value pairs for tracking external context.

created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]
id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]
name: Optional[str]
role: Optional[Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"]]

role is the role of the agent execution

One of the following:
"AGENT_EXECUTION_ROLE_UNSPECIFIED"
"AGENT_EXECUTION_ROLE_DEFAULT"
"AGENT_EXECUTION_ROLE_WORKFLOW"
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
workflow_action_id: Optional[str]

workflow_action_id is set when this agent execution was created as part of a workflow. Used to correlate agent executions with their parent workflow execution action.

formatuuid
spec: Optional[Spec]

Spec is the configuration of the agent that’s required for the runner to start the agent

agent_id: Optional[str]
formatuuid
code_context: Optional[AgentCodeContext]
context_url: Optional[ContextURL]
environment_class_id: Optional[str]
formatuuid
url: Optional[str]
formaturi
environment_id: Optional[str]
formatuuid
project_id: Optional[str]
formatuuid
pull_request: Optional[PullRequest]

Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension

id: Optional[str]

Unique identifier from the source system (e.g., “123” for GitHub PR #123)

author: Optional[str]

Author name as provided by the SCM system

draft: Optional[bool]

Whether this is a draft pull request

from_branch: Optional[str]

Source branch name (the branch being merged from)

repository: Optional[PullRequestRepository]

Repository information

clone_url: Optional[str]
host: Optional[str]
name: Optional[str]
owner: Optional[str]
state: Optional[State]

Current state of the pull request

One of the following:
"STATE_UNSPECIFIED"
"STATE_OPEN"
"STATE_CLOSED"
"STATE_MERGED"
title: Optional[str]

Pull request title

to_branch: Optional[str]

Target branch name (the branch being merged into)

url: Optional[str]

Pull request URL (e.g., “https://github.com/owner/repo/pull/123”)

desired_phase: Optional[Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", 2 more]]

desired_phase is the desired phase of the agent run

One of the following:
"PHASE_UNSPECIFIED"
"PHASE_PENDING"
"PHASE_RUNNING"
"PHASE_WAITING_FOR_INPUT"
"PHASE_STOPPED"
limits: Optional[SpecLimits]
max_input_tokens: Optional[str]
max_iterations: Optional[str]
max_output_tokens: Optional[str]
loop_conditions: Optional[List[SpecLoopCondition]]
id: Optional[str]
description: Optional[str]
expression: Optional[str]
session: Optional[str]
spec_version: Optional[str]

version of the spec. The value of this field has no semantic meaning (e.g. don’t interpret it as as a timestamp), but it can be used to impose a partial order. If a.spec_version < b.spec_version then a was the spec before b.

status: Optional[Status]

Status is the current status of the agent

cached_creation_tokens_used: Optional[str]
cached_input_tokens_used: Optional[str]
context_window_length: Optional[str]
conversation_url: Optional[str]

conversation_url is the URL to the conversation (all messages exchanged between the agent and the user) of the agent run.

current_activity: Optional[str]

current_activity is the current activity description of the agent execution.

current_operation: Optional[StatusCurrentOperation]

current_operation is the current operation of the agent execution.

llm: Optional[StatusCurrentOperationLlm]
complete: Optional[bool]
retries: Optional[str]

retries is the number of times the agent run has retried one or more steps

session: Optional[str]
tool_use: Optional[StatusCurrentOperationToolUse]
complete: Optional[bool]
tool_name: Optional[str]
minLength1
failure_message: Optional[str]

failure_message contains the reason the agent run failed to operate.

failure_reason: Optional[Literal["AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT", "AGENT_EXECUTION_FAILURE_REASON_SERVICE", 3 more]]

failure_reason contains a structured reason code for the failure.

One of the following:
"AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED"
"AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT"
"AGENT_EXECUTION_FAILURE_REASON_SERVICE"
"AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION"
"AGENT_EXECUTION_FAILURE_REASON_INTERNAL"
"AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION"
input_tokens_used: Optional[str]
iterations: Optional[str]
judgement: Optional[str]

judgement is the judgement of the agent run produced by the judgement prompt.

mcp_integration_statuses: Optional[List[StatusMcpIntegrationStatus]]

mcp_integration_statuses contains the status of all MCP integrations used by this agent execution

id: Optional[str]

id is the unique name of the MCP integration

failure_message: Optional[str]

failure_message contains the reason the MCP integration failed to connect or operate

name: Optional[str]

name is the unique name of the MCP integration (e.g., “linear”, “notion”)

phase: Optional[Literal["MCP_INTEGRATION_PHASE_UNSPECIFIED", "MCP_INTEGRATION_PHASE_INITIALIZING", "MCP_INTEGRATION_PHASE_READY", 2 more]]

phase is the current connection/health phase

One of the following:
"MCP_INTEGRATION_PHASE_UNSPECIFIED"
"MCP_INTEGRATION_PHASE_INITIALIZING"
"MCP_INTEGRATION_PHASE_READY"
"MCP_INTEGRATION_PHASE_FAILED"
"MCP_INTEGRATION_PHASE_UNAVAILABLE"
warning_message: Optional[str]

warning_message contains warnings (e.g., rate limiting, degraded performance)

mode: Optional[AgentMode]

mode is the current operational mode of the agent execution. This is set by the agent when entering different modes (e.g., Ralph mode via /ona:ralph command).

One of the following:
"AGENT_MODE_UNSPECIFIED"
"AGENT_MODE_EXECUTION"
"AGENT_MODE_PLANNING"
"AGENT_MODE_RALPH"
"AGENT_MODE_SPEC"
outputs: Optional[Dict[str, StatusOutputs]]

outputs is a map of key-value pairs that can be set by the agent during execution. Similar to task execution outputs, but with typed values for structured data.

bool_value: Optional[bool]
float_value: Optional[float]
formatdouble
int_value: Optional[str]
string_value: Optional[str]
maxLength4096
output_tokens_used: Optional[str]
phase: Optional[Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", 2 more]]
One of the following:
"PHASE_UNSPECIFIED"
"PHASE_PENDING"
"PHASE_RUNNING"
"PHASE_WAITING_FOR_INPUT"
"PHASE_STOPPED"
session: Optional[str]
status_version: Optional[str]

version of the status. The value of this field has no semantic meaning (e.g. don’t interpret it as as a timestamp), but it can be used to impose a partial order. If a.status_version < b.status_version then a was the status before b.

supported_model: Optional[Literal["SUPPORTED_MODEL_UNSPECIFIED", "SUPPORTED_MODEL_SONNET_3_5", "SUPPORTED_MODEL_SONNET_3_7", 18 more]]

supported_model is the LLM model being used by the agent execution.

One of the following:
"SUPPORTED_MODEL_UNSPECIFIED"
"SUPPORTED_MODEL_SONNET_3_5"
"SUPPORTED_MODEL_SONNET_3_7"
"SUPPORTED_MODEL_SONNET_3_7_EXTENDED"
"SUPPORTED_MODEL_SONNET_4"
"SUPPORTED_MODEL_SONNET_4_EXTENDED"
"SUPPORTED_MODEL_SONNET_4_5"
"SUPPORTED_MODEL_SONNET_4_5_EXTENDED"
"SUPPORTED_MODEL_SONNET_4_6"
"SUPPORTED_MODEL_SONNET_4_6_EXTENDED"
"SUPPORTED_MODEL_OPUS_4"
"SUPPORTED_MODEL_OPUS_4_EXTENDED"
"SUPPORTED_MODEL_OPUS_4_5"
"SUPPORTED_MODEL_OPUS_4_5_EXTENDED"
"SUPPORTED_MODEL_OPUS_4_6"
"SUPPORTED_MODEL_OPUS_4_6_EXTENDED"
"SUPPORTED_MODEL_HAIKU_4_5"
"SUPPORTED_MODEL_OPENAI_4O"
"SUPPORTED_MODEL_OPENAI_4O_MINI"
"SUPPORTED_MODEL_OPENAI_O1"
"SUPPORTED_MODEL_OPENAI_O1_MINI"
transcript_url: Optional[str]

transcript_url is the URL to the LLM transcript (all messages exchanged between the agent and the LLM) of the agent run.

used_environments: Optional[List[StatusUsedEnvironment]]

used_environments is the list of environments that were used by the agent execution.

created_by_agent: Optional[bool]
environment_id: Optional[str]
formatuuid
warning_message: Optional[str]

warning_message contains warnings, e.g. when the LLM is overloaded.

class AgentRetrievePromptResponse:
prompt: Optional[Prompt]
id: Optional[str]
metadata: Optional[PromptMetadata]
created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]

creator is the identity of the prompt creator

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]

description is a description of what the prompt does

name: Optional[str]

name is the human readable name of the prompt

organization_id: Optional[str]

organization_id is the ID of the organization that contains the prompt

formatuuid
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
spec: Optional[PromptSpec]
command: Optional[str]

command is the unique command string within the organization

maxLength50
is_command: Optional[bool]

is_command indicates if this prompt is a command

is_skill: Optional[bool]

is_skill indicates if this prompt is a skill (workflow instructions for agents)

is_template: Optional[bool]

is_template indicates if this prompt is a template

prompt: Optional[str]

prompt is the content of the prompt

maxLength20000
class AgentStartExecutionResponse:
agent_execution_id: Optional[str]
formatuuid
class AgentUpdatePromptResponse:
prompt: Optional[Prompt]
id: Optional[str]
metadata: Optional[PromptMetadata]
created_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
creator: Optional[Subject]

creator is the identity of the prompt creator

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"
description: Optional[str]

description is a description of what the prompt does

name: Optional[str]

name is the human readable name of the prompt

organization_id: Optional[str]

organization_id is the ID of the organization that contains the prompt

formatuuid
updated_at: Optional[datetime]

A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.

The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.

Examples

Example 1: Compute Timestamp from POSIX time().

 Timestamp timestamp;
 timestamp.set_seconds(time(NULL));
 timestamp.set_nanos(0);

Example 2: Compute Timestamp from POSIX gettimeofday().

 struct timeval tv;
 gettimeofday(&tv, NULL);

 Timestamp timestamp;
 timestamp.set_seconds(tv.tv_sec);
 timestamp.set_nanos(tv.tv_usec * 1000);

Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().

 FILETIME ft;
 GetSystemTimeAsFileTime(&ft);
 UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

 // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
 // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
 Timestamp timestamp;
 timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
 timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

Example 4: Compute Timestamp from Java System.currentTimeMillis().

 long millis = System.currentTimeMillis();

 Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
     .setNanos((int) ((millis % 1000) * 1000000)).build();

Example 5: Compute Timestamp from Java Instant.now().

 Instant now = Instant.now();

 Timestamp timestamp =
     Timestamp.newBuilder().setSeconds(now.getEpochSecond())
         .setNanos(now.getNano()).build();

Example 6: Compute Timestamp from current time in Python.

 timestamp = Timestamp()
 timestamp.GetCurrentTime()

JSON Mapping

In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).

For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.

In JavaScript, one can convert a Date object to this format using the standard toISOString() method. In Python, a standard datetime.datetime object can be converted to this format using strftime with the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.

formatdate-time
spec: Optional[PromptSpec]
command: Optional[str]

command is the unique command string within the organization

maxLength50
is_command: Optional[bool]

is_command indicates if this prompt is a command

is_skill: Optional[bool]

is_skill indicates if this prompt is a skill (workflow instructions for agents)

is_template: Optional[bool]

is_template indicates if this prompt is a template

prompt: Optional[str]

prompt is the content of the prompt

maxLength20000