MCPcopy Create free account
hub / github.com/compozy/agh / nativeCallerWorkspaceInput

Function nativeCallerWorkspaceInput

internal/daemon/native_tools.go:4905–4929  ·  view source on GitHub ↗
(
	id toolspkg.ToolID,
	field string,
	value string,
	scope toolspkg.Scope,
)

Source from the content-addressed store, hash-verified

4903}
4904
4905func nativeCallerWorkspaceInput(
4906 id toolspkg.ToolID,
4907 field string,
4908 value string,
4909 scope toolspkg.Scope,
4910) (string, error) {
4911 trusted := strings.TrimSpace(scope.WorkspaceID)
4912 current := strings.TrimSpace(value)
4913 if scope.Operator {
4914 if current == "" {
4915 return trusted, nil
4916 }
4917 return current, nil
4918 }
4919 if trusted == "" {
4920 return current, nil
4921 }
4922 if current == "" {
4923 return trusted, nil
4924 }
4925 if current != trusted {
4926 return "", nativeScopeMismatchError(id, field)
4927 }
4928 return current, nil
4929}
4930
4931func nativeScopeMismatchError(id toolspkg.ToolID, field string) error {
4932 return toolspkg.NewToolError(

Callers 9

agentCreateRequestMethod · 0.85
hookCatalogFilterFunction · 0.85
sessionListMethod · 0.85
skillsForMethod · 0.85
resolveSkillMethod · 0.85
decodeLogQueryInputFunction · 0.85
decodeObserveSearchInputFunction · 0.85

Calls 1

nativeScopeMismatchErrorFunction · 0.85

Tested by

no test coverage detected