consumerapi

package
v0.2.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireRequestBody

func RequireRequestBody[T any](
	request *T,
	bodyPresent bool,
	requireBody bool,
	subject string,
) error

RequireRequestBody performs transport-shape checks only.

Domain validation belongs to Workspace services. Store validation and lifecycle enforcement belong to Artifact Store.

Types

type AdoptWorkspaceOccurrenceInput

type AdoptWorkspaceOccurrenceInput struct {
	ExpectedCatalogRevision uint64                    `json:"expectedCatalogRevision"`
	Occurrence              WorkspaceOccurrenceRef    `json:"occurrence"`
	ArtifactID              artifact.ArtifactID       `json:"artifactID"`
	Name                    string                    `json:"name,omitempty"`
	Enabled                 bool                      `json:"enabled"`
	Settings                WorkspaceArtifactSettings `json:"settings"`
}

type AttachWorkspaceSourceInput

type AttachWorkspaceSourceInput struct {
	ExpectedCollectionRevision uint64                      `json:"expectedCollectionRevision"`
	SourceID                   source.SourceID             `json:"sourceID"`
	Role                       collection.AttachmentRole   `json:"role"`
	Enabled                    bool                        `json:"enabled"`
	Settings                   WorkspaceAttachmentSettings `json:"settings"`
}

type ComposeWorkspaceContextRequest

type ComposeWorkspaceContextRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
	Body      *ComposeWorkspaceContextRequestBody
}

type ComposeWorkspaceContextRequestBody

type ComposeWorkspaceContextRequestBody struct {
	Artifacts []artifact.ArtifactRef `json:"artifacts,omitempty"`
}

type ComposeWorkspaceContextResponse

type ComposeWorkspaceContextResponse struct {
	Body *WorkspaceContextLoadPlan
}

type CompositionDecision

type CompositionDecision struct {
	Artifact      artifact.ArtifactRef               `json:"artifact"`
	Status        workspaceRuntime.CompositionStatus `json:"status"`
	Code          string                             `json:"code,omitempty"`
	OriginalBytes int                                `json:"originalBytes"`
	IncludedBytes int                                `json:"includedBytes"`
}

type Config

type Config struct {
	WorkspaceRootID    root.RootID
	ContextComposition workspaceRuntime.CompositionPolicy
	SourceUsePolicy    artifactadapter.SourceUsePolicy
}

func DefaultConfig

func DefaultConfig() Config

type ContextContribution

type ContextContribution struct {
	Artifact         artifact.ArtifactRef                      `json:"artifact"`
	ArtifactRevision uint64                                    `json:"artifactRevision"`
	DefinitionDigest cryptoutil.Digest                         `json:"definitionDigest"`
	SourceID         source.SourceID                           `json:"sourceID"`
	Locator          basespec.Locator                          `json:"locator"`
	Name             string                                    `json:"name"`
	Role             artifactbuiltin.WorkspaceContextRole      `json:"role"`
	MediaType        artifactbuiltin.WorkspaceContextMediaType `json:"mediaType"`
	Content          string                                    `json:"content"`
	ConventionOrder  int                                       `json:"conventionOrder"`
	OriginalBytes    int                                       `json:"originalBytes"`
	IncludedBytes    int                                       `json:"includedBytes"`
	Truncated        bool                                      `json:"truncated"`
}

type ContextDocument

type ContextDocument struct {
	Artifact         artifact.ArtifactRef                      `json:"artifact"`
	ArtifactRevision uint64                                    `json:"artifactRevision"`
	DefinitionDigest cryptoutil.Digest                         `json:"definitionDigest"`
	SourceID         source.SourceID                           `json:"sourceID"`
	Locator          basespec.Locator                          `json:"locator"`
	Name             string                                    `json:"name"`
	Role             artifactbuiltin.WorkspaceContextRole      `json:"role"`
	MediaType        artifactbuiltin.WorkspaceContextMediaType `json:"mediaType"`
	Enabled          bool                                      `json:"enabled"`
	State            artifact.State                            `json:"state"`
	CatalogCurrent   bool                                      `json:"catalogCurrent"`
	ProjectionValid  bool                                      `json:"projectionValid"`
	RuntimeDisabled  bool                                      `json:"runtimeDisabled"`
	Diagnostics      []diagnostic.Diagnostic                   `json:"diagnostics,omitempty"`
}

type ContextInspection

type ContextInspection struct {
	Workspace       collection.CollectionRef `json:"workspace"`
	CatalogRevision uint64                   `json:"catalogRevision"`
	Contributions   []ContextContribution    `json:"contributions"`
	Diagnostics     []diagnostic.Diagnostic  `json:"diagnostics,omitempty"`
}

