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

Function parseNativeOptionalAgentTier

internal/daemon/native_tools.go:5433–5452  ·  view source on GitHub ↗
(
	id toolspkg.ToolID,
	raw string,
	defaultTier memcontract.AgentTier,
)

Source from the content-addressed store, hash-verified

5431}
5432
5433func parseNativeOptionalAgentTier(
5434 id toolspkg.ToolID,
5435 raw string,
5436 defaultTier memcontract.AgentTier,
5437) (memcontract.AgentTier, error) {
5438 tier := memcontract.AgentTier(strings.TrimSpace(raw)).Normalize()
5439 if tier == "" {
5440 tier = defaultTier.Normalize()
5441 }
5442 if err := tier.Validate(); err != nil {
5443 return "", toolspkg.NewToolError(
5444 toolspkg.ErrorCodeInvalidInput,
5445 id,
5446 err.Error(),
5447 fmt.Errorf("%w: %w", toolspkg.ErrToolInvalidInput, err),
5448 toolspkg.ReasonSchemaInvalid,
5449 )
5450 }
5451 return tier, nil
5452}
5453
5454func (n *daemonNativeTools) memoryWorkspaceIdentity(ctx context.Context, ref string) (string, string, error) {
5455 trimmed := strings.TrimSpace(ref)

Callers 1

agentMemoryStoreForMethod · 0.85

Calls 3

ValidateMethod · 0.65
NormalizeMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected