Documentation
¶
Index ¶
- Constants
- func ArtifactRuntimeDisabled(value artifact.Artifact) (bool, error)
- func DecodeArtifactData(raw json.RawMessage) (spec.ArtifactData, error)
- func EncodeArtifactData(value spec.ArtifactData) (json.RawMessage, error)
- func RuntimeDecisionDiagnostic(decision RuntimeDecision, value artifact.Artifact) providerapi.Diagnostic
- func WorkspaceArtifactDiagnostics(locator basespec.Locator, code string, message string) []providerapi.Diagnostic
- func WorkspaceArtifactErrorDiagnostics(locator basespec.Locator, err error) []providerapi.Diagnostic
- type ArtifactRuntimePolicy
- type QueryService
- func (q *QueryService) Catalog(ctx context.Context, workspace collection.CollectionRef) (spec.CatalogView, error)
- func (q *QueryService) ComposeLoadPlan(ctx context.Context, workspace collection.CollectionRef, ...) (spec.LoadPlan, error)
- func (q *QueryService) GetWorkspace(ctx context.Context, workspace collection.CollectionRef) (spec.Workspace, error)
- func (q *QueryService) ResolveArtifact(ctx context.Context, ref artifact.ArtifactRef) (spec.Workspace, spec.Resource, error)
- type RuntimeDecision
- type RuntimeDisposition
- type RuntimePolicyRequest
- type RuntimeUse
- type Service
- func (s *Service) Attach(ctx context.Context, request spec.AttachRequest) (spec.Workspace, error)
- func (s *Service) CreateEmpty(ctx context.Context, request spec.EmptyWorkspaceRequest) (spec.Workspace, error)
- func (s *Service) CreateFilesystem(ctx context.Context, request spec.FilesystemWorkspaceRequest) (spec.Workspace, error)
- func (s *Service) Detach(ctx context.Context, ref collection.CollectionRef, sourceID basespec.SourceID, ...) (spec.Workspace, error)
- func (s *Service) Get(ctx context.Context, ref collection.CollectionRef) (spec.Workspace, error)
- func (s *Service) List(ctx context.Context, rootID basespec.RootID) ([]spec.Workspace, error)
- func (s *Service) Purge(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) error
- func (s *Service) Retire(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) (collection.Collection, error)
- func (s *Service) SetPrimary(ctx context.Context, request spec.SetPrimaryRequest) (spec.Workspace, error)
- func (s *Service) Update(ctx context.Context, request spec.UpdateRequest) (spec.Workspace, error)
- func (s *Service) UpdateAttachment(ctx context.Context, request spec.UpdateAttachmentRequest) (spec.Workspace, error)
- func (s *Service) ValidateFilesystemCreate(request spec.FilesystemWorkspaceRequest) error
- type SourceUsePolicy
Constants ¶
const ( DiagnosticCodeArtifactInvalid = spec.DiagnosticCodeArtifactInvalid DiagnosticCodeContextInvalidContent = spec.DiagnosticCodeContextInvalidContent DiagnosticCodeContextInvalidUTF8 = spec.DiagnosticCodeContextInvalidUTF8 DiagnosticCodeArtifactSchemaUnsupported = spec.DiagnosticCodeArtifactSchemaUnsupported DiagnosticCodeArtifactKindMismatch = spec.DiagnosticCodeArtifactKindMismatch DiagnosticCodeProjectionInvalid = spec.DiagnosticCodeProjectionInvalid DiagnosticCodeArtifactUnresolved = spec.DiagnosticCodeArtifactUnresolved DiagnosticCodeRuntimeDenied = spec.DiagnosticCodeRuntimeDenied DiagnosticCodeCatalogStale = spec.DiagnosticCodeCatalogStale DiagnosticCodeCatalogDecoderStale = spec.DiagnosticCodeCatalogDecoderStale DiagnosticCodeCatalogPlanStale = spec.DiagnosticCodeCatalogPlanStale )
Variables ¶
This section is empty.
Functions ¶
func DecodeArtifactData ¶
func DecodeArtifactData( raw json.RawMessage, ) (spec.ArtifactData, error)
func EncodeArtifactData ¶
func EncodeArtifactData( value spec.ArtifactData, ) (json.RawMessage, error)
func RuntimeDecisionDiagnostic ¶
func RuntimeDecisionDiagnostic( decision RuntimeDecision, value artifact.Artifact, ) providerapi.Diagnostic
func WorkspaceArtifactDiagnostics ¶
func WorkspaceArtifactDiagnostics( locator basespec.Locator, code string, message string, ) []providerapi.Diagnostic
func WorkspaceArtifactErrorDiagnostics ¶
func WorkspaceArtifactErrorDiagnostics( locator basespec.Locator, err error, ) []providerapi.Diagnostic
Types ¶
type ArtifactRuntimePolicy ¶
type ArtifactRuntimePolicy struct{}
ArtifactRuntimePolicy is the default local Workspace trust boundary.
Discovery and management remain available. Runtime use is enabled by default unless the Artifact-local RuntimeDisabled flag explicitly disables it.
func NewArtifactRuntimePolicy ¶
func NewArtifactRuntimePolicy() *ArtifactRuntimePolicy
func (*ArtifactRuntimePolicy) Decide ¶
func (*ArtifactRuntimePolicy) Decide( ctx context.Context, request RuntimePolicyRequest, ) RuntimeDecision
type QueryService ¶
type QueryService struct {
// contains filtered or unexported fields
}
func NewQueryService ¶
func NewQueryService( workspaces *Service, store artifactAPI.ConsumerAPI, supports ...spec.ArtifactSupport, ) (*QueryService, error)
func (*QueryService) Catalog ¶
func (q *QueryService) Catalog( ctx context.Context, workspace collection.CollectionRef, ) (spec.CatalogView, error)
func (*QueryService) ComposeLoadPlan ¶
func (q *QueryService) ComposeLoadPlan( ctx context.Context, workspace collection.CollectionRef, artifactRefs []artifact.ArtifactRef, ) (spec.LoadPlan, error)
func (*QueryService) GetWorkspace ¶
func (q *QueryService) GetWorkspace( ctx context.Context, workspace collection.CollectionRef, ) (spec.Workspace, error)
func (*QueryService) ResolveArtifact ¶
func (q *QueryService) ResolveArtifact( ctx context.Context, ref artifact.ArtifactRef, ) (spec.Workspace, spec.Resource, error)
type RuntimeDecision ¶
type RuntimeDecision struct {
Disposition RuntimeDisposition
Code string
Message string
}
func (RuntimeDecision) Validate ¶
func (d RuntimeDecision) Validate() error
type RuntimeDisposition ¶
type RuntimeDisposition string
const ( RuntimeAllowed RuntimeDisposition = "allowed" RuntimeDenied RuntimeDisposition = "denied" )
type RuntimePolicyRequest ¶
type RuntimePolicyRequest struct {
Use RuntimeUse
Workspace spec.Workspace
Artifact artifact.Artifact
DefinitionDigest cryptoutil.Digest
SourceID basespec.SourceID
}
type RuntimeUse ¶
type RuntimeUse string
const ( RuntimeUseContextPrompt RuntimeUse = "context-prompt" RuntimeUseSkill RuntimeUse = "skill" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( store artifactAPI.ConsumerAPI, workspaceRootID basespec.RootID, ) (*Service, error)
func (*Service) CreateEmpty ¶
func (*Service) CreateFilesystem ¶
func (*Service) Get ¶
func (s *Service) Get( ctx context.Context, ref collection.CollectionRef, ) (spec.Workspace, error)
func (*Service) Purge ¶
func (s *Service) Purge( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) error
Purge destructively removes a retired Workspace Collection and its Collection-scoped metadata. It deliberately verifies the persisted kind before delegating to generic Collection persistence, so Workspace APIs cannot purge another domain's retired Collection.
func (*Service) Retire ¶
func (s *Service) Retire( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) (collection.Collection, error)
func (*Service) SetPrimary ¶
func (s *Service) SetPrimary( ctx context.Context, request spec.SetPrimaryRequest, ) (spec.Workspace, error)
SetPrimary explicitly transitions a Workspace between empty and filesystem modes, or replaces its existing primary Source. Generic attachment APIs intentionally cannot mutate the primary relationship.
func (*Service) UpdateAttachment ¶
func (*Service) ValidateFilesystemCreate ¶ added in v0.2.14
func (s *Service) ValidateFilesystemCreate( request spec.FilesystemWorkspaceRequest, ) error
ValidateFilesystemCreate validates all Workspace-owned creation inputs that can be checked before provisioning a filesystem Source.
type SourceUsePolicy ¶
type SourceUsePolicy interface {
Decide(
ctx context.Context,
request RuntimePolicyRequest,
) RuntimeDecision
}