type ContextLoadPlan

type ContextLoadPlan struct {
	Workspace       collection.CollectionRef `json:"workspace"`
	CatalogRevision uint64                   `json:"catalogRevision"`
	Contributions   []ContextContribution    `json:"contributions"`
	Prompt          string                   `json:"prompt"`
	Diagnostics     []diagnostic.Diagnostic  `json:"diagnostics,omitempty"`
	Decisions       []CompositionDecision    `json:"decisions"`
	PromptBytes     int                      `json:"promptBytes"`
}

type ContextService

type ContextService interface {
	List(
		ctx context.Context,
		workspace collection.CollectionRef,
	) ([]ContextDocument, error)

	Load(
		ctx context.Context,
		workspace collection.CollectionRef,
		artifactRefs []artifact.ArtifactRef,
	) (ContextInspection, error)

	Compose(
		ctx context.Context,
		workspace collection.CollectionRef,
		artifactRefs []artifact.ArtifactRef,
	) (ContextLoadPlan, error)
}

ContextService is the aggregate-facing storage port for Workspace Context list, inspection, and composition operations.

type CreateEmptyWorkspaceInput

type CreateEmptyWorkspaceInput struct {
	DisplayName string             `json:"displayName"`
	Description string             `json:"description,omitempty"`
	Discovery   WorkspaceDiscovery `json:"discovery"`
}

type CreateFilesystemWorkspaceInput

type CreateFilesystemWorkspaceInput struct {
	DisplayName string             `json:"displayName"`
	Description string             `json:"description,omitempty"`
	RootPath    string             `json:"rootPath"`
	Discovery   WorkspaceDiscovery `json:"discovery"`
}

type DetachWorkspaceSourceInput

type DetachWorkspaceSourceInput struct {
	ExpectedCollectionRevision uint64          `json:"expectedCollectionRevision"`
	ExpectedAttachmentRevision uint64          `json:"expectedAttachmentRevision"`
	SourceID                   source.SourceID `json:"sourceID"`
}

type GetWorkspaceArtifactRequest

type GetWorkspaceArtifactRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
	Artifact  artifact.ArtifactRef         `json:"artifact"  required:"true"`
}

type GetWorkspaceArtifactResponse

type GetWorkspaceArtifactResponse struct {
	Body *WorkspaceArtifactView
}

type GetWorkspaceCatalogRequest

type GetWorkspaceCatalogRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
}

type GetWorkspaceCatalogResponse

type GetWorkspaceCatalogResponse struct {
	Body *WorkspaceCatalogView
}

type GetWorkspaceRequest

type GetWorkspaceRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
}

type GetWorkspaceResponse

type GetWorkspaceResponse struct {
	Body *WorkspaceView
}

type ListWorkspaceArtifactsRequest

type ListWorkspaceArtifactsRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
}

type ListWorkspaceArtifactsResponse

type ListWorkspaceArtifactsResponse struct {
	Body *ListWorkspaceArtifactsResponseBody
}

type ListWorkspaceArtifactsResponseBody

type ListWorkspaceArtifactsResponseBody struct {
	Artifacts []WorkspaceArtifactView `json:"artifacts"`
}

type ListWorkspaceContextsRequest

type ListWorkspaceContextsRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
}

type ListWorkspaceContextsResponse

type ListWorkspaceContextsResponse struct {
	Body *ListWorkspaceContextsResponseBody
}

type ListWorkspaceContextsResponseBody

type ListWorkspaceContextsResponseBody struct {
	Contexts []WorkspaceContextView `json:"contexts"`
}

type ListWorkspaceSkillsRequest

type ListWorkspaceSkillsRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
}

type ListWorkspaceSkillsResponse

type ListWorkspaceSkillsResponse struct {
	Body *ListWorkspaceSkillsResponseBody
}

type ListWorkspaceSkillsResponseBody

type ListWorkspaceSkillsResponseBody struct {
	Skills []WorkspaceSkillView `json:"skills"`
}

type ListWorkspacesRequest

type ListWorkspacesRequest struct{}

type ListWorkspacesResponse

type ListWorkspacesResponse struct {
	Body *ListWorkspacesResponseBody
}

type ListWorkspacesResponseBody

type ListWorkspacesResponseBody struct {
	Workspaces []WorkspaceView `json:"workspaces"`
}

type LoadWorkspaceContextsRequest

type LoadWorkspaceContextsRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
	Body      *LoadWorkspaceContextsRequestBody
}

type LoadWorkspaceContextsRequestBody

type LoadWorkspaceContextsRequestBody struct {
	Artifacts []artifact.ArtifactRef `json:"artifacts,omitempty"`
}

