( id toolspkg.ToolID, raw string, defaultTier memcontract.AgentTier, )
| 5431 | } |
| 5432 | |
| 5433 | func 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 | |
| 5454 | func (n *daemonNativeTools) memoryWorkspaceIdentity(ctx context.Context, ref string) (string, string, error) { |
| 5455 | trimmed := strings.TrimSpace(ref) |
no test coverage detected