From 1fedf36d4ad1e6cbe612d0a629c95cb4636b359f Mon Sep 17 00:00:00 2001 From: Jonathan Haas Date: Wed, 15 Apr 2026 18:01:44 -0700 Subject: [PATCH 1/2] feat: add protoc-gen-connect-openapi to codegen pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the sudorandom/protoc-gen-connect-openapi buf plugin to generate OpenAPI v3.1 specs from proto definitions. Specs land in gen/openapi/ and match the Connect-RPC wire format, so mcp-openapi can consume them directly to produce MCP tool definitions. This unblocks evalops/platform#56 by auto-generating OpenAPI for all 22 proto packages — currently only 8 have hand-written specs. The 14 missing services (governance, approvals, objectives, prompts, traces, skills, etc.) become agent-visible through MCP without manual spec authoring. Ref: https://github.com/sudorandom/protoc-gen-connect-openapi Co-Authored-By: Claude Opus 4.6 (1M context) --- buf.gen.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buf.gen.yaml b/buf.gen.yaml index a98de58..a220286 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -17,3 +17,9 @@ plugins: # Python - remote: buf.build/protocolbuffers/python out: gen/python + # OpenAPI — generates Connect-compatible OpenAPI v3.1 specs per service. + # Consumed by mcp-openapi to produce MCP tool definitions for agent-mcp. + - remote: buf.build/community/sudorandom-connect-openapi:v0.19.1 + out: gen/openapi + opt: + - path= From 3ed6af8758008af7d84a629df36b94a6b01ff42a Mon Sep 17 00:00:00 2001 From: Jonathan Haas Date: Wed, 15 Apr 2026 18:05:40 -0700 Subject: [PATCH 2/2] chore: commit generated OpenAPI specs from protoc-gen-connect-openapi Generated by `buf generate` with the newly added sudorandom-connect-openapi plugin. Produces OpenAPI v3.1 specs for all 22 proto packages in gen/openapi/. Co-Authored-By: Claude Opus 4.6 (1M context) --- gen/openapi/agents/v1/agents.openapi.yaml | 1461 ++++++++++++++ .../approvals/v1/approvals.openapi.yaml | 836 ++++++++ .../attribution/v1/attribution.openapi.yaml | 1227 +++++++++++ gen/openapi/audit/v1/audit.openapi.yaml | 515 +++++ .../compliance/v1/compliance.openapi.yaml | 795 ++++++++ gen/openapi/config/v1/config.openapi.yaml | 46 + .../connectors/v1/connectors.openapi.yaml | 869 ++++++++ gen/openapi/entities/v1/entities.openapi.yaml | 923 +++++++++ gen/openapi/events/v1/change.openapi.yaml | 212 ++ gen/openapi/events/v1/cloudevent.openapi.yaml | 234 +++ gen/openapi/events/v1/evaluation.openapi.yaml | 212 ++ .../governance/v1/governance.openapi.yaml | 930 +++++++++ .../identity/v1/organizations.openapi.yaml | 211 ++ gen/openapi/identity/v1/sessions.openapi.yaml | 152 ++ gen/openapi/identity/v1/tokens.openapi.yaml | 422 ++++ gen/openapi/keys/v1/keys.openapi.yaml | 469 +++++ gen/openapi/memory/v1/memory.openapi.yaml | 833 ++++++++ gen/openapi/meter/v1/meter.openapi.yaml | 1184 +++++++++++ .../v1/notifications.openapi.yaml | 926 +++++++++ .../objectives/v1/objectives.openapi.yaml | 811 ++++++++ gen/openapi/prompts/v1/prompts.openapi.yaml | 1112 ++++++++++ gen/openapi/registry/v1/registry.openapi.yaml | 701 +++++++ gen/openapi/skills/v1/skills.openapi.yaml | 901 +++++++++ gen/openapi/tap/v1/event.openapi.yaml | 232 +++ gen/openapi/traces/v1/traces.openapi.yaml | 639 ++++++ .../workflows/v1/workflows.openapi.yaml | 1791 +++++++++++++++++ 26 files changed, 18644 insertions(+) create mode 100644 gen/openapi/agents/v1/agents.openapi.yaml create mode 100644 gen/openapi/approvals/v1/approvals.openapi.yaml create mode 100644 gen/openapi/attribution/v1/attribution.openapi.yaml create mode 100644 gen/openapi/audit/v1/audit.openapi.yaml create mode 100644 gen/openapi/compliance/v1/compliance.openapi.yaml create mode 100644 gen/openapi/config/v1/config.openapi.yaml create mode 100644 gen/openapi/connectors/v1/connectors.openapi.yaml create mode 100644 gen/openapi/entities/v1/entities.openapi.yaml create mode 100644 gen/openapi/events/v1/change.openapi.yaml create mode 100644 gen/openapi/events/v1/cloudevent.openapi.yaml create mode 100644 gen/openapi/events/v1/evaluation.openapi.yaml create mode 100644 gen/openapi/governance/v1/governance.openapi.yaml create mode 100644 gen/openapi/identity/v1/organizations.openapi.yaml create mode 100644 gen/openapi/identity/v1/sessions.openapi.yaml create mode 100644 gen/openapi/identity/v1/tokens.openapi.yaml create mode 100644 gen/openapi/keys/v1/keys.openapi.yaml create mode 100644 gen/openapi/memory/v1/memory.openapi.yaml create mode 100644 gen/openapi/meter/v1/meter.openapi.yaml create mode 100644 gen/openapi/notifications/v1/notifications.openapi.yaml create mode 100644 gen/openapi/objectives/v1/objectives.openapi.yaml create mode 100644 gen/openapi/prompts/v1/prompts.openapi.yaml create mode 100644 gen/openapi/registry/v1/registry.openapi.yaml create mode 100644 gen/openapi/skills/v1/skills.openapi.yaml create mode 100644 gen/openapi/tap/v1/event.openapi.yaml create mode 100644 gen/openapi/traces/v1/traces.openapi.yaml create mode 100644 gen/openapi/workflows/v1/workflows.openapi.yaml diff --git a/gen/openapi/agents/v1/agents.openapi.yaml b/gen/openapi/agents/v1/agents.openapi.yaml new file mode 100644 index 0000000..07cf5c2 --- /dev/null +++ b/gen/openapi/agents/v1/agents.openapi.yaml @@ -0,0 +1,1461 @@ +openapi: 3.1.0 +info: + title: agents.v1 +paths: + /agents.v1.AgentService/Register: + post: + tags: + - agents.v1.AgentService + summary: Register + description: Register creates a new agent definition. + operationId: agents.v1.AgentService.Register + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.RegisterRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.RegisterResponse' + /agents.v1.AgentService/Get: + post: + tags: + - agents.v1.AgentService + summary: Get + description: Get retrieves an agent by ID. + operationId: agents.v1.AgentService.Get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetResponse' + /agents.v1.AgentService/List: + post: + tags: + - agents.v1.AgentService + summary: List + description: List returns agents matching the query filters. + operationId: agents.v1.AgentService.List + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListResponse' + /agents.v1.AgentService/Update: + post: + tags: + - agents.v1.AgentService + summary: Update + description: Update modifies mutable agent metadata (name, description, surfaces). + operationId: agents.v1.AgentService.Update + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.UpdateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.UpdateResponse' + /agents.v1.AgentService/Deregister: + post: + tags: + - agents.v1.AgentService + summary: Deregister + description: Deregister removes an agent from the registry. + operationId: agents.v1.AgentService.Deregister + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.DeregisterRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.DeregisterResponse' + /agents.v1.AgentService/PushConfig: + post: + tags: + - agents.v1.AgentService + summary: PushConfig + description: |- + PushConfig creates a new immutable configuration version for an agent. + The agent's active_config_version advances atomically. + operationId: agents.v1.AgentService.PushConfig + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.PushConfigRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.PushConfigResponse' + /agents.v1.AgentService/GetConfig: + post: + tags: + - agents.v1.AgentService + summary: GetConfig + description: GetConfig retrieves a specific configuration version. + operationId: agents.v1.AgentService.GetConfig + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetConfigRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetConfigResponse' + /agents.v1.AgentService/ListConfigs: + post: + tags: + - agents.v1.AgentService + summary: ListConfigs + description: ListConfigs returns all configuration versions for an agent. + operationId: agents.v1.AgentService.ListConfigs + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListConfigsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListConfigsResponse' + /agents.v1.AgentService/RollbackConfig: + post: + tags: + - agents.v1.AgentService + summary: RollbackConfig + description: RollbackConfig atomically reverts an agent to a prior configuration version. + operationId: agents.v1.AgentService.RollbackConfig + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.RollbackConfigRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.RollbackConfigResponse' + /agents.v1.AgentService/Delegate: + post: + tags: + - agents.v1.AgentService + summary: Delegate + description: |- + Delegate requests that another agent (or any agent with a matching + capability) accept a unit of work. The delegation is tracked as a + DelegationRecord and linked to the originating objective and optional + workflow step. + operationId: agents.v1.AgentService.Delegate + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.DelegateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.DelegateResponse' + /agents.v1.AgentService/ResolveDelegation: + post: + tags: + - agents.v1.AgentService + summary: ResolveDelegation + description: ResolveDelegation records the outcome of a delegation. + operationId: agents.v1.AgentService.ResolveDelegation + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ResolveDelegationRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ResolveDelegationResponse' + /agents.v1.AgentService/GetDelegation: + post: + tags: + - agents.v1.AgentService + summary: GetDelegation + description: GetDelegation retrieves a delegation record by ID. + operationId: agents.v1.AgentService.GetDelegation + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetDelegationRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.GetDelegationResponse' + /agents.v1.AgentService/ListDelegations: + post: + tags: + - agents.v1.AgentService + summary: ListDelegations + description: ListDelegations returns delegations matching the query filters. + operationId: agents.v1.AgentService.ListDelegations + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListDelegationsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.ListDelegationsResponse' + /agents.v1.AgentService/Heartbeat: + post: + tags: + - agents.v1.AgentService + summary: Heartbeat + description: |- + Heartbeat records agent liveness. The registry uses this to maintain + presence state and route capability-based delegation requests. + operationId: agents.v1.AgentService.Heartbeat + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.HeartbeatRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/agents.v1.HeartbeatResponse' +components: + schemas: + agents.v1.AgentStatus: + type: string + title: AgentStatus + enum: + - AGENT_STATUS_UNSPECIFIED + - AGENT_STATUS_ACTIVE + - AGENT_STATUS_IDLE + - AGENT_STATUS_BUSY + - AGENT_STATUS_OFFLINE + - AGENT_STATUS_DEGRADED + - AGENT_STATUS_SUSPENDED + description: AgentStatus describes the operational state of an agent. + agents.v1.DelegationStatus: + type: string + title: DelegationStatus + enum: + - DELEGATION_STATUS_UNSPECIFIED + - DELEGATION_STATUS_PENDING + - DELEGATION_STATUS_ACCEPTED + - DELEGATION_STATUS_REJECTED + - DELEGATION_STATUS_COMPLETED + - DELEGATION_STATUS_FAILED + - DELEGATION_STATUS_TIMED_OUT + description: DelegationStatus describes the lifecycle state of a delegation. + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + agents.v1.Agent: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + name: + type: string + title: name + description: + type: string + title: description + agentType: + type: string + title: agent_type + description: |- + agent_type aligns with identity/v1 IntrospectResponse.agent_type and + IssueAgentTokenRequest.agent_type. Examples: "sdr", "support", "coding", + "ops", "research". + capabilities: + type: array + items: + type: string + title: capabilities + description: |- + capabilities aligns with identity/v1 IntrospectResponse.capabilities and + IssueAgentTokenRequest.capabilities. Used by capability-based delegation + routing. Examples: "hubspot-write", "email-send", "code-review". + surfaces: + type: array + items: + type: string + title: surfaces + description: |- + surfaces this agent can operate on. Aligns with the surface field in + meter/v1, objectives/v1, approvals/v1. Examples: "ensemble", "chat", + "maestro", "conductor", "slack". + status: + title: status + $ref: '#/components/schemas/agents.v1.AgentStatus' + activeConfigVersion: + type: integer + title: active_config_version + format: int32 + ownerId: + type: string + title: owner_id + lastHeartbeatAt: + title: last_heartbeat_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Agent + additionalProperties: false + description: |- + Agent is the canonical agent definition record. + The id field is the value stored in every agent_id / agent string field + across the platform: meter/v1 RecordUsageRequest.agent_id, + objectives/v1 Objective.agent_id, approvals/v1 ApprovalRequest.agent_id, + governance/v1 EvaluateActionRequest.agent_id, memory/v1 Memory.agent, + and events/v1 Change.actor_id when actor_type is "agent". + agents.v1.AgentConfig: + type: object + properties: + version: + type: integer + title: version + format: int32 + agentId: + type: string + title: agent_id + skillIds: + type: array + items: + type: string + title: skill_ids + description: |- + skill_ids reference skills/v1 Skill.id — the reusable capabilities + this agent has loaded. + promptBindings: + type: object + title: prompt_bindings + additionalProperties: + type: string + title: value + description: |- + prompt_bindings maps prompt name to label (e.g., "sdr-outreach" -> "production"). + Aligns with prompts/v1 ResolveRequest.name and ResolveRequest.label. + modelPreferences: + type: object + title: model_preferences + additionalProperties: + type: string + title: value + description: |- + model_preferences maps surface to preferred model identifier + (e.g., "ensemble" -> "claude-opus-4.6"). Aligns with meter/v1 + RecordUsageRequest.model and keys/v1 ResolveProviderRefRequest.provider. + integrationIds: + type: array + items: + type: string + title: integration_ids + description: |- + integration_ids reference connectors/v1 Connection.id — the external + system connections this agent is authorized to use. + entityTypeScopes: + type: array + items: + type: string + title: entity_type_scopes + description: |- + entity_type_scopes restrict which entities/v1 EntityType values this + agent can operate on. Empty means unrestricted. + maxConcurrentObjectives: + type: integer + title: max_concurrent_objectives + format: int32 + description: |- + max_concurrent_objectives caps the number of objectives/v1 Objective + records this agent can hold in RUNNING or BLOCKED state simultaneously. + costBudgetUsd: + type: number + title: cost_budget_usd + format: double + description: |- + cost_budget_usd is the per-period spend ceiling enforced against + meter/v1 usage records for this agent. + notificationChannel: + type: string + title: notification_channel + description: |- + notification_channel specifies the preferred notifications/v1 + DeliveryChannel for this agent's escalations. Stored as string to + avoid cross-package import (e.g., "DELIVERY_CHANNEL_SLACK"). + parameters: + title: parameters + description: parameters holds arbitrary agent-specific tuning knobs. + $ref: '#/components/schemas/google.protobuf.Struct' + author: + type: string + title: author + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: AgentConfig + additionalProperties: false + description: |- + AgentConfig is an immutable snapshot of everything that shapes an agent's + behavior. Promotion and rollback are both config version reassignments — + the same pattern as prompts/v1 Label. + agents.v1.AgentConfig.ModelPreferencesEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: ModelPreferencesEntry + additionalProperties: false + agents.v1.AgentConfig.PromptBindingsEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: PromptBindingsEntry + additionalProperties: false + agents.v1.DelegateRequest: + type: object + properties: + fromAgentId: + type: string + title: from_agent_id + toAgentId: + type: string + title: to_agent_id + description: |- + Specify to_agent_id for direct delegation, or required_capability for + capability-based routing through the registry. + requiredCapability: + type: string + title: required_capability + objectiveId: + type: string + title: objective_id + workflowRunId: + type: string + title: workflow_run_id + workflowStepId: + type: string + title: workflow_step_id + contextPayload: + type: string + title: context_payload + format: byte + reason: + type: string + title: reason + title: DelegateRequest + additionalProperties: false + agents.v1.DelegateResponse: + type: object + properties: + delegation: + title: delegation + $ref: '#/components/schemas/agents.v1.DelegationRecord' + title: DelegateResponse + additionalProperties: false + agents.v1.DelegationRecord: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + fromAgentId: + type: string + title: from_agent_id + toAgentId: + type: string + title: to_agent_id + requiredCapability: + type: string + title: required_capability + objectiveId: + type: string + title: objective_id + description: |- + objective_id links to the objectives/v1 Objective created for this + delegated unit of work. + workflowRunId: + type: string + title: workflow_run_id + description: |- + workflow_run_id and workflow_step_id link to workflows/v1 when this + delegation occurs within a workflow execution. + workflowStepId: + type: string + title: workflow_step_id + status: + title: status + $ref: '#/components/schemas/agents.v1.DelegationStatus' + contextPayload: + type: string + title: context_payload + format: byte + resultPayload: + type: string + title: result_payload + format: byte + reason: + type: string + title: reason + errorMessage: + type: string + title: error_message + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + resolvedAt: + title: resolved_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: DelegationRecord + additionalProperties: false + description: |- + DelegationRecord tracks a typed hand-off between agents. The from_agent_id + creates an objective (objectives/v1) or references a workflow step + (workflows/v1 StepRun) and delegates execution to another agent resolved + by ID or by capability through the registry. + agents.v1.DeregisterRequest: + type: object + properties: + id: + type: string + title: id + reason: + type: string + title: reason + title: DeregisterRequest + additionalProperties: false + agents.v1.DeregisterResponse: + type: object + title: DeregisterResponse + additionalProperties: false + agents.v1.GetConfigRequest: + type: object + properties: + agentId: + type: string + title: agent_id + version: + type: integer + title: version + format: int32 + title: GetConfigRequest + additionalProperties: false + agents.v1.GetConfigResponse: + type: object + properties: + config: + title: config + $ref: '#/components/schemas/agents.v1.AgentConfig' + title: GetConfigResponse + additionalProperties: false + agents.v1.GetDelegationRequest: + type: object + properties: + id: + type: string + title: id + title: GetDelegationRequest + additionalProperties: false + agents.v1.GetDelegationResponse: + type: object + properties: + delegation: + title: delegation + $ref: '#/components/schemas/agents.v1.DelegationRecord' + title: GetDelegationResponse + additionalProperties: false + agents.v1.GetRequest: + type: object + properties: + id: + type: string + title: id + title: GetRequest + additionalProperties: false + agents.v1.GetResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/agents.v1.Agent' + title: GetResponse + additionalProperties: false + agents.v1.HeartbeatRequest: + type: object + properties: + agentId: + type: string + title: agent_id + status: + title: status + $ref: '#/components/schemas/agents.v1.AgentStatus' + currentObjectiveIds: + type: array + items: + type: string + title: current_objective_ids + description: |- + current_objective_ids lists the objectives/v1 Objective.id values this + agent currently holds. Used for capacity-aware delegation routing. + surface: + type: string + title: surface + title: HeartbeatRequest + additionalProperties: false + agents.v1.HeartbeatResponse: + type: object + properties: + nextHeartbeatBy: + title: next_heartbeat_by + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: HeartbeatResponse + additionalProperties: false + agents.v1.ListConfigsRequest: + type: object + properties: + agentId: + type: string + title: agent_id + title: ListConfigsRequest + additionalProperties: false + agents.v1.ListConfigsResponse: + type: object + properties: + configs: + type: array + items: + $ref: '#/components/schemas/agents.v1.AgentConfig' + title: configs + title: ListConfigsResponse + additionalProperties: false + agents.v1.ListDelegationsRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + fromAgentId: + type: string + title: from_agent_id + toAgentId: + type: string + title: to_agent_id + status: + title: status + $ref: '#/components/schemas/agents.v1.DelegationStatus' + workflowRunId: + type: string + title: workflow_run_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListDelegationsRequest + additionalProperties: false + agents.v1.ListDelegationsResponse: + type: object + properties: + delegations: + type: array + items: + $ref: '#/components/schemas/agents.v1.DelegationRecord' + title: delegations + total: + type: integer + title: total + format: int32 + title: ListDelegationsResponse + additionalProperties: false + agents.v1.ListRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + agentType: + type: string + title: agent_type + capability: + type: string + title: capability + surface: + type: string + title: surface + status: + title: status + $ref: '#/components/schemas/agents.v1.AgentStatus' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListRequest + additionalProperties: false + agents.v1.ListResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/agents.v1.Agent' + title: agents + total: + type: integer + title: total + format: int32 + title: ListResponse + additionalProperties: false + agents.v1.PushConfigRequest: + type: object + properties: + agentId: + type: string + title: agent_id + skillIds: + type: array + items: + type: string + title: skill_ids + promptBindings: + type: object + title: prompt_bindings + additionalProperties: + type: string + title: value + modelPreferences: + type: object + title: model_preferences + additionalProperties: + type: string + title: value + integrationIds: + type: array + items: + type: string + title: integration_ids + entityTypeScopes: + type: array + items: + type: string + title: entity_type_scopes + maxConcurrentObjectives: + type: integer + title: max_concurrent_objectives + format: int32 + costBudgetUsd: + type: number + title: cost_budget_usd + format: double + notificationChannel: + type: string + title: notification_channel + parameters: + title: parameters + $ref: '#/components/schemas/google.protobuf.Struct' + author: + type: string + title: author + title: PushConfigRequest + additionalProperties: false + agents.v1.PushConfigRequest.ModelPreferencesEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: ModelPreferencesEntry + additionalProperties: false + agents.v1.PushConfigRequest.PromptBindingsEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: PromptBindingsEntry + additionalProperties: false + agents.v1.PushConfigResponse: + type: object + properties: + config: + title: config + $ref: '#/components/schemas/agents.v1.AgentConfig' + agent: + title: agent + $ref: '#/components/schemas/agents.v1.Agent' + title: PushConfigResponse + additionalProperties: false + agents.v1.RegisterRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + name: + type: string + title: name + description: + type: string + title: description + agentType: + type: string + title: agent_type + capabilities: + type: array + items: + type: string + title: capabilities + surfaces: + type: array + items: + type: string + title: surfaces + ownerId: + type: string + title: owner_id + title: RegisterRequest + additionalProperties: false + agents.v1.RegisterResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/agents.v1.Agent' + title: RegisterResponse + additionalProperties: false + agents.v1.ResolveDelegationRequest: + type: object + properties: + delegationId: + type: string + title: delegation_id + status: + title: status + $ref: '#/components/schemas/agents.v1.DelegationStatus' + resultPayload: + type: string + title: result_payload + format: byte + errorMessage: + type: string + title: error_message + title: ResolveDelegationRequest + additionalProperties: false + agents.v1.ResolveDelegationResponse: + type: object + properties: + delegation: + title: delegation + $ref: '#/components/schemas/agents.v1.DelegationRecord' + title: ResolveDelegationResponse + additionalProperties: false + agents.v1.RollbackConfigRequest: + type: object + properties: + agentId: + type: string + title: agent_id + targetVersion: + type: integer + title: target_version + format: int32 + actor: + type: string + title: actor + reason: + type: string + title: reason + title: RollbackConfigRequest + additionalProperties: false + agents.v1.RollbackConfigResponse: + type: object + properties: + config: + title: config + $ref: '#/components/schemas/agents.v1.AgentConfig' + agent: + title: agent + $ref: '#/components/schemas/agents.v1.Agent' + title: RollbackConfigResponse + additionalProperties: false + agents.v1.UpdateRequest: + type: object + properties: + id: + type: string + title: id + name: + type: string + title: name + description: + type: string + title: description + capabilities: + type: array + items: + type: string + title: capabilities + surfaces: + type: array + items: + type: string + title: surfaces + title: UpdateRequest + additionalProperties: false + agents.v1.UpdateResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/agents.v1.Agent' + title: UpdateResponse + additionalProperties: false + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: agents.v1.AgentService + description: |- + AgentService manages agent definitions, versioned configuration, and + cross-agent delegation. Every string agent_id in the platform (meter, + objectives, approvals, governance, memory) resolves to an Agent record + owned by this service. diff --git a/gen/openapi/approvals/v1/approvals.openapi.yaml b/gen/openapi/approvals/v1/approvals.openapi.yaml new file mode 100644 index 0000000..0dd6377 --- /dev/null +++ b/gen/openapi/approvals/v1/approvals.openapi.yaml @@ -0,0 +1,836 @@ +openapi: 3.1.0 +info: + title: approvals.v1 +paths: + /approvals.v1.ApprovalService/RequestApproval: + post: + tags: + - approvals.v1.ApprovalService + summary: RequestApproval + operationId: approvals.v1.ApprovalService.RequestApproval + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.RequestApprovalRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.RequestApprovalResponse' + /approvals.v1.ApprovalService/ResolveApproval: + post: + tags: + - approvals.v1.ApprovalService + summary: ResolveApproval + operationId: approvals.v1.ApprovalService.ResolveApproval + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.ResolveApprovalRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.ResolveApprovalResponse' + /approvals.v1.ApprovalService/GetPolicy: + post: + tags: + - approvals.v1.ApprovalService + summary: GetPolicy + operationId: approvals.v1.ApprovalService.GetPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetPolicyResponse' + /approvals.v1.ApprovalService/SetPolicy: + post: + tags: + - approvals.v1.ApprovalService + summary: SetPolicy + operationId: approvals.v1.ApprovalService.SetPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.SetPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.SetPolicyResponse' + /approvals.v1.ApprovalService/ListPending: + post: + tags: + - approvals.v1.ApprovalService + summary: ListPending + operationId: approvals.v1.ApprovalService.ListPending + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.ListPendingRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.ListPendingResponse' + /approvals.v1.ApprovalService/GetHabits: + post: + tags: + - approvals.v1.ApprovalService + summary: GetHabits + operationId: approvals.v1.ApprovalService.GetHabits + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetHabitsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetHabitsResponse' + /approvals.v1.ApprovalService/Escalate: + post: + tags: + - approvals.v1.ApprovalService + summary: Escalate + operationId: approvals.v1.ApprovalService.Escalate + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.EscalateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.EscalateResponse' + /approvals.v1.ApprovalService/GetApproval: + post: + tags: + - approvals.v1.ApprovalService + summary: GetApproval + operationId: approvals.v1.ApprovalService.GetApproval + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetApprovalRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/approvals.v1.GetApprovalResponse' +components: + schemas: + approvals.v1.ActionAuthority: + type: string + title: ActionAuthority + enum: + - ACTION_AUTHORITY_UNSPECIFIED + - ACTION_AUTHORITY_OWN + - ACTION_AUTHORITY_RECOMMEND + - ACTION_AUTHORITY_REQUIRE_APPROVAL + description: ActionAuthority describes the authority level for an action. + approvals.v1.DecisionType: + type: string + title: DecisionType + enum: + - DECISION_TYPE_UNSPECIFIED + - DECISION_TYPE_APPROVED + - DECISION_TYPE_DENIED + - DECISION_TYPE_ESCALATED + - DECISION_TYPE_EXPIRED + - DECISION_TYPE_AUTO_APPROVED + description: DecisionType describes the outcome of an approval request. + approvals.v1.RiskLevel: + type: string + title: RiskLevel + enum: + - RISK_LEVEL_UNSPECIFIED + - RISK_LEVEL_LOW + - RISK_LEVEL_MEDIUM + - RISK_LEVEL_HIGH + - RISK_LEVEL_CRITICAL + description: RiskLevel classifies the risk of an action. + approvals.v1.ApprovalDecision: + type: object + properties: + id: + type: string + title: id + approvalRequestId: + type: string + title: approval_request_id + decision: + title: decision + $ref: '#/components/schemas/approvals.v1.DecisionType' + decidedBy: + type: string + title: decided_by + reason: + type: string + title: reason + decidedAt: + title: decided_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ApprovalDecision + additionalProperties: false + description: ApprovalDecision records a decision made on an approval request. + approvals.v1.ApprovalHabit: + type: object + properties: + pattern: + type: string + title: pattern + autoApproveConfidence: + type: number + title: auto_approve_confidence + format: float + observationCount: + type: integer + title: observation_count + format: int32 + approvedCount: + type: integer + title: approved_count + format: int32 + title: ApprovalHabit + additionalProperties: false + description: ApprovalHabit captures learned patterns for auto-approval. + approvals.v1.ApprovalPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + rules: + type: array + items: + $ref: '#/components/schemas/approvals.v1.ApprovalRule' + title: rules + autoApproveConfig: + title: auto_approve_config + $ref: '#/components/schemas/approvals.v1.AutoApproveConfig' + title: ApprovalPolicy + additionalProperties: false + description: ApprovalPolicy defines the set of rules for a workspace. + approvals.v1.ApprovalRequest: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + approverUserId: + type: string + title: approver_user_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + actionType: + type: string + title: action_type + actionPayload: + type: string + title: action_payload + format: byte + riskLevel: + title: risk_level + $ref: '#/components/schemas/approvals.v1.RiskLevel' + contextJson: + type: string + title: context_json + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ApprovalRequest + additionalProperties: false + description: ApprovalRequest is the canonical approval request record. + approvals.v1.ApprovalRule: + type: object + properties: + id: + type: string + title: id + actionType: + type: string + title: action_type + minRiskLevel: + title: min_risk_level + $ref: '#/components/schemas/approvals.v1.RiskLevel' + authority: + title: authority + $ref: '#/components/schemas/approvals.v1.ActionAuthority' + description: + type: string + title: description + title: ApprovalRule + additionalProperties: false + description: ApprovalRule defines a single rule within an approval policy. + approvals.v1.AutoApproveConfig: + type: object + properties: + enabled: + type: boolean + title: enabled + threshold: + type: number + title: threshold + format: float + description: Minimum confidence score. Defaults to 0.95 when not set. + nullable: true + minObservations: + type: integer + title: min_observations + format: int32 + description: Minimum decisions before activation. Defaults to 20 when not set. + nullable: true + excludedRiskLevels: + type: array + items: + $ref: '#/components/schemas/approvals.v1.RiskLevel' + title: excluded_risk_levels + description: always require human + title: AutoApproveConfig + additionalProperties: false + description: AutoApproveConfig controls automatic approval behavior for a workspace. + approvals.v1.AutoApproveEvidence: + type: object + properties: + pattern: + type: string + title: pattern + confidence: + type: number + title: confidence + format: float + observationCount: + type: integer + title: observation_count + format: int32 + thresholdApplied: + type: number + title: threshold_applied + format: float + title: AutoApproveEvidence + additionalProperties: false + description: AutoApproveEvidence captures the data behind an automatic approval decision. + approvals.v1.EscalateRequest: + type: object + properties: + approvalRequestId: + type: string + title: approval_request_id + reason: + type: string + title: reason + title: EscalateRequest + additionalProperties: false + approvals.v1.EscalateResponse: + type: object + properties: + approvalRequest: + title: approval_request + $ref: '#/components/schemas/approvals.v1.ApprovalRequest' + title: EscalateResponse + additionalProperties: false + approvals.v1.GetApprovalRequest: + type: object + properties: + approvalRequestId: + type: string + title: approval_request_id + workspaceId: + type: string + title: workspace_id + title: GetApprovalRequest + additionalProperties: false + approvals.v1.GetApprovalResponse: + type: object + properties: + approvalRequest: + title: approval_request + $ref: '#/components/schemas/approvals.v1.ApprovalRequest' + decisions: + type: array + items: + $ref: '#/components/schemas/approvals.v1.ApprovalDecision' + title: decisions + state: + type: string + title: state + title: GetApprovalResponse + additionalProperties: false + approvals.v1.GetHabitsRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + title: GetHabitsRequest + additionalProperties: false + approvals.v1.GetHabitsResponse: + type: object + properties: + habits: + type: array + items: + $ref: '#/components/schemas/approvals.v1.ApprovalHabit' + title: habits + title: GetHabitsResponse + additionalProperties: false + approvals.v1.GetPolicyRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + title: GetPolicyRequest + additionalProperties: false + approvals.v1.GetPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/approvals.v1.ApprovalPolicy' + title: GetPolicyResponse + additionalProperties: false + approvals.v1.ListPendingRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListPendingRequest + additionalProperties: false + approvals.v1.ListPendingResponse: + type: object + properties: + requests: + type: array + items: + $ref: '#/components/schemas/approvals.v1.ApprovalRequest' + title: requests + total: + type: integer + title: total + format: int32 + title: ListPendingResponse + additionalProperties: false + approvals.v1.RequestApprovalRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + approverUserId: + type: string + title: approver_user_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + actionType: + type: string + title: action_type + actionPayload: + type: string + title: action_payload + format: byte + riskLevel: + title: risk_level + $ref: '#/components/schemas/approvals.v1.RiskLevel' + contextJson: + type: string + title: context_json + title: RequestApprovalRequest + additionalProperties: false + approvals.v1.RequestApprovalResponse: + type: object + properties: + approvalRequest: + title: approval_request + $ref: '#/components/schemas/approvals.v1.ApprovalRequest' + autoApproveEvidence: + title: auto_approve_evidence + $ref: '#/components/schemas/approvals.v1.AutoApproveEvidence' + title: RequestApprovalResponse + additionalProperties: false + approvals.v1.ResolveApprovalRequest: + type: object + properties: + approvalRequestId: + type: string + title: approval_request_id + decision: + title: decision + $ref: '#/components/schemas/approvals.v1.DecisionType' + decidedBy: + type: string + title: decided_by + reason: + type: string + title: reason + title: ResolveApprovalRequest + additionalProperties: false + approvals.v1.ResolveApprovalResponse: + type: object + properties: + decision: + title: decision + $ref: '#/components/schemas/approvals.v1.ApprovalDecision' + title: ResolveApprovalResponse + additionalProperties: false + approvals.v1.SetPolicyRequest: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/approvals.v1.ApprovalPolicy' + title: SetPolicyRequest + additionalProperties: false + approvals.v1.SetPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/approvals.v1.ApprovalPolicy' + title: SetPolicyResponse + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: approvals.v1.ApprovalService + description: ApprovalService manages approval workflows for agent actions. diff --git a/gen/openapi/attribution/v1/attribution.openapi.yaml b/gen/openapi/attribution/v1/attribution.openapi.yaml new file mode 100644 index 0000000..7830dcb --- /dev/null +++ b/gen/openapi/attribution/v1/attribution.openapi.yaml @@ -0,0 +1,1227 @@ +openapi: 3.1.0 +info: + title: attribution.v1 +paths: + /attribution.v1.AttributionService/GenerateReport: + post: + tags: + - attribution.v1.AttributionService + summary: GenerateReport + operationId: attribution.v1.AttributionService.GenerateReport + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GenerateReportRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GenerateReportResponse' + /attribution.v1.AttributionService/GetReport: + post: + tags: + - attribution.v1.AttributionService + summary: GetReport + operationId: attribution.v1.AttributionService.GetReport + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GetReportRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GetReportResponse' + /attribution.v1.AttributionService/ListReports: + post: + tags: + - attribution.v1.AttributionService + summary: ListReports + operationId: attribution.v1.AttributionService.ListReports + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ListReportsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ListReportsResponse' + /attribution.v1.AttributionService/ExportReport: + post: + tags: + - attribution.v1.AttributionService + summary: ExportReport + operationId: attribution.v1.AttributionService.ExportReport + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ExportReportRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ExportReportResponse' + /attribution.v1.AttributionService/RecordSignals: + post: + tags: + - attribution.v1.AttributionService + summary: RecordSignals + operationId: attribution.v1.AttributionService.RecordSignals + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.RecordSignalsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.RecordSignalsResponse' + /attribution.v1.AttributionService/GetSnapshot: + post: + tags: + - attribution.v1.AttributionService + summary: GetSnapshot + operationId: attribution.v1.AttributionService.GetSnapshot + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GetSnapshotRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.GetSnapshotResponse' + /attribution.v1.AttributionService/ListSnapshots: + post: + tags: + - attribution.v1.AttributionService + summary: ListSnapshots + operationId: attribution.v1.AttributionService.ListSnapshots + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ListSnapshotsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/attribution.v1.ListSnapshotsResponse' +components: + schemas: + attribution.v1.AttributionModel: + type: string + title: AttributionModel + enum: + - ATTRIBUTION_MODEL_UNSPECIFIED + - ATTRIBUTION_MODEL_DIRECT + - ATTRIBUTION_MODEL_ASSISTED + - ATTRIBUTION_MODEL_INFLUENCED + attribution.v1.AttributionSignalType: + type: string + title: AttributionSignalType + enum: + - ATTRIBUTION_SIGNAL_TYPE_UNSPECIFIED + - ATTRIBUTION_SIGNAL_TYPE_OBJECTIVE_COMPLETED + - ATTRIBUTION_SIGNAL_TYPE_TRACE_COMPLETED + attribution.v1.AttributionSubjectKind: + type: string + title: AttributionSubjectKind + enum: + - ATTRIBUTION_SUBJECT_KIND_UNSPECIFIED + - ATTRIBUTION_SUBJECT_KIND_DEAL + - ATTRIBUTION_SUBJECT_KIND_OBJECTIVE + attribution.v1.ReportExportFormat: + type: string + title: ReportExportFormat + enum: + - REPORT_EXPORT_FORMAT_UNSPECIFIED + - REPORT_EXPORT_FORMAT_JSON + - REPORT_EXPORT_FORMAT_CSV + attribution.v1.AgentSummary: + type: object + properties: + agentId: + type: string + title: agent_id + attributionWeight: + type: number + title: attribution_weight + format: double + attributedRevenueUsd: + type: number + title: attributed_revenue_usd + format: double + totalCostUsd: + type: number + title: total_cost_usd + format: double + roiMultiple: + type: number + title: roi_multiple + format: double + traceCount: + type: integer + title: trace_count + format: int32 + usageCount: + type: integer + title: usage_count + format: int32 + traceIds: + type: array + items: + type: string + title: trace_ids + usageRecordIds: + type: array + items: + type: string + title: usage_record_ids + title: AgentSummary + additionalProperties: false + attribution.v1.AttributionQuery: + type: object + properties: + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + dealIds: + type: array + items: + type: string + title: deal_ids + model: + title: model + $ref: '#/components/schemas/attribution.v1.AttributionModel' + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + includeTeamRollups: + type: boolean + title: include_team_rollups + objectiveIds: + type: array + items: + type: string + title: objective_ids + title: AttributionQuery + additionalProperties: false + attribution.v1.AttributionReport: + type: object + properties: + id: + type: string + title: id + query: + title: query + $ref: '#/components/schemas/attribution.v1.AttributionQuery' + generatedAt: + title: generated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + deals: + type: array + items: + $ref: '#/components/schemas/attribution.v1.DealAttribution' + title: deals + agentSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AgentSummary' + title: agent_summaries + teamSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.TeamSummary' + title: team_summaries + objectiveOutcomes: + type: array + items: + $ref: '#/components/schemas/attribution.v1.ObjectiveOutcomeAttribution' + title: objective_outcomes + objectiveAgentSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.ObjectiveAgentSummary' + title: objective_agent_summaries + objectiveTeamSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.ObjectiveTeamSummary' + title: objective_team_summaries + title: AttributionReport + additionalProperties: false + attribution.v1.AttributionReportSummary: + type: object + properties: + id: + type: string + title: id + query: + title: query + $ref: '#/components/schemas/attribution.v1.AttributionQuery' + generatedAt: + title: generated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + dealCount: + type: integer + title: deal_count + format: int32 + agentCount: + type: integer + title: agent_count + format: int32 + teamCount: + type: integer + title: team_count + format: int32 + objectiveOutcomeCount: + type: integer + title: objective_outcome_count + format: int32 + title: AttributionReportSummary + additionalProperties: false + attribution.v1.AttributionSignal: + type: object + oneOf: + - properties: + objectiveCompletion: + title: objective_completion + $ref: '#/components/schemas/attribution.v1.ObjectiveCompletionSignal' + title: objective_completion + required: + - objectiveCompletion + - properties: + traceCompletion: + title: trace_completion + $ref: '#/components/schemas/attribution.v1.TraceCompletionSignal' + title: trace_completion + required: + - traceCompletion + title: AttributionSignal + additionalProperties: false + attribution.v1.AttributionSnapshot: + type: object + oneOf: + - properties: + deal: + title: deal + $ref: '#/components/schemas/attribution.v1.DealAttribution' + title: deal + required: + - deal + - properties: + objectiveOutcome: + title: objective_outcome + $ref: '#/components/schemas/attribution.v1.ObjectiveOutcomeAttribution' + title: objective_outcome + required: + - objectiveOutcome + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + subjectKind: + title: subject_kind + $ref: '#/components/schemas/attribution.v1.AttributionSubjectKind' + subjectId: + type: string + title: subject_id + model: + title: model + $ref: '#/components/schemas/attribution.v1.AttributionModel' + signalType: + title: signal_type + $ref: '#/components/schemas/attribution.v1.AttributionSignalType' + signalId: + type: string + title: signal_id + windowStart: + title: window_start + $ref: '#/components/schemas/google.protobuf.Timestamp' + windowEnd: + title: window_end + $ref: '#/components/schemas/google.protobuf.Timestamp' + recordedAt: + title: recorded_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: AttributionSnapshot + additionalProperties: false + attribution.v1.DealAttribution: + type: object + properties: + deal: + title: deal + $ref: '#/components/schemas/attribution.v1.DealContext' + traceTouchpoints: + type: array + items: + $ref: '#/components/schemas/attribution.v1.TraceTouchpoint' + title: trace_touchpoints + usageTouchpoints: + type: array + items: + $ref: '#/components/schemas/attribution.v1.UsageTouchpoint' + title: usage_touchpoints + agentSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AgentSummary' + title: agent_summaries + teamSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.TeamSummary' + title: team_summaries + totalAttributedRevenueUsd: + type: number + title: total_attributed_revenue_usd + format: double + totalAttributedCostUsd: + type: number + title: total_attributed_cost_usd + format: double + unattributedRevenueUsd: + type: number + title: unattributed_revenue_usd + format: double + unattributedCostUsd: + type: number + title: unattributed_cost_usd + format: double + title: DealAttribution + additionalProperties: false + attribution.v1.DealContext: + type: object + properties: + dealId: + type: string + title: deal_id + title: + type: string + title: title + stage: + type: string + title: stage + value: + type: number + title: value + format: double + currency: + type: string + title: currency + ownerId: + type: string + title: owner_id + contactId: + type: string + title: contact_id + companyId: + type: string + title: company_id + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: DealContext + additionalProperties: false + attribution.v1.ExportReportRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/attribution.v1.AttributionQuery' + format: + title: format + $ref: '#/components/schemas/attribution.v1.ReportExportFormat' + title: ExportReportRequest + additionalProperties: false + attribution.v1.ExportReportResponse: + type: object + properties: + content: + type: string + title: content + format: byte + contentType: + type: string + title: content_type + filename: + type: string + title: filename + title: ExportReportResponse + additionalProperties: false + attribution.v1.GenerateReportRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/attribution.v1.AttributionQuery' + title: GenerateReportRequest + additionalProperties: false + attribution.v1.GenerateReportResponse: + type: object + properties: + report: + title: report + $ref: '#/components/schemas/attribution.v1.AttributionReport' + title: GenerateReportResponse + additionalProperties: false + attribution.v1.GetReportRequest: + type: object + properties: + reportId: + type: string + title: report_id + title: GetReportRequest + additionalProperties: false + attribution.v1.GetReportResponse: + type: object + properties: + report: + title: report + $ref: '#/components/schemas/attribution.v1.AttributionReport' + title: GetReportResponse + additionalProperties: false + attribution.v1.GetSnapshotRequest: + type: object + properties: + snapshotId: + type: string + title: snapshot_id + title: GetSnapshotRequest + additionalProperties: false + attribution.v1.GetSnapshotResponse: + type: object + properties: + snapshot: + title: snapshot + $ref: '#/components/schemas/attribution.v1.AttributionSnapshot' + title: GetSnapshotResponse + additionalProperties: false + attribution.v1.ListReportsRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + model: + title: model + $ref: '#/components/schemas/attribution.v1.AttributionModel' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListReportsRequest + additionalProperties: false + attribution.v1.ListReportsResponse: + type: object + properties: + reports: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AttributionReportSummary' + title: reports + hasMore: + type: boolean + title: has_more + title: ListReportsResponse + additionalProperties: false + attribution.v1.ListSnapshotsRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + subjectKind: + title: subject_kind + $ref: '#/components/schemas/attribution.v1.AttributionSubjectKind' + subjectId: + type: string + title: subject_id + model: + title: model + $ref: '#/components/schemas/attribution.v1.AttributionModel' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListSnapshotsRequest + additionalProperties: false + attribution.v1.ListSnapshotsResponse: + type: object + properties: + snapshots: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AttributionSnapshot' + title: snapshots + hasMore: + type: boolean + title: has_more + title: ListSnapshotsResponse + additionalProperties: false + attribution.v1.ObjectiveAgentSummary: + type: object + properties: + agentId: + type: string + title: agent_id + attributionWeight: + type: number + title: attribution_weight + format: double + attributedOutcomeCount: + type: number + title: attributed_outcome_count + format: double + totalCostUsd: + type: number + title: total_cost_usd + format: double + traceCount: + type: integer + title: trace_count + format: int32 + usageCount: + type: integer + title: usage_count + format: int32 + traceIds: + type: array + items: + type: string + title: trace_ids + usageRecordIds: + type: array + items: + type: string + title: usage_record_ids + title: ObjectiveAgentSummary + additionalProperties: false + attribution.v1.ObjectiveCompletionSignal: + type: object + properties: + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + objectiveId: + type: string + title: objective_id + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ObjectiveCompletionSignal + additionalProperties: false + attribution.v1.ObjectiveContext: + type: object + properties: + objectiveId: + type: string + title: objective_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + title: + type: string + title: title + description: + type: string + title: description + state: + type: string + title: state + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ObjectiveContext + additionalProperties: false + attribution.v1.ObjectiveOutcomeAttribution: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/attribution.v1.ObjectiveContext' + traceTouchpoints: + type: array + items: + $ref: '#/components/schemas/attribution.v1.TraceTouchpoint' + title: trace_touchpoints + usageTouchpoints: + type: array + items: + $ref: '#/components/schemas/attribution.v1.UsageTouchpoint' + title: usage_touchpoints + agentSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.ObjectiveAgentSummary' + title: agent_summaries + teamSummaries: + type: array + items: + $ref: '#/components/schemas/attribution.v1.ObjectiveTeamSummary' + title: team_summaries + totalAttributedOutcomeCount: + type: number + title: total_attributed_outcome_count + format: double + totalAttributedCostUsd: + type: number + title: total_attributed_cost_usd + format: double + unattributedOutcomeCount: + type: number + title: unattributed_outcome_count + format: double + unattributedCostUsd: + type: number + title: unattributed_cost_usd + format: double + title: ObjectiveOutcomeAttribution + additionalProperties: false + attribution.v1.ObjectiveTeamSummary: + type: object + properties: + teamId: + type: string + title: team_id + attributionWeight: + type: number + title: attribution_weight + format: double + attributedOutcomeCount: + type: number + title: attributed_outcome_count + format: double + totalCostUsd: + type: number + title: total_cost_usd + format: double + agentIds: + type: array + items: + type: string + title: agent_ids + title: ObjectiveTeamSummary + additionalProperties: false + attribution.v1.RecordSignalsRequest: + type: object + properties: + signals: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AttributionSignal' + title: signals + models: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AttributionModel' + title: models + includeTeamRollups: + type: boolean + title: include_team_rollups + title: RecordSignalsRequest + additionalProperties: false + attribution.v1.RecordSignalsResponse: + type: object + properties: + snapshots: + type: array + items: + $ref: '#/components/schemas/attribution.v1.AttributionSnapshot' + title: snapshots + title: RecordSignalsResponse + additionalProperties: false + attribution.v1.TeamSummary: + type: object + properties: + teamId: + type: string + title: team_id + attributedRevenueUsd: + type: number + title: attributed_revenue_usd + format: double + totalCostUsd: + type: number + title: total_cost_usd + format: double + roiMultiple: + type: number + title: roi_multiple + format: double + agentIds: + type: array + items: + type: string + title: agent_ids + title: TeamSummary + additionalProperties: false + attribution.v1.TraceCompletionSignal: + type: object + properties: + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + traceId: + type: string + title: trace_id + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: TraceCompletionSignal + additionalProperties: false + attribution.v1.TraceTouchpoint: + type: object + properties: + trace: + title: trace + $ref: '#/components/schemas/traces.v1.TraceSummary' + matchReasons: + type: array + items: + type: string + title: match_reasons + title: TraceTouchpoint + additionalProperties: false + attribution.v1.UsageTouchpoint: + type: object + properties: + recordId: + type: string + title: record_id + requestId: + type: string + title: request_id + agentId: + type: string + title: agent_id + teamId: + type: string + title: team_id + surface: + type: string + title: surface + model: + type: string + title: model + provider: + type: string + title: provider + inputTokens: + type: + - integer + - string + title: input_tokens + format: int64 + outputTokens: + type: + - integer + - string + title: output_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + observedAt: + title: observed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: UsageTouchpoint + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + traces.v1.TraceSummary: + type: object + properties: + traceId: + type: string + title: trace_id + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + rootSpanName: + type: string + title: root_span_name + totalSpans: + type: integer + title: total_spans + format: int32 + totalTokenInput: + type: + - integer + - string + title: total_token_input + format: int64 + totalTokenOutput: + type: + - integer + - string + title: total_token_output + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + totalLatencyMs: + type: + - integer + - string + title: total_latency_ms + format: int64 + startedAt: + title: started_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + endedAt: + title: ended_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: TraceSummary + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: attribution.v1.AttributionService + description: AttributionService computes revenue attribution and ROI across traces and usage. diff --git a/gen/openapi/audit/v1/audit.openapi.yaml b/gen/openapi/audit/v1/audit.openapi.yaml new file mode 100644 index 0000000..25deda4 --- /dev/null +++ b/gen/openapi/audit/v1/audit.openapi.yaml @@ -0,0 +1,515 @@ +openapi: 3.1.0 +info: + title: audit.v1 +paths: + /audit.v1.AuditService/RecordEvent: + post: + tags: + - audit.v1.AuditService + summary: RecordEvent + operationId: audit.v1.AuditService.RecordEvent + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/audit.v1.RecordEventRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/audit.v1.RecordEventResponse' + /audit.v1.AuditService/QueryEvents: + post: + tags: + - audit.v1.AuditService + summary: QueryEvents + operationId: audit.v1.AuditService.QueryEvents + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/audit.v1.QueryEventsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/audit.v1.QueryEventsResponse' + /audit.v1.AuditService/ExportEvents: {} +components: + schemas: + audit.v1.Actor: + type: object + properties: + id: + type: string + title: id + type: + type: string + title: type + email: + type: string + title: email + ipAddress: + type: string + title: ip_address + userAgent: + type: string + title: user_agent + service: + type: string + title: service + deviceId: + type: string + title: device_id + title: Actor + additionalProperties: false + description: |- + Actor identifies who performed an action. + Unifies the actor concept across chat's AuditEvent, gate's AuditEntry, + and the standalone audit service's RecordEventRequest. + audit.v1.Event: + type: object + properties: + eventId: + type: string + title: event_id + timestamp: + title: timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + actor: + title: actor + $ref: '#/components/schemas/audit.v1.Actor' + resource: + title: resource + $ref: '#/components/schemas/audit.v1.Resource' + action: + type: string + title: action + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + outcome: + type: string + title: outcome + errorMessage: + type: string + title: error_message + beforeState: + type: string + title: before_state + afterState: + type: string + title: after_state + dataClassification: + type: string + title: data_classification + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + checksum: + type: string + title: checksum + description: Tamper-evidence chain + previousEventId: + type: string + title: previous_event_id + title: Event + additionalProperties: false + description: Event is the canonical audit event. + audit.v1.Event.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + audit.v1.ExportEventsRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + format: + type: string + title: format + includeStateChanges: + type: boolean + title: include_state_changes + exportReason: + type: string + title: export_reason + title: ExportEventsRequest + additionalProperties: false + audit.v1.ExportEventsResponse: + type: object + properties: + data: + type: string + title: data + format: byte + contentType: + type: string + title: content_type + filename: + type: string + title: filename + title: ExportEventsResponse + additionalProperties: false + audit.v1.QueryEventsRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + actorId: + type: string + title: actor_id + actorType: + type: string + title: actor_type + action: + type: string + title: action + resourceType: + type: string + title: resource_type + resourceId: + type: string + title: resource_id + outcome: + type: string + title: outcome + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + includeStateChanges: + type: boolean + title: include_state_changes + title: QueryEventsRequest + additionalProperties: false + audit.v1.QueryEventsResponse: + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/audit.v1.Event' + title: events + total: + type: integer + title: total + format: int32 + title: QueryEventsResponse + additionalProperties: false + audit.v1.RecordEventRequest: + type: object + properties: + actor: + title: actor + $ref: '#/components/schemas/audit.v1.Actor' + resource: + title: resource + $ref: '#/components/schemas/audit.v1.Resource' + action: + type: string + title: action + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + outcome: + type: string + title: outcome + errorMessage: + type: string + title: error_message + beforeState: + type: string + title: before_state + afterState: + type: string + title: after_state + dataClassification: + type: string + title: data_classification + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + requestId: + type: string + title: request_id + traceId: + type: string + title: trace_id + title: RecordEventRequest + additionalProperties: false + audit.v1.RecordEventRequest.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + audit.v1.RecordEventResponse: + type: object + properties: + eventId: + type: string + title: event_id + timestamp: + title: timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + checksum: + type: string + title: checksum + title: RecordEventResponse + additionalProperties: false + audit.v1.Resource: + type: object + properties: + type: + type: string + title: type + id: + type: string + title: id + name: + type: string + title: name + title: Resource + additionalProperties: false + description: Resource identifies what was acted upon. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: audit.v1.AuditService + description: |- + AuditService records and queries audit events across EvalOps services. + This is the cross-service audit contract. Gate and chat each have their own + domain-specific audit protos that extend these base types. diff --git a/gen/openapi/compliance/v1/compliance.openapi.yaml b/gen/openapi/compliance/v1/compliance.openapi.yaml new file mode 100644 index 0000000..ae715c5 --- /dev/null +++ b/gen/openapi/compliance/v1/compliance.openapi.yaml @@ -0,0 +1,795 @@ +openapi: 3.1.0 +info: + title: compliance.v1 +paths: + /compliance.v1.ComplianceService/GenerateEvidencePackage: + post: + tags: + - compliance.v1.ComplianceService + summary: GenerateEvidencePackage + operationId: compliance.v1.ComplianceService.GenerateEvidencePackage + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.GenerateEvidencePackageRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.GenerateEvidencePackageResponse' + /compliance.v1.ComplianceService/DetectGaps: + post: + tags: + - compliance.v1.ComplianceService + summary: DetectGaps + operationId: compliance.v1.ComplianceService.DetectGaps + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.DetectGapsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.DetectGapsResponse' + /compliance.v1.ComplianceService/GetCoverage: + post: + tags: + - compliance.v1.ComplianceService + summary: GetCoverage + operationId: compliance.v1.ComplianceService.GetCoverage + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.GetCoverageRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.GetCoverageResponse' + /compliance.v1.ComplianceService/ExportPackage: + post: + tags: + - compliance.v1.ComplianceService + summary: ExportPackage + operationId: compliance.v1.ComplianceService.ExportPackage + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.ExportPackageRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/compliance.v1.ExportPackageResponse' +components: + schemas: + approvals.v1.DecisionType: + type: string + title: DecisionType + enum: + - DECISION_TYPE_UNSPECIFIED + - DECISION_TYPE_APPROVED + - DECISION_TYPE_DENIED + - DECISION_TYPE_ESCALATED + - DECISION_TYPE_EXPIRED + - DECISION_TYPE_AUTO_APPROVED + description: DecisionType describes the outcome of an approval request. + approvals.v1.RiskLevel: + type: string + title: RiskLevel + enum: + - RISK_LEVEL_UNSPECIFIED + - RISK_LEVEL_LOW + - RISK_LEVEL_MEDIUM + - RISK_LEVEL_HIGH + - RISK_LEVEL_CRITICAL + description: RiskLevel classifies the risk of an action. + compliance.v1.ComplianceFramework: + type: string + title: ComplianceFramework + enum: + - COMPLIANCE_FRAMEWORK_UNSPECIFIED + - COMPLIANCE_FRAMEWORK_SOC2 + - COMPLIANCE_FRAMEWORK_HIPAA + - COMPLIANCE_FRAMEWORK_NIST_CSF + compliance.v1.ExportFormat: + type: string + title: ExportFormat + enum: + - EXPORT_FORMAT_UNSPECIFIED + - EXPORT_FORMAT_JSON + - EXPORT_FORMAT_CSV + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + governance.v1.ActionDecision: + type: string + title: ActionDecision + enum: + - ACTION_DECISION_UNSPECIFIED + - ACTION_DECISION_ALLOW + - ACTION_DECISION_DENY + - ACTION_DECISION_REQUIRE_APPROVAL + description: ActionDecision describes the governance decision for an action. + governance.v1.RiskLevel: + type: string + title: RiskLevel + enum: + - RISK_LEVEL_UNSPECIFIED + - RISK_LEVEL_LOW + - RISK_LEVEL_MEDIUM + - RISK_LEVEL_HIGH + - RISK_LEVEL_CRITICAL + description: RiskLevel classifies the risk of an action. + approvals.v1.ApprovalDecision: + type: object + properties: + id: + type: string + title: id + approvalRequestId: + type: string + title: approval_request_id + decision: + title: decision + $ref: '#/components/schemas/approvals.v1.DecisionType' + decidedBy: + type: string + title: decided_by + reason: + type: string + title: reason + decidedAt: + title: decided_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ApprovalDecision + additionalProperties: false + description: ApprovalDecision records a decision made on an approval request. + approvals.v1.ApprovalRequest: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + approverUserId: + type: string + title: approver_user_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + actionType: + type: string + title: action_type + actionPayload: + type: string + title: action_payload + format: byte + riskLevel: + title: risk_level + $ref: '#/components/schemas/approvals.v1.RiskLevel' + contextJson: + type: string + title: context_json + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ApprovalRequest + additionalProperties: false + description: ApprovalRequest is the canonical approval request record. + compliance.v1.ApprovalEvidence: + type: object + properties: + request: + title: request + $ref: '#/components/schemas/approvals.v1.ApprovalRequest' + decisions: + type: array + items: + $ref: '#/components/schemas/approvals.v1.ApprovalDecision' + title: decisions + state: + type: string + title: state + title: ApprovalEvidence + additionalProperties: false + compliance.v1.ControlCoverage: + type: object + properties: + controlId: + type: string + title: control_id + controlName: + type: string + title: control_name + controlDescription: + type: string + title: control_description + evidenceCount: + type: integer + title: evidence_count + format: int32 + covered: + type: boolean + title: covered + lastObservedAt: + title: last_observed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + evidenceSourceIds: + type: array + items: + type: string + title: evidence_source_ids + title: ControlCoverage + additionalProperties: false + compliance.v1.DetectGapsRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/compliance.v1.EvidenceQuery' + title: DetectGapsRequest + additionalProperties: false + compliance.v1.DetectGapsResponse: + type: object + properties: + gaps: + type: array + items: + $ref: '#/components/schemas/compliance.v1.GapResult' + title: gaps + title: DetectGapsResponse + additionalProperties: false + compliance.v1.EvidenceItem: + type: object + properties: + source: + type: string + title: source + sourceId: + type: string + title: source_id + actorId: + type: string + title: actor_id + actorName: + type: string + title: actor_name + action: + type: string + title: action + resourceType: + type: string + title: resource_type + resourceId: + type: string + title: resource_id + outcome: + type: string + title: outcome + controlIds: + type: array + items: + type: string + title: control_ids + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + observedAt: + title: observed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: EvidenceItem + additionalProperties: false + compliance.v1.EvidencePackage: + type: object + properties: + id: + type: string + title: id + query: + title: query + $ref: '#/components/schemas/compliance.v1.EvidenceQuery' + generatedAt: + title: generated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + evidenceItems: + type: array + items: + $ref: '#/components/schemas/compliance.v1.EvidenceItem' + title: evidence_items + controlCoverage: + type: array + items: + $ref: '#/components/schemas/compliance.v1.ControlCoverage' + title: control_coverage + gaps: + type: array + items: + $ref: '#/components/schemas/compliance.v1.GapResult' + title: gaps + retentionPolicy: + title: retention_policy + $ref: '#/components/schemas/governance.v1.RetentionPolicy' + safetyPolicy: + title: safety_policy + $ref: '#/components/schemas/governance.v1.SafetyPolicy' + approvals: + type: array + items: + $ref: '#/components/schemas/compliance.v1.ApprovalEvidence' + title: approvals + title: EvidencePackage + additionalProperties: false + compliance.v1.EvidenceQuery: + type: object + properties: + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + framework: + title: framework + $ref: '#/components/schemas/compliance.v1.ComplianceFramework' + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + approvalRequestIds: + type: array + items: + type: string + title: approval_request_ids + title: EvidenceQuery + additionalProperties: false + compliance.v1.ExportPackageRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/compliance.v1.EvidenceQuery' + format: + title: format + $ref: '#/components/schemas/compliance.v1.ExportFormat' + title: ExportPackageRequest + additionalProperties: false + compliance.v1.ExportPackageResponse: + type: object + properties: + content: + type: string + title: content + format: byte + contentType: + type: string + title: content_type + filename: + type: string + title: filename + title: ExportPackageResponse + additionalProperties: false + compliance.v1.GapResult: + type: object + properties: + controlId: + type: string + title: control_id + controlName: + type: string + title: control_name + controlDescription: + type: string + title: control_description + reason: + type: string + title: reason + title: GapResult + additionalProperties: false + compliance.v1.GenerateEvidencePackageRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/compliance.v1.EvidenceQuery' + title: GenerateEvidencePackageRequest + additionalProperties: false + compliance.v1.GenerateEvidencePackageResponse: + type: object + properties: + evidencePackage: + title: evidence_package + $ref: '#/components/schemas/compliance.v1.EvidencePackage' + title: GenerateEvidencePackageResponse + additionalProperties: false + compliance.v1.GetCoverageRequest: + type: object + properties: + query: + title: query + $ref: '#/components/schemas/compliance.v1.EvidenceQuery' + title: GetCoverageRequest + additionalProperties: false + compliance.v1.GetCoverageResponse: + type: object + properties: + controlCoverage: + type: array + items: + $ref: '#/components/schemas/compliance.v1.ControlCoverage' + title: control_coverage + coveredControls: + type: integer + title: covered_controls + format: int32 + totalControls: + type: integer + title: total_controls + format: int32 + coverageRatio: + type: number + title: coverage_ratio + format: double + title: GetCoverageResponse + additionalProperties: false + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + governance.v1.RetentionPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + retentionDays: + type: integer + title: retention_days + format: int32 + legalHoldOverride: + type: boolean + title: legal_hold_override + title: RetentionPolicy + additionalProperties: false + description: RetentionPolicy defines data retention rules for a workspace. + governance.v1.SafetyPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + rules: + type: array + items: + $ref: '#/components/schemas/governance.v1.SafetyRule' + title: rules + title: SafetyPolicy + additionalProperties: false + description: SafetyPolicy defines the safety rules for a workspace. + governance.v1.SafetyRule: + type: object + properties: + id: + type: string + title: id + pattern: + type: string + title: pattern + action: + title: action + $ref: '#/components/schemas/governance.v1.ActionDecision' + riskLevel: + title: risk_level + $ref: '#/components/schemas/governance.v1.RiskLevel' + description: + type: string + title: description + title: SafetyRule + additionalProperties: false + description: SafetyRule is a single rule within a safety policy. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: compliance.v1.ComplianceService + description: ComplianceService generates evidence packages and control coverage views. diff --git a/gen/openapi/config/v1/config.openapi.yaml b/gen/openapi/config/v1/config.openapi.yaml new file mode 100644 index 0000000..3ed0271 --- /dev/null +++ b/gen/openapi/config/v1/config.openapi.yaml @@ -0,0 +1,46 @@ +openapi: 3.1.0 +info: + title: config.v1 +paths: {} +components: + schemas: + config.v1.FeatureFlag: + type: object + properties: + key: + type: string + title: key + enabled: + type: boolean + title: enabled + rolloutPercent: + type: integer + title: rollout_percent + owners: + type: array + items: + type: string + title: owners + description: + type: string + title: description + title: FeatureFlag + additionalProperties: false + description: FeatureFlag describes a single rollout, migration, or kill-switch control. + config.v1.FeatureFlagSnapshot: + type: object + properties: + schemaVersion: + type: integer + title: schema_version + flags: + type: array + items: + $ref: '#/components/schemas/config.v1.FeatureFlag' + title: flags + title: FeatureFlagSnapshot + additionalProperties: false + description: |- + FeatureFlagSnapshot is the canonical shared snapshot for lightweight dynamic + runtime configuration and feature-flag state. +security: [] diff --git a/gen/openapi/connectors/v1/connectors.openapi.yaml b/gen/openapi/connectors/v1/connectors.openapi.yaml new file mode 100644 index 0000000..cdb1173 --- /dev/null +++ b/gen/openapi/connectors/v1/connectors.openapi.yaml @@ -0,0 +1,869 @@ +openapi: 3.1.0 +info: + title: connectors.v1 +paths: + /connectors.v1.ConnectorService/RegisterConnection: + post: + tags: + - connectors.v1.ConnectorService + summary: RegisterConnection + operationId: connectors.v1.ConnectorService.RegisterConnection + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RegisterConnectionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RegisterConnectionResponse' + /connectors.v1.ConnectorService/GetConnection: + post: + tags: + - connectors.v1.ConnectorService + summary: GetConnection + operationId: connectors.v1.ConnectorService.GetConnection + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetConnectionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetConnectionResponse' + /connectors.v1.ConnectorService/ListConnections: + post: + tags: + - connectors.v1.ConnectorService + summary: ListConnections + operationId: connectors.v1.ConnectorService.ListConnections + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.ListConnectionsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.ListConnectionsResponse' + /connectors.v1.ConnectorService/RefreshConnection: + post: + tags: + - connectors.v1.ConnectorService + summary: RefreshConnection + operationId: connectors.v1.ConnectorService.RefreshConnection + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RefreshConnectionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RefreshConnectionResponse' + /connectors.v1.ConnectorService/RevokeConnection: + post: + tags: + - connectors.v1.ConnectorService + summary: RevokeConnection + operationId: connectors.v1.ConnectorService.RevokeConnection + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RevokeConnectionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.RevokeConnectionResponse' + /connectors.v1.ConnectorService/GetHealth: + post: + tags: + - connectors.v1.ConnectorService + summary: GetHealth + operationId: connectors.v1.ConnectorService.GetHealth + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetHealthRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetHealthResponse' + /connectors.v1.ConnectorService/ResolveSourceOfTruth: + post: + tags: + - connectors.v1.ConnectorService + summary: ResolveSourceOfTruth + operationId: connectors.v1.ConnectorService.ResolveSourceOfTruth + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.ResolveSourceOfTruthRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.ResolveSourceOfTruthResponse' + /connectors.v1.ConnectorService/GetDegradedReadPolicy: + post: + tags: + - connectors.v1.ConnectorService + summary: GetDegradedReadPolicy + operationId: connectors.v1.ConnectorService.GetDegradedReadPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetDegradedReadPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetDegradedReadPolicyResponse' + /connectors.v1.ConnectorService/SetSourceOfTruthPolicy: + post: + tags: + - connectors.v1.ConnectorService + summary: SetSourceOfTruthPolicy + operationId: connectors.v1.ConnectorService.SetSourceOfTruthPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.SetSourceOfTruthPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.SetSourceOfTruthPolicyResponse' + /connectors.v1.ConnectorService/GetCapabilities: + post: + tags: + - connectors.v1.ConnectorService + summary: GetCapabilities + operationId: connectors.v1.ConnectorService.GetCapabilities + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetCapabilitiesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/connectors.v1.GetCapabilitiesResponse' +components: + schemas: + connectors.v1.AuthType: + type: string + title: AuthType + enum: + - AUTH_TYPE_UNSPECIFIED + - AUTH_TYPE_OAUTH2 + - AUTH_TYPE_API_KEY + - AUTH_TYPE_BASIC + - AUTH_TYPE_MTLS + description: AuthType describes the authentication method for a connection. + connectors.v1.HealthStatus: + type: string + title: HealthStatus + enum: + - HEALTH_STATUS_UNSPECIFIED + - HEALTH_STATUS_HEALTHY + - HEALTH_STATUS_DEGRADED + - HEALTH_STATUS_UNHEALTHY + - HEALTH_STATUS_UNKNOWN + description: HealthStatus describes the health state of a connection. + connectors.v1.SourceOfTruthArea: + type: string + title: SourceOfTruthArea + enum: + - SOURCE_OF_TRUTH_AREA_UNSPECIFIED + - SOURCE_OF_TRUTH_AREA_CRM + - SOURCE_OF_TRUTH_AREA_SUPPORT + - SOURCE_OF_TRUTH_AREA_BILLING + - SOURCE_OF_TRUTH_AREA_ANALYTICS + - SOURCE_OF_TRUTH_AREA_HRIS + description: SourceOfTruthArea identifies a functional domain for source-of-truth resolution. + connectors.v1.Connection: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + providerId: + type: string + title: provider_id + displayName: + type: string + title: display_name + authType: + title: auth_type + $ref: '#/components/schemas/connectors.v1.AuthType' + scopes: + type: array + items: + type: string + title: scopes + healthStatus: + title: health_status + $ref: '#/components/schemas/connectors.v1.HealthStatus' + lastHealthyAt: + title: last_healthy_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + credentialRefs: + type: object + title: credential_refs + additionalProperties: + type: string + title: value + description: |- + credential_refs mirrors non-secret credential references such as vault or + secret-manager handles. Raw credential material must not be returned here. + title: Connection + additionalProperties: false + description: Connection is the canonical external integration connection record. + connectors.v1.Connection.CredentialRefsEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: CredentialRefsEntry + additionalProperties: false + connectors.v1.ConnectionHealth: + type: object + properties: + status: + title: status + $ref: '#/components/schemas/connectors.v1.HealthStatus' + latencyMs: + type: integer + title: latency_ms + format: int32 + lastCheckAt: + title: last_check_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + errorMessage: + type: string + title: error_message + title: ConnectionHealth + additionalProperties: false + description: ConnectionHealth provides detailed health information for a connection. + connectors.v1.DegradedReadPolicy: + type: object + properties: + mode: + type: string + title: mode + allowedIntegrations: + type: array + items: + type: string + title: allowed_integrations + maxAgeMinutes: + type: integer + title: max_age_minutes + format: int32 + queuePrimaryRefresh: + type: boolean + title: queue_primary_refresh + title: DegradedReadPolicy + additionalProperties: false + description: DegradedReadPolicy defines behavior when the primary source is unavailable. + connectors.v1.GetCapabilitiesRequest: + type: object + properties: + connectionId: + type: string + title: connection_id + title: GetCapabilitiesRequest + additionalProperties: false + connectors.v1.GetCapabilitiesResponse: + type: object + properties: + capabilities: + type: array + items: + type: string + title: capabilities + title: GetCapabilitiesResponse + additionalProperties: false + connectors.v1.GetConnectionRequest: + type: object + properties: + id: + type: string + title: id + title: GetConnectionRequest + additionalProperties: false + connectors.v1.GetConnectionResponse: + type: object + properties: + connection: + title: connection + $ref: '#/components/schemas/connectors.v1.Connection' + title: GetConnectionResponse + additionalProperties: false + connectors.v1.GetDegradedReadPolicyRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + title: GetDegradedReadPolicyRequest + additionalProperties: false + connectors.v1.GetDegradedReadPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/connectors.v1.DegradedReadPolicy' + title: GetDegradedReadPolicyResponse + additionalProperties: false + connectors.v1.GetHealthRequest: + type: object + properties: + connectionId: + type: string + title: connection_id + title: GetHealthRequest + additionalProperties: false + connectors.v1.GetHealthResponse: + type: object + properties: + health: + title: health + $ref: '#/components/schemas/connectors.v1.ConnectionHealth' + title: GetHealthResponse + additionalProperties: false + connectors.v1.ListConnectionsRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListConnectionsRequest + additionalProperties: false + connectors.v1.ListConnectionsResponse: + type: object + properties: + connections: + type: array + items: + $ref: '#/components/schemas/connectors.v1.Connection' + title: connections + total: + type: integer + title: total + format: int32 + title: ListConnectionsResponse + additionalProperties: false + connectors.v1.RefreshConnectionRequest: + type: object + properties: + id: + type: string + title: id + title: RefreshConnectionRequest + additionalProperties: false + connectors.v1.RefreshConnectionResponse: + type: object + properties: + connection: + title: connection + $ref: '#/components/schemas/connectors.v1.Connection' + title: RefreshConnectionResponse + additionalProperties: false + connectors.v1.RegisterConnectionRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + providerId: + type: string + title: provider_id + displayName: + type: string + title: display_name + authType: + title: auth_type + $ref: '#/components/schemas/connectors.v1.AuthType' + scopes: + type: array + items: + type: string + title: scopes + credentials: + type: object + title: credentials + additionalProperties: + type: string + title: value + title: RegisterConnectionRequest + additionalProperties: false + connectors.v1.RegisterConnectionRequest.CredentialsEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: CredentialsEntry + additionalProperties: false + connectors.v1.RegisterConnectionResponse: + type: object + properties: + connection: + title: connection + $ref: '#/components/schemas/connectors.v1.Connection' + title: RegisterConnectionResponse + additionalProperties: false + connectors.v1.ResolveSourceOfTruthRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + area: + title: area + $ref: '#/components/schemas/connectors.v1.SourceOfTruthArea' + title: ResolveSourceOfTruthRequest + additionalProperties: false + connectors.v1.ResolveSourceOfTruthResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/connectors.v1.SourceOfTruthPolicy' + primaryConnection: + title: primary_connection + $ref: '#/components/schemas/connectors.v1.Connection' + title: ResolveSourceOfTruthResponse + additionalProperties: false + connectors.v1.RevokeConnectionRequest: + type: object + properties: + id: + type: string + title: id + title: RevokeConnectionRequest + additionalProperties: false + connectors.v1.RevokeConnectionResponse: + type: object + title: RevokeConnectionResponse + additionalProperties: false + connectors.v1.SetSourceOfTruthPolicyRequest: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/connectors.v1.SourceOfTruthPolicy' + title: SetSourceOfTruthPolicyRequest + additionalProperties: false + connectors.v1.SetSourceOfTruthPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/connectors.v1.SourceOfTruthPolicy' + title: SetSourceOfTruthPolicyResponse + additionalProperties: false + connectors.v1.SourceOfTruthPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + area: + title: area + $ref: '#/components/schemas/connectors.v1.SourceOfTruthArea' + primaryConnectionId: + type: string + title: primary_connection_id + fallbackConnectionId: + type: string + title: fallback_connection_id + title: SourceOfTruthPolicy + additionalProperties: false + description: SourceOfTruthPolicy defines which connection is authoritative for a domain. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: connectors.v1.ConnectorService + description: ConnectorService manages external integration connections. diff --git a/gen/openapi/entities/v1/entities.openapi.yaml b/gen/openapi/entities/v1/entities.openapi.yaml new file mode 100644 index 0000000..404069c --- /dev/null +++ b/gen/openapi/entities/v1/entities.openapi.yaml @@ -0,0 +1,923 @@ +openapi: 3.1.0 +info: + title: entities.v1 +paths: + /entities.v1.EntityService/Resolve: + post: + tags: + - entities.v1.EntityService + summary: Resolve + operationId: entities.v1.EntityService.Resolve + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.ResolveRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.ResolveResponse' + /entities.v1.EntityService/Correlate: + post: + tags: + - entities.v1.EntityService + summary: Correlate + operationId: entities.v1.EntityService.Correlate + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.CorrelateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.CorrelateResponse' + /entities.v1.EntityService/GetCanonical: + post: + tags: + - entities.v1.EntityService + summary: GetCanonical + operationId: entities.v1.EntityService.GetCanonical + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.GetCanonicalRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.GetCanonicalResponse' + /entities.v1.EntityService/Search: + post: + tags: + - entities.v1.EntityService + summary: Search + operationId: entities.v1.EntityService.Search + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.SearchRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.SearchResponse' + /entities.v1.EntityService/LinkEntity: + post: + tags: + - entities.v1.EntityService + summary: LinkEntity + operationId: entities.v1.EntityService.LinkEntity + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.LinkEntityRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.LinkEntityResponse' + /entities.v1.EntityService/UnlinkEntity: + post: + tags: + - entities.v1.EntityService + summary: UnlinkEntity + operationId: entities.v1.EntityService.UnlinkEntity + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.UnlinkEntityRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.UnlinkEntityResponse' + /entities.v1.EntityService/MergeEntities: + post: + tags: + - entities.v1.EntityService + summary: MergeEntities + operationId: entities.v1.EntityService.MergeEntities + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.MergeEntitiesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.MergeEntitiesResponse' + /entities.v1.EntityService/SplitEntity: + post: + tags: + - entities.v1.EntityService + summary: SplitEntity + operationId: entities.v1.EntityService.SplitEntity + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.SplitEntityRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.SplitEntityResponse' + /entities.v1.EntityService/GetCorrelationGraph: + post: + tags: + - entities.v1.EntityService + summary: GetCorrelationGraph + operationId: entities.v1.EntityService.GetCorrelationGraph + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.GetCorrelationGraphRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.GetCorrelationGraphResponse' + /entities.v1.EntityService/IngestResult: + post: + tags: + - entities.v1.EntityService + summary: IngestResult + operationId: entities.v1.EntityService.IngestResult + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.IngestResultRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/entities.v1.IngestResultResponse' +components: + schemas: + entities.v1.EntityType: + type: string + title: EntityType + enum: + - ENTITY_TYPE_UNSPECIFIED + - ENTITY_TYPE_CONTACT + - ENTITY_TYPE_COMPANY + - ENTITY_TYPE_DEAL + - ENTITY_TYPE_TICKET + - ENTITY_TYPE_CUSTOMER + - ENTITY_TYPE_OPPORTUNITY + description: EntityType identifies the kind of entity across systems. + entities.v1.MatchMethod: + type: string + title: MatchMethod + enum: + - MATCH_METHOD_UNSPECIFIED + - MATCH_METHOD_EMAIL + - MATCH_METHOD_DOMAIN + - MATCH_METHOD_COMPANY_NAME + - MATCH_METHOD_RECORD_NAME + - MATCH_METHOD_MANUAL + description: MatchMethod describes how two entities were correlated. + entities.v1.CanonicalEntity: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + primaryType: + title: primary_type + $ref: '#/components/schemas/entities.v1.EntityType' + primaryName: + type: string + title: primary_name + refs: + type: array + items: + $ref: '#/components/schemas/entities.v1.CrossSystemRef' + title: refs + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: CanonicalEntity + additionalProperties: false + description: CanonicalEntity is the unified, deduplicated entity record. + entities.v1.CorrelateRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + emails: + type: array + items: + type: string + title: emails + domains: + type: array + items: + type: string + title: domains + companyName: + type: string + title: company_name + recordName: + type: string + title: record_name + title: CorrelateRequest + additionalProperties: false + entities.v1.CorrelateResponse: + type: object + properties: + groups: + type: array + items: + $ref: '#/components/schemas/entities.v1.CorrelationGroup' + title: groups + title: CorrelateResponse + additionalProperties: false + entities.v1.CorrelationGroup: + type: object + properties: + id: + type: string + title: id + primaryName: + type: string + title: primary_name + primaryType: + title: primary_type + $ref: '#/components/schemas/entities.v1.EntityType' + entities: + type: array + items: + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: entities + matches: + type: array + items: + $ref: '#/components/schemas/entities.v1.CorrelationMatch' + title: matches + title: CorrelationGroup + additionalProperties: false + description: CorrelationGroup is a cluster of correlated entities. + entities.v1.CorrelationMatch: + type: object + properties: + matchedBy: + title: matched_by + $ref: '#/components/schemas/entities.v1.MatchMethod' + matchedValue: + type: string + title: matched_value + confidence: + type: number + title: confidence + format: float + title: CorrelationMatch + additionalProperties: false + description: CorrelationMatch describes a single match between entities. + entities.v1.CrossSystemRef: + type: object + properties: + integrationId: + type: string + title: integration_id + recordId: + type: string + title: record_id + entityType: + title: entity_type + $ref: '#/components/schemas/entities.v1.EntityType' + displayName: + type: string + title: display_name + emails: + type: array + items: + type: string + title: emails + domains: + type: array + items: + type: string + title: domains + confidence: + type: number + title: confidence + format: float + title: CrossSystemRef + additionalProperties: false + description: CrossSystemRef links a canonical entity to a record in an external system. + entities.v1.CrossSystemRefKey: + type: object + properties: + integrationId: + type: string + title: integration_id + recordId: + type: string + title: record_id + title: CrossSystemRefKey + additionalProperties: false + entities.v1.GetCanonicalRequest: + type: object + properties: + id: + type: string + title: id + title: GetCanonicalRequest + additionalProperties: false + entities.v1.GetCanonicalResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: GetCanonicalResponse + additionalProperties: false + entities.v1.GetCorrelationGraphRequest: + type: object + properties: + canonicalEntityId: + type: string + title: canonical_entity_id + depth: + type: integer + title: depth + format: int32 + title: GetCorrelationGraphRequest + additionalProperties: false + entities.v1.GetCorrelationGraphResponse: + type: object + properties: + groups: + type: array + items: + $ref: '#/components/schemas/entities.v1.CorrelationGroup' + title: groups + title: GetCorrelationGraphResponse + additionalProperties: false + entities.v1.IngestResultRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + integrationId: + type: string + title: integration_id + recordId: + type: string + title: record_id + entityType: + title: entity_type + $ref: '#/components/schemas/entities.v1.EntityType' + displayName: + type: string + title: display_name + emails: + type: array + items: + type: string + title: emails + domains: + type: array + items: + type: string + title: domains + title: IngestResultRequest + additionalProperties: false + entities.v1.IngestResultResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + created: + type: boolean + title: created + title: IngestResultResponse + additionalProperties: false + entities.v1.LinkEntityRequest: + type: object + properties: + canonicalEntityId: + type: string + title: canonical_entity_id + ref: + title: ref + $ref: '#/components/schemas/entities.v1.CrossSystemRef' + title: LinkEntityRequest + additionalProperties: false + entities.v1.LinkEntityResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: LinkEntityResponse + additionalProperties: false + entities.v1.MergeEntitiesRequest: + type: object + properties: + targetCanonicalEntityId: + type: string + title: target_canonical_entity_id + sourceCanonicalEntityIds: + type: array + items: + type: string + title: source_canonical_entity_ids + primaryType: + title: primary_type + $ref: '#/components/schemas/entities.v1.EntityType' + primaryName: + type: string + title: primary_name + title: MergeEntitiesRequest + additionalProperties: false + entities.v1.MergeEntitiesResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + mergedEntities: + type: array + items: + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: merged_entities + title: MergeEntitiesResponse + additionalProperties: false + entities.v1.ResolveRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + integrationId: + type: string + title: integration_id + recordId: + type: string + title: record_id + title: ResolveRequest + additionalProperties: false + entities.v1.ResolveResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: ResolveResponse + additionalProperties: false + entities.v1.SearchRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + query: + type: string + title: query + entityType: + title: entity_type + $ref: '#/components/schemas/entities.v1.EntityType' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: SearchRequest + additionalProperties: false + entities.v1.SearchResponse: + type: object + properties: + entities: + type: array + items: + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: entities + total: + type: integer + title: total + format: int32 + title: SearchResponse + additionalProperties: false + entities.v1.SplitEntityRequest: + type: object + properties: + canonicalEntityId: + type: string + title: canonical_entity_id + refs: + type: array + items: + $ref: '#/components/schemas/entities.v1.CrossSystemRefKey' + title: refs + newPrimaryType: + title: new_primary_type + $ref: '#/components/schemas/entities.v1.EntityType' + newPrimaryName: + type: string + title: new_primary_name + title: SplitEntityRequest + additionalProperties: false + entities.v1.SplitEntityResponse: + type: object + properties: + sourceEntity: + title: source_entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + splitEntity: + title: split_entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: SplitEntityResponse + additionalProperties: false + entities.v1.UnlinkEntityRequest: + type: object + properties: + canonicalEntityId: + type: string + title: canonical_entity_id + integrationId: + type: string + title: integration_id + recordId: + type: string + title: record_id + title: UnlinkEntityRequest + additionalProperties: false + entities.v1.UnlinkEntityResponse: + type: object + properties: + entity: + title: entity + $ref: '#/components/schemas/entities.v1.CanonicalEntity' + title: UnlinkEntityResponse + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: entities.v1.EntityService + description: EntityService provides cross-system entity resolution and correlation. diff --git a/gen/openapi/events/v1/change.openapi.yaml b/gen/openapi/events/v1/change.openapi.yaml new file mode 100644 index 0000000..80e7b7b --- /dev/null +++ b/gen/openapi/events/v1/change.openapi.yaml @@ -0,0 +1,212 @@ +openapi: 3.1.0 +info: + title: events.v1 +paths: {} +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + events.v1.Change: + type: object + properties: + seq: + type: + - integer + - string + title: seq + format: int64 + organizationId: + type: string + title: organization_id + aggregateType: + type: string + title: aggregate_type + aggregateId: + type: string + title: aggregate_id + operation: + type: string + title: operation + actorType: + type: string + title: actor_type + actorId: + type: string + title: actor_id + aggregateVersion: + type: + - integer + - string + title: aggregate_version + format: int64 + recordedAt: + title: recorded_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + payload: + title: payload + $ref: '#/components/schemas/google.protobuf.Struct' + title: Change + additionalProperties: false + description: |- + Change is the canonical change-journal payload shared by producers like + parker and pipeline and by downstream NATS consumers. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. +security: [] diff --git a/gen/openapi/events/v1/cloudevent.openapi.yaml b/gen/openapi/events/v1/cloudevent.openapi.yaml new file mode 100644 index 0000000..d763451 --- /dev/null +++ b/gen/openapi/events/v1/cloudevent.openapi.yaml @@ -0,0 +1,234 @@ +openapi: 3.1.0 +info: + title: events.v1 +paths: {} +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + events.v1.CloudEvent: + type: object + properties: + specVersion: + type: string + title: spec_version + id: + type: string + title: id + type: + type: string + title: type + source: + type: string + title: source + subject: + type: string + title: subject + time: + title: time + $ref: '#/components/schemas/google.protobuf.Timestamp' + dataContentType: + type: string + title: data_content_type + tenantId: + type: string + title: tenant_id + data: + title: data + $ref: '#/components/schemas/google.protobuf.Any' + extensions: + type: object + title: extensions + additionalProperties: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: CloudEvent + additionalProperties: false + description: |- + CloudEvent is the canonical event envelope used on the internal NATS bus. + The payload remains a typed message so producers and consumers can share one + transport wrapper while evolving event-specific contracts independently. + events.v1.CloudEvent.ExtensionsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: ExtensionsEntry + additionalProperties: false + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. +security: [] diff --git a/gen/openapi/events/v1/evaluation.openapi.yaml b/gen/openapi/events/v1/evaluation.openapi.yaml new file mode 100644 index 0000000..361f26e --- /dev/null +++ b/gen/openapi/events/v1/evaluation.openapi.yaml @@ -0,0 +1,212 @@ +openapi: 3.1.0 +info: + title: events.v1 +paths: {} +components: + schemas: + events.v1.EvaluationCompleted: + type: object + properties: + signalType: + type: string + title: signal_type + summary: + type: string + title: summary + successRate: + type: number + title: success_rate + format: double + nullable: true + companyDomains: + type: array + items: + type: string + title: company_domains + companyNames: + type: array + items: + type: string + title: company_names + dealIds: + type: array + items: + type: string + title: deal_ids + run: + title: run + $ref: '#/components/schemas/events.v1.EvaluationRun' + metrics: + title: metrics + $ref: '#/components/schemas/events.v1.EvaluationMetrics' + title: EvaluationCompleted + additionalProperties: false + description: |- + EvaluationCompleted is the canonical typed payload for evaluation.completed + events that downstream services consume as pipeline signals. + events.v1.EvaluationMetrics: + type: object + properties: + totalTests: + type: + - integer + - string + title: total_tests + format: int64 + nullable: true + passedTests: + type: + - integer + - string + title: passed_tests + format: int64 + nullable: true + failedTests: + type: + - integer + - string + title: failed_tests + format: int64 + nullable: true + totalCost: + type: number + title: total_cost + format: double + nullable: true + duration: + type: number + title: duration + format: double + nullable: true + successRate: + type: number + title: success_rate + format: double + nullable: true + title: EvaluationMetrics + additionalProperties: false + events.v1.EvaluationRun: + type: object + properties: + id: + type: string + title: id + testSuiteId: + type: string + title: test_suite_id + testSuiteName: + type: string + title: test_suite_name + name: + type: string + title: name + description: + type: string + title: description + tags: + type: array + items: + type: string + title: tags + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: EvaluationRun + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. +security: [] diff --git a/gen/openapi/governance/v1/governance.openapi.yaml b/gen/openapi/governance/v1/governance.openapi.yaml new file mode 100644 index 0000000..a4132aa --- /dev/null +++ b/gen/openapi/governance/v1/governance.openapi.yaml @@ -0,0 +1,930 @@ +openapi: 3.1.0 +info: + title: governance.v1 +paths: + /governance.v1.GovernanceService/EvaluateAction: + post: + tags: + - governance.v1.GovernanceService + summary: EvaluateAction + operationId: governance.v1.GovernanceService.EvaluateAction + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.EvaluateActionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.EvaluateActionResponse' + /governance.v1.GovernanceService/DetectPII: + post: + tags: + - governance.v1.GovernanceService + summary: DetectPII + operationId: governance.v1.GovernanceService.DetectPII + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.DetectPIIRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.DetectPIIResponse' + /governance.v1.GovernanceService/ClassifyRisk: + post: + tags: + - governance.v1.GovernanceService + summary: ClassifyRisk + operationId: governance.v1.GovernanceService.ClassifyRisk + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.ClassifyRiskRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.ClassifyRiskResponse' + /governance.v1.GovernanceService/CheckCredentialExposure: + post: + tags: + - governance.v1.GovernanceService + summary: CheckCredentialExposure + operationId: governance.v1.GovernanceService.CheckCredentialExposure + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.CheckCredentialExposureRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.CheckCredentialExposureResponse' + /governance.v1.GovernanceService/GetRetentionPolicy: + post: + tags: + - governance.v1.GovernanceService + summary: GetRetentionPolicy + operationId: governance.v1.GovernanceService.GetRetentionPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.GetRetentionPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.GetRetentionPolicyResponse' + /governance.v1.GovernanceService/SetRetentionPolicy: + post: + tags: + - governance.v1.GovernanceService + summary: SetRetentionPolicy + operationId: governance.v1.GovernanceService.SetRetentionPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetRetentionPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetRetentionPolicyResponse' + /governance.v1.GovernanceService/CheckLegalHold: + post: + tags: + - governance.v1.GovernanceService + summary: CheckLegalHold + operationId: governance.v1.GovernanceService.CheckLegalHold + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.CheckLegalHoldRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.CheckLegalHoldResponse' + /governance.v1.GovernanceService/SetLegalHold: + post: + tags: + - governance.v1.GovernanceService + summary: SetLegalHold + operationId: governance.v1.GovernanceService.SetLegalHold + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetLegalHoldRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetLegalHoldResponse' + /governance.v1.GovernanceService/GetSafetyPolicy: + post: + tags: + - governance.v1.GovernanceService + summary: GetSafetyPolicy + operationId: governance.v1.GovernanceService.GetSafetyPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.GetSafetyPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.GetSafetyPolicyResponse' + /governance.v1.GovernanceService/SetSafetyPolicy: + post: + tags: + - governance.v1.GovernanceService + summary: SetSafetyPolicy + operationId: governance.v1.GovernanceService.SetSafetyPolicy + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetSafetyPolicyRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/governance.v1.SetSafetyPolicyResponse' +components: + schemas: + governance.v1.ActionDecision: + type: string + title: ActionDecision + enum: + - ACTION_DECISION_UNSPECIFIED + - ACTION_DECISION_ALLOW + - ACTION_DECISION_DENY + - ACTION_DECISION_REQUIRE_APPROVAL + description: ActionDecision describes the governance decision for an action. + governance.v1.PIICategory: + type: string + title: PIICategory + enum: + - PII_CATEGORY_UNSPECIFIED + - PII_CATEGORY_EMAIL + - PII_CATEGORY_PHONE + - PII_CATEGORY_SSN + - PII_CATEGORY_CREDIT_CARD + - PII_CATEGORY_ADDRESS + - PII_CATEGORY_PERSON_NAME + - PII_CATEGORY_CUSTOM + description: PIICategory identifies the category of personally identifiable information. + governance.v1.RiskLevel: + type: string + title: RiskLevel + enum: + - RISK_LEVEL_UNSPECIFIED + - RISK_LEVEL_LOW + - RISK_LEVEL_MEDIUM + - RISK_LEVEL_HIGH + - RISK_LEVEL_CRITICAL + description: RiskLevel classifies the risk of an action. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + governance.v1.ActionContext: + type: object + properties: + recordCount: + type: + - integer + - string + title: record_count + format: int64 + currencyAmount: + type: number + title: currency_amount + format: double + currencyCode: + type: string + title: currency_code + environment: + type: string + title: environment + dataClassification: + type: string + title: data_classification + title: ActionContext + additionalProperties: false + governance.v1.ActionEvaluation: + type: object + properties: + decision: + title: decision + $ref: '#/components/schemas/governance.v1.ActionDecision' + riskLevel: + title: risk_level + $ref: '#/components/schemas/governance.v1.RiskLevel' + reasons: + type: array + items: + type: string + title: reasons + matchedRules: + type: array + items: + type: string + title: matched_rules + habitConfidence: + type: number + title: habit_confidence + format: float + description: |- + Approval habit confidence for this action pattern, if available. + Consumers can show "94% confidence, 2 more approvals until auto-approve" + to help humans understand the trust trajectory. + habitObservationCount: + type: integer + title: habit_observation_count + format: int32 + title: ActionEvaluation + additionalProperties: false + description: ActionEvaluation is the result of evaluating an action against governance rules. + governance.v1.CheckCredentialExposureRequest: + type: object + properties: + text: + type: string + title: text + title: CheckCredentialExposureRequest + additionalProperties: false + governance.v1.CheckCredentialExposureResponse: + type: object + properties: + exposed: + type: boolean + title: exposed + credentialTypes: + type: array + items: + type: string + title: credential_types + locations: + type: array + items: + type: string + title: locations + title: CheckCredentialExposureResponse + additionalProperties: false + governance.v1.CheckLegalHoldRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + scope: + type: string + title: scope + title: CheckLegalHoldRequest + additionalProperties: false + governance.v1.CheckLegalHoldResponse: + type: object + properties: + held: + type: boolean + title: held + holds: + type: array + items: + $ref: '#/components/schemas/governance.v1.LegalHold' + title: holds + title: CheckLegalHoldResponse + additionalProperties: false + governance.v1.ClassifyRiskRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + actionType: + type: string + title: action_type + actionPayload: + type: string + title: action_payload + format: byte + context: + title: context + $ref: '#/components/schemas/governance.v1.ActionContext' + title: ClassifyRiskRequest + additionalProperties: false + governance.v1.ClassifyRiskResponse: + type: object + properties: + riskLevel: + title: risk_level + $ref: '#/components/schemas/governance.v1.RiskLevel' + reasons: + type: array + items: + type: string + title: reasons + title: ClassifyRiskResponse + additionalProperties: false + governance.v1.DetectPIIRequest: + type: object + properties: + text: + type: string + title: text + categories: + type: array + items: + $ref: '#/components/schemas/governance.v1.PIICategory' + title: categories + title: DetectPIIRequest + additionalProperties: false + governance.v1.DetectPIIResponse: + type: object + properties: + result: + title: result + $ref: '#/components/schemas/governance.v1.PIIDetectionResult' + title: DetectPIIResponse + additionalProperties: false + governance.v1.EvaluateActionRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + agentId: + type: string + title: agent_id + actionType: + type: string + title: action_type + actionPayload: + type: string + title: action_payload + format: byte + context: + title: context + $ref: '#/components/schemas/governance.v1.ActionContext' + title: EvaluateActionRequest + additionalProperties: false + governance.v1.EvaluateActionResponse: + type: object + properties: + evaluation: + title: evaluation + $ref: '#/components/schemas/governance.v1.ActionEvaluation' + title: EvaluateActionResponse + additionalProperties: false + governance.v1.GetRetentionPolicyRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + title: GetRetentionPolicyRequest + additionalProperties: false + governance.v1.GetRetentionPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.RetentionPolicy' + title: GetRetentionPolicyResponse + additionalProperties: false + governance.v1.GetSafetyPolicyRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + title: GetSafetyPolicyRequest + additionalProperties: false + governance.v1.GetSafetyPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.SafetyPolicy' + title: GetSafetyPolicyResponse + additionalProperties: false + governance.v1.LegalHold: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + scope: + type: string + title: scope + reason: + type: string + title: reason + createdBy: + type: string + title: created_by + active: + type: boolean + title: active + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: LegalHold + additionalProperties: false + description: LegalHold prevents data deletion for compliance or legal reasons. + governance.v1.PIIDetectionResult: + type: object + properties: + spans: + type: array + items: + $ref: '#/components/schemas/governance.v1.PIISpan' + title: spans + title: PIIDetectionResult + additionalProperties: false + description: PIIDetectionResult contains all PII spans found in a text. + governance.v1.PIISpan: + type: object + properties: + startOffset: + type: integer + title: start_offset + format: int32 + endOffset: + type: integer + title: end_offset + format: int32 + category: + title: category + $ref: '#/components/schemas/governance.v1.PIICategory' + text: + type: string + title: text + confidence: + type: number + title: confidence + format: float + title: PIISpan + additionalProperties: false + description: PIISpan identifies a single occurrence of PII within text. + governance.v1.RetentionPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + retentionDays: + type: integer + title: retention_days + format: int32 + legalHoldOverride: + type: boolean + title: legal_hold_override + title: RetentionPolicy + additionalProperties: false + description: RetentionPolicy defines data retention rules for a workspace. + governance.v1.SafetyPolicy: + type: object + properties: + workspaceId: + type: string + title: workspace_id + rules: + type: array + items: + $ref: '#/components/schemas/governance.v1.SafetyRule' + title: rules + title: SafetyPolicy + additionalProperties: false + description: SafetyPolicy defines the safety rules for a workspace. + governance.v1.SafetyRule: + type: object + properties: + id: + type: string + title: id + pattern: + type: string + title: pattern + action: + title: action + $ref: '#/components/schemas/governance.v1.ActionDecision' + riskLevel: + title: risk_level + $ref: '#/components/schemas/governance.v1.RiskLevel' + description: + type: string + title: description + title: SafetyRule + additionalProperties: false + description: SafetyRule is a single rule within a safety policy. + governance.v1.SetLegalHoldRequest: + type: object + properties: + hold: + title: hold + $ref: '#/components/schemas/governance.v1.LegalHold' + title: SetLegalHoldRequest + additionalProperties: false + governance.v1.SetLegalHoldResponse: + type: object + properties: + hold: + title: hold + $ref: '#/components/schemas/governance.v1.LegalHold' + title: SetLegalHoldResponse + additionalProperties: false + governance.v1.SetRetentionPolicyRequest: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.RetentionPolicy' + title: SetRetentionPolicyRequest + additionalProperties: false + governance.v1.SetRetentionPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.RetentionPolicy' + title: SetRetentionPolicyResponse + additionalProperties: false + governance.v1.SetSafetyPolicyRequest: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.SafetyPolicy' + title: SetSafetyPolicyRequest + additionalProperties: false + governance.v1.SetSafetyPolicyResponse: + type: object + properties: + policy: + title: policy + $ref: '#/components/schemas/governance.v1.SafetyPolicy' + title: SetSafetyPolicyResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: governance.v1.GovernanceService + description: GovernanceService enforces safety, compliance, and data governance policies. diff --git a/gen/openapi/identity/v1/organizations.openapi.yaml b/gen/openapi/identity/v1/organizations.openapi.yaml new file mode 100644 index 0000000..2cfc33c --- /dev/null +++ b/gen/openapi/identity/v1/organizations.openapi.yaml @@ -0,0 +1,211 @@ +openapi: 3.1.0 +info: + title: identity.v1 +paths: {} +components: + schemas: + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + identity.v1.APIKey: + type: object + properties: + id: + type: string + title: id + organizationId: + type: string + title: organization_id + name: + type: string + title: name + prefix: + type: string + title: prefix + provider: + type: string + title: provider + role: + type: string + title: role + label: + type: string + title: label + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: APIKey + additionalProperties: false + description: |- + APIKey is the canonical API key type. + Unifies gate's APIKey (tenant.proto) and chat's APIKeyInfo (auth.proto). + identity.v1.Member: + type: object + properties: + userId: + type: string + title: user_id + organizationId: + type: string + title: organization_id + email: + type: string + title: email + name: + type: string + title: name + picture: + type: string + title: picture + role: + type: string + title: role + status: + type: string + title: status + identityProvider: + type: string + title: identity_provider + provisioningSource: + type: string + title: provisioning_source + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Member + additionalProperties: false + description: |- + Member is the canonical org membership type. + Unifies gate's OrgMember and chat's WorkspaceMemberInfo. + identity.v1.Organization: + type: object + properties: + id: + type: string + title: id + name: + type: string + title: name + slug: + type: string + title: slug + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Organization + additionalProperties: false + description: |- + Organization is the canonical org/workspace type. + Unifies gate's Organization (tenant.proto) and chat's WorkspaceInfo (auth.proto). + identity.v1.OrganizationMembership: + type: object + properties: + organization: + title: organization + $ref: '#/components/schemas/identity.v1.Organization' + role: + type: string + title: role + title: OrganizationMembership + additionalProperties: false + description: |- + OrganizationMembership is the canonical "org plus this user's role in it" + view. It replaces chat's WorkspaceInfo without pushing membership-scoped + fields onto Organization itself. +security: [] diff --git a/gen/openapi/identity/v1/sessions.openapi.yaml b/gen/openapi/identity/v1/sessions.openapi.yaml new file mode 100644 index 0000000..2887085 --- /dev/null +++ b/gen/openapi/identity/v1/sessions.openapi.yaml @@ -0,0 +1,152 @@ +openapi: 3.1.0 +info: + title: identity.v1 +paths: {} +components: + schemas: + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + identity.v1.DeviceInfo: + type: object + properties: + ip: + type: string + title: ip + forwardedFor: + type: string + title: forwarded_for + userAgent: + type: string + title: user_agent + title: DeviceInfo + additionalProperties: false + identity.v1.Session: + type: object + properties: + id: + type: string + title: id + identityId: + type: string + title: identity_id + organizationId: + type: string + title: organization_id + tenantId: + type: string + title: tenant_id + active: + type: boolean + title: active + deviceInfo: + title: device_info + $ref: '#/components/schemas/identity.v1.DeviceInfo' + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Session + additionalProperties: false + description: |- + Session represents an authenticated user session. + Derived from identity/internal/sessions.Session. +security: [] diff --git a/gen/openapi/identity/v1/tokens.openapi.yaml b/gen/openapi/identity/v1/tokens.openapi.yaml new file mode 100644 index 0000000..dfd5b9b --- /dev/null +++ b/gen/openapi/identity/v1/tokens.openapi.yaml @@ -0,0 +1,422 @@ +openapi: 3.1.0 +info: + title: identity.v1 +paths: + /identity.v1.TokenService/Introspect: + post: + tags: + - identity.v1.TokenService + summary: Introspect + description: Introspect validates a bearer token and returns the resolved claims. + operationId: identity.v1.TokenService.Introspect + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IntrospectRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IntrospectResponse' + /identity.v1.TokenService/IssueServiceToken: + post: + tags: + - identity.v1.TokenService + summary: IssueServiceToken + description: IssueServiceToken mints a short-lived token for service-to-service calls. + operationId: identity.v1.TokenService.IssueServiceToken + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IssueServiceTokenRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IssueServiceTokenResponse' + /identity.v1.TokenService/IssueAgentToken: + post: + tags: + - identity.v1.TokenService + summary: IssueAgentToken + description: IssueAgentToken mints a token scoped to an agent identity. + operationId: identity.v1.TokenService.IssueAgentToken + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IssueAgentTokenRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/identity.v1.IssueAgentTokenResponse' +components: + schemas: + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + identity.v1.IntrospectRequest: + type: object + properties: + token: + type: string + title: token + title: IntrospectRequest + additionalProperties: false + identity.v1.IntrospectResponse: + type: object + properties: + active: + type: boolean + title: active + subject: + type: string + title: subject + tokenType: + type: string + title: token_type + service: + type: string + title: service + organizationId: + type: string + title: organization_id + scopes: + type: array + items: + type: string + title: scopes + agentType: + type: string + title: agent_type + capabilities: + type: array + items: + type: string + title: capabilities + runId: + type: string + title: run_id + surface: + type: string + title: surface + userSubject: + type: string + title: user_subject + email: + type: string + title: email + name: + type: string + title: name + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + issuedAt: + title: issued_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: IntrospectResponse + additionalProperties: false + description: |- + IntrospectResponse is the canonical introspection result. + Superset of service-runtime/identityclient.IntrospectionResult and + llm-gateway/internal/auth.IntrospectionResult — callers should import + this type instead of maintaining their own structs. + identity.v1.IssueAgentTokenRequest: + type: object + properties: + agentType: + type: string + title: agent_type + description: |- + Deprecated: use agent_id instead. Ignored when agent_id is set. + Accepted for backward compatibility when agent_id is empty. + deprecated: true + capabilities: + type: array + items: + type: string + deprecated: true + title: capabilities + description: |- + Deprecated: use agent_id instead. Ignored when agent_id is set. + Accepted for backward compatibility when agent_id is empty. + deprecated: true + scopes: + type: array + items: + type: string + title: scopes + surface: + type: string + title: surface + ttlSeconds: + type: integer + title: ttl_seconds + format: int32 + agentId: + type: string + title: agent_id + description: |- + When set, the identity service looks up the agent record in registry + and derives agent_type and capabilities from it. Takes precedence over + the deprecated agent_type and capabilities fields. Must reference an + existing agents/v1 Agent record. + title: IssueAgentTokenRequest + additionalProperties: false + identity.v1.IssueAgentTokenResponse: + type: object + properties: + token: + type: string + title: token + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: IssueAgentTokenResponse + additionalProperties: false + identity.v1.IssueServiceTokenRequest: + type: object + properties: + service: + type: string + title: service + organizationId: + type: string + title: organization_id + scopes: + type: array + items: + type: string + title: scopes + ttlSeconds: + type: integer + title: ttl_seconds + format: int32 + title: IssueServiceTokenRequest + additionalProperties: false + identity.v1.IssueServiceTokenResponse: + type: object + properties: + token: + type: string + title: token + expiresAt: + title: expires_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: IssueServiceTokenResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: identity.v1.TokenService + description: TokenService handles token introspection and issuance for cross-service auth. diff --git a/gen/openapi/keys/v1/keys.openapi.yaml b/gen/openapi/keys/v1/keys.openapi.yaml new file mode 100644 index 0000000..6b88e6d --- /dev/null +++ b/gen/openapi/keys/v1/keys.openapi.yaml @@ -0,0 +1,469 @@ +openapi: 3.1.0 +info: + title: keys.v1 +paths: + /keys.v1.ProviderRefsService/UpsertProviderRef: + post: + tags: + - keys.v1.ProviderRefsService + summary: UpsertProviderRef + operationId: keys.v1.ProviderRefsService.UpsertProviderRef + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.UpsertProviderRefRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.UpsertProviderRefResponse' + /keys.v1.ProviderRefsService/ResolveProviderRef: + post: + tags: + - keys.v1.ProviderRefsService + summary: ResolveProviderRef + operationId: keys.v1.ProviderRefsService.ResolveProviderRef + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.ResolveProviderRefRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.ResolveProviderRefResponse' + /keys.v1.ProviderRefsService/DeleteProviderRef: + post: + tags: + - keys.v1.ProviderRefsService + summary: DeleteProviderRef + operationId: keys.v1.ProviderRefsService.DeleteProviderRef + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.DeleteProviderRefRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/keys.v1.DeleteProviderRefResponse' +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + keys.v1.DeleteProviderRefRequest: + type: object + properties: + provider: + type: string + title: provider + environment: + type: string + title: environment + credentialName: + type: string + title: credential_name + teamId: + type: string + title: team_id + title: DeleteProviderRefRequest + additionalProperties: false + keys.v1.DeleteProviderRefResponse: + type: object + properties: + providerRef: + title: provider_ref + $ref: '#/components/schemas/keys.v1.ProviderRef' + title: DeleteProviderRefResponse + additionalProperties: false + keys.v1.ProviderRef: + type: object + properties: + id: + type: string + title: id + organizationId: + type: string + title: organization_id + provider: + type: string + title: provider + environment: + type: string + title: environment + credentialName: + type: string + title: credential_name + teamId: + type: string + title: team_id + credentialType: + type: string + title: credential_type + endpointUrl: + type: string + title: endpoint_url + region: + type: string + title: region + credentialData: + title: credential_data + $ref: '#/components/schemas/google.protobuf.Struct' + providerConfig: + title: provider_config + $ref: '#/components/schemas/google.protobuf.Struct' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: ProviderRef + additionalProperties: false + keys.v1.ResolveProviderRefRequest: + type: object + properties: + provider: + type: string + title: provider + environment: + type: string + title: environment + credentialName: + type: string + title: credential_name + teamId: + type: string + title: team_id + title: ResolveProviderRefRequest + additionalProperties: false + keys.v1.ResolveProviderRefResponse: + type: object + properties: + providerRef: + title: provider_ref + $ref: '#/components/schemas/keys.v1.ProviderRef' + title: ResolveProviderRefResponse + additionalProperties: false + keys.v1.UpsertProviderRefRequest: + type: object + properties: + provider: + type: string + title: provider + environment: + type: string + title: environment + credentialName: + type: string + title: credential_name + teamId: + type: string + title: team_id + credentialType: + type: string + title: credential_type + endpointUrl: + type: string + title: endpoint_url + region: + type: string + title: region + credentialData: + title: credential_data + $ref: '#/components/schemas/google.protobuf.Struct' + providerConfig: + title: provider_config + $ref: '#/components/schemas/google.protobuf.Struct' + title: UpsertProviderRefRequest + additionalProperties: false + keys.v1.UpsertProviderRefResponse: + type: object + properties: + providerRef: + title: provider_ref + $ref: '#/components/schemas/keys.v1.ProviderRef' + title: UpsertProviderRefResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: keys.v1.ProviderRefsService + description: |- + ProviderRefsService resolves the managed provider credentials and endpoint + metadata that downstream services need to talk to external model vendors. diff --git a/gen/openapi/memory/v1/memory.openapi.yaml b/gen/openapi/memory/v1/memory.openapi.yaml new file mode 100644 index 0000000..b22895c --- /dev/null +++ b/gen/openapi/memory/v1/memory.openapi.yaml @@ -0,0 +1,833 @@ +openapi: 3.1.0 +info: + title: memory.v1 +paths: + /memory.v1.MemoryService/Store: + post: + tags: + - memory.v1.MemoryService + summary: Store + operationId: memory.v1.MemoryService.Store + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.StoreRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.StoreResponse' + /memory.v1.MemoryService/Recall: + post: + tags: + - memory.v1.MemoryService + summary: Recall + operationId: memory.v1.MemoryService.Recall + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.RecallRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.RecallResponse' + /memory.v1.MemoryService/RecallKnowledge: + post: + tags: + - memory.v1.MemoryService + summary: RecallKnowledge + operationId: memory.v1.MemoryService.RecallKnowledge + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.RecallKnowledgeRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.RecallKnowledgeResponse' + /memory.v1.MemoryService/Update: + post: + tags: + - memory.v1.MemoryService + summary: Update + operationId: memory.v1.MemoryService.Update + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.UpdateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.UpdateResponse' + /memory.v1.MemoryService/Delete: + post: + tags: + - memory.v1.MemoryService + summary: Delete + operationId: memory.v1.MemoryService.Delete + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.DeleteRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.DeleteResponse' + /memory.v1.MemoryService/List: + post: + tags: + - memory.v1.MemoryService + summary: List + operationId: memory.v1.MemoryService.List + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.ListRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.ListResponse' + /memory.v1.MemoryService/GetOperatingRules: + post: + tags: + - memory.v1.MemoryService + summary: GetOperatingRules + operationId: memory.v1.MemoryService.GetOperatingRules + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.GetOperatingRulesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.GetOperatingRulesResponse' + /memory.v1.MemoryService/Consolidate: + post: + tags: + - memory.v1.MemoryService + summary: Consolidate + operationId: memory.v1.MemoryService.Consolidate + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.ConsolidateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/memory.v1.ConsolidateResponse' +components: + schemas: + memory.v1.Scope: + type: string + title: Scope + enum: + - SCOPE_UNSPECIFIED + - SCOPE_USER + - SCOPE_TEAM + - SCOPE_ORGANIZATION + - SCOPE_AGENT + - SCOPE_PROJECT + description: Scope controls memory visibility. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + memory.v1.ConsolidateRequest: + type: object + properties: + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + projectId: + type: string + title: project_id + title: ConsolidateRequest + additionalProperties: false + memory.v1.ConsolidateResponse: + type: object + properties: + merged: + type: integer + title: merged + format: int32 + pruned: + type: integer + title: pruned + format: int32 + title: ConsolidateResponse + additionalProperties: false + memory.v1.DeleteRequest: + type: object + properties: + id: + type: string + title: id + title: DeleteRequest + additionalProperties: false + memory.v1.DeleteResponse: + type: object + title: DeleteResponse + additionalProperties: false + memory.v1.GetOperatingRulesRequest: + type: object + properties: + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: GetOperatingRulesRequest + additionalProperties: false + memory.v1.GetOperatingRulesResponse: + type: object + properties: + memories: + type: array + items: + $ref: '#/components/schemas/memory.v1.Memory' + title: memories + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: GetOperatingRulesResponse + additionalProperties: false + memory.v1.ListRequest: + type: object + properties: + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + type: + type: string + title: type + title: ListRequest + additionalProperties: false + memory.v1.ListResponse: + type: object + properties: + memories: + type: array + items: + $ref: '#/components/schemas/memory.v1.Memory' + title: memories + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListResponse + additionalProperties: false + memory.v1.Memory: + type: object + properties: + id: + type: string + title: id + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + content: + type: string + title: content + type: + type: string + title: type + source: + type: string + title: source + confidence: + type: number + title: confidence + format: float + pinned: + type: boolean + title: pinned + embedding: + type: array + items: + type: number + format: float + title: embedding + description: Packed float encoding — ~4x smaller than JSON float arrays. + workspaceId: + type: string + title: workspace_id + userId: + type: string + title: user_id + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + isPolicy: + type: boolean + title: is_policy + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + tags: + type: array + items: + type: string + title: tags + title: Memory + additionalProperties: false + description: |- + Memory is the canonical memory record. + Unifies chat's Memory proto and ensemble's TypeScript memory types. + memory.v1.RecallKnowledgeRequest: + type: object + properties: + conditions: + type: array + items: + type: string + title: conditions + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + topK: + type: integer + title: top_k + format: int32 + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + title: RecallKnowledgeRequest + additionalProperties: false + memory.v1.RecallKnowledgeResponse: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/memory.v1.RecallResult' + title: results + title: RecallKnowledgeResponse + additionalProperties: false + memory.v1.RecallRequest: + type: object + properties: + query: + type: string + title: query + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + topK: + type: integer + title: top_k + format: int32 + minSimilarity: + type: number + title: min_similarity + format: float + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + type: + type: string + title: type + title: RecallRequest + additionalProperties: false + memory.v1.RecallResponse: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/memory.v1.RecallResult' + title: results + title: RecallResponse + additionalProperties: false + memory.v1.RecallResult: + type: object + properties: + memory: + title: memory + $ref: '#/components/schemas/memory.v1.Memory' + similarity: + type: number + title: similarity + format: float + title: RecallResult + additionalProperties: false + memory.v1.StoreRequest: + type: object + properties: + scope: + title: scope + $ref: '#/components/schemas/memory.v1.Scope' + content: + type: string + title: content + type: + type: string + title: type + source: + type: string + title: source + confidence: + type: number + title: confidence + format: float + projectId: + type: string + title: project_id + teamId: + type: string + title: team_id + repository: + type: string + title: repository + agent: + type: string + title: agent + isPolicy: + type: boolean + title: is_policy + tags: + type: array + items: + type: string + title: tags + id: + type: string + title: id + title: StoreRequest + additionalProperties: false + memory.v1.StoreResponse: + type: object + properties: + memory: + title: memory + $ref: '#/components/schemas/memory.v1.Memory' + title: StoreResponse + additionalProperties: false + memory.v1.UpdateRequest: + type: object + properties: + id: + type: string + title: id + content: + type: string + title: content + type: + type: string + title: type + confidence: + type: number + title: confidence + format: float + tags: + type: array + items: + type: string + title: tags + title: UpdateRequest + additionalProperties: false + memory.v1.UpdateResponse: + type: object + properties: + memory: + title: memory + $ref: '#/components/schemas/memory.v1.Memory' + title: UpdateResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: memory.v1.MemoryService + description: |- + MemoryService provides semantic memory storage and recall. + Canonical contract for evalops/memory, replacing hand-written structs + in chat (externalmemory/client.go) and ensemble (src/lib/memory/). diff --git a/gen/openapi/meter/v1/meter.openapi.yaml b/gen/openapi/meter/v1/meter.openapi.yaml new file mode 100644 index 0000000..db72a90 --- /dev/null +++ b/gen/openapi/meter/v1/meter.openapi.yaml @@ -0,0 +1,1184 @@ +openapi: 3.1.0 +info: + title: meter.v1 +paths: + /meter.v1.MeterService/RecordUsage: + post: + tags: + - meter.v1.MeterService + summary: RecordUsage + operationId: meter.v1.MeterService.RecordUsage + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.RecordUsageRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.RecordUsageResponse' + /meter.v1.MeterService/RecordUsageBatch: + post: + tags: + - meter.v1.MeterService + summary: RecordUsageBatch + operationId: meter.v1.MeterService.RecordUsageBatch + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.RecordUsageBatchRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.RecordUsageBatchResponse' + /meter.v1.MeterService/QueryUsage: + post: + tags: + - meter.v1.MeterService + summary: QueryUsage + operationId: meter.v1.MeterService.QueryUsage + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.QueryUsageRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.QueryUsageResponse' + /meter.v1.MeterService/GetUsageSummary: + post: + tags: + - meter.v1.MeterService + summary: GetUsageSummary + operationId: meter.v1.MeterService.GetUsageSummary + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetUsageSummaryRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetUsageSummaryResponse' + /meter.v1.MeterService/GetMeterSummary: + post: + tags: + - meter.v1.MeterService + summary: GetMeterSummary + operationId: meter.v1.MeterService.GetMeterSummary + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetMeterSummaryRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetMeterSummaryResponse' + /meter.v1.MeterService/IngestWideEvent: + post: + tags: + - meter.v1.MeterService + summary: IngestWideEvent + operationId: meter.v1.MeterService.IngestWideEvent + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.IngestWideEventRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.IngestWideEventResponse' + /meter.v1.MeterService/QueryWideEvents: + post: + tags: + - meter.v1.MeterService + summary: QueryWideEvents + operationId: meter.v1.MeterService.QueryWideEvents + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.QueryWideEventsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.QueryWideEventsResponse' + /meter.v1.MeterService/GetEventDashboard: + post: + tags: + - meter.v1.MeterService + summary: GetEventDashboard + operationId: meter.v1.MeterService.GetEventDashboard + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetEventDashboardRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/meter.v1.GetEventDashboardResponse' +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + meter.v1.SummaryGroupBy: + type: string + title: SummaryGroupBy + enum: + - SUMMARY_GROUP_BY_UNSPECIFIED + - SUMMARY_GROUP_BY_MODEL + - SUMMARY_GROUP_BY_PROVIDER + - SUMMARY_GROUP_BY_TEAM + - SUMMARY_GROUP_BY_AGENT + - SUMMARY_GROUP_BY_SURFACE + - SUMMARY_GROUP_BY_METADATA + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + meter.v1.EventDashboardBucket: + type: object + properties: + key: + type: string + title: key + count: + type: + - integer + - string + title: count + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + title: EventDashboardBucket + additionalProperties: false + meter.v1.GetEventDashboardRequest: + type: object + properties: + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + metadataKey: + type: string + title: metadata_key + metadataValue: + type: string + title: metadata_value + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + topN: + type: integer + title: top_n + format: int32 + title: GetEventDashboardRequest + additionalProperties: false + meter.v1.GetEventDashboardResponse: + type: object + properties: + totalEvents: + type: + - integer + - string + title: total_events + format: int64 + totalInputTokens: + type: + - integer + - string + title: total_input_tokens + format: int64 + totalOutputTokens: + type: + - integer + - string + title: total_output_tokens + format: int64 + totalCacheReadTokens: + type: + - integer + - string + title: total_cache_read_tokens + format: int64 + totalCacheWriteTokens: + type: + - integer + - string + title: total_cache_write_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + byEventType: + type: array + items: + $ref: '#/components/schemas/meter.v1.EventDashboardBucket' + title: by_event_type + bySurface: + type: array + items: + $ref: '#/components/schemas/meter.v1.EventDashboardBucket' + title: by_surface + byModel: + type: array + items: + $ref: '#/components/schemas/meter.v1.EventDashboardBucket' + title: by_model + byProvider: + type: array + items: + $ref: '#/components/schemas/meter.v1.EventDashboardBucket' + title: by_provider + title: GetEventDashboardResponse + additionalProperties: false + meter.v1.GetMeterSummaryRequest: + type: object + properties: + meterId: + type: string + title: meter_id + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + groupBy: + title: group_by + $ref: '#/components/schemas/meter.v1.SummaryGroupBy' + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: GetMeterSummaryRequest + additionalProperties: false + meter.v1.GetMeterSummaryResponse: + type: object + properties: + meterId: + type: string + title: meter_id + buckets: + type: array + items: + $ref: '#/components/schemas/meter.v1.MeterSummaryBucket' + title: buckets + title: GetMeterSummaryResponse + additionalProperties: false + meter.v1.GetUsageSummaryRequest: + type: object + properties: + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + groupBy: + title: group_by + $ref: '#/components/schemas/meter.v1.SummaryGroupBy' + groupMetadataKey: + type: string + title: group_metadata_key + metadataKey: + type: string + title: metadata_key + metadataValue: + type: string + title: metadata_value + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: GetUsageSummaryRequest + additionalProperties: false + meter.v1.GetUsageSummaryResponse: + type: object + properties: + buckets: + type: array + items: + $ref: '#/components/schemas/meter.v1.UsageSummary' + title: buckets + title: GetUsageSummaryResponse + additionalProperties: false + meter.v1.IngestWideEventRequest: + type: object + properties: + timestamp: + title: timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + requestId: + type: string + title: request_id + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + data: + title: data + $ref: '#/components/schemas/google.protobuf.Struct' + metrics: + title: metrics + $ref: '#/components/schemas/meter.v1.WideEventMetrics' + title: IngestWideEventRequest + additionalProperties: false + meter.v1.IngestWideEventResponse: + type: object + properties: + event: + title: event + $ref: '#/components/schemas/meter.v1.WideEvent' + budgetExceeded: + type: boolean + title: budget_exceeded + description: true when this event pushed the agent or team over budget + budgetMessage: + type: string + title: budget_message + description: human-readable budget status, empty when within budget + title: IngestWideEventResponse + additionalProperties: false + meter.v1.MeterSummaryBucket: + type: object + properties: + key: + type: string + title: key + value: + type: number + title: value + format: double + recordCount: + type: + - integer + - string + title: record_count + format: int64 + title: MeterSummaryBucket + additionalProperties: false + meter.v1.QueryUsageRequest: + type: object + properties: + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + metadataKey: + type: string + title: metadata_key + metadataValue: + type: string + title: metadata_value + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: QueryUsageRequest + additionalProperties: false + meter.v1.QueryUsageResponse: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/meter.v1.UsageRecord' + title: records + title: QueryUsageResponse + additionalProperties: false + meter.v1.QueryWideEventsRequest: + type: object + properties: + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + metadataKey: + type: string + title: metadata_key + metadataValue: + type: string + title: metadata_value + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: QueryWideEventsRequest + additionalProperties: false + meter.v1.QueryWideEventsResponse: + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/meter.v1.WideEvent' + title: events + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: QueryWideEventsResponse + additionalProperties: false + meter.v1.RecordUsageBatchRequest: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/meter.v1.RecordUsageRequest' + title: records + title: RecordUsageBatchRequest + additionalProperties: false + meter.v1.RecordUsageBatchResponse: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/meter.v1.UsageRecord' + title: records + title: RecordUsageBatchResponse + additionalProperties: false + meter.v1.RecordUsageRequest: + type: object + properties: + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + inputTokens: + type: + - integer + - string + title: input_tokens + format: int64 + outputTokens: + type: + - integer + - string + title: output_tokens + format: int64 + cacheReadTokens: + type: + - integer + - string + title: cache_read_tokens + format: int64 + cacheWriteTokens: + type: + - integer + - string + title: cache_write_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + requestId: + type: string + title: request_id + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + data: + title: data + $ref: '#/components/schemas/google.protobuf.Struct' + title: RecordUsageRequest + additionalProperties: false + meter.v1.RecordUsageResponse: + type: object + properties: + record: + title: record + $ref: '#/components/schemas/meter.v1.UsageRecord' + title: RecordUsageResponse + additionalProperties: false + meter.v1.UsageRecord: + type: object + properties: + id: + type: string + title: id + timestamp: + title: timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + organizationId: + type: string + title: organization_id + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + inputTokens: + type: + - integer + - string + title: input_tokens + format: int64 + outputTokens: + type: + - integer + - string + title: output_tokens + format: int64 + cacheReadTokens: + type: + - integer + - string + title: cache_read_tokens + format: int64 + cacheWriteTokens: + type: + - integer + - string + title: cache_write_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + requestId: + type: string + title: request_id + data: + title: data + $ref: '#/components/schemas/google.protobuf.Struct' + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: UsageRecord + additionalProperties: false + meter.v1.UsageSummary: + type: object + properties: + key: + type: string + title: key + totalInputTokens: + type: + - integer + - string + title: total_input_tokens + format: int64 + totalOutputTokens: + type: + - integer + - string + title: total_output_tokens + format: int64 + totalCacheReadTokens: + type: + - integer + - string + title: total_cache_read_tokens + format: int64 + totalCacheWriteTokens: + type: + - integer + - string + title: total_cache_write_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + recordCount: + type: + - integer + - string + title: record_count + format: int64 + title: UsageSummary + additionalProperties: false + meter.v1.WideEvent: + type: object + properties: + id: + type: string + title: id + timestamp: + title: timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + organizationId: + type: string + title: organization_id + teamId: + type: string + title: team_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + eventType: + type: string + title: event_type + model: + type: string + title: model + provider: + type: string + title: provider + requestId: + type: string + title: request_id + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + data: + title: data + $ref: '#/components/schemas/google.protobuf.Struct' + metrics: + title: metrics + $ref: '#/components/schemas/meter.v1.WideEventMetrics' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WideEvent + additionalProperties: false + meter.v1.WideEventMetrics: + type: object + properties: + inputTokens: + type: + - integer + - string + title: input_tokens + format: int64 + outputTokens: + type: + - integer + - string + title: output_tokens + format: int64 + cacheReadTokens: + type: + - integer + - string + title: cache_read_tokens + format: int64 + cacheWriteTokens: + type: + - integer + - string + title: cache_write_tokens + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + durationMs: + type: + - integer + - string + title: duration_ms + format: int64 + timeToFirstTokenMs: + type: + - integer + - string + title: time_to_first_token_ms + format: int64 + toolCallsCount: + type: + - integer + - string + title: tool_calls_count + format: int64 + title: WideEventMetrics + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: meter.v1.MeterService + description: MeterService records and queries usage across EvalOps services. diff --git a/gen/openapi/notifications/v1/notifications.openapi.yaml b/gen/openapi/notifications/v1/notifications.openapi.yaml new file mode 100644 index 0000000..8f7071b --- /dev/null +++ b/gen/openapi/notifications/v1/notifications.openapi.yaml @@ -0,0 +1,926 @@ +openapi: 3.1.0 +info: + title: notifications.v1 +paths: + /notifications.v1.NotificationService/Send: + post: + tags: + - notifications.v1.NotificationService + summary: Send + operationId: notifications.v1.NotificationService.Send + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SendRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SendResponse' + /notifications.v1.NotificationService/SendBatch: + post: + tags: + - notifications.v1.NotificationService + summary: SendBatch + operationId: notifications.v1.NotificationService.SendBatch + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SendBatchRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SendBatchResponse' + /notifications.v1.NotificationService/GetPreferences: + post: + tags: + - notifications.v1.NotificationService + summary: GetPreferences + operationId: notifications.v1.NotificationService.GetPreferences + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.GetPreferencesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.GetPreferencesResponse' + /notifications.v1.NotificationService/SetPreferences: + post: + tags: + - notifications.v1.NotificationService + summary: SetPreferences + operationId: notifications.v1.NotificationService.SetPreferences + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SetPreferencesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.SetPreferencesResponse' + /notifications.v1.NotificationService/ListHistory: + post: + tags: + - notifications.v1.NotificationService + summary: ListHistory + operationId: notifications.v1.NotificationService.ListHistory + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.ListHistoryRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.ListHistoryResponse' + /notifications.v1.NotificationService/RegisterChannel: + post: + tags: + - notifications.v1.NotificationService + summary: RegisterChannel + operationId: notifications.v1.NotificationService.RegisterChannel + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.RegisterChannelRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.RegisterChannelResponse' + /notifications.v1.NotificationService/GetDeliveryStatus: + post: + tags: + - notifications.v1.NotificationService + summary: GetDeliveryStatus + operationId: notifications.v1.NotificationService.GetDeliveryStatus + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.GetDeliveryStatusRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.GetDeliveryStatusResponse' + /notifications.v1.NotificationService/UpsertTemplate: + post: + tags: + - notifications.v1.NotificationService + summary: UpsertTemplate + operationId: notifications.v1.NotificationService.UpsertTemplate + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.UpsertTemplateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.UpsertTemplateResponse' + /notifications.v1.NotificationService/ListTemplates: + post: + tags: + - notifications.v1.NotificationService + summary: ListTemplates + operationId: notifications.v1.NotificationService.ListTemplates + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.ListTemplatesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/notifications.v1.ListTemplatesResponse' +components: + schemas: + notifications.v1.DeliveryChannel: + type: string + title: DeliveryChannel + enum: + - DELIVERY_CHANNEL_UNSPECIFIED + - DELIVERY_CHANNEL_SLACK + - DELIVERY_CHANNEL_EMAIL + - DELIVERY_CHANNEL_WEBHOOK + - DELIVERY_CHANNEL_IN_APP + description: DeliveryChannel identifies the notification delivery channel. + notifications.v1.DeliveryStatus: + type: string + title: DeliveryStatus + enum: + - DELIVERY_STATUS_UNSPECIFIED + - DELIVERY_STATUS_PENDING + - DELIVERY_STATUS_SENT + - DELIVERY_STATUS_DELIVERED + - DELIVERY_STATUS_FAILED + - DELIVERY_STATUS_BOUNCED + - DELIVERY_STATUS_QUEUED + description: DeliveryStatus describes the delivery state of a notification. + notifications.v1.NotificationCategory: + type: string + title: NotificationCategory + enum: + - NOTIFICATION_CATEGORY_UNSPECIFIED + - NOTIFICATION_CATEGORY_APPROVAL_REQUEST + - NOTIFICATION_CATEGORY_BUDGET_ALERT + - NOTIFICATION_CATEGORY_PII_DETECTION + - NOTIFICATION_CATEGORY_INCIDENT + - NOTIFICATION_CATEGORY_REPORT + - NOTIFICATION_CATEGORY_INTEGRATION + - NOTIFICATION_CATEGORY_DIGEST + - NOTIFICATION_CATEGORY_GENERAL + description: NotificationCategory groups notifications for routing and template selection. + notifications.v1.Priority: + type: string + title: Priority + enum: + - PRIORITY_UNSPECIFIED + - PRIORITY_LOW + - PRIORITY_NORMAL + - PRIORITY_HIGH + - PRIORITY_URGENT + description: Priority describes the urgency of a notification. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + notifications.v1.CategoryChannelPreference: + type: object + properties: + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + title: CategoryChannelPreference + additionalProperties: false + description: CategoryChannelPreference overrides delivery routing for a specific category. + notifications.v1.DigestPreference: + type: object + properties: + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + windowSeconds: + type: integer + title: window_seconds + format: int32 + enabled: + type: boolean + title: enabled + title: DigestPreference + additionalProperties: false + description: DigestPreference controls batching for a category/channel pair. + notifications.v1.EscalationRule: + type: object + properties: + ifUnacknowledgedAfterSeconds: + type: integer + title: if_unacknowledged_after_seconds + format: int32 + escalateToChannel: + title: escalate_to_channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + title: EscalationRule + additionalProperties: false + description: EscalationRule defines automatic escalation when a notification is unacknowledged. + notifications.v1.GetDeliveryStatusRequest: + type: object + properties: + notificationId: + type: string + title: notification_id + title: GetDeliveryStatusRequest + additionalProperties: false + notifications.v1.GetDeliveryStatusResponse: + type: object + properties: + status: + title: status + $ref: '#/components/schemas/notifications.v1.DeliveryStatus' + lastUpdatedAt: + title: last_updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + errorMessage: + type: string + title: error_message + title: GetDeliveryStatusResponse + additionalProperties: false + notifications.v1.GetPreferencesRequest: + type: object + properties: + userId: + type: string + title: user_id + workspaceId: + type: string + title: workspace_id + title: GetPreferencesRequest + additionalProperties: false + notifications.v1.GetPreferencesResponse: + type: object + properties: + preferences: + title: preferences + $ref: '#/components/schemas/notifications.v1.NotificationPreferences' + title: GetPreferencesResponse + additionalProperties: false + notifications.v1.ListHistoryRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + recipientId: + type: string + title: recipient_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListHistoryRequest + additionalProperties: false + notifications.v1.ListHistoryResponse: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/notifications.v1.Notification' + title: notifications + total: + type: integer + title: total + format: int32 + title: ListHistoryResponse + additionalProperties: false + notifications.v1.ListTemplatesRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + includeBuiltIn: + type: boolean + title: include_built_in + title: ListTemplatesRequest + additionalProperties: false + notifications.v1.ListTemplatesResponse: + type: object + properties: + templates: + type: array + items: + $ref: '#/components/schemas/notifications.v1.NotificationTemplate' + title: templates + title: ListTemplatesResponse + additionalProperties: false + notifications.v1.Notification: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + recipientId: + type: string + title: recipient_id + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + priority: + title: priority + $ref: '#/components/schemas/notifications.v1.Priority' + subject: + type: string + title: subject + body: + type: string + title: body + metadataJson: + type: string + title: metadata_json + deliveryStatus: + title: delivery_status + $ref: '#/components/schemas/notifications.v1.DeliveryStatus' + sentAt: + title: sent_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + deliveredAt: + title: delivered_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + templateName: + type: string + title: template_name + title: Notification + additionalProperties: false + description: Notification is the canonical notification record. + notifications.v1.NotificationPreferences: + type: object + properties: + userId: + type: string + title: user_id + workspaceId: + type: string + title: workspace_id + defaultChannel: + title: default_channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + quietHoursStart: + type: string + title: quiet_hours_start + quietHoursEnd: + type: string + title: quiet_hours_end + escalationRules: + type: array + items: + $ref: '#/components/schemas/notifications.v1.EscalationRule' + title: escalation_rules + categoryChannels: + type: array + items: + $ref: '#/components/schemas/notifications.v1.CategoryChannelPreference' + title: category_channels + digestPreferences: + type: array + items: + $ref: '#/components/schemas/notifications.v1.DigestPreference' + title: digest_preferences + title: NotificationPreferences + additionalProperties: false + description: NotificationPreferences stores a user's notification settings. + notifications.v1.NotificationTemplate: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + name: + type: string + title: name + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + subjectTemplate: + type: string + title: subject_template + bodyTemplate: + type: string + title: body_template + requiredVariables: + type: array + items: + type: string + title: required_variables + builtIn: + type: boolean + title: built_in + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: NotificationTemplate + additionalProperties: false + description: NotificationTemplate defines a reusable notification subject/body template. + notifications.v1.RegisterChannelRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + channel: + title: channel + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + config: + type: object + title: config + additionalProperties: + type: string + title: value + title: RegisterChannelRequest + additionalProperties: false + notifications.v1.RegisterChannelRequest.ConfigEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: ConfigEntry + additionalProperties: false + notifications.v1.RegisterChannelResponse: + type: object + properties: + success: + type: boolean + title: success + title: RegisterChannelResponse + additionalProperties: false + notifications.v1.SendBatchRequest: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/notifications.v1.SendRequest' + title: notifications + title: SendBatchRequest + additionalProperties: false + notifications.v1.SendBatchResponse: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/notifications.v1.Notification' + title: notifications + failedCount: + type: integer + title: failed_count + format: int32 + title: SendBatchResponse + additionalProperties: false + notifications.v1.SendRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + recipientId: + type: string + title: recipient_id + channel: + title: channel + description: |- + If channel is unspecified, the notifications service may resolve it from + the recipient's preferences before falling back to a safe default. + $ref: '#/components/schemas/notifications.v1.DeliveryChannel' + priority: + title: priority + $ref: '#/components/schemas/notifications.v1.Priority' + subject: + type: string + title: subject + body: + type: string + title: body + metadataJson: + type: string + title: metadata_json + category: + title: category + $ref: '#/components/schemas/notifications.v1.NotificationCategory' + templateName: + type: string + title: template_name + templateVariablesJson: + type: string + title: template_variables_json + title: SendRequest + additionalProperties: false + notifications.v1.SendResponse: + type: object + properties: + notification: + title: notification + $ref: '#/components/schemas/notifications.v1.Notification' + title: SendResponse + additionalProperties: false + notifications.v1.SetPreferencesRequest: + type: object + properties: + preferences: + title: preferences + $ref: '#/components/schemas/notifications.v1.NotificationPreferences' + title: SetPreferencesRequest + additionalProperties: false + notifications.v1.SetPreferencesResponse: + type: object + properties: + preferences: + title: preferences + $ref: '#/components/schemas/notifications.v1.NotificationPreferences' + title: SetPreferencesResponse + additionalProperties: false + notifications.v1.UpsertTemplateRequest: + type: object + properties: + template: + title: template + $ref: '#/components/schemas/notifications.v1.NotificationTemplate' + title: UpsertTemplateRequest + additionalProperties: false + notifications.v1.UpsertTemplateResponse: + type: object + properties: + template: + title: template + $ref: '#/components/schemas/notifications.v1.NotificationTemplate' + title: UpsertTemplateResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: notifications.v1.NotificationService + description: NotificationService manages delivery of notifications across channels. diff --git a/gen/openapi/objectives/v1/objectives.openapi.yaml b/gen/openapi/objectives/v1/objectives.openapi.yaml new file mode 100644 index 0000000..659d783 --- /dev/null +++ b/gen/openapi/objectives/v1/objectives.openapi.yaml @@ -0,0 +1,811 @@ +openapi: 3.1.0 +info: + title: objectives.v1 +paths: + /objectives.v1.ObjectiveService/Create: + post: + tags: + - objectives.v1.ObjectiveService + summary: Create + operationId: objectives.v1.ObjectiveService.Create + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.CreateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.CreateResponse' + /objectives.v1.ObjectiveService/Get: + post: + tags: + - objectives.v1.ObjectiveService + summary: Get + operationId: objectives.v1.ObjectiveService.Get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.GetRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.GetResponse' + /objectives.v1.ObjectiveService/Transition: + post: + tags: + - objectives.v1.ObjectiveService + summary: Transition + operationId: objectives.v1.ObjectiveService.Transition + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.TransitionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.TransitionResponse' + /objectives.v1.ObjectiveService/Wake: + post: + tags: + - objectives.v1.ObjectiveService + summary: Wake + operationId: objectives.v1.ObjectiveService.Wake + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.WakeRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.WakeResponse' + /objectives.v1.ObjectiveService/Query: + post: + tags: + - objectives.v1.ObjectiveService + summary: Query + operationId: objectives.v1.ObjectiveService.Query + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.QueryRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.QueryResponse' + /objectives.v1.ObjectiveService/RecordProvenance: + post: + tags: + - objectives.v1.ObjectiveService + summary: RecordProvenance + operationId: objectives.v1.ObjectiveService.RecordProvenance + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.RecordProvenanceRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.RecordProvenanceResponse' + /objectives.v1.ObjectiveService/RecordMutation: + post: + tags: + - objectives.v1.ObjectiveService + summary: RecordMutation + operationId: objectives.v1.ObjectiveService.RecordMutation + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.RecordMutationRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.RecordMutationResponse' + /objectives.v1.ObjectiveService/GetGovernanceEvaluation: + post: + tags: + - objectives.v1.ObjectiveService + summary: GetGovernanceEvaluation + operationId: objectives.v1.ObjectiveService.GetGovernanceEvaluation + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.GetGovernanceEvaluationRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.GetGovernanceEvaluationResponse' + /objectives.v1.ObjectiveService/Cancel: + post: + tags: + - objectives.v1.ObjectiveService + summary: Cancel + operationId: objectives.v1.ObjectiveService.Cancel + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.CancelRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/objectives.v1.CancelResponse' +components: + schemas: + objectives.v1.MutationStatus: + type: string + title: MutationStatus + enum: + - MUTATION_STATUS_UNSPECIFIED + - MUTATION_STATUS_PENDING + - MUTATION_STATUS_APPROVED + - MUTATION_STATUS_DENIED + - MUTATION_STATUS_EXECUTED + - MUTATION_STATUS_ROLLED_BACK + description: MutationStatus describes the status of a mutation operation. + objectives.v1.ObjectiveState: + type: string + title: ObjectiveState + enum: + - OBJECTIVE_STATE_UNSPECIFIED + - OBJECTIVE_STATE_PENDING + - OBJECTIVE_STATE_RUNNING + - OBJECTIVE_STATE_BLOCKED + - OBJECTIVE_STATE_DEGRADED + - OBJECTIVE_STATE_AWAITING_APPROVAL + - OBJECTIVE_STATE_QUEUED + - OBJECTIVE_STATE_COMPLETED + - OBJECTIVE_STATE_FAILED + - OBJECTIVE_STATE_CANCELLED + description: ObjectiveState describes the lifecycle state of an objective. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + objectives.v1.CancelRequest: + type: object + properties: + id: + type: string + title: id + reason: + type: string + title: reason + title: CancelRequest + additionalProperties: false + objectives.v1.CancelResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: CancelResponse + additionalProperties: false + objectives.v1.CreateRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + title: + type: string + title: title + description: + type: string + title: description + title: CreateRequest + additionalProperties: false + objectives.v1.CreateResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: CreateResponse + additionalProperties: false + objectives.v1.GetGovernanceEvaluationRequest: + type: object + properties: + objectiveId: + type: string + title: objective_id + title: GetGovernanceEvaluationRequest + additionalProperties: false + objectives.v1.GetGovernanceEvaluationResponse: + type: object + properties: + objectiveId: + type: string + title: objective_id + compliant: + type: boolean + title: compliant + violations: + type: array + items: + type: string + title: violations + title: GetGovernanceEvaluationResponse + additionalProperties: false + objectives.v1.GetRequest: + type: object + properties: + id: + type: string + title: id + title: GetRequest + additionalProperties: false + objectives.v1.GetResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: GetResponse + additionalProperties: false + objectives.v1.MutationRecord: + type: object + properties: + targetIntegration: + type: string + title: target_integration + operation: + type: string + title: operation + status: + title: status + $ref: '#/components/schemas/objectives.v1.MutationStatus' + approvalId: + type: string + title: approval_id + title: MutationRecord + additionalProperties: false + description: MutationRecord tracks a write operation performed by an objective. + objectives.v1.Objective: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + title: + type: string + title: title + description: + type: string + title: description + state: + title: state + $ref: '#/components/schemas/objectives.v1.ObjectiveState' + provenance: + type: array + items: + $ref: '#/components/schemas/objectives.v1.ProvenanceRecord' + title: provenance + mutations: + type: array + items: + $ref: '#/components/schemas/objectives.v1.MutationRecord' + title: mutations + wakeSchedule: + title: wake_schedule + $ref: '#/components/schemas/objectives.v1.WakeSchedule' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Objective + additionalProperties: false + description: Objective is the canonical agent objective record. + objectives.v1.ProvenanceRecord: + type: object + properties: + sourceIntegration: + type: string + title: source_integration + sourceId: + type: string + title: source_id + freshnessSeconds: + type: integer + title: freshness_seconds + format: int32 + confidence: + type: number + title: confidence + format: float + title: ProvenanceRecord + additionalProperties: false + description: ProvenanceRecord tracks where data came from. + objectives.v1.QueryRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + agentId: + type: string + title: agent_id + state: + title: state + $ref: '#/components/schemas/objectives.v1.ObjectiveState' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: QueryRequest + additionalProperties: false + objectives.v1.QueryResponse: + type: object + properties: + objectives: + type: array + items: + $ref: '#/components/schemas/objectives.v1.Objective' + title: objectives + total: + type: integer + title: total + format: int32 + title: QueryResponse + additionalProperties: false + objectives.v1.RecordMutationRequest: + type: object + properties: + objectiveId: + type: string + title: objective_id + mutation: + title: mutation + $ref: '#/components/schemas/objectives.v1.MutationRecord' + title: RecordMutationRequest + additionalProperties: false + objectives.v1.RecordMutationResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: RecordMutationResponse + additionalProperties: false + objectives.v1.RecordProvenanceRequest: + type: object + properties: + objectiveId: + type: string + title: objective_id + provenance: + title: provenance + $ref: '#/components/schemas/objectives.v1.ProvenanceRecord' + title: RecordProvenanceRequest + additionalProperties: false + objectives.v1.RecordProvenanceResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: RecordProvenanceResponse + additionalProperties: false + objectives.v1.TransitionRequest: + type: object + properties: + id: + type: string + title: id + state: + title: state + $ref: '#/components/schemas/objectives.v1.ObjectiveState' + reason: + type: string + title: reason + title: TransitionRequest + additionalProperties: false + objectives.v1.TransitionResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: TransitionResponse + additionalProperties: false + objectives.v1.WakeRequest: + type: object + properties: + id: + type: string + title: id + title: WakeRequest + additionalProperties: false + objectives.v1.WakeResponse: + type: object + properties: + objective: + title: objective + $ref: '#/components/schemas/objectives.v1.Objective' + title: WakeResponse + additionalProperties: false + objectives.v1.WakeSchedule: + type: object + properties: + wakeAt: + title: wake_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + reason: + type: string + title: reason + retryCount: + type: integer + title: retry_count + format: int32 + maxRetries: + type: integer + title: max_retries + format: int32 + backoffSeconds: + type: integer + title: backoff_seconds + format: int32 + title: WakeSchedule + additionalProperties: false + description: WakeSchedule defines when and how an objective should be reactivated. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: objectives.v1.ObjectiveService + description: ObjectiveService manages agent objectives and their lifecycle. diff --git a/gen/openapi/prompts/v1/prompts.openapi.yaml b/gen/openapi/prompts/v1/prompts.openapi.yaml new file mode 100644 index 0000000..61edd04 --- /dev/null +++ b/gen/openapi/prompts/v1/prompts.openapi.yaml @@ -0,0 +1,1112 @@ +openapi: 3.1.0 +info: + title: prompts.v1 +paths: + /prompts.v1.PromptService/CreatePrompt: + post: + tags: + - prompts.v1.PromptService + summary: CreatePrompt + operationId: prompts.v1.PromptService.CreatePrompt + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.CreatePromptRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.Prompt' + /prompts.v1.PromptService/GetPrompt: + post: + tags: + - prompts.v1.PromptService + summary: GetPrompt + operationId: prompts.v1.PromptService.GetPrompt + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.GetPromptRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.Prompt' + /prompts.v1.PromptService/ListPrompts: + post: + tags: + - prompts.v1.PromptService + summary: ListPrompts + operationId: prompts.v1.PromptService.ListPrompts + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListPromptsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListPromptsResponse' + /prompts.v1.PromptService/CreateVersion: + post: + tags: + - prompts.v1.PromptService + summary: CreateVersion + operationId: prompts.v1.PromptService.CreateVersion + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.CreateVersionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.Version' + /prompts.v1.PromptService/ListVersions: + post: + tags: + - prompts.v1.PromptService + summary: ListVersions + operationId: prompts.v1.PromptService.ListVersions + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListVersionsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListVersionsResponse' + /prompts.v1.PromptService/AssignLabel: + post: + tags: + - prompts.v1.PromptService + summary: AssignLabel + operationId: prompts.v1.PromptService.AssignLabel + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.AssignLabelRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.Label' + /prompts.v1.PromptService/ListLabels: + post: + tags: + - prompts.v1.PromptService + summary: ListLabels + operationId: prompts.v1.PromptService.ListLabels + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListLabelsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListLabelsResponse' + /prompts.v1.PromptService/ListDeployments: + post: + tags: + - prompts.v1.PromptService + summary: ListDeployments + operationId: prompts.v1.PromptService.ListDeployments + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListDeploymentsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ListDeploymentsResponse' + /prompts.v1.PromptService/LinkEval: + post: + tags: + - prompts.v1.PromptService + summary: LinkEval + operationId: prompts.v1.PromptService.LinkEval + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.LinkEvalRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.EvalLink' + /prompts.v1.PromptService/Resolve: + post: + tags: + - prompts.v1.PromptService + summary: Resolve + operationId: prompts.v1.PromptService.Resolve + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ResolveRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ResolveResponse' + /prompts.v1.PromptService/ResolveAll: + post: + tags: + - prompts.v1.PromptService + summary: ResolveAll + operationId: prompts.v1.PromptService.ResolveAll + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ResolveAllRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/prompts.v1.ResolveAllResponse' +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + prompts.v1.AssignLabelRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + name: + type: string + title: name + description: 'label name: "production", "staging", "canary"' + version: + type: integer + title: version + format: int32 + description: target version number + actor: + type: string + title: actor + description: who is making the assignment + rollbackFrom: + type: integer + title: rollback_from + format: int32 + description: set when this is a rollback (the version being rolled back from) + title: AssignLabelRequest + additionalProperties: false + description: |- + AssignLabelRequest atomically moves a label pointer to a version. + Used for promotion, rollback, and canary assignment. + prompts.v1.CreatePromptRequest: + type: object + properties: + name: + type: string + title: name + surface: + type: string + title: surface + tags: + type: array + items: + type: string + title: tags + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + title: CreatePromptRequest + additionalProperties: false + prompts.v1.CreateVersionRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + content: + type: string + title: content + model: + type: string + title: model + author: + type: string + title: author + variables: + type: array + items: + type: string + title: variables + title: CreateVersionRequest + additionalProperties: false + prompts.v1.Deployment: + type: object + properties: + id: + type: string + title: id + promptId: + type: string + title: prompt_id + versionId: + type: string + title: version_id + version: + type: integer + title: version + format: int32 + surface: + type: string + title: surface + description: label name (kept as "surface" for wire compat) + env: + type: string + title: env + description: deprecated — use label name + actor: + type: string + title: actor + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + rollbackFrom: + type: integer + title: rollback_from + format: int32 + title: Deployment + additionalProperties: false + description: |- + Deployment is an audit record of a label assignment. Retained for compliance. + Every AssignLabel call produces both a Label update and a Deployment record. + prompts.v1.EvalLink: + type: object + properties: + id: + type: string + title: id + promptId: + type: string + title: prompt_id + versionId: + type: string + title: version_id + evalRunId: + type: string + title: eval_run_id + score: + type: number + title: score + format: double + pass: + type: boolean + title: pass + evalUrl: + type: string + title: eval_url + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: EvalLink + additionalProperties: false + description: EvalLink connects a prompt version to a Fermata evaluation result. + prompts.v1.GetPromptRequest: + type: object + properties: + id: + type: string + title: id + title: GetPromptRequest + additionalProperties: false + prompts.v1.Label: + type: object + properties: + promptId: + type: string + title: prompt_id + name: + type: string + title: name + description: '"production", "staging", "canary"' + version: + type: integer + title: version + format: int32 + actor: + type: string + title: actor + rollbackFrom: + type: integer + title: rollback_from + format: int32 + description: set when this assignment is a rollback + assignedAt: + title: assigned_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Label + additionalProperties: false + description: |- + Label is a mutable pointer from (org, prompt, label_name) to a version. + The primary resolution mechanism — code references labels, not version numbers. + Promotion and rollback are both label reassignments. + prompts.v1.LinkEvalRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + versionId: + type: string + title: version_id + evalRunId: + type: string + title: eval_run_id + score: + type: number + title: score + format: double + pass: + type: boolean + title: pass + evalUrl: + type: string + title: eval_url + title: LinkEvalRequest + additionalProperties: false + prompts.v1.ListDeploymentsRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListDeploymentsRequest + additionalProperties: false + prompts.v1.ListDeploymentsResponse: + type: object + properties: + deployments: + type: array + items: + $ref: '#/components/schemas/prompts.v1.Deployment' + title: deployments + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListDeploymentsResponse + additionalProperties: false + prompts.v1.ListLabelsRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListLabelsRequest + additionalProperties: false + prompts.v1.ListLabelsResponse: + type: object + properties: + labels: + type: array + items: + $ref: '#/components/schemas/prompts.v1.Label' + title: labels + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListLabelsResponse + additionalProperties: false + prompts.v1.ListPromptsRequest: + type: object + properties: + surface: + type: string + title: surface + tag: + type: string + title: tag + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListPromptsRequest + additionalProperties: false + prompts.v1.ListPromptsResponse: + type: object + properties: + prompts: + type: array + items: + $ref: '#/components/schemas/prompts.v1.Prompt' + title: prompts + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListPromptsResponse + additionalProperties: false + prompts.v1.ListVersionsRequest: + type: object + properties: + promptId: + type: string + title: prompt_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListVersionsRequest + additionalProperties: false + prompts.v1.ListVersionsResponse: + type: object + properties: + versions: + type: array + items: + $ref: '#/components/schemas/prompts.v1.Version' + title: versions + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListVersionsResponse + additionalProperties: false + prompts.v1.Prompt: + type: object + properties: + id: + type: string + title: id + organizationId: + type: string + title: organization_id + name: + type: string + title: name + surface: + type: string + title: surface + tags: + type: array + items: + type: string + title: tags + metadata: + title: metadata + $ref: '#/components/schemas/google.protobuf.Struct' + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Prompt + additionalProperties: false + description: |- + Prompt is a named, versioned prompt template scoped to an organization. + Used by all surfaces (Maestro, Ensemble, Aria) and by Fermata for eval + linkage. The canonical cross-service contract for prompt governance. + prompts.v1.ResolveAllRequest: + type: object + properties: + label: + type: string + title: label + description: 'default: "production"' + title: ResolveAllRequest + additionalProperties: false + description: ResolveAllRequest returns all active prompts for a label — gateway startup path. + prompts.v1.ResolveAllResponse: + type: object + properties: + prompts: + type: array + items: + $ref: '#/components/schemas/prompts.v1.ResolvedPrompt' + title: prompts + title: ResolveAllResponse + additionalProperties: false + prompts.v1.ResolveRequest: + type: object + properties: + name: + type: string + title: name + label: + type: string + title: label + description: 'default: "production"' + title: ResolveRequest + additionalProperties: false + description: |- + ResolveRequest is the hot-path lookup. Label defaults to "production". + Consumers MUST pin the resolved version at session/sequence start. + prompts.v1.ResolveResponse: + type: object + properties: + version: + title: version + $ref: '#/components/schemas/prompts.v1.Version' + title: ResolveResponse + additionalProperties: false + prompts.v1.ResolvedPrompt: + type: object + properties: + promptName: + type: string + title: prompt_name + promptId: + type: string + title: prompt_id + label: + type: string + title: label + version: + title: version + $ref: '#/components/schemas/prompts.v1.Version' + title: ResolvedPrompt + additionalProperties: false + description: ResolvedPrompt is returned by the bulk-load endpoint for gateway startup. + prompts.v1.Version: + type: object + properties: + id: + type: string + title: id + promptId: + type: string + title: prompt_id + version: + type: integer + title: version + format: int32 + content: + type: string + title: content + model: + type: string + title: model + hash: + type: string + title: hash + author: + type: string + title: author + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + variables: + type: array + items: + type: string + title: variables + description: |- + Expected interpolation variable names (e.g., "customer_name", "deal_stage"). + Declaration only — rendering is the consumer's responsibility. + tokenCounts: + type: object + title: token_counts + additionalProperties: + type: + - integer + - string + title: value + format: int64 + description: |- + Per-model token counts for context window budgeting. + Populated lazily by gateway or fermata after first tokenization. + title: Version + additionalProperties: false + description: Version is an immutable snapshot of prompt content. + prompts.v1.Version.TokenCountsEntry: + type: object + properties: + key: + type: string + title: key + value: + type: + - integer + - string + title: value + format: int64 + title: TokenCountsEntry + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: prompts.v1.PromptService + description: PromptService defines the prompt registry API. diff --git a/gen/openapi/registry/v1/registry.openapi.yaml b/gen/openapi/registry/v1/registry.openapi.yaml new file mode 100644 index 0000000..bba3716 --- /dev/null +++ b/gen/openapi/registry/v1/registry.openapi.yaml @@ -0,0 +1,701 @@ +openapi: 3.1.0 +info: + title: registry.v1 +paths: + /registry.v1.RegistryService/Register: + post: + tags: + - registry.v1.RegistryService + summary: Register + operationId: registry.v1.RegistryService.Register + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.RegisterRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.RegisterResponse' + /registry.v1.RegistryService/Get: + post: + tags: + - registry.v1.RegistryService + summary: Get + operationId: registry.v1.RegistryService.Get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.GetRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.GetResponse' + /registry.v1.RegistryService/List: + post: + tags: + - registry.v1.RegistryService + summary: List + operationId: registry.v1.RegistryService.List + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.ListRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.ListResponse' + /registry.v1.RegistryService/Update: + post: + tags: + - registry.v1.RegistryService + summary: Update + operationId: registry.v1.RegistryService.Update + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.UpdateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.UpdateResponse' + /registry.v1.RegistryService/Delete: + post: + tags: + - registry.v1.RegistryService + summary: Delete + operationId: registry.v1.RegistryService.Delete + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.DeleteRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.DeleteResponse' + /registry.v1.RegistryService/Heartbeat: + post: + tags: + - registry.v1.RegistryService + summary: Heartbeat + operationId: registry.v1.RegistryService.Heartbeat + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.HeartbeatRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.HeartbeatResponse' + /registry.v1.RegistryService/Discover: + post: + tags: + - registry.v1.RegistryService + summary: Discover + operationId: registry.v1.RegistryService.Discover + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.DiscoverRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/registry.v1.DiscoverResponse' +components: + schemas: + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + registry.v1.Agent: + type: object + properties: + id: + type: string + title: id + organizationId: + type: string + title: organization_id + surface: + type: string + title: surface + capabilities: + type: array + items: + type: string + title: capabilities + status: + type: string + title: status + capacity: + title: capacity + $ref: '#/components/schemas/registry.v1.Capacity' + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + heartbeatAt: + title: heartbeat_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + registeredAt: + title: registered_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Agent + additionalProperties: false + registry.v1.Agent.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + registry.v1.Capacity: + type: object + properties: + current: + type: integer + title: current + format: int32 + max: + type: integer + title: max + format: int32 + title: Capacity + additionalProperties: false + registry.v1.DeleteRequest: + type: object + properties: + id: + type: string + title: id + title: DeleteRequest + additionalProperties: false + registry.v1.DeleteResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/registry.v1.Agent' + title: DeleteResponse + additionalProperties: false + registry.v1.DiscoverRequest: + type: object + properties: + capability: + type: string + title: capability + capabilities: + type: array + items: + type: string + title: capabilities + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + surface: + type: string + title: surface + status: + type: string + title: status + limit: + type: integer + title: limit + format: int32 + title: DiscoverRequest + additionalProperties: false + registry.v1.DiscoverRequest.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + registry.v1.DiscoverResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/registry.v1.Agent' + title: agents + title: DiscoverResponse + additionalProperties: false + registry.v1.GetRequest: + type: object + properties: + id: + type: string + title: id + title: GetRequest + additionalProperties: false + registry.v1.GetResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/registry.v1.Agent' + title: GetResponse + additionalProperties: false + registry.v1.HeartbeatRequest: + type: object + properties: + id: + type: string + title: id + status: + type: string + title: status + capacity: + title: capacity + $ref: '#/components/schemas/registry.v1.Capacity' + title: HeartbeatRequest + additionalProperties: false + registry.v1.HeartbeatResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/registry.v1.Agent' + title: HeartbeatResponse + additionalProperties: false + registry.v1.ListRequest: + type: object + properties: + surface: + type: string + title: surface + capability: + type: string + title: capability + status: + type: string + title: status + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListRequest + additionalProperties: false + registry.v1.ListResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/registry.v1.Agent' + title: agents + title: ListResponse + additionalProperties: false + registry.v1.RegisterRequest: + type: object + properties: + surface: + type: string + title: surface + capabilities: + type: array + items: + type: string + title: capabilities + status: + type: string + title: status + capacity: + title: capacity + $ref: '#/components/schemas/registry.v1.Capacity' + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + title: RegisterRequest + additionalProperties: false + registry.v1.RegisterRequest.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + registry.v1.RegisterResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/registry.v1.Agent' + title: RegisterResponse + additionalProperties: false + registry.v1.UpdateRequest: + type: object + properties: + id: + type: string + title: id + surface: + type: string + title: surface + capabilities: + type: array + items: + type: string + title: capabilities + status: + type: string + title: status + capacity: + title: capacity + $ref: '#/components/schemas/registry.v1.Capacity' + metadata: + type: object + title: metadata + additionalProperties: + type: string + title: value + title: UpdateRequest + additionalProperties: false + registry.v1.UpdateRequest.MetadataEntry: + type: object + properties: + key: + type: string + title: key + value: + type: string + title: value + title: MetadataEntry + additionalProperties: false + registry.v1.UpdateResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/registry.v1.Agent' + title: UpdateResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: registry.v1.RegistryService + description: |- + RegistryService provides agent presence and capability discovery across + EvalOps product surfaces. + + Canonical contract for evalops/registry, replacing hand-written JSON clients + in downstream services such as chat. diff --git a/gen/openapi/skills/v1/skills.openapi.yaml b/gen/openapi/skills/v1/skills.openapi.yaml new file mode 100644 index 0000000..bed584a --- /dev/null +++ b/gen/openapi/skills/v1/skills.openapi.yaml @@ -0,0 +1,901 @@ +openapi: 3.1.0 +info: + title: skills.v1 +paths: + /skills.v1.SkillService/Create: + post: + tags: + - skills.v1.SkillService + summary: Create + operationId: skills.v1.SkillService.Create + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.CreateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.CreateResponse' + /skills.v1.SkillService/Get: + post: + tags: + - skills.v1.SkillService + summary: Get + operationId: skills.v1.SkillService.Get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.GetRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.GetResponse' + /skills.v1.SkillService/List: + post: + tags: + - skills.v1.SkillService + summary: List + operationId: skills.v1.SkillService.List + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ListRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ListResponse' + /skills.v1.SkillService/Update: + post: + tags: + - skills.v1.SkillService + summary: Update + operationId: skills.v1.SkillService.Update + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.UpdateRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.UpdateResponse' + /skills.v1.SkillService/Delete: + post: + tags: + - skills.v1.SkillService + summary: Delete + operationId: skills.v1.SkillService.Delete + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.DeleteRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.DeleteResponse' + /skills.v1.SkillService/CreateVersion: + post: + tags: + - skills.v1.SkillService + summary: CreateVersion + operationId: skills.v1.SkillService.CreateVersion + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.CreateVersionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.CreateVersionResponse' + /skills.v1.SkillService/GetVersion: + post: + tags: + - skills.v1.SkillService + summary: GetVersion + operationId: skills.v1.SkillService.GetVersion + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.GetVersionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.GetVersionResponse' + /skills.v1.SkillService/ListVersions: + post: + tags: + - skills.v1.SkillService + summary: ListVersions + operationId: skills.v1.SkillService.ListVersions + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ListVersionsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ListVersionsResponse' + /skills.v1.SkillService/Search: + post: + tags: + - skills.v1.SkillService + summary: Search + operationId: skills.v1.SkillService.Search + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.SearchRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.SearchResponse' + /skills.v1.SkillService/Import: + post: + tags: + - skills.v1.SkillService + summary: Import + operationId: skills.v1.SkillService.Import + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ImportRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ImportResponse' + /skills.v1.SkillService/Export: + post: + tags: + - skills.v1.SkillService + summary: Export + operationId: skills.v1.SkillService.Export + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ExportRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/skills.v1.ExportResponse' +components: + schemas: + skills.v1.SkillScope: + type: string + title: SkillScope + enum: + - SKILL_SCOPE_UNSPECIFIED + - SKILL_SCOPE_GLOBAL + - SKILL_SCOPE_WORKSPACE + - SKILL_SCOPE_PERSONAL + description: SkillScope controls the visibility of a skill. + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + skills.v1.CreateRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + ownerId: + type: string + title: owner_id + name: + type: string + title: name + description: + type: string + title: description + scope: + title: scope + $ref: '#/components/schemas/skills.v1.SkillScope' + content: + type: string + title: content + tags: + type: array + items: + type: string + title: tags + title: CreateRequest + additionalProperties: false + skills.v1.CreateResponse: + type: object + properties: + skill: + title: skill + $ref: '#/components/schemas/skills.v1.Skill' + title: CreateResponse + additionalProperties: false + skills.v1.CreateVersionRequest: + type: object + properties: + skillId: + type: string + title: skill_id + content: + type: string + title: content + createdBy: + type: string + title: created_by + title: CreateVersionRequest + additionalProperties: false + skills.v1.CreateVersionResponse: + type: object + properties: + version: + title: version + $ref: '#/components/schemas/skills.v1.SkillVersion' + title: CreateVersionResponse + additionalProperties: false + skills.v1.DeleteRequest: + type: object + properties: + id: + type: string + title: id + title: DeleteRequest + additionalProperties: false + skills.v1.DeleteResponse: + type: object + title: DeleteResponse + additionalProperties: false + skills.v1.ExportRequest: + type: object + properties: + id: + type: string + title: id + format: + type: string + title: format + title: ExportRequest + additionalProperties: false + skills.v1.ExportResponse: + type: object + properties: + data: + type: string + title: data + format: byte + format: + type: string + title: format + title: ExportResponse + additionalProperties: false + skills.v1.GetRequest: + type: object + properties: + id: + type: string + title: id + title: GetRequest + additionalProperties: false + skills.v1.GetResponse: + type: object + properties: + skill: + title: skill + $ref: '#/components/schemas/skills.v1.Skill' + title: GetResponse + additionalProperties: false + skills.v1.GetVersionRequest: + type: object + properties: + skillId: + type: string + title: skill_id + versionNumber: + type: integer + title: version_number + format: int32 + title: GetVersionRequest + additionalProperties: false + skills.v1.GetVersionResponse: + type: object + properties: + version: + title: version + $ref: '#/components/schemas/skills.v1.SkillVersion' + title: GetVersionResponse + additionalProperties: false + skills.v1.ImportRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + data: + type: string + title: data + format: byte + format: + type: string + title: format + title: ImportRequest + additionalProperties: false + skills.v1.ImportResponse: + type: object + properties: + skill: + title: skill + $ref: '#/components/schemas/skills.v1.Skill' + title: ImportResponse + additionalProperties: false + skills.v1.ListRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + scope: + title: scope + $ref: '#/components/schemas/skills.v1.SkillScope' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListRequest + additionalProperties: false + skills.v1.ListResponse: + type: object + properties: + skills: + type: array + items: + $ref: '#/components/schemas/skills.v1.Skill' + title: skills + total: + type: integer + title: total + format: int32 + title: ListResponse + additionalProperties: false + skills.v1.ListVersionsRequest: + type: object + properties: + skillId: + type: string + title: skill_id + title: ListVersionsRequest + additionalProperties: false + skills.v1.ListVersionsResponse: + type: object + properties: + versions: + type: array + items: + $ref: '#/components/schemas/skills.v1.SkillVersion' + title: versions + title: ListVersionsResponse + additionalProperties: false + skills.v1.SearchRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + query: + type: string + title: query + scope: + title: scope + $ref: '#/components/schemas/skills.v1.SkillScope' + tags: + type: array + items: + type: string + title: tags + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: SearchRequest + additionalProperties: false + skills.v1.SearchResponse: + type: object + properties: + skills: + type: array + items: + $ref: '#/components/schemas/skills.v1.Skill' + title: skills + total: + type: integer + title: total + format: int32 + title: SearchResponse + additionalProperties: false + skills.v1.Skill: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + ownerId: + type: string + title: owner_id + name: + type: string + title: name + description: + type: string + title: description + scope: + title: scope + $ref: '#/components/schemas/skills.v1.SkillScope' + content: + type: string + title: content + currentVersion: + type: integer + title: current_version + format: int32 + tags: + type: array + items: + type: string + title: tags + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Skill + additionalProperties: false + description: Skill is the canonical skill definition. + skills.v1.SkillVersion: + type: object + properties: + id: + type: string + title: id + skillId: + type: string + title: skill_id + versionNumber: + type: integer + title: version_number + format: int32 + content: + type: string + title: content + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + createdBy: + type: string + title: created_by + title: SkillVersion + additionalProperties: false + description: SkillVersion is an immutable snapshot of a skill's content. + skills.v1.UpdateRequest: + type: object + properties: + id: + type: string + title: id + name: + type: string + title: name + description: + type: string + title: description + scope: + title: scope + $ref: '#/components/schemas/skills.v1.SkillScope' + content: + type: string + title: content + tags: + type: array + items: + type: string + title: tags + title: UpdateRequest + additionalProperties: false + skills.v1.UpdateResponse: + type: object + properties: + skill: + title: skill + $ref: '#/components/schemas/skills.v1.Skill' + title: UpdateResponse + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: skills.v1.SkillService + description: SkillService manages reusable agent skill definitions and versions. diff --git a/gen/openapi/tap/v1/event.openapi.yaml b/gen/openapi/tap/v1/event.openapi.yaml new file mode 100644 index 0000000..d50733e --- /dev/null +++ b/gen/openapi/tap/v1/event.openapi.yaml @@ -0,0 +1,232 @@ +openapi: 3.1.0 +info: + title: tap.v1 +paths: {} +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + tap.v1.FieldChange: + type: object + properties: + from: + title: from + $ref: '#/components/schemas/google.protobuf.Value' + to: + title: to + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldChange + additionalProperties: false + description: FieldChange records a before/after value transition for a provider field. + tap.v1.TapEventData: + type: object + properties: + provider: + type: string + title: provider + entityType: + type: string + title: entity_type + entityId: + type: string + title: entity_id + action: + type: string + title: action + changes: + type: object + title: changes + additionalProperties: + title: value + $ref: '#/components/schemas/tap.v1.FieldChange' + snapshot: + title: snapshot + $ref: '#/components/schemas/google.protobuf.Struct' + providerEventId: + type: string + title: provider_event_id + providerTimestamp: + title: provider_timestamp + $ref: '#/components/schemas/google.protobuf.Timestamp' + tenantId: + type: string + title: tenant_id + requestId: + type: string + title: request_id + title: TapEventData + additionalProperties: false + description: |- + TapEventData is the canonical normalized provider event payload produced by + siphon and consumed by downstream systems like pipeline. + tap.v1.TapEventData.ChangesEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/tap.v1.FieldChange' + title: ChangesEntry + additionalProperties: false +security: [] diff --git a/gen/openapi/traces/v1/traces.openapi.yaml b/gen/openapi/traces/v1/traces.openapi.yaml new file mode 100644 index 0000000..0a4d002 --- /dev/null +++ b/gen/openapi/traces/v1/traces.openapi.yaml @@ -0,0 +1,639 @@ +openapi: 3.1.0 +info: + title: traces.v1 +paths: + /traces.v1.SpanIngestService/IngestSpans: + post: + tags: + - traces.v1.SpanIngestService + summary: IngestSpans + operationId: traces.v1.SpanIngestService.IngestSpans + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.IngestSpansRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.IngestSpansResponse' + /traces.v1.SpanIngestService/GetTrace: + post: + tags: + - traces.v1.SpanIngestService + summary: GetTrace + operationId: traces.v1.SpanIngestService.GetTrace + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.GetTraceRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.GetTraceResponse' + /traces.v1.SpanIngestService/ListTraces: + post: + tags: + - traces.v1.SpanIngestService + summary: ListTraces + operationId: traces.v1.SpanIngestService.ListTraces + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.ListTracesRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.ListTracesResponse' + /traces.v1.SpanIngestService/GetSpanTree: + post: + tags: + - traces.v1.SpanIngestService + summary: GetSpanTree + operationId: traces.v1.SpanIngestService.GetSpanTree + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.GetSpanTreeRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/traces.v1.GetSpanTreeResponse' +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + traces.v1.GovernanceDecision: + type: string + title: GovernanceDecision + enum: + - GOVERNANCE_DECISION_UNSPECIFIED + - GOVERNANCE_DECISION_ALLOW + - GOVERNANCE_DECISION_DENY + - GOVERNANCE_DECISION_REQUIRE_APPROVAL + - GOVERNANCE_DECISION_AUTO_APPROVED + traces.v1.SpanStatus: + type: string + title: SpanStatus + enum: + - SPAN_STATUS_UNSPECIFIED + - SPAN_STATUS_OK + - SPAN_STATUS_ERROR + - SPAN_STATUS_CANCELLED + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + traces.v1.GetSpanTreeRequest: + type: object + properties: + traceId: + type: string + title: trace_id + title: GetSpanTreeRequest + additionalProperties: false + traces.v1.GetSpanTreeResponse: + type: object + properties: + trace: + title: trace + $ref: '#/components/schemas/traces.v1.TraceSummary' + roots: + type: array + items: + $ref: '#/components/schemas/traces.v1.SpanNode' + title: roots + title: GetSpanTreeResponse + additionalProperties: false + traces.v1.GetTraceRequest: + type: object + properties: + traceId: + type: string + title: trace_id + title: GetTraceRequest + additionalProperties: false + traces.v1.GetTraceResponse: + type: object + properties: + trace: + title: trace + $ref: '#/components/schemas/traces.v1.TraceSummary' + spans: + type: array + items: + $ref: '#/components/schemas/traces.v1.Span' + title: spans + title: GetTraceResponse + additionalProperties: false + traces.v1.IngestSpansRequest: + type: object + properties: + spans: + type: array + items: + $ref: '#/components/schemas/traces.v1.Span' + title: spans + title: IngestSpansRequest + additionalProperties: false + traces.v1.IngestSpansResponse: + type: object + properties: + ingestedCount: + type: integer + title: ingested_count + format: int32 + traces: + type: array + items: + $ref: '#/components/schemas/traces.v1.TraceSummary' + title: traces + title: IngestSpansResponse + additionalProperties: false + traces.v1.ListTracesRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + startTime: + title: start_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + endTime: + title: end_time + $ref: '#/components/schemas/google.protobuf.Timestamp' + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListTracesRequest + additionalProperties: false + traces.v1.ListTracesResponse: + type: object + properties: + traces: + type: array + items: + $ref: '#/components/schemas/traces.v1.TraceSummary' + title: traces + total: + type: integer + title: total + format: int32 + hasMore: + type: boolean + title: has_more + title: ListTracesResponse + additionalProperties: false + traces.v1.Span: + type: object + properties: + traceId: + type: string + title: trace_id + spanId: + type: string + title: span_id + parentSpanId: + type: string + title: parent_span_id + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + name: + type: string + title: name + kind: + type: string + title: kind + model: + type: string + title: model + provider: + type: string + title: provider + tokenInput: + type: + - integer + - string + title: token_input + format: int64 + tokenOutput: + type: + - integer + - string + title: token_output + format: int64 + latencyMs: + type: + - integer + - string + title: latency_ms + format: int64 + status: + title: status + $ref: '#/components/schemas/traces.v1.SpanStatus' + governanceDecision: + title: governance_decision + $ref: '#/components/schemas/traces.v1.GovernanceDecision' + costUsd: + type: number + title: cost_usd + format: double + attributes: + title: attributes + $ref: '#/components/schemas/google.protobuf.Struct' + startedAt: + title: started_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + endedAt: + title: ended_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Span + additionalProperties: false + traces.v1.SpanNode: + type: object + properties: + span: + title: span + $ref: '#/components/schemas/traces.v1.Span' + children: + type: array + items: + $ref: '#/components/schemas/traces.v1.SpanNode' + title: children + title: SpanNode + additionalProperties: false + traces.v1.TraceSummary: + type: object + properties: + traceId: + type: string + title: trace_id + workspaceId: + type: string + title: workspace_id + organizationId: + type: string + title: organization_id + agentId: + type: string + title: agent_id + surface: + type: string + title: surface + rootSpanName: + type: string + title: root_span_name + totalSpans: + type: integer + title: total_spans + format: int32 + totalTokenInput: + type: + - integer + - string + title: total_token_input + format: int64 + totalTokenOutput: + type: + - integer + - string + title: total_token_output + format: int64 + totalCostUsd: + type: number + title: total_cost_usd + format: double + totalLatencyMs: + type: + - integer + - string + title: total_latency_ms + format: int64 + startedAt: + title: started_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + endedAt: + title: ended_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: TraceSummary + additionalProperties: false + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: traces.v1.SpanIngestService + description: SpanIngestService records and queries agent execution traces. diff --git a/gen/openapi/workflows/v1/workflows.openapi.yaml b/gen/openapi/workflows/v1/workflows.openapi.yaml new file mode 100644 index 0000000..a947a30 --- /dev/null +++ b/gen/openapi/workflows/v1/workflows.openapi.yaml @@ -0,0 +1,1791 @@ +openapi: 3.1.0 +info: + title: workflows.v1 +paths: + /workflows.v1.WorkflowService/CreateDefinition: + post: + tags: + - workflows.v1.WorkflowService + summary: CreateDefinition + description: CreateDefinition registers a new workflow definition. + operationId: workflows.v1.WorkflowService.CreateDefinition + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CreateDefinitionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CreateDefinitionResponse' + /workflows.v1.WorkflowService/GetDefinition: + post: + tags: + - workflows.v1.WorkflowService + summary: GetDefinition + description: GetDefinition retrieves a workflow definition by ID. + operationId: workflows.v1.WorkflowService.GetDefinition + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.GetDefinitionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.GetDefinitionResponse' + /workflows.v1.WorkflowService/ListDefinitions: + post: + tags: + - workflows.v1.WorkflowService + summary: ListDefinitions + description: ListDefinitions returns workflow definitions matching the query filters. + operationId: workflows.v1.WorkflowService.ListDefinitions + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListDefinitionsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListDefinitionsResponse' + /workflows.v1.WorkflowService/PublishVersion: + post: + tags: + - workflows.v1.WorkflowService + summary: PublishVersion + description: |- + PublishVersion creates an immutable version snapshot of a definition. + Runs always reference a specific definition version. + operationId: workflows.v1.WorkflowService.PublishVersion + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.PublishVersionRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.PublishVersionResponse' + /workflows.v1.WorkflowService/ListVersions: + post: + tags: + - workflows.v1.WorkflowService + summary: ListVersions + description: ListVersions returns all published versions of a definition. + operationId: workflows.v1.WorkflowService.ListVersions + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListVersionsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListVersionsResponse' + /workflows.v1.WorkflowService/StartRun: + post: + tags: + - workflows.v1.WorkflowService + summary: StartRun + description: StartRun begins execution of a workflow definition version. + operationId: workflows.v1.WorkflowService.StartRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.StartRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.StartRunResponse' + /workflows.v1.WorkflowService/HandleTrigger: + post: + tags: + - workflows.v1.WorkflowService + summary: HandleTrigger + description: |- + HandleTrigger processes an asynchronous workflow trigger. It starts + matching latest workflow versions for EVENT, WEBHOOK, or SCHEDULE + triggers and may also satisfy WAIT_FOR_EVENT steps when event + metadata is present. + operationId: workflows.v1.WorkflowService.HandleTrigger + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.HandleTriggerRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.HandleTriggerResponse' + /workflows.v1.WorkflowService/GetRun: + post: + tags: + - workflows.v1.WorkflowService + summary: GetRun + description: GetRun retrieves a workflow run by ID. + operationId: workflows.v1.WorkflowService.GetRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.GetRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.GetRunResponse' + /workflows.v1.WorkflowService/ListRuns: + post: + tags: + - workflows.v1.WorkflowService + summary: ListRuns + description: ListRuns returns workflow runs matching the query filters. + operationId: workflows.v1.WorkflowService.ListRuns + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListRunsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ListRunsResponse' + /workflows.v1.WorkflowService/TransitionStep: + post: + tags: + - workflows.v1.WorkflowService + summary: TransitionStep + description: |- + TransitionStep records a step state change. Called by the orchestrator + as agents complete objectives, approvals resolve, or events arrive. + operationId: workflows.v1.WorkflowService.TransitionStep + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.TransitionStepRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.TransitionStepResponse' + /workflows.v1.WorkflowService/PauseRun: + post: + tags: + - workflows.v1.WorkflowService + summary: PauseRun + description: |- + PauseRun suspends a running workflow. Steps in RUNNING state continue + to completion but no new steps are started. + operationId: workflows.v1.WorkflowService.PauseRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.PauseRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.PauseRunResponse' + /workflows.v1.WorkflowService/ResumeRun: + post: + tags: + - workflows.v1.WorkflowService + summary: ResumeRun + description: ResumeRun resumes a paused workflow. + operationId: workflows.v1.WorkflowService.ResumeRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ResumeRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.ResumeRunResponse' + /workflows.v1.WorkflowService/CancelRun: + post: + tags: + - workflows.v1.WorkflowService + summary: CancelRun + description: |- + CancelRun terminates a workflow. In-progress steps are cancelled and + no compensation is triggered. + operationId: workflows.v1.WorkflowService.CancelRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CancelRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CancelRunResponse' + /workflows.v1.WorkflowService/CompensateRun: + post: + tags: + - workflows.v1.WorkflowService + summary: CompensateRun + description: |- + CompensateRun triggers the compensation path for a failed workflow, + executing compensation steps in reverse topological order. + operationId: workflows.v1.WorkflowService.CompensateRun + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CompensateRunRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/workflows.v1.CompensateRunResponse' +components: + schemas: + google.protobuf.NullValue: + type: string + title: NullValue + enum: + - NULL_VALUE + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + workflows.v1.StepRunState: + type: string + title: StepRunState + enum: + - STEP_RUN_STATE_UNSPECIFIED + - STEP_RUN_STATE_PENDING + - STEP_RUN_STATE_RUNNING + - STEP_RUN_STATE_WAITING + - STEP_RUN_STATE_COMPLETED + - STEP_RUN_STATE_FAILED + - STEP_RUN_STATE_SKIPPED + - STEP_RUN_STATE_COMPENSATED + - STEP_RUN_STATE_CANCELLED + description: StepRunState describes the lifecycle state of an individual step execution. + workflows.v1.StepType: + type: string + title: StepType + enum: + - STEP_TYPE_UNSPECIFIED + - STEP_TYPE_AGENT_ACTION + - STEP_TYPE_APPROVAL_GATE + - STEP_TYPE_GOVERNANCE_CHECK + - STEP_TYPE_WAIT_FOR_EVENT + - STEP_TYPE_BRANCH + - STEP_TYPE_PARALLEL + - STEP_TYPE_NOTIFICATION + - STEP_TYPE_HUMAN_TASK + description: StepType describes the semantic kind of a workflow step. + workflows.v1.TriggerType: + type: string + title: TriggerType + enum: + - TRIGGER_TYPE_UNSPECIFIED + - TRIGGER_TYPE_EVENT + - TRIGGER_TYPE_SCHEDULE + - TRIGGER_TYPE_MANUAL + - TRIGGER_TYPE_WEBHOOK + - TRIGGER_TYPE_WORKFLOW + description: TriggerType describes what initiates a workflow run. + workflows.v1.WorkflowState: + type: string + title: WorkflowState + enum: + - WORKFLOW_STATE_UNSPECIFIED + - WORKFLOW_STATE_PENDING + - WORKFLOW_STATE_RUNNING + - WORKFLOW_STATE_PAUSED + - WORKFLOW_STATE_COMPENSATING + - WORKFLOW_STATE_COMPLETED + - WORKFLOW_STATE_FAILED + - WORKFLOW_STATE_CANCELLED + description: WorkflowState describes the lifecycle state of a workflow run. + google.protobuf.ListValue: + type: object + properties: + values: + type: array + items: + $ref: '#/components/schemas/google.protobuf.Value' + title: values + description: Repeated field of dynamically typed values. + title: ListValue + additionalProperties: false + description: |- + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + google.protobuf.Struct: + type: object + additionalProperties: + $ref: '#/components/schemas/google.protobuf.Value' + description: |- + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + google.protobuf.Struct.FieldsEntry: + type: object + properties: + key: + type: string + title: key + value: + title: value + $ref: '#/components/schemas/google.protobuf.Value' + title: FieldsEntry + additionalProperties: false + google.protobuf.Timestamp: + type: string + examples: + - 1s + - 1.000340012s + format: date-time + description: |- + 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. + google.protobuf.Value: + oneOf: + - type: "null" + - type: number + - type: string + - type: boolean + - type: array + - type: object + additionalProperties: true + description: |- + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of these + variants. Absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + workflows.v1.CancelRunRequest: + type: object + properties: + id: + type: string + title: id + reason: + type: string + title: reason + title: CancelRunRequest + additionalProperties: false + workflows.v1.CancelRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: CancelRunResponse + additionalProperties: false + workflows.v1.CompensateRunRequest: + type: object + properties: + id: + type: string + title: id + reason: + type: string + title: reason + title: CompensateRunRequest + additionalProperties: false + workflows.v1.CompensateRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: CompensateRunResponse + additionalProperties: false + workflows.v1.CreateDefinitionRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + name: + type: string + title: name + description: + type: string + title: description + tags: + type: array + items: + type: string + title: tags + title: CreateDefinitionRequest + additionalProperties: false + workflows.v1.CreateDefinitionResponse: + type: object + properties: + definition: + title: definition + $ref: '#/components/schemas/workflows.v1.WorkflowDefinition' + title: CreateDefinitionResponse + additionalProperties: false + workflows.v1.Edge: + type: object + properties: + fromStepId: + type: string + title: from_step_id + toStepId: + type: string + title: to_step_id + conditionExpr: + type: string + title: condition_expr + description: |- + Optional condition for BRANCH steps. When the from_step is a BRANCH, + each outgoing edge has a condition_expr evaluated against the step's + output. The first matching edge is followed. + label: + type: string + title: label + description: |- + label for the edge, useful for debugging and visualization + (e.g., "approved", "denied", "high-value", "default"). + title: Edge + additionalProperties: false + description: Edge defines a directed connection between two steps in the DAG. + workflows.v1.GetDefinitionRequest: + type: object + properties: + id: + type: string + title: id + title: GetDefinitionRequest + additionalProperties: false + workflows.v1.GetDefinitionResponse: + type: object + properties: + definition: + title: definition + $ref: '#/components/schemas/workflows.v1.WorkflowDefinition' + title: GetDefinitionResponse + additionalProperties: false + workflows.v1.GetRunRequest: + type: object + properties: + id: + type: string + title: id + title: GetRunRequest + additionalProperties: false + workflows.v1.GetRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: GetRunResponse + additionalProperties: false + workflows.v1.HandleTriggerRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + triggerType: + title: trigger_type + description: |- + trigger_type selects how the request is matched against WorkflowTrigger. + Supported values are EVENT, WEBHOOK, and SCHEDULE. + $ref: '#/components/schemas/workflows.v1.TriggerType' + triggerEventId: + type: string + title: trigger_event_id + description: |- + trigger_event_id references the events/v1 CloudEvent.id that initiated + this trigger when trigger_type is EVENT or WEBHOOK. + eventType: + type: string + title: event_type + description: |- + For EVENT and optional WAIT_FOR_EVENT satisfaction: the + events/v1 CloudEvent.type value. + eventSubject: + type: string + title: event_subject + description: |- + For EVENT and optional WAIT_FOR_EVENT satisfaction: the + events/v1 CloudEvent.subject value. + tapProvider: + type: string + title: tap_provider + description: 'For WEBHOOK: the tap/v1 TapEventData.provider to match.' + tapEntityType: + type: string + title: tap_entity_type + description: 'For WEBHOOK: the tap/v1 TapEventData.entity_type to match.' + tapAction: + type: string + title: tap_action + description: 'For WEBHOOK: the tap/v1 TapEventData.action to match.' + cronExpr: + type: string + title: cron_expr + description: 'For SCHEDULE: the cron expression that fired.' + initiatorAgentId: + type: string + title: initiator_agent_id + initiatorUserId: + type: string + title: initiator_user_id + entityId: + type: string + title: entity_id + entityType: + type: string + title: entity_type + inputPayload: + title: input_payload + description: |- + input_payload is passed to newly started runs and, when event metadata + is present, to WAIT_FOR_EVENT steps completed by this trigger. + $ref: '#/components/schemas/google.protobuf.Struct' + title: HandleTriggerRequest + additionalProperties: false + workflows.v1.HandleTriggerResponse: + type: object + properties: + startedRuns: + type: array + items: + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: started_runs + description: started_runs contains runs created by matching workflow triggers. + updatedRuns: + type: array + items: + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: updated_runs + description: |- + updated_runs contains existing runs advanced by satisfying + WAIT_FOR_EVENT steps. Runs already present in started_runs should not + be repeated here. + title: HandleTriggerResponse + additionalProperties: false + workflows.v1.ListDefinitionsRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + tag: + type: string + title: tag + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListDefinitionsRequest + additionalProperties: false + workflows.v1.ListDefinitionsResponse: + type: object + properties: + definitions: + type: array + items: + $ref: '#/components/schemas/workflows.v1.WorkflowDefinition' + title: definitions + total: + type: integer + title: total + format: int32 + title: ListDefinitionsResponse + additionalProperties: false + workflows.v1.ListRunsRequest: + type: object + properties: + workspaceId: + type: string + title: workspace_id + definitionId: + type: string + title: definition_id + state: + title: state + $ref: '#/components/schemas/workflows.v1.WorkflowState' + entityId: + type: string + title: entity_id + initiatorAgentId: + type: string + title: initiator_agent_id + limit: + type: integer + title: limit + format: int32 + offset: + type: integer + title: offset + format: int32 + title: ListRunsRequest + additionalProperties: false + workflows.v1.ListRunsResponse: + type: object + properties: + runs: + type: array + items: + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: runs + total: + type: integer + title: total + format: int32 + title: ListRunsResponse + additionalProperties: false + workflows.v1.ListVersionsRequest: + type: object + properties: + definitionId: + type: string + title: definition_id + title: ListVersionsRequest + additionalProperties: false + workflows.v1.ListVersionsResponse: + type: object + properties: + versions: + type: array + items: + $ref: '#/components/schemas/workflows.v1.WorkflowVersion' + title: versions + title: ListVersionsResponse + additionalProperties: false + workflows.v1.PauseRunRequest: + type: object + properties: + id: + type: string + title: id + reason: + type: string + title: reason + title: PauseRunRequest + additionalProperties: false + workflows.v1.PauseRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: PauseRunResponse + additionalProperties: false + workflows.v1.PublishVersionRequest: + type: object + properties: + definitionId: + type: string + title: definition_id + steps: + type: array + items: + $ref: '#/components/schemas/workflows.v1.StepDefinition' + title: steps + edges: + type: array + items: + $ref: '#/components/schemas/workflows.v1.Edge' + title: edges + trigger: + title: trigger + $ref: '#/components/schemas/workflows.v1.WorkflowTrigger' + defaultRetryPolicy: + title: default_retry_policy + $ref: '#/components/schemas/workflows.v1.RetryPolicy' + timeoutSeconds: + type: integer + title: timeout_seconds + format: int32 + author: + type: string + title: author + title: PublishVersionRequest + additionalProperties: false + workflows.v1.PublishVersionResponse: + type: object + properties: + version: + title: version + $ref: '#/components/schemas/workflows.v1.WorkflowVersion' + definition: + title: definition + $ref: '#/components/schemas/workflows.v1.WorkflowDefinition' + title: PublishVersionResponse + additionalProperties: false + workflows.v1.ResumeRunRequest: + type: object + properties: + id: + type: string + title: id + title: ResumeRunRequest + additionalProperties: false + workflows.v1.ResumeRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: ResumeRunResponse + additionalProperties: false + workflows.v1.RetryPolicy: + type: object + properties: + maxRetries: + type: integer + title: max_retries + format: int32 + backoffSeconds: + type: integer + title: backoff_seconds + format: int32 + backoffMultiplier: + type: number + title: backoff_multiplier + format: float + title: RetryPolicy + additionalProperties: false + description: |- + RetryPolicy controls retry behavior for steps. Mirrors the pattern in + objectives/v1 WakeSchedule (retry_count, max_retries, backoff_seconds). + workflows.v1.StartRunRequest: + type: object + properties: + definitionId: + type: string + title: definition_id + definitionVersion: + type: integer + title: definition_version + format: int32 + workspaceId: + type: string + title: workspace_id + initiatorAgentId: + type: string + title: initiator_agent_id + initiatorUserId: + type: string + title: initiator_user_id + entityId: + type: string + title: entity_id + entityType: + type: string + title: entity_type + parentRunId: + type: string + title: parent_run_id + inputPayload: + title: input_payload + $ref: '#/components/schemas/google.protobuf.Struct' + triggerType: + title: trigger_type + description: |- + trigger_type allows callers to start non-manual runs explicitly. + When omitted, services may infer WORKFLOW from parent_run_id or + default to MANUAL. + $ref: '#/components/schemas/workflows.v1.TriggerType' + triggerEventId: + type: string + title: trigger_event_id + description: |- + trigger_event_id references the events/v1 CloudEvent.id that started + this run when trigger_type is EVENT or WEBHOOK. + title: StartRunRequest + additionalProperties: false + workflows.v1.StartRunResponse: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: StartRunResponse + additionalProperties: false + workflows.v1.StepDefinition: + type: object + properties: + id: + type: string + title: id + description: |- + Unique identifier within the workflow (e.g., "prospect", "qualify", + "send-outreach"). Referenced by Edge.from_step_id / Edge.to_step_id + and by StepRun.step_id. + name: + type: string + title: name + stepType: + title: step_type + $ref: '#/components/schemas/workflows.v1.StepType' + agentId: + type: string + title: agent_id + description: |- + For AGENT_ACTION: the agents/v1 Agent.id to assign, or empty for + capability-based routing. + requiredCapability: + type: string + title: required_capability + description: |- + For AGENT_ACTION: the agents/v1 capability required. Used when + agent_id is empty to resolve the best available agent through the + registry. + actionType: + type: string + title: action_type + description: |- + For AGENT_ACTION: the action type passed to governance/v1 + EvaluateActionRequest.action_type and approvals/v1 + RequestApprovalRequest.action_type. + riskLevel: + type: string + title: risk_level + description: |- + For APPROVAL_GATE: the approvals/v1 RiskLevel for this gate. + Stored as string to avoid cross-package import (e.g., "RISK_LEVEL_HIGH"). + eventTypePattern: + type: string + title: event_type_pattern + description: 'For WAIT_FOR_EVENT: the events/v1 CloudEvent.type pattern to match.' + eventSubjectPattern: + type: string + title: event_subject_pattern + description: 'For WAIT_FOR_EVENT: the events/v1 CloudEvent.subject pattern to match.' + notificationChannel: + type: string + title: notification_channel + description: |- + For NOTIFICATION: the notifications/v1 DeliveryChannel to use. + Stored as string (e.g., "DELIVERY_CHANNEL_SLACK"). + notificationTemplate: + type: string + title: notification_template + description: 'For NOTIFICATION: the notification template.' + conditionExpr: + type: string + title: condition_expr + description: |- + For BRANCH: the expression evaluated to select outgoing edges. + References step output fields from prior steps. + compensationStepId: + type: string + title: compensation_step_id + description: |- + The step to execute if this step fails and the workflow enters + COMPENSATING state. References another StepDefinition.id in the + same workflow. + config: + title: config + description: |- + Step-specific parameters. For AGENT_ACTION, passed as the objective + description or context. For WAIT_FOR_EVENT, may contain + timeout_seconds. For HUMAN_TASK, contains instructions. + $ref: '#/components/schemas/google.protobuf.Struct' + retryPolicy: + title: retry_policy + description: Per-step retry policy. Falls back to WorkflowVersion.default_retry_policy. + $ref: '#/components/schemas/workflows.v1.RetryPolicy' + timeoutSeconds: + type: integer + title: timeout_seconds + format: int32 + description: Per-step timeout. Falls back to WorkflowVersion.timeout_seconds. + promptName: + type: string + title: prompt_name + description: |- + prompt_name references prompts/v1 Prompt.name for agent action steps. + Resolved through prompts/v1 Resolve at execution time using the + label from the agent's agents/v1 AgentConfig.prompt_bindings. + skillId: + type: string + title: skill_id + description: skill_id references skills/v1 Skill.id required for this step. + title: StepDefinition + additionalProperties: false + description: StepDefinition is a single node in the workflow DAG. + workflows.v1.StepRun: + type: object + properties: + stepId: + type: string + title: step_id + description: step_id references StepDefinition.id from the workflow version. + stepName: + type: string + title: step_name + stepType: + title: step_type + $ref: '#/components/schemas/workflows.v1.StepType' + state: + title: state + $ref: '#/components/schemas/workflows.v1.StepRunState' + objectiveId: + type: string + title: objective_id + description: |- + objective_id links to objectives/v1 Objective.id — the objective + created when this AGENT_ACTION step begins execution. + agentId: + type: string + title: agent_id + description: agent_id links to agents/v1 Agent.id — the agent assigned to this step. + delegationId: + type: string + title: delegation_id + description: |- + delegation_id links to agents/v1 DelegationRecord.id when the step + was fulfilled through capability-based delegation. + approvalRequestId: + type: string + title: approval_request_id + description: |- + approval_request_id links to approvals/v1 ApprovalRequest.id for + APPROVAL_GATE steps or when governance/v1 returns REQUIRE_APPROVAL. + governanceDecision: + type: string + title: governance_decision + description: |- + governance_decision stores the governance/v1 ActionDecision result. + Stored as string (e.g., "ACTION_DECISION_ALLOW"). + eventId: + type: string + title: event_id + description: |- + event_id references the events/v1 CloudEvent.id that satisfied a + WAIT_FOR_EVENT step. + notificationId: + type: string + title: notification_id + description: |- + notification_id references notifications/v1 Notification.id for + NOTIFICATION steps. + inputPayload: + title: input_payload + description: input_payload is the data this step received from upstream steps. + $ref: '#/components/schemas/google.protobuf.Struct' + outputPayload: + title: output_payload + description: output_payload is the data this step produced for downstream steps. + $ref: '#/components/schemas/google.protobuf.Struct' + errorMessage: + type: string + title: error_message + retryCount: + type: integer + title: retry_count + format: int32 + costUsd: + type: number + title: cost_usd + format: double + description: cost_usd is the meter/v1 cost attributed to this step's execution. + startedAt: + title: started_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: StepRun + additionalProperties: false + description: StepRun is the execution record for a single step within a workflow run. + workflows.v1.TransitionStepRequest: + type: object + properties: + runId: + type: string + title: run_id + stepId: + type: string + title: step_id + state: + title: state + $ref: '#/components/schemas/workflows.v1.StepRunState' + objectiveId: + type: string + title: objective_id + agentId: + type: string + title: agent_id + delegationId: + type: string + title: delegation_id + approvalRequestId: + type: string + title: approval_request_id + governanceDecision: + type: string + title: governance_decision + eventId: + type: string + title: event_id + notificationId: + type: string + title: notification_id + outputPayload: + title: output_payload + $ref: '#/components/schemas/google.protobuf.Struct' + errorMessage: + type: string + title: error_message + costUsd: + type: number + title: cost_usd + format: double + title: TransitionStepRequest + additionalProperties: false + workflows.v1.TransitionStepResponse: + type: object + properties: + step: + title: step + $ref: '#/components/schemas/workflows.v1.StepRun' + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + title: TransitionStepResponse + additionalProperties: false + workflows.v1.WorkflowDefinition: + type: object + properties: + id: + type: string + title: id + workspaceId: + type: string + title: workspace_id + name: + type: string + title: name + description: + type: string + title: description + latestVersion: + type: integer + title: latest_version + format: int32 + tags: + type: array + items: + type: string + title: tags + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WorkflowDefinition + additionalProperties: false + description: WorkflowDefinition is a named, versioned process template. + workflows.v1.WorkflowRun: + type: object + properties: + id: + type: string + title: id + definitionId: + type: string + title: definition_id + definitionVersion: + type: integer + title: definition_version + format: int32 + workspaceId: + type: string + title: workspace_id + state: + title: state + $ref: '#/components/schemas/workflows.v1.WorkflowState' + steps: + type: array + items: + $ref: '#/components/schemas/workflows.v1.StepRun' + title: steps + triggerEventId: + type: string + title: trigger_event_id + description: |- + trigger_event_id references the events/v1 CloudEvent.id that started + this run, if trigger_type is EVENT or WEBHOOK. + triggerType: + title: trigger_type + $ref: '#/components/schemas/workflows.v1.TriggerType' + initiatorAgentId: + type: string + title: initiator_agent_id + description: |- + initiator_agent_id references agents/v1 Agent.id if an agent started + this run. For MANUAL triggers, this may be empty (human-initiated). + initiatorUserId: + type: string + title: initiator_user_id + description: |- + initiator_user_id references identity/v1 Member.user_id if a human + started this run. + parentRunId: + type: string + title: parent_run_id + description: |- + parent_run_id references another WorkflowRun.id when this run is a + sub-workflow started by a WORKFLOW trigger. + entityId: + type: string + title: entity_id + description: |- + entity_id references entities/v1 CanonicalEntity.id — the primary + entity this workflow operates on (e.g., a contact being prospected, + a deal being closed). + entityType: + type: string + title: entity_type + description: |- + entity_type aligns with entities/v1 EntityType. Stored as string + to avoid cross-package import (e.g., "ENTITY_TYPE_DEAL"). + inputPayload: + title: input_payload + description: input_payload is the trigger data passed to the first step. + $ref: '#/components/schemas/google.protobuf.Struct' + outputPayload: + title: output_payload + description: output_payload is the final result produced by the terminal step. + $ref: '#/components/schemas/google.protobuf.Struct' + totalCostUsd: + type: number + title: total_cost_usd + format: double + description: |- + total_cost_usd is the sum of meter/v1 usage records attributed to + this workflow run's steps. + startedAt: + title: started_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + completedAt: + title: completed_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WorkflowRun + additionalProperties: false + description: WorkflowRun is a live execution of a workflow definition version. + workflows.v1.WorkflowRunLifecycleEvent: + type: object + properties: + run: + title: run + $ref: '#/components/schemas/workflows.v1.WorkflowRun' + operation: + type: string + title: operation + recordedAt: + title: recorded_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WorkflowRunLifecycleEvent + additionalProperties: false + description: |- + WorkflowRunLifecycleEvent is the typed payload for workflow run lifecycle + events published on the internal event bus (for example + `workflows.changes.run.started` and `workflows.changes.run.completed`). + workflows.v1.WorkflowStepLifecycleEvent: + type: object + properties: + runId: + type: string + title: run_id + definitionId: + type: string + title: definition_id + definitionVersion: + type: integer + title: definition_version + format: int32 + workspaceId: + type: string + title: workspace_id + workflowState: + title: workflow_state + $ref: '#/components/schemas/workflows.v1.WorkflowState' + triggerType: + title: trigger_type + $ref: '#/components/schemas/workflows.v1.TriggerType' + triggerEventId: + type: string + title: trigger_event_id + initiatorAgentId: + type: string + title: initiator_agent_id + initiatorUserId: + type: string + title: initiator_user_id + parentRunId: + type: string + title: parent_run_id + entityId: + type: string + title: entity_id + entityType: + type: string + title: entity_type + workflowTotalCostUsd: + type: number + title: workflow_total_cost_usd + format: double + step: + title: step + $ref: '#/components/schemas/workflows.v1.StepRun' + operation: + type: string + title: operation + recordedAt: + title: recorded_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WorkflowStepLifecycleEvent + additionalProperties: false + description: |- + WorkflowStepLifecycleEvent is the typed payload for workflow step lifecycle + events published on the internal event bus (for example + `workflows.changes.step.started`, `workflows.changes.step.waiting`, and + `workflows.changes.step.completed`). It carries the specific StepRun plus the + run context consumers need without requiring the full WorkflowRun snapshot. + workflows.v1.WorkflowTrigger: + type: object + properties: + triggerType: + title: trigger_type + $ref: '#/components/schemas/workflows.v1.TriggerType' + eventType: + type: string + title: event_type + description: 'For EVENT: the events/v1 CloudEvent.type to match.' + eventSubject: + type: string + title: event_subject + description: 'For EVENT: the events/v1 CloudEvent.subject to match.' + tapProvider: + type: string + title: tap_provider + description: 'For WEBHOOK: the tap/v1 TapEventData.provider to match.' + tapEntityType: + type: string + title: tap_entity_type + description: 'For WEBHOOK: the tap/v1 TapEventData.entity_type to match.' + tapAction: + type: string + title: tap_action + description: 'For WEBHOOK: the tap/v1 TapEventData.action to match.' + cronExpr: + type: string + title: cron_expr + description: 'For SCHEDULE: the cron expression.' + parentWorkflowId: + type: string + title: parent_workflow_id + description: 'For WORKFLOW: the parent workflows/v1 WorkflowDefinition.id.' + filterExpr: + type: string + title: filter_expr + description: |- + Filter expression applied to the trigger payload. Only events matching + this expression start a run. + title: WorkflowTrigger + additionalProperties: false + description: WorkflowTrigger defines what automatically starts a workflow run. + workflows.v1.WorkflowVersion: + type: object + properties: + id: + type: string + title: id + definitionId: + type: string + title: definition_id + version: + type: integer + title: version + format: int32 + steps: + type: array + items: + $ref: '#/components/schemas/workflows.v1.StepDefinition' + title: steps + edges: + type: array + items: + $ref: '#/components/schemas/workflows.v1.Edge' + title: edges + trigger: + title: trigger + $ref: '#/components/schemas/workflows.v1.WorkflowTrigger' + defaultRetryPolicy: + title: default_retry_policy + $ref: '#/components/schemas/workflows.v1.RetryPolicy' + timeoutSeconds: + type: integer + title: timeout_seconds + format: int32 + author: + type: string + title: author + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: WorkflowVersion + additionalProperties: false + description: |- + WorkflowVersion is an immutable snapshot of a workflow's step graph. + Follows the same versioning pattern as prompts/v1 Version and + skills/v1 SkillVersion. + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms + connect.error: + type: object + properties: + code: + type: string + examples: + - not_found + enum: + - canceled + - unknown + - invalid_argument + - deadline_exceeded + - not_found + - already_exists + - permission_denied + - resource_exhausted + - failed_precondition + - aborted + - out_of_range + - unimplemented + - internal + - unavailable + - data_loss + - unauthenticated + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + detail: + $ref: '#/components/schemas/google.protobuf.Any' + title: Connect Error + additionalProperties: true + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + google.protobuf.Any: + type: object + properties: + type: + type: string + value: + type: string + format: binary + debug: + type: object + additionalProperties: true + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +security: [] +tags: + - name: workflows.v1.WorkflowService + description: |- + WorkflowService manages multi-agent process definitions and their + executions. A workflow composes multiple objectives/v1 Objective records + into a DAG with typed step semantics, approval gates, governance checks, + event waits, branching, and compensation. + + Where objectives/v1 tracks a single agent doing a single thing, a workflow + tracks the process: prospect -> qualify -> outreach -> follow-up -> close. + Each step in a running workflow creates an objective, delegates to an agent + (agents/v1), and feeds its output to the next step.