type LoadWorkspaceContextsResponse

type LoadWorkspaceContextsResponse struct {
	Body *WorkspaceContextInspectionView
}

type LoadWorkspaceSkillsRequest

type LoadWorkspaceSkillsRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
	Body      *LoadWorkspaceSkillsRequestBody
}

type LoadWorkspaceSkillsRequestBody

type LoadWorkspaceSkillsRequestBody struct {
	Artifacts []artifact.ArtifactRef `json:"artifacts"`
}

type LoadWorkspaceSkillsResponse

type LoadWorkspaceSkillsResponse struct {
	Body *WorkspaceSkillLoadView
}

type PinWorkspaceArtifactInput

type PinWorkspaceArtifactInput struct {
	ExpectedCollectionRevision uint64                    `json:"expectedCollectionRevision"`
	ArtifactID                 artifact.ArtifactID       `json:"artifactID"`
	Binding                    artifact.SourceBinding    `json:"binding"`
	Name                       string                    `json:"name"`
	Enabled                    bool                      `json:"enabled"`
	Settings                   WorkspaceArtifactSettings `json:"settings"`
}

type QueryService

type QueryService struct {
	// contains filtered or unexported fields
}

func NewQueryService

func NewQueryService(
	workspaces *Service,
	resources compositionapi.ResourceAPI,
) (*QueryService, error)

func (*QueryService) Catalog

func (*QueryService) ComposeLoadPlan

func (q *QueryService) ComposeLoadPlan(
	ctx context.Context,
	workspace collection.CollectionRef,
	artifactRefs []artifact.ArtifactRef,
) (workspaceDomain.LoadPlan, error)

func (*QueryService) ComposeLoadPlanFromCatalog

func (q *QueryService) ComposeLoadPlanFromCatalog(
	view workspaceDomain.CatalogView,
	artifactRefs []artifact.ArtifactRef,
) (workspaceDomain.LoadPlan, error)

ComposeLoadPlanFromCatalog performs Workspace selection validation and runtime-read eligibility projection from one already loaded Catalog view.

Context and Skill adapters use this to avoid loading a second Catalog after they have already selected Artifact references from the first one.

func (*QueryService) GetWorkspace

func (q *QueryService) GetWorkspace(
	ctx context.Context,
	workspace collection.CollectionRef,
) (workspaceDomain.Workspace, error)

func (*QueryService) ResolveArtifact

type RegisterWorkspaceDirectoryInput

type RegisterWorkspaceDirectoryInput struct {
	ExpectedCollectionRevision uint64                      `json:"expectedCollectionRevision"`
	DisplayName                string                      `json:"displayName"`
	RootPath                   string                      `json:"rootPath"`
	Role                       collection.AttachmentRole   `json:"role"`
	Settings                   WorkspaceAttachmentSettings `json:"settings"`
}

type RetireWorkspaceResult

