# Agents ## CreateAgentExecutionConversationToken `client.Agents.NewExecutionConversationToken(ctx, body) (*AgentNewExecutionConversationTokenResponse, error)` **post** `/gitpod.v1.AgentService/CreateAgentExecutionConversationToken` Creates a token for conversation access with a specific agent run. This method generates a temporary token that can be used to securely connect to an ongoing agent conversation, for example in a web UI. ### Examples - Create a token to join an agent run conversation in a front-end application: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" ``` ### Parameters - `body AgentNewExecutionConversationTokenParams` - `AgentExecutionID param.Field[string]` ### Returns - `type AgentNewExecutionConversationTokenResponse struct{…}` - `Token string` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.NewExecutionConversationToken(context.TODO(), gitpod.AgentNewExecutionConversationTokenParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Token) } ``` #### Response ```json { "token": "token" } ``` ## CreatePrompt `client.Agents.NewPrompt(ctx, body) (*AgentNewPromptResponse, error)` **post** `/gitpod.v1.AgentService/CreatePrompt` Creates a new prompt. Use this method to: - Define new prompts for templates or commands - Set up organization-wide prompt libraries ### Parameters - `body AgentNewPromptParams` - `Command param.Field[string]` - `Description param.Field[string]` - `IsCommand param.Field[bool]` - `IsSkill param.Field[bool]` - `IsTemplate param.Field[bool]` - `Name param.Field[string]` - `Prompt param.Field[string]` ### Returns - `type AgentNewPromptResponse struct{…}` - `Prompt Prompt` - `ID string` - `Metadata PromptMetadata` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec PromptSpec` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.NewPrompt(context.TODO(), gitpod.AgentNewPromptParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Prompt) } ``` #### Response ```json { "prompt": { "id": "id", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "command": "command", "isCommand": true, "isSkill": true, "isTemplate": true, "prompt": "prompt" } } } ``` ## DeleteAgentExecution `client.Agents.DeleteExecution(ctx, body) (*AgentDeleteExecutionResponse, error)` **post** `/gitpod.v1.AgentService/DeleteAgentExecution` Deletes an agent run. Use this method to: - Clean up agent runs that are no longer needed ### Examples - Delete an agent run by ID: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" ``` ### Parameters - `body AgentDeleteExecutionParams` - `AgentExecutionID param.Field[string]` ### Returns - `type AgentDeleteExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.DeleteExecution(context.TODO(), gitpod.AgentDeleteExecutionParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## DeletePrompt `client.Agents.DeletePrompt(ctx, body) (*AgentDeletePromptResponse, error)` **post** `/gitpod.v1.AgentService/DeletePrompt` Deletes a prompt. Use this method to: - Remove unused prompts ### Parameters - `body AgentDeletePromptParams` - `PromptID param.Field[string]` ### Returns - `type AgentDeletePromptResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.DeletePrompt(context.TODO(), gitpod.AgentDeletePromptParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## ListAgentExecutions `client.Agents.ListExecutions(ctx, params) (*AgentExecutionsPage[AgentExecution], error)` **post** `/gitpod.v1.AgentService/ListAgentExecutions` Lists all agent runs matching the specified filter. Use this method to track multiple agent runs and their associated resources. Results are ordered by their creation time with the newest first. ### Examples - List agent runs by agent ID: ```yaml filter: agentIds: ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"] pagination: pageSize: 10 ``` ### Parameters - `params AgentListExecutionsParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AgentListExecutionsParamsFilter]` Body param - `AgentIDs []string` - `Annotations map[string, string]` annotations filters by key-value pairs. Only executions containing all specified annotations (with matching values) are returned. - `CreatorIDs []string` - `EnvironmentIDs []string` - `ProjectIDs []string` - `Roles []AgentListExecutionsParamsFilterRole` - `const AgentListExecutionsParamsFilterRoleAgentExecutionRoleUnspecified AgentListExecutionsParamsFilterRole = "AGENT_EXECUTION_ROLE_UNSPECIFIED"` - `const AgentListExecutionsParamsFilterRoleAgentExecutionRoleDefault AgentListExecutionsParamsFilterRole = "AGENT_EXECUTION_ROLE_DEFAULT"` - `const AgentListExecutionsParamsFilterRoleAgentExecutionRoleWorkflow AgentListExecutionsParamsFilterRole = "AGENT_EXECUTION_ROLE_WORKFLOW"` - `SessionIDs []string` session_ids filters the response to only executions belonging to the specified sessions - `StatusPhases []AgentListExecutionsParamsFilterStatusPhase` - `const AgentListExecutionsParamsFilterStatusPhasePhaseUnspecified AgentListExecutionsParamsFilterStatusPhase = "PHASE_UNSPECIFIED"` - `const AgentListExecutionsParamsFilterStatusPhasePhasePending AgentListExecutionsParamsFilterStatusPhase = "PHASE_PENDING"` - `const AgentListExecutionsParamsFilterStatusPhasePhaseRunning AgentListExecutionsParamsFilterStatusPhase = "PHASE_RUNNING"` - `const AgentListExecutionsParamsFilterStatusPhasePhaseWaitingForInput AgentListExecutionsParamsFilterStatusPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentListExecutionsParamsFilterStatusPhasePhaseStopped AgentListExecutionsParamsFilterStatusPhase = "PHASE_STOPPED"` - `Pagination param.Field[AgentListExecutionsParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type AgentExecution struct{…}` - `ID string` 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 AgentExecutionMetadata` Metadata is data associated with this agent that's required for other parts of Gitpod to function - `Annotations map[string, string]` annotations are key-value pairs for tracking external context. - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Name string` - `Role AgentExecutionMetadataRole` role is the role of the agent execution - `const AgentExecutionMetadataRoleAgentExecutionRoleUnspecified AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_UNSPECIFIED"` - `const AgentExecutionMetadataRoleAgentExecutionRoleDefault AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_DEFAULT"` - `const AgentExecutionMetadataRoleAgentExecutionRoleWorkflow AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_WORKFLOW"` - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowActionID string` 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. - `Spec AgentExecutionSpec` Spec is the configuration of the agent that's required for the runner to start the agent - `AgentID string` - `CodeContext AgentCodeContext` - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` 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 string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `DesiredPhase AgentExecutionSpecDesiredPhase` desired_phase is the desired phase of the agent run - `const AgentExecutionSpecDesiredPhasePhaseUnspecified AgentExecutionSpecDesiredPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionSpecDesiredPhasePhasePending AgentExecutionSpecDesiredPhase = "PHASE_PENDING"` - `const AgentExecutionSpecDesiredPhasePhaseRunning AgentExecutionSpecDesiredPhase = "PHASE_RUNNING"` - `const AgentExecutionSpecDesiredPhasePhaseWaitingForInput AgentExecutionSpecDesiredPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionSpecDesiredPhasePhaseStopped AgentExecutionSpecDesiredPhase = "PHASE_STOPPED"` - `Limits AgentExecutionSpecLimits` - `MaxInputTokens string` - `MaxIterations string` - `MaxOutputTokens string` - `LoopConditions []AgentExecutionSpecLoopCondition` - `ID string` - `Description string` - `Expression string` - `Session string` - `SpecVersion string` 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 AgentExecutionStatus` Status is the current status of the agent - `CachedCreationTokensUsed string` - `CachedInputTokensUsed string` - `ContextWindowLength string` - `ConversationURL string` conversation_url is the URL to the conversation (all messages exchanged between the agent and the user) of the agent run. - `CurrentActivity string` current_activity is the current activity description of the agent execution. - `CurrentOperation AgentExecutionStatusCurrentOperation` current_operation is the current operation of the agent execution. - `Llm AgentExecutionStatusCurrentOperationLlm` - `Complete bool` - `Retries string` retries is the number of times the agent run has retried one or more steps - `Session string` - `ToolUse AgentExecutionStatusCurrentOperationToolUse` - `Complete bool` - `ToolName string` - `FailureMessage string` failure_message contains the reason the agent run failed to operate. - `FailureReason AgentExecutionStatusFailureReason` failure_reason contains a structured reason code for the failure. - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonUnspecified AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonEnvironment AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonService AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_SERVICE"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonLlmIntegration AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonInternal AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_INTERNAL"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonAgentExecution AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION"` - `InputTokensUsed string` - `Iterations string` - `Judgement string` judgement is the judgement of the agent run produced by the judgement prompt. - `McpIntegrationStatuses []AgentExecutionStatusMcpIntegrationStatus` mcp_integration_statuses contains the status of all MCP integrations used by this agent execution - `ID string` id is the unique name of the MCP integration - `FailureMessage string` failure_message contains the reason the MCP integration failed to connect or operate - `Name string` name is the unique name of the MCP integration (e.g., "linear", "notion") - `Phase AgentExecutionStatusMcpIntegrationStatusesPhase` phase is the current connection/health phase - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnspecified AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNSPECIFIED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseInitializing AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_INITIALIZING"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseReady AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_READY"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseFailed AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_FAILED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnavailable AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNAVAILABLE"` - `WarningMessage string` warning_message contains warnings (e.g., rate limiting, degraded performance) - `Mode 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). - `const AgentModeUnspecified AgentMode = "AGENT_MODE_UNSPECIFIED"` - `const AgentModeExecution AgentMode = "AGENT_MODE_EXECUTION"` - `const AgentModePlanning AgentMode = "AGENT_MODE_PLANNING"` - `const AgentModeRalph AgentMode = "AGENT_MODE_RALPH"` - `const AgentModeSpec AgentMode = "AGENT_MODE_SPEC"` - `Outputs map[string, AgentExecutionStatusOutput]` 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. - `BoolValue bool` - `FloatValue float64` - `IntValue string` - `StringValue string` - `OutputTokensUsed string` - `Phase AgentExecutionStatusPhase` - `const AgentExecutionStatusPhasePhaseUnspecified AgentExecutionStatusPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionStatusPhasePhasePending AgentExecutionStatusPhase = "PHASE_PENDING"` - `const AgentExecutionStatusPhasePhaseRunning AgentExecutionStatusPhase = "PHASE_RUNNING"` - `const AgentExecutionStatusPhasePhaseWaitingForInput AgentExecutionStatusPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionStatusPhasePhaseStopped AgentExecutionStatusPhase = "PHASE_STOPPED"` - `Session string` - `StatusVersion string` 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. - `SupportedModel AgentExecutionStatusSupportedModel` supported_model is the LLM model being used by the agent execution. - `const AgentExecutionStatusSupportedModelSupportedModelUnspecified AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_UNSPECIFIED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelHaiku4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_HAIKU_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4O AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O_MINI"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1Mini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1_MINI"` - `TranscriptURL string` transcript_url is the URL to the LLM transcript (all messages exchanged between the agent and the LLM) of the agent run. - `UsedEnvironments []AgentExecutionStatusUsedEnvironment` used_environments is the list of environments that were used by the agent execution. - `CreatedByAgent bool` - `EnvironmentID string` - `WarningMessage string` warning_message contains warnings, e.g. when the LLM is overloaded. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Agents.ListExecutions(context.TODO(), gitpod.AgentListExecutionsParams{ Filter: gitpod.F(gitpod.AgentListExecutionsParamsFilter{ AgentIDs: gitpod.F([]string{"b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"}), }), Pagination: gitpod.F(gitpod.AgentListExecutionsParamsPagination{ PageSize: gitpod.F(int64(10)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "agentExecutions": [ { "id": "id", "metadata": { "annotations": { "foo": "string" }, "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "role": "AGENT_EXECUTION_ROLE_UNSPECIFIED", "sessionId": "sessionId", "updatedAt": "2019-12-27T18:11:19.117Z", "workflowActionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "agentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "codeContext": { "contextUrl": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com" }, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" } }, "desiredPhase": "PHASE_UNSPECIFIED", "limits": { "maxInputTokens": "maxInputTokens", "maxIterations": "maxIterations", "maxOutputTokens": "maxOutputTokens" }, "loopConditions": [ { "id": "id", "description": "description", "expression": "expression" } ], "session": "session", "specVersion": "specVersion" }, "status": { "cachedCreationTokensUsed": "cachedCreationTokensUsed", "cachedInputTokensUsed": "cachedInputTokensUsed", "contextWindowLength": "contextWindowLength", "conversationUrl": "conversationUrl", "currentActivity": "currentActivity", "currentOperation": { "llm": { "complete": true }, "retries": "retries", "session": "session", "toolUse": { "complete": true, "toolName": "x" } }, "failureMessage": "failureMessage", "failureReason": "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", "inputTokensUsed": "inputTokensUsed", "iterations": "iterations", "judgement": "judgement", "loopConditionResults": [ { "conditionId": "conditionId", "iteration": 0, "lastEvaluatedAt": "2019-12-27T18:11:19.117Z", "met": true } ], "mcpIntegrationStatuses": [ { "id": "id", "failureMessage": "failureMessage", "name": "name", "phase": "MCP_INTEGRATION_PHASE_UNSPECIFIED", "warningMessage": "warningMessage" } ], "mode": "AGENT_MODE_UNSPECIFIED", "outputs": { "foo": { "boolValue": true, "floatValue": 0, "intValue": "intValue", "stringValue": "stringValue" } }, "outputTokensUsed": "outputTokensUsed", "phase": "PHASE_UNSPECIFIED", "session": "session", "statusVersion": "statusVersion", "supportBundleUrl": "supportBundleUrl", "supportedModel": "SUPPORTED_MODEL_UNSPECIFIED", "terminalId": "terminalId", "transcriptUrl": "transcriptUrl", "usedEnvironments": [ { "createdByAgent": true, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "waitingInfo": { "interests": [ { "id": "id", "environment": { "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "phase": "" }, "subAgent": { "executionId": "executionId" }, "timer": { "cron": "cron", "duration": "duration", "firesAt": "2019-12-27T18:11:19.117Z" }, "userMessage": {} } ], "waitId": "waitId", "waitingSince": "2019-12-27T18:11:19.117Z" }, "warningMessage": "warningMessage" } } ], "pagination": { "nextToken": "nextToken" } } ``` ## ListPrompts `client.Agents.ListPrompts(ctx, params) (*PromptsPage[Prompt], error)` **post** `/gitpod.v1.AgentService/ListPrompts` Lists all prompts matching the specified criteria. Use this method to find and browse prompts across your organization. Results are ordered by their creation time with the newest first. ### Examples - List all prompts: Retrieves all prompts with pagination. ```yaml pagination: pageSize: 10 ``` ### Parameters - `params AgentListPromptsParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AgentListPromptsParamsFilter]` Body param - `Command string` - `CommandPrefix string` - `ExcludePromptContent bool` exclude_prompt_content omits the large spec.prompt text from the response. Other spec fields (is_template, is_command, command, is_skill) are still returned. Use GetPrompt to retrieve the full prompt content when needed. - `IsCommand bool` - `IsSkill bool` - `IsTemplate bool` - `Search string` search performs case-insensitive search across prompt name, description, and command. - `Pagination param.Field[AgentListPromptsParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type Prompt struct{…}` - `ID string` - `Metadata PromptMetadata` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec PromptSpec` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Agents.ListPrompts(context.TODO(), gitpod.AgentListPromptsParams{ Pagination: gitpod.F(gitpod.AgentListPromptsParamsPagination{ PageSize: gitpod.F(int64(10)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "prompts": [ { "id": "id", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "command": "command", "isCommand": true, "isSkill": true, "isTemplate": true, "prompt": "prompt" } } ] } ``` ## GetAgentExecution `client.Agents.GetExecution(ctx, body) (*AgentGetExecutionResponse, error)` **post** `/gitpod.v1.AgentService/GetAgentExecution` Gets details about a specific agent run, including its metadata, specification, and status (phase, error messages, and usage statistics). Use this method to: - Monitor the run's progress - Retrieve the agent's conversation URL - Check if an agent run is actively producing output ### Examples - Get agent run details by ID: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" ``` ### Parameters - `body AgentGetExecutionParams` - `AgentExecutionID param.Field[string]` ### Returns - `type AgentGetExecutionResponse struct{…}` - `AgentExecution AgentExecution` - `ID string` 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 AgentExecutionMetadata` Metadata is data associated with this agent that's required for other parts of Gitpod to function - `Annotations map[string, string]` annotations are key-value pairs for tracking external context. - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Name string` - `Role AgentExecutionMetadataRole` role is the role of the agent execution - `const AgentExecutionMetadataRoleAgentExecutionRoleUnspecified AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_UNSPECIFIED"` - `const AgentExecutionMetadataRoleAgentExecutionRoleDefault AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_DEFAULT"` - `const AgentExecutionMetadataRoleAgentExecutionRoleWorkflow AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_WORKFLOW"` - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowActionID string` 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. - `Spec AgentExecutionSpec` Spec is the configuration of the agent that's required for the runner to start the agent - `AgentID string` - `CodeContext AgentCodeContext` - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` 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 string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `DesiredPhase AgentExecutionSpecDesiredPhase` desired_phase is the desired phase of the agent run - `const AgentExecutionSpecDesiredPhasePhaseUnspecified AgentExecutionSpecDesiredPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionSpecDesiredPhasePhasePending AgentExecutionSpecDesiredPhase = "PHASE_PENDING"` - `const AgentExecutionSpecDesiredPhasePhaseRunning AgentExecutionSpecDesiredPhase = "PHASE_RUNNING"` - `const AgentExecutionSpecDesiredPhasePhaseWaitingForInput AgentExecutionSpecDesiredPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionSpecDesiredPhasePhaseStopped AgentExecutionSpecDesiredPhase = "PHASE_STOPPED"` - `Limits AgentExecutionSpecLimits` - `MaxInputTokens string` - `MaxIterations string` - `MaxOutputTokens string` - `LoopConditions []AgentExecutionSpecLoopCondition` - `ID string` - `Description string` - `Expression string` - `Session string` - `SpecVersion string` 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 AgentExecutionStatus` Status is the current status of the agent - `CachedCreationTokensUsed string` - `CachedInputTokensUsed string` - `ContextWindowLength string` - `ConversationURL string` conversation_url is the URL to the conversation (all messages exchanged between the agent and the user) of the agent run. - `CurrentActivity string` current_activity is the current activity description of the agent execution. - `CurrentOperation AgentExecutionStatusCurrentOperation` current_operation is the current operation of the agent execution. - `Llm AgentExecutionStatusCurrentOperationLlm` - `Complete bool` - `Retries string` retries is the number of times the agent run has retried one or more steps - `Session string` - `ToolUse AgentExecutionStatusCurrentOperationToolUse` - `Complete bool` - `ToolName string` - `FailureMessage string` failure_message contains the reason the agent run failed to operate. - `FailureReason AgentExecutionStatusFailureReason` failure_reason contains a structured reason code for the failure. - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonUnspecified AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonEnvironment AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonService AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_SERVICE"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonLlmIntegration AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonInternal AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_INTERNAL"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonAgentExecution AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION"` - `InputTokensUsed string` - `Iterations string` - `Judgement string` judgement is the judgement of the agent run produced by the judgement prompt. - `McpIntegrationStatuses []AgentExecutionStatusMcpIntegrationStatus` mcp_integration_statuses contains the status of all MCP integrations used by this agent execution - `ID string` id is the unique name of the MCP integration - `FailureMessage string` failure_message contains the reason the MCP integration failed to connect or operate - `Name string` name is the unique name of the MCP integration (e.g., "linear", "notion") - `Phase AgentExecutionStatusMcpIntegrationStatusesPhase` phase is the current connection/health phase - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnspecified AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNSPECIFIED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseInitializing AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_INITIALIZING"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseReady AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_READY"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseFailed AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_FAILED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnavailable AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNAVAILABLE"` - `WarningMessage string` warning_message contains warnings (e.g., rate limiting, degraded performance) - `Mode 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). - `const AgentModeUnspecified AgentMode = "AGENT_MODE_UNSPECIFIED"` - `const AgentModeExecution AgentMode = "AGENT_MODE_EXECUTION"` - `const AgentModePlanning AgentMode = "AGENT_MODE_PLANNING"` - `const AgentModeRalph AgentMode = "AGENT_MODE_RALPH"` - `const AgentModeSpec AgentMode = "AGENT_MODE_SPEC"` - `Outputs map[string, AgentExecutionStatusOutput]` 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. - `BoolValue bool` - `FloatValue float64` - `IntValue string` - `StringValue string` - `OutputTokensUsed string` - `Phase AgentExecutionStatusPhase` - `const AgentExecutionStatusPhasePhaseUnspecified AgentExecutionStatusPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionStatusPhasePhasePending AgentExecutionStatusPhase = "PHASE_PENDING"` - `const AgentExecutionStatusPhasePhaseRunning AgentExecutionStatusPhase = "PHASE_RUNNING"` - `const AgentExecutionStatusPhasePhaseWaitingForInput AgentExecutionStatusPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionStatusPhasePhaseStopped AgentExecutionStatusPhase = "PHASE_STOPPED"` - `Session string` - `StatusVersion string` 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. - `SupportedModel AgentExecutionStatusSupportedModel` supported_model is the LLM model being used by the agent execution. - `const AgentExecutionStatusSupportedModelSupportedModelUnspecified AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_UNSPECIFIED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelHaiku4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_HAIKU_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4O AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O_MINI"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1Mini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1_MINI"` - `TranscriptURL string` transcript_url is the URL to the LLM transcript (all messages exchanged between the agent and the LLM) of the agent run. - `UsedEnvironments []AgentExecutionStatusUsedEnvironment` used_environments is the list of environments that were used by the agent execution. - `CreatedByAgent bool` - `EnvironmentID string` - `WarningMessage string` warning_message contains warnings, e.g. when the LLM is overloaded. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.GetExecution(context.TODO(), gitpod.AgentGetExecutionParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.AgentExecution) } ``` #### Response ```json { "agentExecution": { "id": "id", "metadata": { "annotations": { "foo": "string" }, "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "role": "AGENT_EXECUTION_ROLE_UNSPECIFIED", "sessionId": "sessionId", "updatedAt": "2019-12-27T18:11:19.117Z", "workflowActionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "agentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "codeContext": { "contextUrl": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com" }, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" } }, "desiredPhase": "PHASE_UNSPECIFIED", "limits": { "maxInputTokens": "maxInputTokens", "maxIterations": "maxIterations", "maxOutputTokens": "maxOutputTokens" }, "loopConditions": [ { "id": "id", "description": "description", "expression": "expression" } ], "session": "session", "specVersion": "specVersion" }, "status": { "cachedCreationTokensUsed": "cachedCreationTokensUsed", "cachedInputTokensUsed": "cachedInputTokensUsed", "contextWindowLength": "contextWindowLength", "conversationUrl": "conversationUrl", "currentActivity": "currentActivity", "currentOperation": { "llm": { "complete": true }, "retries": "retries", "session": "session", "toolUse": { "complete": true, "toolName": "x" } }, "failureMessage": "failureMessage", "failureReason": "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", "inputTokensUsed": "inputTokensUsed", "iterations": "iterations", "judgement": "judgement", "loopConditionResults": [ { "conditionId": "conditionId", "iteration": 0, "lastEvaluatedAt": "2019-12-27T18:11:19.117Z", "met": true } ], "mcpIntegrationStatuses": [ { "id": "id", "failureMessage": "failureMessage", "name": "name", "phase": "MCP_INTEGRATION_PHASE_UNSPECIFIED", "warningMessage": "warningMessage" } ], "mode": "AGENT_MODE_UNSPECIFIED", "outputs": { "foo": { "boolValue": true, "floatValue": 0, "intValue": "intValue", "stringValue": "stringValue" } }, "outputTokensUsed": "outputTokensUsed", "phase": "PHASE_UNSPECIFIED", "session": "session", "statusVersion": "statusVersion", "supportBundleUrl": "supportBundleUrl", "supportedModel": "SUPPORTED_MODEL_UNSPECIFIED", "terminalId": "terminalId", "transcriptUrl": "transcriptUrl", "usedEnvironments": [ { "createdByAgent": true, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "waitingInfo": { "interests": [ { "id": "id", "environment": { "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "phase": "" }, "subAgent": { "executionId": "executionId" }, "timer": { "cron": "cron", "duration": "duration", "firesAt": "2019-12-27T18:11:19.117Z" }, "userMessage": {} } ], "waitId": "waitId", "waitingSince": "2019-12-27T18:11:19.117Z" }, "warningMessage": "warningMessage" } } } ``` ## GetPrompt `client.Agents.GetPrompt(ctx, body) (*AgentGetPromptResponse, error)` **post** `/gitpod.v1.AgentService/GetPrompt` Gets details about a specific prompt including name, description, and prompt content. Use this method to: - Retrieve prompt details for editing - Get prompt content for execution ### Examples - Get prompt details: ```yaml promptId: "07e03a28-65a5-4d98-b532-8ea67b188048" ``` ### Parameters - `body AgentGetPromptParams` - `PromptID param.Field[string]` ### Returns - `type AgentGetPromptResponse struct{…}` - `Prompt Prompt` - `ID string` - `Metadata PromptMetadata` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec PromptSpec` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.GetPrompt(context.TODO(), gitpod.AgentGetPromptParams{ PromptID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Prompt) } ``` #### Response ```json { "prompt": { "id": "id", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "command": "command", "isCommand": true, "isSkill": true, "isTemplate": true, "prompt": "prompt" } } } ``` ## SendToAgentExecution `client.Agents.SendToExecution(ctx, body) (*AgentSendToExecutionResponse, error)` **post** `/gitpod.v1.AgentService/SendToAgentExecution` Sends user input to an active agent run. This method is used to provide interactive or conversation-based input to an agent. The agent can respond with output blocks containing text, file changes, or tool usage requests. ### Examples - Send a text message to an agent: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" userInput: text: content: "Generate a report based on the latest logs." ``` ### Parameters - `body AgentSendToExecutionParams` - `AgentExecutionID param.Field[string]` - `AgentMessage param.Field[AgentMessage]` AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa). - `UserInput param.Field[UserInputBlock]` - `WakeEvent param.Field[WakeEvent]` WakeEvent is sent by the backend to wake an agent when a registered interest fires. Delivered via SendToAgentExecution as a new oneof variant. ### Returns - `type AgentSendToExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.SendToExecution(context.TODO(), gitpod.AgentSendToExecutionParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), UserInput: gitpod.F(gitpod.UserInputBlockParam{ Text: gitpod.F(gitpod.UserInputBlockTextParam{ Content: gitpod.F("Generate a report based on the latest logs."), }), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## StartAgent `client.Agents.StartExecution(ctx, body) (*AgentStartExecutionResponse, error)` **post** `/gitpod.v1.AgentService/StartAgent` Starts (or triggers) an agent run using a provided agent. Use this method to: - Launch an agent based on a known agent ### Examples - Start an agent with a project ID: ```yaml agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" codeContext: projectId: "2d22e4eb-31da-467f-882c-27e21550992f" ``` ### Parameters - `body AgentStartExecutionParams` - `AgentID param.Field[string]` - `Annotations param.Field[map[string, string]]` annotations are key-value pairs for tracking external context (e.g., integration session IDs, GitHub issue references). Keys should follow domain/name convention (e.g., "agent-client-session/id"). - `CodeContext param.Field[AgentCodeContext]` - `Mode param.Field[AgentMode]` mode specifies the operational mode for this agent execution If not specified, defaults to AGENT_MODE_EXECUTION - `Name param.Field[string]` - `RunnerID param.Field[string]` runner_id specifies a runner for this agent execution. When set, the agent execution is routed to this runner instead of the runner associated with the environment. - `SessionID param.Field[string]` session_id is the ID of the session this agent execution belongs to. If empty, a new session is created implicitly. - `WorkflowActionID param.Field[string]` workflow_action_id is an optional reference to the workflow execution action that created this agent execution. Used for tracking and event correlation. ### Returns - `type AgentStartExecutionResponse struct{…}` - `AgentExecutionID string` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.StartExecution(context.TODO(), gitpod.AgentStartExecutionParams{ AgentID: gitpod.F("b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"), CodeContext: gitpod.F(gitpod.AgentCodeContextParam{ ProjectID: gitpod.F("2d22e4eb-31da-467f-882c-27e21550992f"), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.AgentExecutionID) } ``` #### Response ```json { "agentExecutionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ``` ## StopAgentExecution `client.Agents.StopExecution(ctx, body) (*AgentStopExecutionResponse, error)` **post** `/gitpod.v1.AgentService/StopAgentExecution` Stops an active agent execution. Use this method to: - Stop an agent that is currently running - Prevent further processing or resource usage ### Examples - Stop an agent execution by ID: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" ``` ### Parameters - `body AgentStopExecutionParams` - `AgentExecutionID param.Field[string]` ### Returns - `type AgentStopExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.StopExecution(context.TODO(), gitpod.AgentStopExecutionParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## UpdatePrompt `client.Agents.UpdatePrompt(ctx, body) (*AgentUpdatePromptResponse, error)` **post** `/gitpod.v1.AgentService/UpdatePrompt` Updates an existing prompt. Use this method to: - Modify prompt content or metadata - Change prompt type (template/command) ### Parameters - `body AgentUpdatePromptParams` - `Metadata param.Field[AgentUpdatePromptParamsMetadata]` Metadata updates - `Description string` A description of what the prompt does - `Name string` The name of the prompt - `PromptID param.Field[string]` The ID of the prompt to update - `Spec param.Field[AgentUpdatePromptParamsSpec]` Spec updates - `Command string` The command string (unique within organization) - `IsCommand bool` Whether this prompt is a command - `IsSkill bool` Whether this prompt is a skill - `IsTemplate bool` Whether this prompt is a template - `Prompt string` The prompt content ### Returns - `type AgentUpdatePromptResponse struct{…}` - `Prompt Prompt` - `ID string` - `Metadata PromptMetadata` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec PromptSpec` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.UpdatePrompt(context.TODO(), gitpod.AgentUpdatePromptParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Prompt) } ``` #### Response ```json { "prompt": { "id": "id", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "command": "command", "isCommand": true, "isSkill": true, "isTemplate": true, "prompt": "prompt" } } } ``` ## Domain Types ### Agent Code Context - `type AgentCodeContext struct{…}` - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` 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 string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") ### Agent Execution - `type AgentExecution struct{…}` - `ID string` 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 AgentExecutionMetadata` Metadata is data associated with this agent that's required for other parts of Gitpod to function - `Annotations map[string, string]` annotations are key-value pairs for tracking external context. - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Name string` - `Role AgentExecutionMetadataRole` role is the role of the agent execution - `const AgentExecutionMetadataRoleAgentExecutionRoleUnspecified AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_UNSPECIFIED"` - `const AgentExecutionMetadataRoleAgentExecutionRoleDefault AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_DEFAULT"` - `const AgentExecutionMetadataRoleAgentExecutionRoleWorkflow AgentExecutionMetadataRole = "AGENT_EXECUTION_ROLE_WORKFLOW"` - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowActionID string` 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. - `Spec AgentExecutionSpec` Spec is the configuration of the agent that's required for the runner to start the agent - `AgentID string` - `CodeContext AgentCodeContext` - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` 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 string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `DesiredPhase AgentExecutionSpecDesiredPhase` desired_phase is the desired phase of the agent run - `const AgentExecutionSpecDesiredPhasePhaseUnspecified AgentExecutionSpecDesiredPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionSpecDesiredPhasePhasePending AgentExecutionSpecDesiredPhase = "PHASE_PENDING"` - `const AgentExecutionSpecDesiredPhasePhaseRunning AgentExecutionSpecDesiredPhase = "PHASE_RUNNING"` - `const AgentExecutionSpecDesiredPhasePhaseWaitingForInput AgentExecutionSpecDesiredPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionSpecDesiredPhasePhaseStopped AgentExecutionSpecDesiredPhase = "PHASE_STOPPED"` - `Limits AgentExecutionSpecLimits` - `MaxInputTokens string` - `MaxIterations string` - `MaxOutputTokens string` - `LoopConditions []AgentExecutionSpecLoopCondition` - `ID string` - `Description string` - `Expression string` - `Session string` - `SpecVersion string` 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 AgentExecutionStatus` Status is the current status of the agent - `CachedCreationTokensUsed string` - `CachedInputTokensUsed string` - `ContextWindowLength string` - `ConversationURL string` conversation_url is the URL to the conversation (all messages exchanged between the agent and the user) of the agent run. - `CurrentActivity string` current_activity is the current activity description of the agent execution. - `CurrentOperation AgentExecutionStatusCurrentOperation` current_operation is the current operation of the agent execution. - `Llm AgentExecutionStatusCurrentOperationLlm` - `Complete bool` - `Retries string` retries is the number of times the agent run has retried one or more steps - `Session string` - `ToolUse AgentExecutionStatusCurrentOperationToolUse` - `Complete bool` - `ToolName string` - `FailureMessage string` failure_message contains the reason the agent run failed to operate. - `FailureReason AgentExecutionStatusFailureReason` failure_reason contains a structured reason code for the failure. - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonUnspecified AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonEnvironment AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonService AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_SERVICE"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonLlmIntegration AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonInternal AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_INTERNAL"` - `const AgentExecutionStatusFailureReasonAgentExecutionFailureReasonAgentExecution AgentExecutionStatusFailureReason = "AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION"` - `InputTokensUsed string` - `Iterations string` - `Judgement string` judgement is the judgement of the agent run produced by the judgement prompt. - `McpIntegrationStatuses []AgentExecutionStatusMcpIntegrationStatus` mcp_integration_statuses contains the status of all MCP integrations used by this agent execution - `ID string` id is the unique name of the MCP integration - `FailureMessage string` failure_message contains the reason the MCP integration failed to connect or operate - `Name string` name is the unique name of the MCP integration (e.g., "linear", "notion") - `Phase AgentExecutionStatusMcpIntegrationStatusesPhase` phase is the current connection/health phase - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnspecified AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNSPECIFIED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseInitializing AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_INITIALIZING"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseReady AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_READY"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseFailed AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_FAILED"` - `const AgentExecutionStatusMcpIntegrationStatusesPhaseMcpIntegrationPhaseUnavailable AgentExecutionStatusMcpIntegrationStatusesPhase = "MCP_INTEGRATION_PHASE_UNAVAILABLE"` - `WarningMessage string` warning_message contains warnings (e.g., rate limiting, degraded performance) - `Mode 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). - `const AgentModeUnspecified AgentMode = "AGENT_MODE_UNSPECIFIED"` - `const AgentModeExecution AgentMode = "AGENT_MODE_EXECUTION"` - `const AgentModePlanning AgentMode = "AGENT_MODE_PLANNING"` - `const AgentModeRalph AgentMode = "AGENT_MODE_RALPH"` - `const AgentModeSpec AgentMode = "AGENT_MODE_SPEC"` - `Outputs map[string, AgentExecutionStatusOutput]` 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. - `BoolValue bool` - `FloatValue float64` - `IntValue string` - `StringValue string` - `OutputTokensUsed string` - `Phase AgentExecutionStatusPhase` - `const AgentExecutionStatusPhasePhaseUnspecified AgentExecutionStatusPhase = "PHASE_UNSPECIFIED"` - `const AgentExecutionStatusPhasePhasePending AgentExecutionStatusPhase = "PHASE_PENDING"` - `const AgentExecutionStatusPhasePhaseRunning AgentExecutionStatusPhase = "PHASE_RUNNING"` - `const AgentExecutionStatusPhasePhaseWaitingForInput AgentExecutionStatusPhase = "PHASE_WAITING_FOR_INPUT"` - `const AgentExecutionStatusPhasePhaseStopped AgentExecutionStatusPhase = "PHASE_STOPPED"` - `Session string` - `StatusVersion string` 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. - `SupportedModel AgentExecutionStatusSupportedModel` supported_model is the LLM model being used by the agent execution. - `const AgentExecutionStatusSupportedModelSupportedModelUnspecified AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_UNSPECIFIED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet3_7Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_3_7_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelSonnet4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_SONNET_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_5Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_5_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6"` - `const AgentExecutionStatusSupportedModelSupportedModelOpus4_6Extended AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPUS_4_6_EXTENDED"` - `const AgentExecutionStatusSupportedModelSupportedModelHaiku4_5 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_HAIKU_4_5"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4O AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAI4OMini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_4O_MINI"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1 AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1"` - `const AgentExecutionStatusSupportedModelSupportedModelOpenAIO1Mini AgentExecutionStatusSupportedModel = "SUPPORTED_MODEL_OPENAI_O1_MINI"` - `TranscriptURL string` transcript_url is the URL to the LLM transcript (all messages exchanged between the agent and the LLM) of the agent run. - `UsedEnvironments []AgentExecutionStatusUsedEnvironment` used_environments is the list of environments that were used by the agent execution. - `CreatedByAgent bool` - `EnvironmentID string` - `WarningMessage string` warning_message contains warnings, e.g. when the LLM is overloaded. ### Agent Message - `type AgentMessage struct{…}` AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa). - `Payload string` Free-form payload of the message. - `Type Type` - `const TypeUnspecified Type = "TYPE_UNSPECIFIED"` - `const TypeUpdate Type = "TYPE_UPDATE"` - `const TypeComplete Type = "TYPE_COMPLETE"` ### Agent Mode - `type AgentMode string` AgentMode defines the operational mode of an agent - `const AgentModeUnspecified AgentMode = "AGENT_MODE_UNSPECIFIED"` - `const AgentModeExecution AgentMode = "AGENT_MODE_EXECUTION"` - `const AgentModePlanning AgentMode = "AGENT_MODE_PLANNING"` - `const AgentModeRalph AgentMode = "AGENT_MODE_RALPH"` - `const AgentModeSpec AgentMode = "AGENT_MODE_SPEC"` ### Prompt - `type Prompt struct{…}` - `ID string` - `Metadata PromptMetadata` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec PromptSpec` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Prompt Metadata - `type PromptMetadata struct{…}` - `CreatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` creator is the identity of the prompt creator - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` description is a description of what the prompt does - `Name string` name is the human readable name of the prompt - `OrganizationID string` organization_id is the ID of the organization that contains the prompt - `UpdatedAt Time` 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](https://developers.google.com/time/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](https://www.ietf.org/rfc/rfc3339.txt) 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](https://www.ietf.org/rfc/rfc3339.txt) 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.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()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Prompt Spec - `type PromptSpec struct{…}` - `Command string` command is the unique command string within the organization - `IsCommand bool` is_command indicates if this prompt is a command - `IsSkill bool` is_skill indicates if this prompt is a skill (workflow instructions for agents) - `IsTemplate bool` is_template indicates if this prompt is a template - `Prompt string` prompt is the content of the prompt ### Role - `type Role string` Role identifies the sender's relationship in the parent/child hierarchy. - `const RoleUnspecified Role = "ROLE_UNSPECIFIED"` - `const RoleParent Role = "ROLE_PARENT"` - `const RoleChild Role = "ROLE_CHILD"` ### Type - `type Type string` - `const TypeUnspecified Type = "TYPE_UNSPECIFIED"` - `const TypeUpdate Type = "TYPE_UPDATE"` - `const TypeComplete Type = "TYPE_COMPLETE"` ### User Input Block - `type UserInputBlock struct{…}` - `ID string` - `CreatedAt Time` Timestamp when this block was created. Used for debugging and support bundles. - `Image UserInputBlockImage` ImageInput allows sending images to the agent. Client must provide the MIME type; backend validates against magic bytes. - `Data string` Raw image data (max 4MB). Supported formats: PNG, JPEG. - `MimeType UserInputBlockImageMimeType` - `const UserInputBlockImageMimeTypeImagePng UserInputBlockImageMimeType = "image/png"` - `const UserInputBlockImageMimeTypeImageJpeg UserInputBlockImageMimeType = "image/jpeg"` - `Inputs []UserInputBlockInput` - `Image UserInputBlockInputsImage` ImageInput allows sending images to the agent. Client must provide the MIME type; backend validates against magic bytes. - `Data string` Raw image data (max 4MB). Supported formats: PNG, JPEG. - `MimeType UserInputBlockInputsImageMimeType` - `const UserInputBlockInputsImageMimeTypeImagePng UserInputBlockInputsImageMimeType = "image/png"` - `const UserInputBlockInputsImageMimeTypeImageJpeg UserInputBlockInputsImageMimeType = "image/jpeg"` - `Text UserInputBlockInputsText` - `Content string` - `Text UserInputBlockText` - `Content string` ### Wake Event - `type WakeEvent struct{…}` WakeEvent is sent by the backend to wake an agent when a registered interest fires. Delivered via SendToAgentExecution as a new oneof variant. - `Environment WakeEventEnvironment` - `EnvironmentID string` - `FailureMessage []string` - `Phase string` The phase the environment reached (e.g. "running", "stopped", "deleted"). - `InterestID string` The interest ID that fired (from WaitingInfo.Interest.id). - `LoopRetrigger WakeEventLoopRetrigger` - `Outputs map[string, string]` - `UnmetConditions []WakeEventLoopRetriggerUnmetCondition` - `ID string` - `Description string` - `Expression string` - `Iteration int64` - `MaxIterations int64` - `Reason string` - `Timer WakeEventTimer` - `FiredAt Time` The actual time the timer was evaluated as expired.