type RetireWorkspaceResult struct {
	Workspace WorkspaceRef `json:"workspace"`
	Revision  uint64       `json:"revision"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	collections compositionapi.CollectionAPI,
	sources compositionapi.SourceAPI,
	workspaceRootID root.RootID,
) (*Service, error)

func (*Service) Get

func (*Service) List

func (s *Service) List(
	ctx context.Context,
	rootID root.RootID,
) ([]workspaceDomain.Workspace, error)

type SetWorkspaceArtifactRuntimeDisabledRequest

type SetWorkspaceArtifactRuntimeDisabledRequest struct {
	Workspace workspaceDomain.WorkspaceRef `json:"workspace" required:"true"`
	Artifact  artifact.ArtifactRef         `json:"artifact"  required:"true"`
	Body      *SetWorkspaceArtifactRuntimeDisabledRequestBody
}

type SetWorkspaceArtifactRuntimeDisabledRequestBody

type SetWorkspaceArtifactRuntimeDisabledRequestBody struct {
	ExpectedRevision uint64 `json:"expectedRevision" required:"true"`
	RuntimeDisabled  bool   `json:"runtimeDisabled"  required:"true"`
}

type SetWorkspaceArtifactRuntimeDisabledResponse

type SetWorkspaceArtifactRuntimeDisabledResponse struct {
	Body *WorkspaceArtifactView
}

type SetWorkspacePrimarySourceInput

type SetWorkspacePrimarySourceInput struct {
	ExpectedCollectionRevision uint64          `json:"expectedCollectionRevision"`
	SourceID                   source.SourceID `json:"sourceID,omitempty"`
	Clear                      bool            `json:"clear,omitempty"`
}

type StoreAPI

type StoreAPI struct {
	// contains filtered or unexported fields
}

func NewStoreAPI

func NewStoreAPI(
	sources compositionapi.SourceAPI,
	collections compositionapi.CollectionAPI,
	artifacts compositionapi.ArtifactAPI,
	catalogs compositionapi.CatalogAPI,
	resources compositionapi.ResourceAPI,
	config Config,
) (*StoreAPI, error)

func (*StoreAPI) AdoptWorkspaceOccurrence

func (a *StoreAPI) AdoptWorkspaceOccurrence(
	ctx context.Context,
	ref WorkspaceRef,
	input AdoptWorkspaceOccurrenceInput,
) (WorkspaceArtifactView, error)

func (*StoreAPI) AttachWorkspaceSource

func (a *StoreAPI) AttachWorkspaceSource(
	ctx context.Context,
	ref WorkspaceRef,
	input AttachWorkspaceSourceInput,
) (WorkspaceView, error)

func (*StoreAPI) ContextService

func (a *StoreAPI) ContextService() ContextService

func (*StoreAPI) CreateEmptyWorkspace

func (a *StoreAPI) CreateEmptyWorkspace(
	ctx context.Context,
	input CreateEmptyWorkspaceInput,
) (WorkspaceView, error)

func (*StoreAPI) CreateFilesystemWorkspace

func (a *StoreAPI) CreateFilesystemWorkspace(
	ctx context.Context,
	input CreateFilesystemWorkspaceInput,
) (WorkspaceView, error)

func (*StoreAPI) DetachWorkspaceSource

func (a *StoreAPI) DetachWorkspaceSource(
	ctx context.Context,
	ref WorkspaceRef,
	input DetachWorkspaceSourceInput,
) (WorkspaceView, error)

func (*StoreAPI) GetWorkspace

func (a *StoreAPI) GetWorkspace(
	ctx context.Context,
	request *GetWorkspaceRequest,
) (*GetWorkspaceResponse, error)

func (*StoreAPI) GetWorkspaceArtifact

func (a *StoreAPI) GetWorkspaceArtifact(
	ctx context.Context,
	request *GetWorkspaceArtifactRequest,
) (*GetWorkspaceArtifactResponse, error)

func (*StoreAPI) GetWorkspaceCatalog

func (a *StoreAPI) GetWorkspaceCatalog(
	ctx context.Context,
	request *GetWorkspaceCatalogRequest,
) (*GetWorkspaceCatalogResponse, error)

func (*StoreAPI) ListWorkspaceArtifacts

func (a *StoreAPI) ListWorkspaceArtifacts(
	ctx context.Context,
	request *ListWorkspaceArtifactsRequest,
) (*ListWorkspaceArtifactsResponse, error)

func (*StoreAPI) ListWorkspaceSourcesForManagement

func (a *StoreAPI) ListWorkspaceSourcesForManagement(
	ctx context.Context,
) ([]WorkspaceSourceSummary, error)

func (*StoreAPI) ListWorkspaceSuppressions

func (a *StoreAPI) ListWorkspaceSuppressions(
	ctx context.Context,
	ref WorkspaceRef,
) ([]WorkspaceSuppressionView, error)

func (*StoreAPI) ListWorkspaces

func (a *StoreAPI) ListWorkspaces(
	ctx context.Context,
	request *ListWorkspacesRequest,
) (*ListWorkspacesResponse, error)

func (*StoreAPI) PinWorkspaceArtifact

func (a *StoreAPI) PinWorkspaceArtifact(
	ctx context.Context,
	ref WorkspaceRef,
	input PinWorkspaceArtifactInput,
) (WorkspaceArtifactView, error)

func (*StoreAPI) PurgeWorkspace

func (a *StoreAPI) PurgeWorkspace(
	ctx context.Context,
	ref WorkspaceRef,
	expectedRevision uint64,
) (WorkspaceRef, error)

func (*StoreAPI) PurgeWorkspaceArtifact

func (a *StoreAPI) PurgeWorkspaceArtifact(
	ctx context.Context,
	workspace WorkspaceRef,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
) (artifact.ArtifactRef, error)

func (*StoreAPI) RefreshWorkspace

func (a *StoreAPI) RefreshWorkspace(
	ctx context.Context,
	ref WorkspaceRef,
) (WorkspaceRefreshResult, error)

func (*StoreAPI) RetireWorkspace

func (a *StoreAPI) RetireWorkspace(
	ctx context.Context,
	ref WorkspaceRef,
	expectedRevision uint64,
) (RetireWorkspaceResult, error)

func (*StoreAPI) SetArtifactRuntimeDisabled

func (a *StoreAPI) SetArtifactRuntimeDisabled(
	ctx context.Context,
	workspace workspaceDomain.WorkspaceRef,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
	runtimeDisabled bool,
) (WorkspaceArtifactView, error)

func (*StoreAPI) SetWorkspaceArtifactEnabled

func (a *StoreAPI) SetWorkspaceArtifactEnabled(
	ctx context.Context,
	workspace WorkspaceRef,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
	enabled bool,
) (WorkspaceArtifactView, error)

func (*StoreAPI) SetWorkspacePrimarySource

func (a *StoreAPI) SetWorkspacePrimarySource(
	ctx context.Context,
	ref WorkspaceRef,
	input SetWorkspacePrimarySourceInput,
) (WorkspaceView, error)

func (*StoreAPI) SetWorkspaceSourceEnabled

func (a *StoreAPI) SetWorkspaceSourceEnabled(
	ctx context.Context,
	sourceID source.SourceID,
	expectedRevision uint64,
	enabled bool,
) (WorkspaceSourceSummary, error)

func (*StoreAPI) SkillAdapter

func (a *StoreAPI) SkillAdapter() *workspaceadapter.Adapter

func (*StoreAPI) SuppressWorkspaceBinding

func (a *StoreAPI) SuppressWorkspaceBinding(
	ctx context.Context,
	ref WorkspaceRef,
	input SuppressWorkspaceBindingInput,
) (WorkspaceSuppressionView, error)

func (*StoreAPI) UnadoptWorkspaceArtifact

func (a *StoreAPI) UnadoptWorkspaceArtifact(
	ctx context.Context,
	workspace WorkspaceRef,
	ref artifact.ArtifactRef,
	input UnadoptWorkspaceArtifactInput,
) (UnadoptWorkspaceArtifactResult, error)

func (*StoreAPI) UnsuppressWorkspaceBinding

func (a *StoreAPI) UnsuppressWorkspaceBinding(
	ctx context.Context,
	ref WorkspaceRef,
	binding artifact.SourceBinding,
	expectedRevision uint64,
) (UnsuppressWorkspaceBindingResult, error)

func (*StoreAPI) UpdateWorkspace

func (a *StoreAPI) UpdateWorkspace(
	ctx context.Context,
	ref WorkspaceRef,
	input UpdateWorkspaceInput,
) (WorkspaceView, error)

func (*StoreAPI) UpdateWorkspaceAttachment

func (a *StoreAPI) UpdateWorkspaceAttachment(
	ctx context.Context,
	ref WorkspaceRef,
	input UpdateWorkspaceAttachmentInput,
) (WorkspaceView, error)

type SuppressWorkspaceBindingInput

type SuppressWorkspaceBindingInput struct {
	ExpectedCollectionRevision uint64                 `json:"expectedCollectionRevision"`
	Binding                    artifact.SourceBinding `json:"binding"`
}

type UnadoptWorkspaceArtifactInput

type UnadoptWorkspaceArtifactInput struct {
	ExpectedRevision uint64 `json:"expectedRevision"`
	Suppress         bool   `json:"suppress"`
}

type UnadoptWorkspaceArtifactResult

type UnadoptWorkspaceArtifactResult struct {
	Artifact artifact.ArtifactRef `json:"artifact"`
}

type UnsuppressWorkspaceBindingResult

type UnsuppressWorkspaceBindingResult struct {
	Workspace WorkspaceRef           `json:"workspace"`
	Binding   artifact.SourceBinding `json:"binding"`
}

type UpdateWorkspaceAttachmentInput

type UpdateWorkspaceAttachmentInput struct {
	ExpectedCollectionRevision uint64                      `json:"expectedCollectionRevision"`
	ExpectedAttachmentRevision uint64                      `json:"expectedAttachmentRevision"`
	SourceID                   source.SourceID             `json:"sourceID"`
	Role                       collection.AttachmentRole   `json:"role"`
	Enabled                    bool                        `json:"enabled"`
	Settings                   WorkspaceAttachmentSettings `json:"settings"`
}

type UpdateWorkspaceInput

type UpdateWorkspaceInput struct {
	ExpectedRevision uint64             `json:"expectedRevision"`
	DisplayName      string             `json:"displayName"`
	Description      string             `json:"description,omitempty"`
	Enabled          bool               `json:"enabled"`
	Discovery        WorkspaceDiscovery `json:"discovery"`
}

type WorkspaceArtifactSettings

type WorkspaceArtifactSettings struct {
	RuntimeDisabled bool `json:"runtimeDisabled"`
}

type WorkspaceArtifactView

type WorkspaceArtifactView struct {
	Artifact           artifact.ArtifactRef        `json:"artifact"`
	Revision           uint64                      `json:"revision"`
	Name               string                      `json:"name"`
	Kind               artifact.ArtifactKind       `json:"kind"`
	Enabled            bool                        `json:"enabled"`
	State              artifact.State              `json:"state"`
	Adoption           artifact.AdoptionMode       `json:"adoption"`
	ResolvedDefinition *cryptoutil.Digest          `json:"resolvedDefinition,omitempty"`
	SourceID           source.SourceID             `json:"sourceID"`
	Locator            basespec.Locator            `json:"locator"`
	SubresourceLocator basespec.SubresourceLocator `json:"subresourceLocator,omitempty"`
	RuntimeDisabled    bool                        `json:"runtimeDisabled"`
	Diagnostics        []diagnostic.Diagnostic     `json:"diagnostics,omitempty"`
}

type WorkspaceAttachmentSettings

type WorkspaceAttachmentSettings struct {
	Recursive     *bool `json:"recursive,omitempty"`
	Authoritative *bool `json:"authoritative,omitempty"`
}

type WorkspaceAttachmentView

type WorkspaceAttachmentView struct {
	SourceID          source.SourceID             `json:"sourceID"`
	Revision          uint64                      `json:"revision"`
	Role              collection.AttachmentRole   `json:"role"`
	Enabled           bool                        `json:"enabled"`
	SourceDisplayName string                      `json:"sourceDisplayName,omitempty"`
	SourceKind        string                      `json:"sourceKind,omitempty"`
	Path              string                      `json:"path,omitempty"`
	Settings          WorkspaceAttachmentSettings `json:"settings"`
	Diagnostics       []diagnostic.Diagnostic     `json:"diagnostics,omitempty"`
}

type WorkspaceCatalogView

type WorkspaceCatalogView struct {
	Workspace               WorkspaceView                `json:"workspace"`
	CatalogRevision         uint64                       `json:"catalogRevision"`
	CatalogCurrent          bool                         `json:"catalogCurrent"`
	Diagnostics             []diagnostic.Diagnostic      `json:"diagnostics,omitempty"`
	Resources               []WorkspaceResourceView      `json:"resources"`
	Groups                  []WorkspaceResourceGroupView `json:"groups"`
	Occurrences             []WorkspaceOccurrenceView    `json:"occurrences"`
	ValidOccurrences        []WorkspaceOccurrenceView    `json:"validOccurrences"`
	InvalidOccurrences      []WorkspaceOccurrenceView    `json:"invalidOccurrences"`
	MissingOccurrences      []WorkspaceOccurrenceView    `json:"missingOccurrences"`
	UnrecordedOccurrences   []WorkspaceOccurrenceView    `json:"unrecordedOccurrences"`
	UnresolvedArtifacts     []WorkspaceArtifactView      `json:"unresolvedArtifacts"`
	UnrecordedCount         int                          `json:"unrecordedCount"`
	UnresolvedArtifactCount int                          `json:"unresolvedArtifactCount"`
}

type WorkspaceContextContribution

type WorkspaceContextContribution struct {
	Artifact         artifact.ArtifactRef                      `json:"artifact"`
	RecordRevision   uint64                                    `json:"recordRevision"`
	DefinitionDigest cryptoutil.Digest                         `json:"definitionDigest"`
	SourceID         source.SourceID                           `json:"sourceID"`
	Locator          basespec.Locator                          `json:"locator"`
	Name             string                                    `json:"name"`
	Role             artifactbuiltin.WorkspaceContextRole      `json:"role"`
	MediaType        artifactbuiltin.WorkspaceContextMediaType `json:"mediaType"`
	Content          string                                    `json:"content"`
	ConventionOrder  int                                       `json:"conventionOrder"`
	OriginalBytes    int                                       `json:"originalBytes"`
	IncludedBytes    int                                       `json:"includedBytes"`
	Truncated        bool                                      `json:"truncated"`
}

func ContextContributionViewOf

func ContextContributionViewOf(
	value ContextContribution,
) WorkspaceContextContribution

type WorkspaceContextDecision

type WorkspaceContextDecision struct {
	Artifact      artifact.ArtifactRef               `json:"artifact"`
	Status        workspaceRuntime.CompositionStatus `json:"status"`
	Code          string                             `json:"code,omitempty"`
	OriginalBytes int                                `json:"originalBytes"`
	IncludedBytes int                                `json:"includedBytes"`
}

type WorkspaceContextInspectionView

type WorkspaceContextInspectionView struct {
	Workspace       workspaceDomain.WorkspaceRef   `json:"workspace"`
	CatalogRevision uint64                         `json:"catalogRevision"`
	Contributions   []WorkspaceContextContribution `json:"contributions"`
	Diagnostics     []diagnostic.Diagnostic        `json:"diagnostics,omitempty"`
}

type WorkspaceContextLoadPlan

type WorkspaceContextLoadPlan struct {
	Workspace       workspaceDomain.WorkspaceRef   `json:"workspace"`
	CatalogRevision uint64                         `json:"catalogRevision"`
	Contributions   []WorkspaceContextContribution `json:"contributions"`
	Prompt          string                         `json:"prompt"`
	Diagnostics     []diagnostic.Diagnostic        `json:"diagnostics,omitempty"`
	Decisions       []WorkspaceContextDecision     `json:"decisions"`
	PromptBytes     int                            `json:"promptBytes"`
}

func ContextLoadPlanViewOf

func ContextLoadPlanViewOf(
	value ContextLoadPlan,
) WorkspaceContextLoadPlan

type WorkspaceContextView

type WorkspaceContextView struct {
	Artifact         artifact.ArtifactRef                      `json:"artifact"`
	RecordRevision   uint64                                    `json:"recordRevision"`
	DefinitionDigest cryptoutil.Digest                         `json:"definitionDigest"`
	SourceID         source.SourceID                           `json:"sourceID"`
	Locator          basespec.Locator                          `json:"locator"`
	Name             string                                    `json:"name"`
	Role             artifactbuiltin.WorkspaceContextRole      `json:"role"`
	MediaType        artifactbuiltin.WorkspaceContextMediaType `json:"mediaType"`
	Enabled          bool                                      `json:"enabled"`
	State            artifact.State                            `json:"state"`
	CatalogCurrent   bool                                      `json:"catalogCurrent"`
	ProjectionValid  bool                                      `json:"projectionValid"`
	RuntimeDisabled  bool                                      `json:"runtimeDisabled"`
	Diagnostics      []diagnostic.Diagnostic                   `json:"diagnostics,omitempty"`
}

func ContextViewOf

func ContextViewOf(value ContextDocument) WorkspaceContextView

type WorkspaceDirectoryRegistrationResult

type WorkspaceDirectoryRegistrationResult struct {
	Source    WorkspaceSourceSummary `json:"source"`
	Workspace WorkspaceView          `json:"workspace"`
}

type WorkspaceDiscovery

type WorkspaceDiscovery struct {
	AdditionalLocators []basespec.Locator       `json:"additionalLocators,omitempty"`
	AdditionalRoots    []WorkspaceDiscoveryRoot `json:"additionalRoots,omitempty"`
	IncludeReadme      bool                     `json:"includeReadme,omitempty"`
}

type WorkspaceDiscoveryRoot

type WorkspaceDiscoveryRoot struct {
	Root            basespec.Locator `json:"root"`
	Recursive       bool             `json:"recursive"`
	IncludePatterns []string         `json:"includePatterns,omitempty"`
}

type WorkspaceOccurrenceRef

type WorkspaceOccurrenceRef struct {
	SourceID           source.SourceID             `json:"sourceID"`
	Locator            basespec.Locator            `json:"locator"`
	SubresourceLocator basespec.SubresourceLocator `json:"subresourceLocator,omitempty"`
}

type WorkspaceOccurrenceView

type WorkspaceOccurrenceView struct {
	SourceID            source.SourceID             `json:"sourceID"`
	Locator             basespec.Locator            `json:"locator"`
	SubresourceLocator  basespec.SubresourceLocator `json:"subresourceLocator,omitempty"`
	Kind                artifact.ArtifactKind       `json:"kind,omitempty"`
	LogicalName         basespec.LogicalName        `json:"logicalName,omitempty"`
	LogicalVersion      basespec.LogicalVersion     `json:"logicalVersion,omitempty"`
	DefinitionDigest    *cryptoutil.Digest          `json:"definitionDigest,omitempty"`
	SourceContentDigest *cryptoutil.Digest          `json:"sourceContentDigest,omitempty"`
	State               string                      `json:"state"`
	Recorded            bool                        `json:"recorded"`
	Artifact            *artifact.ArtifactRef       `json:"artifact,omitempty"`
	Diagnostics         []diagnostic.Diagnostic     `json:"diagnostics,omitempty"`
}

type WorkspaceRef

type WorkspaceRef = collection.CollectionRef

type WorkspaceRefreshResult

type WorkspaceRefreshResult struct {
	Workspace        WorkspaceRef            `json:"workspace"`
	CatalogRevision  uint64                  `json:"catalogRevision"`
	CreatedArtifacts []artifact.ArtifactRef  `json:"createdArtifacts"`
	UpdatedArtifacts []artifact.ArtifactRef  `json:"updatedArtifacts"`
	Diagnostics      []diagnostic.Diagnostic `json:"diagnostics,omitempty"`
	Candidates       int                     `json:"candidates"`
}

type WorkspaceResourceGroupView

type WorkspaceResourceGroupView struct {
	Kind       artifact.ArtifactKind     `json:"kind"`
	Resources  []WorkspaceResourceView   `json:"resources"`
	Unrecorded []WorkspaceOccurrenceView `json:"unrecorded"`
}

type WorkspaceResourceView

type WorkspaceResourceView struct {
	Artifact         WorkspaceArtifactView   `json:"artifact"`
	DefinitionDigest cryptoutil.Digest       `json:"definitionDigest"`
	SourceID         source.SourceID         `json:"sourceID"`
	Locator          basespec.Locator        `json:"locator"`
	CatalogCurrent   bool                    `json:"catalogCurrent"`
	ProjectionValid  bool                    `json:"projectionValid"`
	Diagnostics      []diagnostic.Diagnostic `json:"diagnostics,omitempty"`
}

type WorkspaceSkillArgument

type WorkspaceSkillArgument struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Default     string `json:"default,omitempty"`
}

type WorkspaceSkillLoadView

type WorkspaceSkillLoadView struct {
	Workspace       workspaceDomain.WorkspaceRef `json:"workspace"`
	CatalogRevision uint64                       `json:"catalogRevision"`
	Skills          []WorkspaceSkillView         `json:"skills"`
	Diagnostics     []diagnostic.Diagnostic      `json:"diagnostics,omitempty"`
}

type WorkspaceSkillSummary

type WorkspaceSkillSummary struct {
	SchemaVersion string                   `json:"schemaVersion"`
	ID            artifact.ArtifactID      `json:"id"`
	Slug          string                   `json:"slug"`
	Name          string                   `json:"name"`
	DisplayName   string                   `json:"displayName"`
	Description   string                   `json:"description"`
	Tags          []string                 `json:"tags,omitempty"`
	Insert        document.SkillInsert     `json:"insert"`
	Arguments     []WorkspaceSkillArgument `json:"arguments,omitempty"`
	IsEnabled     bool                     `json:"isEnabled"`
	CreatedAt     time.Time                `json:"createdAt"`
	ModifiedAt    time.Time                `json:"modifiedAt"`
}

type WorkspaceSkillView

type WorkspaceSkillView struct {
	Workspace        workspaceDomain.WorkspaceRef `json:"workspace"`
	Artifact         artifact.ArtifactRef         `json:"artifact"`
	DefinitionDigest cryptoutil.Digest            `json:"definitionDigest"`
	SourceID         source.SourceID              `json:"sourceID"`
	Locator          basespec.Locator             `json:"locator"`
	Skill            WorkspaceSkillSummary        `json:"skill"`
	MarkdownBody     string                       `json:"markdownBody,omitempty"`
	RecordRevision   uint64                       `json:"recordRevision"`
	State            artifact.State               `json:"state"`
	ProjectionValid  bool                         `json:"projectionValid"`
	CatalogCurrent   bool                         `json:"catalogCurrent"`
	RuntimeDisabled  bool                         `json:"runtimeDisabled"`
	Diagnostics      []diagnostic.Diagnostic      `json:"diagnostics,omitempty"`
}

type WorkspaceSourceSummary

type WorkspaceSourceSummary = source.Summary

type WorkspaceSuppressionView

type WorkspaceSuppressionView struct {
	Workspace  WorkspaceRef           `json:"workspace"`
	Binding    artifact.SourceBinding `json:"binding"`
	Revision   uint64                 `json:"revision"`
	CreatedAt  time.Time              `json:"createdAt"`
	ModifiedAt time.Time              `json:"modifiedAt"`
}

type WorkspaceView

type WorkspaceView struct {
	Workspace       workspaceDomain.WorkspaceRef `json:"workspace"`
	Revision        uint64                       `json:"revision"`
	DisplayName     string                       `json:"displayName"`
	Description     string                       `json:"description,omitempty"`
	Enabled         bool                         `json:"enabled"`
	Mode            workspaceDomain.Mode         `json:"mode"`
	PrimarySourceID source.SourceID              `json:"primarySourceID,omitempty"`
	PrimaryPath     string                       `json:"primaryPath,omitempty"`
	Discovery       WorkspaceDiscovery           `json:"discovery"`
	Attachments     []WorkspaceAttachmentView    `json:"attachments"`
}

WorkspaceView is the API-safe representation of a workspace.

It deliberately excludes source configuration, root data, attachment raw data, and the trust-reference contents. Local filesystem paths are included because the local Workspace management UI intentionally displays them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL